diff --git a/AlchemistGlobalItem.cs b/AlchemistGlobalItem.cs index f841bf6f..89d5316b 100644 --- a/AlchemistGlobalItem.cs +++ b/AlchemistGlobalItem.cs @@ -6,85 +6,85 @@ namespace Tremor { - public class AlchemistGlobalItem : GlobalItem - { - public override bool ConsumeItem(Item item, Player player) - { - MPlayer modPlayer = player.GetModPlayer(mod); - if (modPlayer.novaChestplate) - { - if (player.FindBuffIndex(mod.BuffType("SuperFlask")) != -1) - { - if ((item.type == mod.ItemType("LesserManaFlask") || item.type == mod.ItemType("BurningFlask") || item.type == mod.ItemType("BoomFlask") || item.type == mod.ItemType("BigVenomFlask") || item.type == mod.ItemType("BigPoisonFlask") || item.type == mod.ItemType("BigManaFlask") || - item.type == mod.ItemType("BigHealingFlack") || item.type == mod.ItemType("BasicFlask") || item.type == mod.ItemType("FreezeFlask") || - item.type == mod.ItemType("DepressionFlask") || item.type == mod.ItemType("CrystalFlask") || item.type == mod.ItemType("ClusterFlask") || - item.type == mod.ItemType("GoldFlask") || item.type == mod.ItemType("ExtendedFreezeFlask") || item.type == mod.ItemType("ExtendedBurningFlask") || - item.type == mod.ItemType("ExtendedBoomFlask") || item.type == mod.ItemType("HealthSupportFlask") || item.type == mod.ItemType("ManaSupportFlask") || - item.type == mod.ItemType("LesserVenomFlask") || item.type == mod.ItemType("LesserPoisonFlask") || item.type == mod.ItemType("LesserHealingFlack") || - item.type == mod.ItemType("PlagueFlask") || item.type == mod.ItemType("PhantomFlask") || item.type == mod.ItemType("MoonDustFlask") || - item.type == mod.ItemType("SparkingFlask") || item.type == mod.ItemType("SuperManaFlask") || item.type == mod.ItemType("SuperHealingFlask") || item.type == mod.ItemType("NovaFlask")) && Main.rand.NextFloat() < 0.65f) - { - return false; - } - } - if (player.FindBuffIndex(mod.BuffType("SuperFlaskBig")) != -1) - { - if ((item.type == mod.ItemType("LesserManaFlask") || item.type == mod.ItemType("BurningFlask") || item.type == mod.ItemType("BoomFlask") || item.type == mod.ItemType("BigVenomFlask") || item.type == mod.ItemType("BigPoisonFlask") || item.type == mod.ItemType("BigManaFlask") || - item.type == mod.ItemType("BigHealingFlack") || item.type == mod.ItemType("BasicFlask") || item.type == mod.ItemType("FreezeFlask") || - item.type == mod.ItemType("DepressionFlask") || item.type == mod.ItemType("CrystalFlask") || item.type == mod.ItemType("ClusterFlask") || - item.type == mod.ItemType("GoldFlask") || item.type == mod.ItemType("ExtendedFreezeFlask") || item.type == mod.ItemType("ExtendedBurningFlask") || - item.type == mod.ItemType("ExtendedBoomFlask") || item.type == mod.ItemType("HealthSupportFlask") || item.type == mod.ItemType("ManaSupportFlask") || - item.type == mod.ItemType("LesserVenomFlask") || item.type == mod.ItemType("LesserPoisonFlask") || item.type == mod.ItemType("LesserHealingFlack") || - item.type == mod.ItemType("PlagueFlask") || item.type == mod.ItemType("PhantomFlask") || item.type == mod.ItemType("MoonDustFlask") || - item.type == mod.ItemType("SparkingFlask") || item.type == mod.ItemType("SuperManaFlask") || item.type == mod.ItemType("SuperHealingFlask") || item.type == mod.ItemType("NovaFlask")) && Main.rand.NextFloat() < 0.85f) - { - return false; - } - } - if (player.FindBuffIndex(mod.BuffType("SuperFlaskBig")) < 1 && player.FindBuffIndex(mod.BuffType("SuperFlaskBig")) < 1) - { - if ((item.type == mod.ItemType("LesserManaFlask") || item.type == mod.ItemType("BurningFlask") || item.type == mod.ItemType("BoomFlask") || item.type == mod.ItemType("BigVenomFlask") || item.type == mod.ItemType("BigPoisonFlask") || item.type == mod.ItemType("BigManaFlask") || - item.type == mod.ItemType("BigHealingFlack") || item.type == mod.ItemType("BasicFlask") || item.type == mod.ItemType("FreezeFlask") || - item.type == mod.ItemType("DepressionFlask") || item.type == mod.ItemType("CrystalFlask") || item.type == mod.ItemType("ClusterFlask") || - item.type == mod.ItemType("GoldFlask") || item.type == mod.ItemType("ExtendedFreezeFlask") || item.type == mod.ItemType("ExtendedBurningFlask") || - item.type == mod.ItemType("ExtendedBoomFlask") || item.type == mod.ItemType("HealthSupportFlask") || item.type == mod.ItemType("ManaSupportFlask") || - item.type == mod.ItemType("LesserVenomFlask") || item.type == mod.ItemType("LesserPoisonFlask") || item.type == mod.ItemType("LesserHealingFlack") || - item.type == mod.ItemType("PlagueFlask") || item.type == mod.ItemType("PhantomFlask") || item.type == mod.ItemType("MoonDustFlask") || - item.type == mod.ItemType("SparkingFlask") || item.type == mod.ItemType("SuperManaFlask") || item.type == mod.ItemType("SuperHealingFlask") || item.type == mod.ItemType("NovaFlask")) && Main.rand.NextFloat() < 0.4f) - { - return false; - } - } - } - if (player.FindBuffIndex(mod.BuffType("SuperFlask")) != -1) - { - if ((item.type == mod.ItemType("LesserManaFlask") || item.type == mod.ItemType("BurningFlask") || item.type == mod.ItemType("BoomFlask") || item.type == mod.ItemType("BigVenomFlask") || item.type == mod.ItemType("BigPoisonFlask") || item.type == mod.ItemType("BigManaFlask") || - item.type == mod.ItemType("BigHealingFlack") || item.type == mod.ItemType("BasicFlask") || item.type == mod.ItemType("FreezeFlask") || - item.type == mod.ItemType("DepressionFlask") || item.type == mod.ItemType("CrystalFlask") || item.type == mod.ItemType("ClusterFlask") || - item.type == mod.ItemType("GoldFlask") || item.type == mod.ItemType("ExtendedFreezeFlask") || item.type == mod.ItemType("ExtendedBurningFlask") || - item.type == mod.ItemType("ExtendedBoomFlask") || item.type == mod.ItemType("HealthSupportFlask") || item.type == mod.ItemType("ManaSupportFlask") || - item.type == mod.ItemType("LesserVenomFlask") || item.type == mod.ItemType("LesserPoisonFlask") || item.type == mod.ItemType("LesserHealingFlack") || - item.type == mod.ItemType("PlagueFlask") || item.type == mod.ItemType("PhantomFlask") || item.type == mod.ItemType("MoonDustFlask") || - item.type == mod.ItemType("SparkingFlask") || item.type == mod.ItemType("SuperManaFlask") || item.type == mod.ItemType("SuperHealingFlask") || item.type == mod.ItemType("NovaFlask")) && Main.rand.NextFloat() < 0.25f) - { - return false; - } - } - if (player.FindBuffIndex(mod.BuffType("SuperFlaskBig")) != -1 && modPlayer.novaAura) - { - if ((item.type == mod.ItemType("LesserManaFlask") || item.type == mod.ItemType("BurningFlask") || item.type == mod.ItemType("BoomFlask") || item.type == mod.ItemType("BigVenomFlask") || item.type == mod.ItemType("BigPoisonFlask") || item.type == mod.ItemType("BigManaFlask") || - item.type == mod.ItemType("BigHealingFlack") || item.type == mod.ItemType("BasicFlask") || item.type == mod.ItemType("FreezeFlask") || - item.type == mod.ItemType("DepressionFlask") || item.type == mod.ItemType("CrystalFlask") || item.type == mod.ItemType("ClusterFlask") || - item.type == mod.ItemType("GoldFlask") || item.type == mod.ItemType("ExtendedFreezeFlask") || item.type == mod.ItemType("ExtendedBurningFlask") || - item.type == mod.ItemType("ExtendedBoomFlask") || item.type == mod.ItemType("HealthSupportFlask") || item.type == mod.ItemType("ManaSupportFlask") || - item.type == mod.ItemType("LesserVenomFlask") || item.type == mod.ItemType("LesserPoisonFlask") || item.type == mod.ItemType("LesserHealingFlack") || - item.type == mod.ItemType("PlagueFlask") || item.type == mod.ItemType("PhantomFlask") || item.type == mod.ItemType("MoonDustFlask") || - item.type == mod.ItemType("SparkingFlask") || item.type == mod.ItemType("SuperManaFlask") || item.type == mod.ItemType("SuperHealingFlask") || item.type == mod.ItemType("NovaFlask")) && Main.rand.NextFloat() < 0.45f) - { - return false; - } - } - return base.ConsumeItem(item, player); - } - } + public class AlchemistGlobalItem : GlobalItem + { + public override bool ConsumeItem(Item item, Player player) + { + MPlayer modPlayer = player.GetModPlayer(mod); + if (modPlayer.novaChestplate) + { + if (player.FindBuffIndex(mod.BuffType("SuperFlask")) != -1) + { + if ((item.type == mod.ItemType("LesserManaFlask") || item.type == mod.ItemType("BurningFlask") || item.type == mod.ItemType("BoomFlask") || item.type == mod.ItemType("BigVenomFlask") || item.type == mod.ItemType("BigPoisonFlask") || item.type == mod.ItemType("BigManaFlask") || + item.type == mod.ItemType("BigHealingFlack") || item.type == mod.ItemType("BasicFlask") || item.type == mod.ItemType("FreezeFlask") || + item.type == mod.ItemType("DepressionFlask") || item.type == mod.ItemType("CrystalFlask") || item.type == mod.ItemType("ClusterFlask") || + item.type == mod.ItemType("GoldFlask") || item.type == mod.ItemType("ExtendedFreezeFlask") || item.type == mod.ItemType("ExtendedBurningFlask") || + item.type == mod.ItemType("ExtendedBoomFlask") || item.type == mod.ItemType("HealthSupportFlask") || item.type == mod.ItemType("ManaSupportFlask") || + item.type == mod.ItemType("LesserVenomFlask") || item.type == mod.ItemType("LesserPoisonFlask") || item.type == mod.ItemType("LesserHealingFlack") || + item.type == mod.ItemType("PlagueFlask") || item.type == mod.ItemType("PhantomFlask") || item.type == mod.ItemType("MoonDustFlask") || + item.type == mod.ItemType("SparkingFlask") || item.type == mod.ItemType("SuperManaFlask") || item.type == mod.ItemType("SuperHealingFlask") || item.type == mod.ItemType("NovaFlask")) && Main.rand.NextFloat() < 0.65f) + { + return false; + } + } + if (player.FindBuffIndex(mod.BuffType("SuperFlaskBig")) != -1) + { + if ((item.type == mod.ItemType("LesserManaFlask") || item.type == mod.ItemType("BurningFlask") || item.type == mod.ItemType("BoomFlask") || item.type == mod.ItemType("BigVenomFlask") || item.type == mod.ItemType("BigPoisonFlask") || item.type == mod.ItemType("BigManaFlask") || + item.type == mod.ItemType("BigHealingFlack") || item.type == mod.ItemType("BasicFlask") || item.type == mod.ItemType("FreezeFlask") || + item.type == mod.ItemType("DepressionFlask") || item.type == mod.ItemType("CrystalFlask") || item.type == mod.ItemType("ClusterFlask") || + item.type == mod.ItemType("GoldFlask") || item.type == mod.ItemType("ExtendedFreezeFlask") || item.type == mod.ItemType("ExtendedBurningFlask") || + item.type == mod.ItemType("ExtendedBoomFlask") || item.type == mod.ItemType("HealthSupportFlask") || item.type == mod.ItemType("ManaSupportFlask") || + item.type == mod.ItemType("LesserVenomFlask") || item.type == mod.ItemType("LesserPoisonFlask") || item.type == mod.ItemType("LesserHealingFlack") || + item.type == mod.ItemType("PlagueFlask") || item.type == mod.ItemType("PhantomFlask") || item.type == mod.ItemType("MoonDustFlask") || + item.type == mod.ItemType("SparkingFlask") || item.type == mod.ItemType("SuperManaFlask") || item.type == mod.ItemType("SuperHealingFlask") || item.type == mod.ItemType("NovaFlask")) && Main.rand.NextFloat() < 0.85f) + { + return false; + } + } + if (player.FindBuffIndex(mod.BuffType("SuperFlaskBig")) < 1 && player.FindBuffIndex(mod.BuffType("SuperFlaskBig")) < 1) + { + if ((item.type == mod.ItemType("LesserManaFlask") || item.type == mod.ItemType("BurningFlask") || item.type == mod.ItemType("BoomFlask") || item.type == mod.ItemType("BigVenomFlask") || item.type == mod.ItemType("BigPoisonFlask") || item.type == mod.ItemType("BigManaFlask") || + item.type == mod.ItemType("BigHealingFlack") || item.type == mod.ItemType("BasicFlask") || item.type == mod.ItemType("FreezeFlask") || + item.type == mod.ItemType("DepressionFlask") || item.type == mod.ItemType("CrystalFlask") || item.type == mod.ItemType("ClusterFlask") || + item.type == mod.ItemType("GoldFlask") || item.type == mod.ItemType("ExtendedFreezeFlask") || item.type == mod.ItemType("ExtendedBurningFlask") || + item.type == mod.ItemType("ExtendedBoomFlask") || item.type == mod.ItemType("HealthSupportFlask") || item.type == mod.ItemType("ManaSupportFlask") || + item.type == mod.ItemType("LesserVenomFlask") || item.type == mod.ItemType("LesserPoisonFlask") || item.type == mod.ItemType("LesserHealingFlack") || + item.type == mod.ItemType("PlagueFlask") || item.type == mod.ItemType("PhantomFlask") || item.type == mod.ItemType("MoonDustFlask") || + item.type == mod.ItemType("SparkingFlask") || item.type == mod.ItemType("SuperManaFlask") || item.type == mod.ItemType("SuperHealingFlask") || item.type == mod.ItemType("NovaFlask")) && Main.rand.NextFloat() < 0.4f) + { + return false; + } + } + } + if (player.FindBuffIndex(mod.BuffType("SuperFlask")) != -1) + { + if ((item.type == mod.ItemType("LesserManaFlask") || item.type == mod.ItemType("BurningFlask") || item.type == mod.ItemType("BoomFlask") || item.type == mod.ItemType("BigVenomFlask") || item.type == mod.ItemType("BigPoisonFlask") || item.type == mod.ItemType("BigManaFlask") || + item.type == mod.ItemType("BigHealingFlack") || item.type == mod.ItemType("BasicFlask") || item.type == mod.ItemType("FreezeFlask") || + item.type == mod.ItemType("DepressionFlask") || item.type == mod.ItemType("CrystalFlask") || item.type == mod.ItemType("ClusterFlask") || + item.type == mod.ItemType("GoldFlask") || item.type == mod.ItemType("ExtendedFreezeFlask") || item.type == mod.ItemType("ExtendedBurningFlask") || + item.type == mod.ItemType("ExtendedBoomFlask") || item.type == mod.ItemType("HealthSupportFlask") || item.type == mod.ItemType("ManaSupportFlask") || + item.type == mod.ItemType("LesserVenomFlask") || item.type == mod.ItemType("LesserPoisonFlask") || item.type == mod.ItemType("LesserHealingFlack") || + item.type == mod.ItemType("PlagueFlask") || item.type == mod.ItemType("PhantomFlask") || item.type == mod.ItemType("MoonDustFlask") || + item.type == mod.ItemType("SparkingFlask") || item.type == mod.ItemType("SuperManaFlask") || item.type == mod.ItemType("SuperHealingFlask") || item.type == mod.ItemType("NovaFlask")) && Main.rand.NextFloat() < 0.25f) + { + return false; + } + } + if (player.FindBuffIndex(mod.BuffType("SuperFlaskBig")) != -1 && modPlayer.novaAura) + { + if ((item.type == mod.ItemType("LesserManaFlask") || item.type == mod.ItemType("BurningFlask") || item.type == mod.ItemType("BoomFlask") || item.type == mod.ItemType("BigVenomFlask") || item.type == mod.ItemType("BigPoisonFlask") || item.type == mod.ItemType("BigManaFlask") || + item.type == mod.ItemType("BigHealingFlack") || item.type == mod.ItemType("BasicFlask") || item.type == mod.ItemType("FreezeFlask") || + item.type == mod.ItemType("DepressionFlask") || item.type == mod.ItemType("CrystalFlask") || item.type == mod.ItemType("ClusterFlask") || + item.type == mod.ItemType("GoldFlask") || item.type == mod.ItemType("ExtendedFreezeFlask") || item.type == mod.ItemType("ExtendedBurningFlask") || + item.type == mod.ItemType("ExtendedBoomFlask") || item.type == mod.ItemType("HealthSupportFlask") || item.type == mod.ItemType("ManaSupportFlask") || + item.type == mod.ItemType("LesserVenomFlask") || item.type == mod.ItemType("LesserPoisonFlask") || item.type == mod.ItemType("LesserHealingFlack") || + item.type == mod.ItemType("PlagueFlask") || item.type == mod.ItemType("PhantomFlask") || item.type == mod.ItemType("MoonDustFlask") || + item.type == mod.ItemType("SparkingFlask") || item.type == mod.ItemType("SuperManaFlask") || item.type == mod.ItemType("SuperHealingFlask") || item.type == mod.ItemType("NovaFlask")) && Main.rand.NextFloat() < 0.45f) + { + return false; + } + } + return base.ConsumeItem(item, player); + } + } } \ No newline at end of file diff --git a/AlchemistItem.cs b/AlchemistItem.cs index ec355fe1..44589a0a 100644 --- a/AlchemistItem.cs +++ b/AlchemistItem.cs @@ -12,80 +12,80 @@ namespace Tremor { - public abstract class AlchemistItem : ModItem - { + public abstract class AlchemistItem : ModItem + { - public override void ModifyTooltips(System.Collections.Generic.List tooltips) - { - for (int i = 0; i < tooltips.Count; ++i) - { - if (tooltips[i].Name == "Damage") - { - MPlayer mp = Main.LocalPlayer.GetModPlayer(mod); - tooltips[i].text = ((int)(item.damage * mp.alchemistDamage)).ToString() + " alchemic damage"; - } + public override void ModifyTooltips(System.Collections.Generic.List tooltips) + { + for (int i = 0; i < tooltips.Count; ++i) + { + if (tooltips[i].Name == "Damage") + { + MPlayer mp = Main.LocalPlayer.GetModPlayer(mod); + tooltips[i].text = ((int)(item.damage * mp.alchemistDamage)).ToString() + " alchemic damage"; + } - if (tooltips[i].Name == "CritChance") - { - MPlayer mp = Main.LocalPlayer.GetModPlayer(mod); - tooltips[i].text = ((int)(item.crit + mp.alchemistCrit)).ToString() + "% critical strike chance"; - } - } - MPlayer mp2 = Main.LocalPlayer.GetModPlayer(mod); - TooltipLine tip = new TooltipLine(mod, "Tremor:Tooltip", ((int)(item.crit + mp2.alchemistCrit)).ToString() + "% critical strike chance"); - tooltips.Insert(2, tip); - } - - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - MPlayer modPlayer = player.GetModPlayer(mod); - if (modPlayer.glove) - { - for (int i = 0; i < 1; ++i) - { - if (player.FindBuffIndex(mod.BuffType("BottledSpirit")) != -1) - { - Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 297, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, 297, damage, knockBack, Main.myPlayer); - } - if (player.FindBuffIndex(mod.BuffType("BigBottledSpirit")) != -1) - { - Projectile.NewProjectile(position.X, position.Y, speedX + 3, speedY + 3, 297, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 297, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, 297, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 2, speedY - 2, 297, damage, knockBack, Main.myPlayer); - } - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - int k = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Main.projectile[k].friendly = true; - } - return false; - } - if (player.FindBuffIndex(mod.BuffType("BottledSpirit")) != -1 && !modPlayer.glove) - { - for (int i = 0; i < 1; ++i) - { - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, 297, damage, knockBack, Main.myPlayer); - int k = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, 297, damage, knockBack, Main.myPlayer); - Main.projectile[k].friendly = true; - } - return false; - } - if (player.FindBuffIndex(mod.BuffType("BigBottledSpirit")) != -1 && !modPlayer.glove) - { - for (int i = 0; i < 1; ++i) - { - Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 297, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, 297, damage, knockBack, Main.myPlayer); - int k = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, 297, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 2, speedY - 2, 297, damage, knockBack, Main.myPlayer); - Main.projectile[k].friendly = true; - } - return false; - } - return true; - } - } + if (tooltips[i].Name == "CritChance") + { + MPlayer mp = Main.LocalPlayer.GetModPlayer(mod); + tooltips[i].text = ((int)(item.crit + mp.alchemistCrit)).ToString() + "% critical strike chance"; + } + } + MPlayer mp2 = Main.LocalPlayer.GetModPlayer(mod); + TooltipLine tip = new TooltipLine(mod, "Tremor:Tooltip", ((int)(item.crit + mp2.alchemistCrit)).ToString() + "% critical strike chance"); + tooltips.Insert(2, tip); + } + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + MPlayer modPlayer = player.GetModPlayer(mod); + if (modPlayer.glove) + { + for (int i = 0; i < 1; ++i) + { + if (player.FindBuffIndex(mod.BuffType("BottledSpirit")) != -1) + { + Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 297, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, 297, damage, knockBack, Main.myPlayer); + } + if (player.FindBuffIndex(mod.BuffType("BigBottledSpirit")) != -1) + { + Projectile.NewProjectile(position.X, position.Y, speedX + 3, speedY + 3, 297, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 297, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, 297, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 2, speedY - 2, 297, damage, knockBack, Main.myPlayer); + } + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + int k = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Main.projectile[k].friendly = true; + } + return false; + } + if (player.FindBuffIndex(mod.BuffType("BottledSpirit")) != -1 && !modPlayer.glove) + { + for (int i = 0; i < 1; ++i) + { + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, 297, damage, knockBack, Main.myPlayer); + int k = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, 297, damage, knockBack, Main.myPlayer); + Main.projectile[k].friendly = true; + } + return false; + } + if (player.FindBuffIndex(mod.BuffType("BigBottledSpirit")) != -1 && !modPlayer.glove) + { + for (int i = 0; i < 1; ++i) + { + Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 297, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, 297, damage, knockBack, Main.myPlayer); + int k = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, 297, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 2, speedY - 2, 297, damage, knockBack, Main.myPlayer); + Main.projectile[k].friendly = true; + } + return false; + } + return true; + } + } } diff --git a/Angle.cs b/Angle.cs index 14253e57..752ee578 100644 --- a/Angle.cs +++ b/Angle.cs @@ -2,51 +2,52 @@ namespace Tremor { -public struct Angle -{ - public float Value; - public Angle(float angle) - { - Value = angle; - float remainder = Value % (2f * (float)Math.PI); - float rotations = Value - remainder; - Value -= rotations; - if(Value < 0f) - { - Value += 2f * (float)Math.PI; - } - } + public struct Angle + { + public float Value; + public Angle(float angle) + { + Value = angle; + float remainder = Value % (2f * (float)Math.PI); + float rotations = Value - remainder; + Value -= rotations; + if (Value < 0f) + { + Value += 2f * (float)Math.PI; + } + } - public static Angle operator +(Angle a1, Angle a2) - { - return new Angle(a1.Value + a2.Value); - } + public static Angle operator +(Angle a1, Angle a2) + { + return new Angle(a1.Value + a2.Value); + } - public static Angle operator -(Angle a1, Angle a2) - { - return new Angle(a1.Value - a2.Value); - } + public static Angle operator -(Angle a1, Angle a2) + { + return new Angle(a1.Value - a2.Value); + } - public Angle Opposite() - { - return new Angle(Value + (float)Math.PI); - } + public Angle Opposite() + { + return new Angle(Value + (float)Math.PI); + } - public bool ClockwiseFrom(Angle other) - { - if(other.Value >= (float)Math.PI) - { - return this.Value < other.Value && this.Value >= other.Opposite().Value; - } - return this.Value < other.Value || this.Value >= other.Opposite().Value; - } + public bool ClockwiseFrom(Angle other) + { + if (other.Value >= (float)Math.PI) + { + return this.Value < other.Value && this.Value >= other.Opposite().Value; + } + return this.Value < other.Value || this.Value >= other.Opposite().Value; + } - public bool Between(Angle cLimit, Angle ccLimit) - { - if(cLimit.Value < ccLimit.Value) - { - return this.Value >= cLimit.Value && this.Value <= ccLimit.Value; - } - return this.Value >= cLimit.Value || this.Value <= ccLimit.Value; - } -}} \ No newline at end of file + public bool Between(Angle cLimit, Angle ccLimit) + { + if (cLimit.Value < ccLimit.Value) + { + return this.Value >= cLimit.Value && this.Value <= ccLimit.Value; + } + return this.Value >= cLimit.Value || this.Value <= ccLimit.Value; + } + } +} \ No newline at end of file diff --git a/Buffs/AncientBannerBuff.cs b/Buffs/AncientBannerBuff.cs index 977677ee..0c20d2e1 100644 --- a/Buffs/AncientBannerBuff.cs +++ b/Buffs/AncientBannerBuff.cs @@ -16,7 +16,7 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - player.lifeRegen += 40; + player.lifeRegen += 40; } } } \ No newline at end of file diff --git a/Buffs/AncientPredatorBuff.cs b/Buffs/AncientPredatorBuff.cs index 205b0df2..b2b84b91 100644 --- a/Buffs/AncientPredatorBuff.cs +++ b/Buffs/AncientPredatorBuff.cs @@ -6,8 +6,8 @@ namespace Tremor.Buffs { public class AncientPredatorBuff : ModBuff { - int MinionType = -1; - int MinionID = -1; + int MinionType = -1; + int MinionID = -1; public override void SetDefaults() { @@ -20,18 +20,18 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - if (MinionType == -1) - MinionType = mod.ProjectileType("AncientPredator"); - if (MinionID == -1 || Main.projectile[MinionID].type != MinionType || !Main.projectile[MinionID].active || Main.projectile[MinionID].owner != player.whoAmI) - { - Projectile proj = new Projectile(); - proj.SetDefaults(MinionType); - MinionID = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0, 0, MinionType, 300, 3, player.whoAmI); - } - else - { - Main.projectile[MinionID].timeLeft = 5; - } + if (MinionType == -1) + MinionType = mod.ProjectileType("AncientPredator"); + if (MinionID == -1 || Main.projectile[MinionID].type != MinionType || !Main.projectile[MinionID].active || Main.projectile[MinionID].owner != player.whoAmI) + { + Projectile proj = new Projectile(); + proj.SetDefaults(MinionType); + MinionID = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0, 0, MinionType, 300, 3, player.whoAmI); + } + else + { + Main.projectile[MinionID].timeLeft = 5; + } } } } \ No newline at end of file diff --git a/Buffs/BallnChainBuff.cs b/Buffs/BallnChainBuff.cs index 78d43683..8d3e1c7b 100644 --- a/Buffs/BallnChainBuff.cs +++ b/Buffs/BallnChainBuff.cs @@ -4,14 +4,14 @@ namespace Tremor.Buffs { public class BallnChainBuff : ModBuff - { - int MinionType = -1; - int MinionID = -1; + { + int MinionType = -1; + int MinionID = -1; - const int Damage = 30; - const float KB = 1; + const int Damage = 30; + const float KB = 1; - public override void SetDefaults() + public override void SetDefaults() { Main.buffNoTimeDisplay[Type] = true; DisplayName.SetDefault("Ball n' Chain"); @@ -19,12 +19,12 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - if (MinionType == -1) - MinionType = mod.ProjectileType("BallChainPro"); - if (MinionID == -1 || Main.projectile[MinionID].type != MinionType || !Main.projectile[MinionID].active || Main.projectile[MinionID].owner != player.whoAmI) - MinionID = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0, 0, MinionType, (int)(Damage * player.meleeDamage), KB, player.whoAmI); - else - Main.projectile[MinionID].timeLeft = 6; - } + if (MinionType == -1) + MinionType = mod.ProjectileType("BallChainPro"); + if (MinionID == -1 || Main.projectile[MinionID].type != MinionType || !Main.projectile[MinionID].active || Main.projectile[MinionID].owner != player.whoAmI) + MinionID = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0, 0, MinionType, (int)(Damage * player.meleeDamage), KB, player.whoAmI); + else + Main.projectile[MinionID].timeLeft = 6; + } } } \ No newline at end of file diff --git a/Buffs/BarrierBuff.cs b/Buffs/BarrierBuff.cs index e5e5435e..76132d5e 100644 --- a/Buffs/BarrierBuff.cs +++ b/Buffs/BarrierBuff.cs @@ -15,11 +15,11 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - player.statDefense += 500; - if(player.buffTime[buffIndex] == 0) - { - player.AddBuff(mod.BuffType("BarrierRechargeBuff"), 7200); - } + player.statDefense += 500; + if (player.buffTime[buffIndex] == 0) + { + player.AddBuff(mod.BuffType("BarrierRechargeBuff"), 7200); + } } } } \ No newline at end of file diff --git a/Buffs/BarrierRechargeBuff.cs b/Buffs/BarrierRechargeBuff.cs index e3e7511a..6997b0d4 100644 --- a/Buffs/BarrierRechargeBuff.cs +++ b/Buffs/BarrierRechargeBuff.cs @@ -10,7 +10,7 @@ public override void SetDefaults() { DisplayName.SetDefault("Barrier Recharging"); Description.SetDefault("Magic barrier can't appear"); - Main.debuff[Type] = true; + Main.debuff[Type] = true; } } } \ No newline at end of file diff --git a/Buffs/BerserkerBuff.cs b/Buffs/BerserkerBuff.cs index 6659d213..95810a11 100644 --- a/Buffs/BerserkerBuff.cs +++ b/Buffs/BerserkerBuff.cs @@ -4,14 +4,14 @@ namespace Tremor.Buffs { public class BerserkerBuff : ModBuff - { - int MinionType = -1; - int MinionID = -1; + { + int MinionType = -1; + int MinionID = -1; - const int Damage = 30; - const float KB = 1; + const int Damage = 30; + const float KB = 1; - public override void SetDefaults() + public override void SetDefaults() { Main.buffNoTimeDisplay[Type] = true; DisplayName.SetDefault("Berserker"); @@ -19,12 +19,12 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - if (MinionType == -1) - MinionType = mod.ProjectileType("BerserkerPro"); - if (MinionID == -1 || Main.projectile[MinionID].type != MinionType || !Main.projectile[MinionID].active || Main.projectile[MinionID].owner != player.whoAmI) - MinionID = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0, 0, MinionType, (int)(Damage * player.meleeDamage), KB, player.whoAmI); - else - Main.projectile[MinionID].timeLeft = 6; - } + if (MinionType == -1) + MinionType = mod.ProjectileType("BerserkerPro"); + if (MinionID == -1 || Main.projectile[MinionID].type != MinionType || !Main.projectile[MinionID].active || Main.projectile[MinionID].owner != player.whoAmI) + MinionID = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0, 0, MinionType, (int)(Damage * player.meleeDamage), KB, player.whoAmI); + else + Main.projectile[MinionID].timeLeft = 6; + } } } \ No newline at end of file diff --git a/Buffs/BirbStaffBuff.cs b/Buffs/BirbStaffBuff.cs index b9f5959a..eeb4d705 100644 --- a/Buffs/BirbStaffBuff.cs +++ b/Buffs/BirbStaffBuff.cs @@ -10,26 +10,26 @@ public override void SetDefaults() { DisplayName.SetDefault("Birb"); Description.SetDefault("A birb will fight for you"); - Main.buffNoSave[Type] = true; - Main.buffNoTimeDisplay[Type] = true; - } + Main.buffNoSave[Type] = true; + Main.buffNoTimeDisplay[Type] = true; + } public override void Update(Player player, ref int buffIndex) { - TremorPlayer modPlayer = (TremorPlayer)player.GetModPlayer(mod, "TremorPlayer"); - if (player.ownedProjectileCounts[mod.ProjectileType("BirbStaffPro")] > 0) - { - modPlayer.birbStaff = true; - } - if (!modPlayer.birbStaff) - { - player.DelBuff(buffIndex); - buffIndex--; - } - else - { - player.buffTime[buffIndex] = 18000; - } - } + TremorPlayer modPlayer = (TremorPlayer)player.GetModPlayer(mod, "TremorPlayer"); + if (player.ownedProjectileCounts[mod.ProjectileType("BirbStaffPro")] > 0) + { + modPlayer.birbStaff = true; + } + if (!modPlayer.birbStaff) + { + player.DelBuff(buffIndex); + buffIndex--; + } + else + { + player.buffTime[buffIndex] = 18000; + } + } } } \ No newline at end of file diff --git a/Buffs/BottledSoulOfFlight.cs b/Buffs/BottledSoulOfFlight.cs index c95f6d24..78072bfe 100644 --- a/Buffs/BottledSoulOfFlight.cs +++ b/Buffs/BottledSoulOfFlight.cs @@ -16,7 +16,7 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - player.jumpSpeedBoost += 0.2f; + player.jumpSpeedBoost += 0.2f; } } } diff --git a/Buffs/BottledSoulOfFright.cs b/Buffs/BottledSoulOfFright.cs index 235ea160..a7a61fee 100644 --- a/Buffs/BottledSoulOfFright.cs +++ b/Buffs/BottledSoulOfFright.cs @@ -16,10 +16,10 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - player.rangedCrit += 2; - player.meleeCrit += 2; - player.magicCrit += 2; - player.thrownCrit += 2; + player.rangedCrit += 2; + player.meleeCrit += 2; + player.magicCrit += 2; + player.thrownCrit += 2; } } } diff --git a/Buffs/BottledSoulOfLight.cs b/Buffs/BottledSoulOfLight.cs index b23227dc..b55c6067 100644 --- a/Buffs/BottledSoulOfLight.cs +++ b/Buffs/BottledSoulOfLight.cs @@ -16,7 +16,7 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - player.moveSpeed += 0.2f; + player.moveSpeed += 0.2f; } } } diff --git a/Buffs/BottledSoulOfMight.cs b/Buffs/BottledSoulOfMight.cs index 136a231b..e07137ec 100644 --- a/Buffs/BottledSoulOfMight.cs +++ b/Buffs/BottledSoulOfMight.cs @@ -16,11 +16,11 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - player.meleeDamage += 0.05f; - player.rangedDamage += 0.05f; - player.thrownDamage += 0.05f; - player.minionDamage += 0.05f; - player.magicDamage += 0.05f; + player.meleeDamage += 0.05f; + player.rangedDamage += 0.05f; + player.thrownDamage += 0.05f; + player.minionDamage += 0.05f; + player.magicDamage += 0.05f; } } } diff --git a/Buffs/BottledSoulOfMind.cs b/Buffs/BottledSoulOfMind.cs index 8672df8b..aa36ddef 100644 --- a/Buffs/BottledSoulOfMind.cs +++ b/Buffs/BottledSoulOfMind.cs @@ -16,7 +16,7 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - player.findTreasure = true; + player.findTreasure = true; } } } diff --git a/Buffs/BottledSoulOfNight.cs b/Buffs/BottledSoulOfNight.cs index 35bb4027..20be230f 100644 --- a/Buffs/BottledSoulOfNight.cs +++ b/Buffs/BottledSoulOfNight.cs @@ -16,7 +16,7 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - player.meleeSpeed += 0.08f; + player.meleeSpeed += 0.08f; } } } diff --git a/Buffs/BottledSoulOfSight.cs b/Buffs/BottledSoulOfSight.cs index fe35a2d0..f72e6a5d 100644 --- a/Buffs/BottledSoulOfSight.cs +++ b/Buffs/BottledSoulOfSight.cs @@ -16,7 +16,7 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - player.detectCreature = true; + player.detectCreature = true; } } } diff --git a/Buffs/BrainSmasherBuff.cs b/Buffs/BrainSmasherBuff.cs index d1a455af..cee09006 100644 --- a/Buffs/BrainSmasherBuff.cs +++ b/Buffs/BrainSmasherBuff.cs @@ -4,14 +4,14 @@ namespace Tremor.Buffs { public class BrainSmasherBuff : ModBuff - { - int MinionType = -1; - int MinionID = -1; + { + int MinionType = -1; + int MinionID = -1; - const int Damage = 90; - const float KB = 1; + const int Damage = 90; + const float KB = 1; - public override void SetDefaults() + public override void SetDefaults() { Main.buffNoTimeDisplay[Type] = true; DisplayName.SetDefault("Brain Smasher"); @@ -19,12 +19,12 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - if (MinionType == -1) - MinionType = mod.ProjectileType("BrainSmasherPro"); - if (MinionID == -1 || Main.projectile[MinionID].type != MinionType || !Main.projectile[MinionID].active || Main.projectile[MinionID].owner != player.whoAmI) - MinionID = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0, 0, MinionType, (int)(Damage * player.meleeDamage), KB, player.whoAmI); - else - Main.projectile[MinionID].timeLeft = 6; - } + if (MinionType == -1) + MinionType = mod.ProjectileType("BrainSmasherPro"); + if (MinionID == -1 || Main.projectile[MinionID].type != MinionType || !Main.projectile[MinionID].active || Main.projectile[MinionID].owner != player.whoAmI) + MinionID = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0, 0, MinionType, (int)(Damage * player.meleeDamage), KB, player.whoAmI); + else + Main.projectile[MinionID].timeLeft = 6; + } } } \ No newline at end of file diff --git a/Buffs/BrassChipBuff.cs b/Buffs/BrassChipBuff.cs index 91ce7b4b..f88fac21 100644 --- a/Buffs/BrassChipBuff.cs +++ b/Buffs/BrassChipBuff.cs @@ -10,7 +10,7 @@ public override void SetDefaults() { DisplayName.SetDefault("Brass Chip"); Description.SetDefault("Shoots rockets from the sky when a flask is destroyed"); - Main.buffNoSave[Type] = true; + Main.buffNoSave[Type] = true; Main.buffNoTimeDisplay[Type] = true; } } diff --git a/Buffs/BrutalliskCrystal.cs b/Buffs/BrutalliskCrystal.cs index 71cc4f6a..8fa9e6a8 100644 --- a/Buffs/BrutalliskCrystal.cs +++ b/Buffs/BrutalliskCrystal.cs @@ -10,9 +10,9 @@ public class BrutalliskCrystal : ModBuff public override void SetDefaults() { Main.buffNoTimeDisplay[Type] = true; - DisplayName.SetDefault("Aquamarine Crystal"); - Description.SetDefault("A fast way of travelling"); - } + DisplayName.SetDefault("Aquamarine Crystal"); + Description.SetDefault("A fast way of travelling"); + } public override void Update(Player player, ref int buffIndex) { diff --git a/Buffs/ChaosElementBuff.cs b/Buffs/ChaosElementBuff.cs index 1acb220f..3d696715 100644 --- a/Buffs/ChaosElementBuff.cs +++ b/Buffs/ChaosElementBuff.cs @@ -10,7 +10,7 @@ public override void SetDefaults() { DisplayName.SetDefault("Chaos Element"); Description.SetDefault("Flasks summon crystal splinters that heal you when hit enemy"); - Main.buffNoSave[Type] = true; + Main.buffNoSave[Type] = true; Main.buffNoTimeDisplay[Type] = true; } } diff --git a/Buffs/ConcentrationofFear.cs b/Buffs/ConcentrationofFear.cs index 38ad1375..dc66021e 100644 --- a/Buffs/ConcentrationofFear.cs +++ b/Buffs/ConcentrationofFear.cs @@ -5,31 +5,31 @@ namespace Tremor.Buffs { - public class ConcentrationofFear : ModBuff - { + public class ConcentrationofFear : ModBuff + { - public override void SetDefaults() - { + public override void SetDefaults() + { DisplayName.SetDefault("Concentration of Fear"); - Description.SetDefault("Increased all damage"); - Main.buffNoTimeDisplay[Type] = true; - } + Description.SetDefault("Increased all damage"); + Main.buffNoTimeDisplay[Type] = true; + } -public override void Update(Player player, ref int buffIndex) - { - player.statDefense += 15; - player.meleeCrit += 5; - player.meleeDamage += 0.25f; - player.meleeSpeed += 0.15f; - player.magicCrit += 5; - player.magicDamage += 0.25f; - player.rangedCrit += 5; - player.rangedDamage += 0.25f; - player.thrownCrit += 5; - player.thrownDamage += 0.25f; - player.minionDamage += 0.25f; - player.minionKB += 0.5f; - player.moveSpeed += 0.15f; - } - } + public override void Update(Player player, ref int buffIndex) + { + player.statDefense += 15; + player.meleeCrit += 5; + player.meleeDamage += 0.25f; + player.meleeSpeed += 0.15f; + player.magicCrit += 5; + player.magicDamage += 0.25f; + player.rangedCrit += 5; + player.rangedDamage += 0.25f; + player.thrownCrit += 5; + player.thrownDamage += 0.25f; + player.minionDamage += 0.25f; + player.minionKB += 0.5f; + player.moveSpeed += 0.15f; + } + } } \ No newline at end of file diff --git a/Buffs/CrabBuff.cs b/Buffs/CrabBuff.cs index 85059a42..84a78ef0 100644 --- a/Buffs/CrabBuff.cs +++ b/Buffs/CrabBuff.cs @@ -10,26 +10,26 @@ public override void SetDefaults() { DisplayName.SetDefault("Little Crab"); Description.SetDefault("A little crab will fight for you"); - Main.buffNoSave[Type] = true; - Main.buffNoTimeDisplay[Type] = true; - } + Main.buffNoSave[Type] = true; + Main.buffNoTimeDisplay[Type] = true; + } public override void Update(Player player, ref int buffIndex) { - TremorPlayer modPlayer = (TremorPlayer)player.GetModPlayer(mod, "TremorPlayer"); - if (player.ownedProjectileCounts[mod.ProjectileType("CrabStaffPro")] > 0) - { - modPlayer.crabStaff = true; - } - if (!modPlayer.crabStaff) - { - player.DelBuff(buffIndex); - buffIndex--; - } - else - { - player.buffTime[buffIndex] = 18000; - } - } + TremorPlayer modPlayer = (TremorPlayer)player.GetModPlayer(mod, "TremorPlayer"); + if (player.ownedProjectileCounts[mod.ProjectileType("CrabStaffPro")] > 0) + { + modPlayer.crabStaff = true; + } + if (!modPlayer.crabStaff) + { + player.DelBuff(buffIndex); + buffIndex--; + } + else + { + player.buffTime[buffIndex] = 18000; + } + } } } \ No newline at end of file diff --git a/Buffs/CursedBannerBuff.cs b/Buffs/CursedBannerBuff.cs index 60435f68..7ebc3df2 100644 --- a/Buffs/CursedBannerBuff.cs +++ b/Buffs/CursedBannerBuff.cs @@ -16,11 +16,11 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - player.meleeCrit += 25; - player.rangedCrit += 25; - player.magicCrit += 25; - player.thrownCrit += 25; - player.GetModPlayer(mod).alchemistCrit += 25; + player.meleeCrit += 25; + player.rangedCrit += 25; + player.magicCrit += 25; + player.thrownCrit += 25; + player.GetModPlayer(mod).alchemistCrit += 25; } } } \ No newline at end of file diff --git a/Buffs/DayHunting.cs b/Buffs/DayHunting.cs index 607cfa33..4002ad1d 100644 --- a/Buffs/DayHunting.cs +++ b/Buffs/DayHunting.cs @@ -16,18 +16,18 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - if (Main.dayTime) - { - player.meleeDamage += 0.15f; - player.meleeCrit += 12; - player.magicDamage += 0.15f; - player.magicCrit += 12; - player.rangedDamage += 0.15f; - player.rangedCrit += 12; - player.minionDamage += 0.15f; - player.thrownDamage += 0.15f; - player.moveSpeed += 0.25f; - } + if (Main.dayTime) + { + player.meleeDamage += 0.15f; + player.meleeCrit += 12; + player.magicDamage += 0.15f; + player.magicCrit += 12; + player.rangedDamage += 0.15f; + player.rangedCrit += 12; + player.minionDamage += 0.15f; + player.thrownDamage += 0.15f; + player.moveSpeed += 0.25f; + } } } } diff --git a/Buffs/DesertEmperorSetBuff.cs b/Buffs/DesertEmperorSetBuff.cs index 002e1516..57ffcbf9 100644 --- a/Buffs/DesertEmperorSetBuff.cs +++ b/Buffs/DesertEmperorSetBuff.cs @@ -9,7 +9,7 @@ public class DesertEmperorSetBuff : ModBuff public override void SetDefaults() { DisplayName.SetDefault("Desert Wasp"); - Description.SetDefault("Releases a wasp to attack enemies when a flask explodes"); + Description.SetDefault("Releases a wasp to attack enemies when a flask explodes"); Main.buffNoSave[Type] = true; Main.buffNoTimeDisplay[Type] = true; } diff --git a/Buffs/DesertSigilBuff.cs b/Buffs/DesertSigilBuff.cs index d1e27062..6ebe6466 100644 --- a/Buffs/DesertSigilBuff.cs +++ b/Buffs/DesertSigilBuff.cs @@ -5,8 +5,8 @@ namespace Tremor.Buffs { public class DesertSigilBuff : ModBuff { - int MinionType = -1; - int MinionID = -1; + int MinionType = -1; + int MinionID = -1; public override void SetDefaults() { @@ -17,18 +17,18 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - if (MinionType == -1) - MinionType = mod.ProjectileType("DesertSigil"); - if (MinionID == -1 || Main.projectile[MinionID].type != MinionType || !Main.projectile[MinionID].active || Main.projectile[MinionID].owner != player.whoAmI) - { - Projectile proj = new Projectile(); - proj.SetDefaults(MinionType); - MinionID = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0, 0, MinionType, proj.damage, proj.knockBack, player.whoAmI); - } - else - { - Main.projectile[MinionID].timeLeft = 5; - } + if (MinionType == -1) + MinionType = mod.ProjectileType("DesertSigil"); + if (MinionID == -1 || Main.projectile[MinionID].type != MinionType || !Main.projectile[MinionID].active || Main.projectile[MinionID].owner != player.whoAmI) + { + Projectile proj = new Projectile(); + proj.SetDefaults(MinionType); + MinionID = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0, 0, MinionType, proj.damage, proj.knockBack, player.whoAmI); + } + else + { + Main.projectile[MinionID].timeLeft = 5; + } } } } diff --git a/Buffs/EmeraldStoneBuff.cs b/Buffs/EmeraldStoneBuff.cs index 6b84ee1c..2f6b27e7 100644 --- a/Buffs/EmeraldStoneBuff.cs +++ b/Buffs/EmeraldStoneBuff.cs @@ -11,8 +11,8 @@ public override void SetDefaults() { DisplayName.SetDefault("Emeraldy"); Description.SetDefault("It lights up the area"); - Main.buffNoTimeDisplay[Type] = true; - Main.lightPet[Type] = true; + Main.buffNoTimeDisplay[Type] = true; + Main.lightPet[Type] = true; } public override void Update(Player player, ref int buffIndex) @@ -33,15 +33,15 @@ public override void Update(Player player, ref int buffIndex) { //if (player.doubleTapCardinalTimer[0] > 0 && player.doubleTapCardinalTimer[0] != 15) //{ - for (int j = 0; j < 1000; j++) + for (int j = 0; j < 1000; j++) + { + if (Main.projectile[j].active && Main.projectile[j].type == mod.ProjectileType("Emeraldy") && Main.projectile[j].owner == player.whoAmI) { - if (Main.projectile[j].active && Main.projectile[j].type == mod.ProjectileType("Emeraldy") && Main.projectile[j].owner == player.whoAmI) - { - Projectile lightpet = Main.projectile[j]; - Vector2 vectorToMouse = player.Center - lightpet.Center; - lightpet.velocity += 5f * Vector2.Normalize(vectorToMouse); - } + Projectile lightpet = Main.projectile[j]; + Vector2 vectorToMouse = player.Center - lightpet.Center; + lightpet.velocity += 5f * Vector2.Normalize(vectorToMouse); } + } //} } } diff --git a/Buffs/EnchantedBuff.cs b/Buffs/EnchantedBuff.cs index eb5f2949..92008bfb 100644 --- a/Buffs/EnchantedBuff.cs +++ b/Buffs/EnchantedBuff.cs @@ -13,7 +13,7 @@ public override void SetDefaults() { DisplayName.SetDefault("Enchanted"); Description.SetDefault("Enchanted weapons have more power"); - //Main.buffNoSave[Type] = true; + //Main.buffNoSave[Type] = true; Main.buffNoTimeDisplay[Type] = true; } } diff --git a/Buffs/ExtendedHealthBooster.cs b/Buffs/ExtendedHealthBooster.cs index b4bab577..a76e79ae 100644 --- a/Buffs/ExtendedHealthBooster.cs +++ b/Buffs/ExtendedHealthBooster.cs @@ -4,7 +4,7 @@ namespace Tremor.Buffs { - public class ExtendedHealthBooster: ModBuff + public class ExtendedHealthBooster : ModBuff { public override void SetDefaults() { @@ -14,12 +14,12 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - if(player.buffTime[buffIndex] == 0) - { - player.statLife += 150; - player.HealEffect(150); - player.AddBuff(mod.BuffType("ExtendedHealthBooster"), 2700); - } + if (player.buffTime[buffIndex] == 0) + { + player.statLife += 150; + player.HealEffect(150); + player.AddBuff(mod.BuffType("ExtendedHealthBooster"), 2700); + } } } } \ No newline at end of file diff --git a/Buffs/ExtendedManaBooster.cs b/Buffs/ExtendedManaBooster.cs index 383d3a16..22af1e66 100644 --- a/Buffs/ExtendedManaBooster.cs +++ b/Buffs/ExtendedManaBooster.cs @@ -4,7 +4,7 @@ namespace Tremor.Buffs { - public class ExtendedManaBooster: ModBuff + public class ExtendedManaBooster : ModBuff { public override void SetDefaults() { @@ -14,12 +14,12 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - if(player.buffTime[buffIndex] == 0) - { - player.statMana += 200; - player.ManaEffect(200); - player.AddBuff(mod.BuffType("ExtendedManaBooster"), 2700); - } + if (player.buffTime[buffIndex] == 0) + { + player.statMana += 200; + player.ManaEffect(200); + player.AddBuff(mod.BuffType("ExtendedManaBooster"), 2700); + } } } } \ No newline at end of file diff --git a/Buffs/EyeMonolithBuff.cs b/Buffs/EyeMonolithBuff.cs index d8d1c01c..f2f82f55 100644 --- a/Buffs/EyeMonolithBuff.cs +++ b/Buffs/EyeMonolithBuff.cs @@ -16,7 +16,7 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - player.minionDamage += 0.15f; + player.minionDamage += 0.15f; } } } diff --git a/Buffs/FirstTrueBlade.cs b/Buffs/FirstTrueBlade.cs index 296ee395..709e41af 100644 --- a/Buffs/FirstTrueBlade.cs +++ b/Buffs/FirstTrueBlade.cs @@ -4,28 +4,28 @@ namespace Tremor.Buffs { public class FirstTrueBlade : ModBuff - { - int MinionType = -1; - int MinionID = -1; + { + int MinionType = -1; + int MinionID = -1; - const int Damage = 100; - const float KB = 1; + const int Damage = 100; + const float KB = 1; - public override void SetDefaults() + public override void SetDefaults() { - Description.SetDefault("One out of three blades is protecting you"); + Description.SetDefault("One out of three blades is protecting you"); Main.buffNoTimeDisplay[Type] = true; DisplayName.SetDefault("First True Blade"); } public override void Update(Player player, ref int buffIndex) { - if (MinionType == -1) - MinionType = mod.ProjectileType("TrueBladeOne"); - if (MinionID == -1 || Main.projectile[MinionID].type != MinionType || !Main.projectile[MinionID].active || Main.projectile[MinionID].owner != player.whoAmI) - MinionID = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0, 0, MinionType, (int)(Damage * player.meleeDamage), KB, player.whoAmI); - else - Main.projectile[MinionID].timeLeft = 6; - } + if (MinionType == -1) + MinionType = mod.ProjectileType("TrueBladeOne"); + if (MinionID == -1 || Main.projectile[MinionID].type != MinionType || !Main.projectile[MinionID].active || Main.projectile[MinionID].owner != player.whoAmI) + MinionID = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0, 0, MinionType, (int)(Damage * player.meleeDamage), KB, player.whoAmI); + else + Main.projectile[MinionID].timeLeft = 6; + } } } \ No newline at end of file diff --git a/Buffs/FragileCondition.cs b/Buffs/FragileCondition.cs index 4218453e..5796c8c6 100644 --- a/Buffs/FragileCondition.cs +++ b/Buffs/FragileCondition.cs @@ -15,13 +15,13 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - player.statDefense = 0; - player.magicDamage *= 3f; - player.minionDamage *= 3f; - player.meleeDamage *= 3f; - player.rangedDamage *= 3f; - player.thrownDamage *= 3f; - player.GetModPlayer(mod).alchemistDamage *= 3f; + player.statDefense = 0; + player.magicDamage *= 3f; + player.minionDamage *= 3f; + player.meleeDamage *= 3f; + player.rangedDamage *= 3f; + player.thrownDamage *= 3f; + player.GetModPlayer(mod).alchemistDamage *= 3f; } } } diff --git a/Buffs/GoldenGlowingRingBuff.cs b/Buffs/GoldenGlowingRingBuff.cs index 19d376cb..2bd3dedb 100644 --- a/Buffs/GoldenGlowingRingBuff.cs +++ b/Buffs/GoldenGlowingRingBuff.cs @@ -4,17 +4,17 @@ namespace Tremor.Buffs { public class GoldenGlowingRingBuff : ModBuff - { - int MinionType = -1; - int MinionID = -1; + { + int MinionType = -1; + int MinionID = -1; - int MinionType1 = -1; - int MinionID1 = -1; + int MinionType1 = -1; + int MinionID1 = -1; - const int Damage = 26; - const float KB = 1; + const int Damage = 26; + const float KB = 1; - public override void SetDefaults() + public override void SetDefaults() { Main.buffNoTimeDisplay[Type] = true; DisplayName.SetDefault("Fungus Blades"); @@ -23,19 +23,19 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - if (MinionType == -1) - MinionType = mod.ProjectileType("FungusBlueSword"); - if (MinionID == -1 || Main.projectile[MinionID].type != MinionType || !Main.projectile[MinionID].active || Main.projectile[MinionID].owner != player.whoAmI) - MinionID = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0, 0, MinionType, (int)(Damage * player.meleeDamage), KB, player.whoAmI); - else - Main.projectile[MinionID].timeLeft = 6; + if (MinionType == -1) + MinionType = mod.ProjectileType("FungusBlueSword"); + if (MinionID == -1 || Main.projectile[MinionID].type != MinionType || !Main.projectile[MinionID].active || Main.projectile[MinionID].owner != player.whoAmI) + MinionID = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0, 0, MinionType, (int)(Damage * player.meleeDamage), KB, player.whoAmI); + else + Main.projectile[MinionID].timeLeft = 6; - if (MinionType1 == -1) - MinionType1 = mod.ProjectileType("FungusYellowSword"); - if (MinionID1 == -1 || Main.projectile[MinionID1].type != MinionType1 || !Main.projectile[MinionID1].active || Main.projectile[MinionID1].owner != player.whoAmI) - MinionID1 = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0, 0, MinionType1, (int)(Damage * player.meleeDamage), KB, player.whoAmI); - else - Main.projectile[MinionID1].timeLeft = 6; - } + if (MinionType1 == -1) + MinionType1 = mod.ProjectileType("FungusYellowSword"); + if (MinionID1 == -1 || Main.projectile[MinionID1].type != MinionType1 || !Main.projectile[MinionID1].active || Main.projectile[MinionID1].owner != player.whoAmI) + MinionID1 = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0, 0, MinionType1, (int)(Damage * player.meleeDamage), KB, player.whoAmI); + else + Main.projectile[MinionID1].timeLeft = 6; + } } } \ No newline at end of file diff --git a/Buffs/GoldenWhale.cs b/Buffs/GoldenWhale.cs index bfd0058a..7a532457 100644 --- a/Buffs/GoldenWhale.cs +++ b/Buffs/GoldenWhale.cs @@ -16,7 +16,7 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - player.meleeEnchant = 4; + player.meleeEnchant = 4; player.buffTime[buffIndex] = 18000; TremorPlayer modPlayer = (TremorPlayer)player.GetModPlayer(mod, "TremorPlayer"); diff --git a/Buffs/GurdPetBuff.cs b/Buffs/GurdPetBuff.cs index dc73ee3a..7401c932 100644 --- a/Buffs/GurdPetBuff.cs +++ b/Buffs/GurdPetBuff.cs @@ -16,7 +16,7 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - player.GetModPlayer(mod).alchemistCrit += 20; + player.GetModPlayer(mod).alchemistCrit += 20; player.buffTime[buffIndex] = 18000; TremorPlayer modPlayer = (TremorPlayer)player.GetModPlayer(mod, "TremorPlayer"); modPlayer.gurdPet = true; diff --git a/Buffs/HealthBooster.cs b/Buffs/HealthBooster.cs index 09050453..04d90276 100644 --- a/Buffs/HealthBooster.cs +++ b/Buffs/HealthBooster.cs @@ -4,7 +4,7 @@ namespace Tremor.Buffs { - public class HealthBooster: ModBuff + public class HealthBooster : ModBuff { public override void SetDefaults() { @@ -14,12 +14,12 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - if(player.buffTime[buffIndex] == 0) - { - player.statLife += 100; - player.HealEffect(100); - player.AddBuff(mod.BuffType("HealthBooster"), 3600); - } + if (player.buffTime[buffIndex] == 0) + { + player.statLife += 100; + player.HealEffect(100); + player.AddBuff(mod.BuffType("HealthBooster"), 3600); + } } } } \ No newline at end of file diff --git a/Buffs/HealthRecharging.cs b/Buffs/HealthRecharging.cs index ca586d59..6deadbe6 100644 --- a/Buffs/HealthRecharging.cs +++ b/Buffs/HealthRecharging.cs @@ -9,7 +9,7 @@ public class HealthRecharging : ModBuff { public override void SetDefaults() { - Main.debuff[Type] = true; + Main.debuff[Type] = true; DisplayName.SetDefault("Health Recharging"); Description.SetDefault("Wait before you can use the hourglass again"); } diff --git a/Buffs/HeroBuff.cs b/Buffs/HeroBuff.cs index 70778260..703cb241 100644 --- a/Buffs/HeroBuff.cs +++ b/Buffs/HeroBuff.cs @@ -15,14 +15,14 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - player.aggro += 50; - + player.aggro += 50; + player.statDefense += 10000; player.moveSpeed += 0.15f; player.moveSpeed += 999f; - - player.buffImmune[20] = true; - player.buffImmune[21] = true; + + player.buffImmune[20] = true; + player.buffImmune[21] = true; player.buffImmune[22] = true; player.buffImmune[23] = true; player.buffImmune[24] = true; diff --git a/Buffs/HuskyBuff.cs b/Buffs/HuskyBuff.cs index d1df6c7f..18595e0f 100644 --- a/Buffs/HuskyBuff.cs +++ b/Buffs/HuskyBuff.cs @@ -10,26 +10,26 @@ public override void SetDefaults() { DisplayName.SetDefault("Husky"); Description.SetDefault("A husky will fight for you"); - Main.buffNoSave[Type] = true; - Main.buffNoTimeDisplay[Type] = true; - } + Main.buffNoSave[Type] = true; + Main.buffNoTimeDisplay[Type] = true; + } public override void Update(Player player, ref int buffIndex) { - TremorPlayer modPlayer = (TremorPlayer)player.GetModPlayer(mod, "TremorPlayer"); - if (player.ownedProjectileCounts[mod.ProjectileType("HuskyStaffPro")] > 0) - { - modPlayer.huskyStaff = true; - } - if (!modPlayer.huskyStaff) - { - player.DelBuff(buffIndex); - buffIndex--; - } - else - { - player.buffTime[buffIndex] = 18000; - } - } + TremorPlayer modPlayer = (TremorPlayer)player.GetModPlayer(mod, "TremorPlayer"); + if (player.ownedProjectileCounts[mod.ProjectileType("HuskyStaffPro")] > 0) + { + modPlayer.huskyStaff = true; + } + if (!modPlayer.huskyStaff) + { + player.DelBuff(buffIndex); + buffIndex--; + } + else + { + player.buffTime[buffIndex] = 18000; + } + } } } \ No newline at end of file diff --git a/Buffs/ManaBooster.cs b/Buffs/ManaBooster.cs index 7ff8bc7a..16cdad0d 100644 --- a/Buffs/ManaBooster.cs +++ b/Buffs/ManaBooster.cs @@ -4,7 +4,7 @@ namespace Tremor.Buffs { - public class ManaBooster: ModBuff + public class ManaBooster : ModBuff { public override void SetDefaults() { @@ -14,12 +14,12 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - if(player.buffTime[buffIndex] == 0) - { - player.statMana += 150; - player.ManaEffect(150); - player.AddBuff(mod.BuffType("ManaBooster"), 3600); - } + if (player.buffTime[buffIndex] == 0) + { + player.statMana += 150; + player.ManaEffect(150); + player.AddBuff(mod.BuffType("ManaBooster"), 3600); + } } } } \ No newline at end of file diff --git a/Buffs/ManaGeneration.cs b/Buffs/ManaGeneration.cs index 2f9db07a..03d86889 100644 --- a/Buffs/ManaGeneration.cs +++ b/Buffs/ManaGeneration.cs @@ -16,7 +16,7 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - player.manaCost -= 0.70f; + player.manaCost -= 0.70f; } } } diff --git a/Buffs/ManaSaving.cs b/Buffs/ManaSaving.cs index e4a249e0..23611b96 100644 --- a/Buffs/ManaSaving.cs +++ b/Buffs/ManaSaving.cs @@ -15,7 +15,7 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - player.manaCost -= 0.50f; + player.manaCost -= 0.50f; } } } diff --git a/Buffs/MaximumCharge.cs b/Buffs/MaximumCharge.cs index c5f9ba84..edcd47b4 100644 --- a/Buffs/MaximumCharge.cs +++ b/Buffs/MaximumCharge.cs @@ -15,7 +15,7 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - player.statManaMax2 += 100; + player.statManaMax2 += 100; } } } diff --git a/Buffs/MoltenWatcherBuff.cs b/Buffs/MoltenWatcherBuff.cs index 56aaa061..d45ca4c4 100644 --- a/Buffs/MoltenWatcherBuff.cs +++ b/Buffs/MoltenWatcherBuff.cs @@ -5,8 +5,8 @@ namespace Tremor.Buffs { public class MoltenWatcherBuff : ModBuff { - int MinionType = -1; - int MinionID = -1; + int MinionType = -1; + int MinionID = -1; public override void SetDefaults() { @@ -17,18 +17,18 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - if (MinionType == -1) - MinionType = mod.ProjectileType("MoltenWatcher"); - if (MinionID == -1 || Main.projectile[MinionID].type != MinionType || !Main.projectile[MinionID].active || Main.projectile[MinionID].owner != player.whoAmI) - { - Projectile proj = new Projectile(); - proj.SetDefaults(MinionType); - MinionID = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0, 0, MinionType, proj.damage, proj.knockBack, player.whoAmI); - } - else - { - Main.projectile[MinionID].timeLeft = 5; - } + if (MinionType == -1) + MinionType = mod.ProjectileType("MoltenWatcher"); + if (MinionID == -1 || Main.projectile[MinionID].type != MinionType || !Main.projectile[MinionID].active || Main.projectile[MinionID].owner != player.whoAmI) + { + Projectile proj = new Projectile(); + proj.SetDefaults(MinionType); + MinionID = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0, 0, MinionType, proj.damage, proj.knockBack, player.whoAmI); + } + else + { + Main.projectile[MinionID].timeLeft = 5; + } } } } diff --git a/Buffs/NanoDronBuff.cs b/Buffs/NanoDronBuff.cs index d0952855..498cd88e 100644 --- a/Buffs/NanoDronBuff.cs +++ b/Buffs/NanoDronBuff.cs @@ -5,8 +5,8 @@ namespace Tremor.Buffs { public class NanoDronBuff : ModBuff { - int MinionType = -1; - int MinionID = -1; + int MinionType = -1; + int MinionID = -1; public override void SetDefaults() { @@ -17,18 +17,18 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - if (MinionType == -1) - MinionType = mod.ProjectileType("NanoDronPro"); - if (MinionID == -1 || Main.projectile[MinionID].type != MinionType || !Main.projectile[MinionID].active || Main.projectile[MinionID].owner != player.whoAmI) - { - Projectile proj = new Projectile(); - proj.SetDefaults(MinionType); - MinionID = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0, 0, MinionType, proj.damage, proj.knockBack, player.whoAmI); - } - else - { - Main.projectile[MinionID].timeLeft = 5; - } + if (MinionType == -1) + MinionType = mod.ProjectileType("NanoDronPro"); + if (MinionID == -1 || Main.projectile[MinionID].type != MinionType || !Main.projectile[MinionID].active || Main.projectile[MinionID].owner != player.whoAmI) + { + Projectile proj = new Projectile(); + proj.SetDefaults(MinionType); + MinionID = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0, 0, MinionType, proj.damage, proj.knockBack, player.whoAmI); + } + else + { + Main.projectile[MinionID].timeLeft = 5; + } } } } diff --git a/Buffs/NightHunting.cs b/Buffs/NightHunting.cs index 0819010c..10d35de8 100644 --- a/Buffs/NightHunting.cs +++ b/Buffs/NightHunting.cs @@ -16,18 +16,18 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - if (!Main.dayTime) - { - player.meleeDamage += 0.15f; - player.meleeCrit += 12; - player.magicDamage += 0.15f; - player.magicCrit += 12; - player.rangedDamage += 0.15f; - player.rangedCrit += 12; - player.minionDamage += 0.15f; - player.thrownDamage += 0.15f; - player.moveSpeed += 0.25f; - } + if (!Main.dayTime) + { + player.meleeDamage += 0.15f; + player.meleeCrit += 12; + player.magicDamage += 0.15f; + player.magicCrit += 12; + player.rangedDamage += 0.15f; + player.rangedCrit += 12; + player.minionDamage += 0.15f; + player.thrownDamage += 0.15f; + player.moveSpeed += 0.25f; + } } } } diff --git a/Buffs/Omnibuff.cs b/Buffs/Omnibuff.cs index 66c0c2eb..6c7bb2e4 100644 --- a/Buffs/Omnibuff.cs +++ b/Buffs/Omnibuff.cs @@ -5,8 +5,8 @@ namespace Tremor.Buffs { public class Omnibuff : ModBuff { - int MinionType = -1; - int MinionID = -1; + int MinionType = -1; + int MinionID = -1; public override void SetDefaults() { @@ -17,18 +17,18 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - if (MinionType == -1) - MinionType = mod.ProjectileType("OmnikronBeast"); - if (MinionID == -1 || Main.projectile[MinionID].type != MinionType || !Main.projectile[MinionID].active || Main.projectile[MinionID].owner != player.whoAmI) - { - Projectile proj = new Projectile(); - proj.SetDefaults(MinionType); - MinionID = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0, 0, MinionType, proj.damage, proj.knockBack, player.whoAmI); - } - else - { - Main.projectile[MinionID].timeLeft = 5; - } + if (MinionType == -1) + MinionType = mod.ProjectileType("OmnikronBeast"); + if (MinionID == -1 || Main.projectile[MinionID].type != MinionType || !Main.projectile[MinionID].active || Main.projectile[MinionID].owner != player.whoAmI) + { + Projectile proj = new Projectile(); + proj.SetDefaults(MinionType); + MinionID = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0, 0, MinionType, proj.damage, proj.knockBack, player.whoAmI); + } + else + { + Main.projectile[MinionID].timeLeft = 5; + } } } } diff --git a/Buffs/PaladinBuff.cs b/Buffs/PaladinBuff.cs index d25cb075..21395720 100644 --- a/Buffs/PaladinBuff.cs +++ b/Buffs/PaladinBuff.cs @@ -4,14 +4,14 @@ namespace Tremor.Buffs { public class PaladinBuff : ModBuff - { - int MinionType = -1; - int MinionID = -1; + { + int MinionType = -1; + int MinionID = -1; - const int Damage = 200; - const float KB = 1; + const int Damage = 200; + const float KB = 1; - public override void SetDefaults() + public override void SetDefaults() { Main.buffNoTimeDisplay[Type] = true; DisplayName.SetDefault("Paladin Hammer"); @@ -19,12 +19,12 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - if (MinionType == -1) - MinionType = mod.ProjectileType("PaladinHammerPro"); - if (MinionID == -1 || Main.projectile[MinionID].type != MinionType || !Main.projectile[MinionID].active || Main.projectile[MinionID].owner != player.whoAmI) - MinionID = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0, 0, MinionType, (int)(Damage * player.meleeDamage), KB, player.whoAmI); - else - Main.projectile[MinionID].timeLeft = 6; - } + if (MinionType == -1) + MinionType = mod.ProjectileType("PaladinHammerPro"); + if (MinionID == -1 || Main.projectile[MinionID].type != MinionType || !Main.projectile[MinionID].active || Main.projectile[MinionID].owner != player.whoAmI) + MinionID = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0, 0, MinionType, (int)(Damage * player.meleeDamage), KB, player.whoAmI); + else + Main.projectile[MinionID].timeLeft = 6; + } } } \ No newline at end of file diff --git a/Buffs/PetsBuffs.cs b/Buffs/PetsBuffs.cs index 642c0281..4663aafe 100644 --- a/Buffs/PetsBuffs.cs +++ b/Buffs/PetsBuffs.cs @@ -4,194 +4,194 @@ namespace Tremor.Buffs { - public class PetsBuffs : GlobalBuff - { - public override void Update(int type, Player player, ref int buffIndex) - { - if (type == 41) - { - player.buffImmune[44] = true; - player.buffImmune[46] = true; - player.buffImmune[47] = true; - } - if (type == 42) - { - player.statDefense += 8; - } - if (type == 45) - { - player.moveSpeed += 0.15f; - } - if (type == 50) - { - player.aggro -= 400; - } - if (type == 51) - { - player.jumpBoost = true; - } - if (type == 52) - { - player.endurance += 0.20f; - } - if (type == 53) - { - player.autoJump = true; - } - if (type == 54) - { - player.armorPenetration += 8; - } - if (type == 55) - { - player.detectCreature = true; - } - if (type == 56) - { - player.manaRegenDelayBonus++; - player.manaRegenBonus += 20; - } - if (type == 61) - { - player.meleeDamage += 0.08f; - player.magicDamage += 0.08f; - player.rangedDamage += 0.08f; - player.thrownDamage += 0.08f; - player.minionDamage += 0.08f; - } - if (type == 65) - { - player.findTreasure = true; - } - if (type == 81) - { - player.spikedBoots = 1; - player.spikedBoots = 2; - } - if (type == 82) - { - player.statManaMax2 += 100; - } - if (type == 84) - { - player.maxMinions += 1; - } - if (type == 85) - { - player.meleeCrit += 8; - player.magicCrit += 8; - player.rangedCrit += 8; - player.thrownCrit += 8; - } - if (type == 91) - { - player.meleeSpeed += 0.1f; - } - if (type == 92) - { - player.aggro += 400; - } - if (type == 127) - { - player.pickSpeed -= 0.12f; - } - if (type == 136) - { - player.lifeRegen += 5; - } - if (type == 154) - { - player.statLifeMax2 += 50; - } - } -/* - public override void ModifyBuffTip(int type, ref string tip, ref int rare) - { - if (type == 41) - { - tip = "Grants immunity to frozen effects"); - } - if (type == 42) - { - tip = "Increases your defense"); - } - if (type == 45) - { - tip = "Gives extra speed"); - } - if (type == 50) - { - tip = "Enemies are less likely to target you"); - } - if (type == 51) - { - tip = "Increases jump height"); - } - if (type == 52) - { - tip = "Reduces damage taken by 20%"; - } - if (type == 53) - { - tip = "Allows auto-jump"); - } - if (type == 54) - { - tip = "Increases armor penetration"); - } - if (type == 55) - { - tip = "Detects creatures"); - } - if (type == 56) - { - tip = "Increases mana regeneration rate"); - } - if (type == 61) - { - tip = "Increases all damage by 8%"; - } - if (type == 65) - { - tip = "Detect treasures and ores"); - } - if (type == 81) - { - tip = "Grants ability to climb walls"); - } - if (type == 82) - { - tip = "Increase maximum mana by 100"); - } - if (type == 84) - { - tip = "Allows you to summon another minion"); - } - if (type == 85) - { - tip = "Increases all crit chanse by 8%"; - } - if (type == 91) - { - tip = "Increases your melee speed"); - } - if (type == 92) - { - tip = "Enemies are more likely to target you"); - } - if (type == 127) - { - tip = "Make your pickaxe faster"); - } - if (type == 136) - { - tip = "Increases regeneration"); - } - if (type == 154) - { - tip = "Increases max health by 50"); - } - } -*/ - } + public class PetsBuffs : GlobalBuff + { + public override void Update(int type, Player player, ref int buffIndex) + { + if (type == 41) + { + player.buffImmune[44] = true; + player.buffImmune[46] = true; + player.buffImmune[47] = true; + } + if (type == 42) + { + player.statDefense += 8; + } + if (type == 45) + { + player.moveSpeed += 0.15f; + } + if (type == 50) + { + player.aggro -= 400; + } + if (type == 51) + { + player.jumpBoost = true; + } + if (type == 52) + { + player.endurance += 0.20f; + } + if (type == 53) + { + player.autoJump = true; + } + if (type == 54) + { + player.armorPenetration += 8; + } + if (type == 55) + { + player.detectCreature = true; + } + if (type == 56) + { + player.manaRegenDelayBonus++; + player.manaRegenBonus += 20; + } + if (type == 61) + { + player.meleeDamage += 0.08f; + player.magicDamage += 0.08f; + player.rangedDamage += 0.08f; + player.thrownDamage += 0.08f; + player.minionDamage += 0.08f; + } + if (type == 65) + { + player.findTreasure = true; + } + if (type == 81) + { + player.spikedBoots = 1; + player.spikedBoots = 2; + } + if (type == 82) + { + player.statManaMax2 += 100; + } + if (type == 84) + { + player.maxMinions += 1; + } + if (type == 85) + { + player.meleeCrit += 8; + player.magicCrit += 8; + player.rangedCrit += 8; + player.thrownCrit += 8; + } + if (type == 91) + { + player.meleeSpeed += 0.1f; + } + if (type == 92) + { + player.aggro += 400; + } + if (type == 127) + { + player.pickSpeed -= 0.12f; + } + if (type == 136) + { + player.lifeRegen += 5; + } + if (type == 154) + { + player.statLifeMax2 += 50; + } + } + /* + public override void ModifyBuffTip(int type, ref string tip, ref int rare) + { + if (type == 41) + { + tip = "Grants immunity to frozen effects"); + } + if (type == 42) + { + tip = "Increases your defense"); + } + if (type == 45) + { + tip = "Gives extra speed"); + } + if (type == 50) + { + tip = "Enemies are less likely to target you"); + } + if (type == 51) + { + tip = "Increases jump height"); + } + if (type == 52) + { + tip = "Reduces damage taken by 20%"; + } + if (type == 53) + { + tip = "Allows auto-jump"); + } + if (type == 54) + { + tip = "Increases armor penetration"); + } + if (type == 55) + { + tip = "Detects creatures"); + } + if (type == 56) + { + tip = "Increases mana regeneration rate"); + } + if (type == 61) + { + tip = "Increases all damage by 8%"; + } + if (type == 65) + { + tip = "Detect treasures and ores"); + } + if (type == 81) + { + tip = "Grants ability to climb walls"); + } + if (type == 82) + { + tip = "Increase maximum mana by 100"); + } + if (type == 84) + { + tip = "Allows you to summon another minion"); + } + if (type == 85) + { + tip = "Increases all crit chanse by 8%"; + } + if (type == 91) + { + tip = "Increases your melee speed"); + } + if (type == 92) + { + tip = "Enemies are more likely to target you"); + } + if (type == 127) + { + tip = "Make your pickaxe faster"); + } + if (type == 136) + { + tip = "Increases regeneration"); + } + if (type == 154) + { + tip = "Increases max health by 50"); + } + } + */ + } } diff --git a/Buffs/ReinforcedHeart.cs b/Buffs/ReinforcedHeart.cs index f0f6de8b..f17e92d4 100644 --- a/Buffs/ReinforcedHeart.cs +++ b/Buffs/ReinforcedHeart.cs @@ -16,7 +16,7 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - player.statLifeMax2 += 100; + player.statLifeMax2 += 100; } } } diff --git a/Buffs/RockClimberBuff.cs b/Buffs/RockClimberBuff.cs index 61d5403d..d78b4fce 100644 --- a/Buffs/RockClimberBuff.cs +++ b/Buffs/RockClimberBuff.cs @@ -15,8 +15,8 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - player.spikedBoots = 1; - player.spikedBoots = 2; + player.spikedBoots = 1; + player.spikedBoots = 2; } } } diff --git a/Buffs/RuinAltarBuff.cs b/Buffs/RuinAltarBuff.cs index 4c89be7f..9288dfef 100644 --- a/Buffs/RuinAltarBuff.cs +++ b/Buffs/RuinAltarBuff.cs @@ -15,8 +15,8 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - TremorPlayer modPlayer = (TremorPlayer)player.GetModPlayer(mod, "TremorPlayer"); - modPlayer.ruinAltar = true; - } + TremorPlayer modPlayer = (TremorPlayer)player.GetModPlayer(mod, "TremorPlayer"); + modPlayer.ruinAltar = true; + } } } diff --git a/Buffs/Sad.cs b/Buffs/Sad.cs index 9e71843a..e5df70b3 100644 --- a/Buffs/Sad.cs +++ b/Buffs/Sad.cs @@ -14,12 +14,12 @@ public override void SetDefaults() { DisplayName.SetDefault("Sad"); Description.SetDefault("10% decreased damage"); - Main.debuff[Type] = true; + Main.debuff[Type] = true; } - public override void Update(NPC npc, ref int buffIndex) - { - npc.damage = (int) (npc.damage - 0.1f); - } + public override void Update(NPC npc, ref int buffIndex) + { + npc.damage = (int)(npc.damage - 0.1f); + } } } \ No newline at end of file diff --git a/Buffs/SandstormMinionBuff.cs b/Buffs/SandstormMinionBuff.cs index d7d325b1..fc08bc3d 100644 --- a/Buffs/SandstormMinionBuff.cs +++ b/Buffs/SandstormMinionBuff.cs @@ -5,8 +5,8 @@ namespace Tremor.Buffs { public class SandstormMinionBuff : ModBuff { - int MinionType = -1; - int MinionID = -1; + int MinionType = -1; + int MinionID = -1; public override void SetDefaults() { @@ -16,18 +16,18 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - if (MinionType == -1) - MinionType = mod.ProjectileType("SandstormMinion"); - if (MinionID == -1 || Main.projectile[MinionID].type != MinionType || !Main.projectile[MinionID].active || Main.projectile[MinionID].owner != player.whoAmI) - { - Projectile proj = new Projectile(); - proj.SetDefaults(MinionType); - MinionID = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0, 0, MinionType, proj.damage, proj.knockBack, player.whoAmI); - } - else - { - Main.projectile[MinionID].timeLeft = 5; - } + if (MinionType == -1) + MinionType = mod.ProjectileType("SandstormMinion"); + if (MinionID == -1 || Main.projectile[MinionID].type != MinionType || !Main.projectile[MinionID].active || Main.projectile[MinionID].owner != player.whoAmI) + { + Projectile proj = new Projectile(); + proj.SetDefaults(MinionType); + MinionID = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0, 0, MinionType, proj.damage, proj.knockBack, player.whoAmI); + } + else + { + Main.projectile[MinionID].timeLeft = 5; + } } } } diff --git a/Buffs/SecondTrueBlade.cs b/Buffs/SecondTrueBlade.cs index 34203191..452c16d9 100644 --- a/Buffs/SecondTrueBlade.cs +++ b/Buffs/SecondTrueBlade.cs @@ -4,28 +4,28 @@ namespace Tremor.Buffs { public class SecondTrueBlade : ModBuff - { - int MinionType = -1; - int MinionID = -1; + { + int MinionType = -1; + int MinionID = -1; - const int Damage = 125; - const float KB = 1; + const int Damage = 125; + const float KB = 1; - public override void SetDefaults() + public override void SetDefaults() { - Description.SetDefault("One out of three blades is protecting you"); + Description.SetDefault("One out of three blades is protecting you"); Main.buffNoTimeDisplay[Type] = true; DisplayName.SetDefault("Second True Blade"); } public override void Update(Player player, ref int buffIndex) { - if (MinionType == -1) - MinionType = mod.ProjectileType("TrueBladeTwo"); - if (MinionID == -1 || Main.projectile[MinionID].type != MinionType || !Main.projectile[MinionID].active || Main.projectile[MinionID].owner != player.whoAmI) - MinionID = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0, 0, MinionType, (int)(Damage * player.meleeDamage), KB, player.whoAmI); - else - Main.projectile[MinionID].timeLeft = 6; - } + if (MinionType == -1) + MinionType = mod.ProjectileType("TrueBladeTwo"); + if (MinionID == -1 || Main.projectile[MinionID].type != MinionType || !Main.projectile[MinionID].active || Main.projectile[MinionID].owner != player.whoAmI) + MinionID = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0, 0, MinionType, (int)(Damage * player.meleeDamage), KB, player.whoAmI); + else + Main.projectile[MinionID].timeLeft = 6; + } } } \ No newline at end of file diff --git a/Buffs/SilkBannerBuff.cs b/Buffs/SilkBannerBuff.cs index 38b98c75..dec28fea 100644 --- a/Buffs/SilkBannerBuff.cs +++ b/Buffs/SilkBannerBuff.cs @@ -16,8 +16,8 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - player.thorns = 3f; - player.statDefense += 15; + player.thorns = 3f; + player.statDefense += 15; } } } \ No newline at end of file diff --git a/Buffs/StarfishBuff.cs b/Buffs/StarfishBuff.cs index affb71cc..f059ca4e 100644 --- a/Buffs/StarfishBuff.cs +++ b/Buffs/StarfishBuff.cs @@ -6,8 +6,8 @@ namespace Tremor.Buffs { public class StarfishBuff : ModBuff { - int MinionType = -1; - int MinionID = -1; + int MinionType = -1; + int MinionID = -1; public override void SetDefaults() { @@ -19,18 +19,18 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - if (MinionType == -1) - MinionType = mod.ProjectileType("StarfishPro"); - if (MinionID == -1 || Main.projectile[MinionID].type != MinionType || !Main.projectile[MinionID].active || Main.projectile[MinionID].owner != player.whoAmI) - { - Projectile proj = new Projectile(); - proj.SetDefaults(MinionType); - MinionID = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0, 0, MinionType, 10, 2, player.whoAmI); - } - else - { - Main.projectile[MinionID].timeLeft = 5; - } + if (MinionType == -1) + MinionType = mod.ProjectileType("StarfishPro"); + if (MinionID == -1 || Main.projectile[MinionID].type != MinionType || !Main.projectile[MinionID].active || Main.projectile[MinionID].owner != player.whoAmI) + { + Projectile proj = new Projectile(); + proj.SetDefaults(MinionType); + MinionID = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0, 0, MinionType, 10, 2, player.whoAmI); + } + else + { + Main.projectile[MinionID].timeLeft = 5; + } } } } \ No newline at end of file diff --git a/Buffs/TatteredBannerBuff.cs b/Buffs/TatteredBannerBuff.cs index 4d50f55a..ac2bbee2 100644 --- a/Buffs/TatteredBannerBuff.cs +++ b/Buffs/TatteredBannerBuff.cs @@ -16,12 +16,12 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - player.meleeDamage += 0.25f; - player.rangedDamage += 0.25f; - player.minionDamage += 0.25f; - player.magicDamage += 0.25f; - player.thrownDamage += 0.25f; - player.GetModPlayer(mod).alchemistDamage += 0.25f; + player.meleeDamage += 0.25f; + player.rangedDamage += 0.25f; + player.minionDamage += 0.25f; + player.magicDamage += 0.25f; + player.thrownDamage += 0.25f; + player.GetModPlayer(mod).alchemistDamage += 0.25f; } } } \ No newline at end of file diff --git a/Buffs/TheCadenceBuff.cs b/Buffs/TheCadenceBuff.cs index e62ef196..382d3b2b 100644 --- a/Buffs/TheCadenceBuff.cs +++ b/Buffs/TheCadenceBuff.cs @@ -10,7 +10,7 @@ public override void SetDefaults() { DisplayName.SetDefault("The Cadence"); Description.SetDefault("Flasks attack your enemies with souls"); - Main.buffNoSave[Type] = true; + Main.buffNoSave[Type] = true; Main.buffNoTimeDisplay[Type] = true; } } diff --git a/Buffs/ThirdTrueBlade.cs b/Buffs/ThirdTrueBlade.cs index fd124bbd..42bcf44b 100644 --- a/Buffs/ThirdTrueBlade.cs +++ b/Buffs/ThirdTrueBlade.cs @@ -4,28 +4,28 @@ namespace Tremor.Buffs { public class ThirdTrueBlade : ModBuff - { - int MinionType = -1; - int MinionID = -1; + { + int MinionType = -1; + int MinionID = -1; - const int Damage = 150; - const float KB = 1; + const int Damage = 150; + const float KB = 1; - public override void SetDefaults() + public override void SetDefaults() { - Description.SetDefault("One out of three blades is protecting you"); + Description.SetDefault("One out of three blades is protecting you"); Main.buffNoTimeDisplay[Type] = true; DisplayName.SetDefault("Third True Blade"); } public override void Update(Player player, ref int buffIndex) { - if (MinionType == -1) - MinionType = mod.ProjectileType("TrueBladeThree"); - if (MinionID == -1 || Main.projectile[MinionID].type != MinionType || !Main.projectile[MinionID].active || Main.projectile[MinionID].owner != player.whoAmI) - MinionID = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0, 0, MinionType, (int)(Damage * player.meleeDamage), KB, player.whoAmI); - else - Main.projectile[MinionID].timeLeft = 6; - } + if (MinionType == -1) + MinionType = mod.ProjectileType("TrueBladeThree"); + if (MinionID == -1 || Main.projectile[MinionID].type != MinionType || !Main.projectile[MinionID].active || Main.projectile[MinionID].owner != player.whoAmI) + MinionID = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0, 0, MinionType, (int)(Damage * player.meleeDamage), KB, player.whoAmI); + else + Main.projectile[MinionID].timeLeft = 6; + } } } \ No newline at end of file diff --git a/Buffs/TremorBuffs.cs b/Buffs/TremorBuffs.cs index a14c43e0..baa23152 100644 --- a/Buffs/TremorBuffs.cs +++ b/Buffs/TremorBuffs.cs @@ -8,14 +8,14 @@ public class TremorBuffs : GlobalBuff public override void Update(int type, Terraria.Player player, ref int buffIndex) { - if(player.FindBuffIndex(117) != -1) - { - player.GetModPlayer(mod).alchemistDamage += 0.1f; - } - if(player.FindBuffIndex(115) != -1) - { - player.GetModPlayer(mod).alchemistCrit += 10; - } + if (player.FindBuffIndex(117) != -1) + { + player.GetModPlayer(mod).alchemistDamage += 0.1f; + } + if (player.FindBuffIndex(115) != -1) + { + player.GetModPlayer(mod).alchemistCrit += 10; + } } } } \ No newline at end of file diff --git a/Buffs/ZephyrhornBuff.cs b/Buffs/ZephyrhornBuff.cs index cb2172ea..abe153a4 100644 --- a/Buffs/ZephyrhornBuff.cs +++ b/Buffs/ZephyrhornBuff.cs @@ -15,7 +15,7 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - player.minionDamage += 0.1f; + player.minionDamage += 0.1f; } } } diff --git a/Buffs/buffSteampunkProbe.cs b/Buffs/buffSteampunkProbe.cs index 299cf9f1..7b969434 100644 --- a/Buffs/buffSteampunkProbe.cs +++ b/Buffs/buffSteampunkProbe.cs @@ -5,36 +5,36 @@ namespace Tremor.Buffs { - public class buffSteampunkProbe : ModBuff - { - int Probe = -1; + public class buffSteampunkProbe : ModBuff + { + int Probe = -1; - public override void SetDefaults() - { - Main.buffNoTimeDisplay[Type] = true; - DisplayName.SetDefault("SteampunkProbe"); - Description.SetDefault("This probe protects you."); - } + public override void SetDefaults() + { + Main.buffNoTimeDisplay[Type] = true; + DisplayName.SetDefault("SteampunkProbe"); + Description.SetDefault("This probe protects you."); + } - public override void Update(Player player, ref int buffIndex) - { - if (player.buffTime[buffIndex] >= 2) - { - if (Probe == -1) - Probe = Projectile.NewProjectile(player.position.X, player.position.Y, 0, 0, mod.ProjectileType("projSteampunkProbe"), 0, 0, player.whoAmI); - if (!Main.projectile[Probe].active || Main.projectile[Probe].type != mod.ProjectileType("projSteampunkProbe")) - { - Probe = Projectile.NewProjectile(player.position.X, player.position.Y, 0, 0, mod.ProjectileType("projSteampunkProbe"), 0, 0, player.whoAmI); - } - Main.projectile[Probe].timeLeft = 6; - } - else - { - if (Probe != -1) - { - Main.projectile[Probe].active = false; - } - } - } - } + public override void Update(Player player, ref int buffIndex) + { + if (player.buffTime[buffIndex] >= 2) + { + if (Probe == -1) + Probe = Projectile.NewProjectile(player.position.X, player.position.Y, 0, 0, mod.ProjectileType("projSteampunkProbe"), 0, 0, player.whoAmI); + if (!Main.projectile[Probe].active || Main.projectile[Probe].type != mod.ProjectileType("projSteampunkProbe")) + { + Probe = Projectile.NewProjectile(player.position.X, player.position.Y, 0, 0, mod.ProjectileType("projSteampunkProbe"), 0, 0, player.whoAmI); + } + Main.projectile[Probe].timeLeft = 6; + } + else + { + if (Probe != -1) + { + Main.projectile[Probe].active = false; + } + } + } + } } \ No newline at end of file diff --git a/Buffs/petGenie.cs b/Buffs/petGenie.cs index 290942bb..93e2d81b 100644 --- a/Buffs/petGenie.cs +++ b/Buffs/petGenie.cs @@ -3,31 +3,31 @@ namespace Tremor.Buffs { - public class petGenie : ModBuff - { - public int MyDzhin = -1; + public class petGenie : ModBuff + { + public int MyDzhin = -1; - public override void SetDefaults() - { - DisplayName.SetDefault("Genie"); - Description.SetDefault("A Genie follows you and shows location of enemies"); - Main.buffNoTimeDisplay[this.Type] = true; - } + public override void SetDefaults() + { + DisplayName.SetDefault("Genie"); + Description.SetDefault("A Genie follows you and shows location of enemies"); + Main.buffNoTimeDisplay[this.Type] = true; + } -public override void Update(Player player, ref int buffIndex) - { - foreach(NPC npc in Main.npc) - { - if (npc.friendly || npc.lifeMax <= 5 || !npc.active || npc.Distance(player.position) > 750) - continue; - Lighting.AddLight(npc.Center, new Microsoft.Xna.Framework.Vector3(0, 0, 1)); - } - if (MyDzhin == -1) - MyDzhin = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0, 0, mod.ProjectileType("projGenie"), 0, 0, 0); - if (!Main.projectile[MyDzhin].active || Main.projectile[MyDzhin].type != mod.ProjectileType("projGenie")) - MyDzhin = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0, 0, mod.ProjectileType("projGenie"), 0, 0, 0); - Main.projectile[MyDzhin].timeLeft = 2; - player.buffTime[buffIndex] = 2; - } - } + public override void Update(Player player, ref int buffIndex) + { + foreach (NPC npc in Main.npc) + { + if (npc.friendly || npc.lifeMax <= 5 || !npc.active || npc.Distance(player.position) > 750) + continue; + Lighting.AddLight(npc.Center, new Microsoft.Xna.Framework.Vector3(0, 0, 1)); + } + if (MyDzhin == -1) + MyDzhin = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0, 0, mod.ProjectileType("projGenie"), 0, 0, 0); + if (!Main.projectile[MyDzhin].active || Main.projectile[MyDzhin].type != mod.ProjectileType("projGenie")) + MyDzhin = Projectile.NewProjectile(player.Center.X, player.Center.Y, 0, 0, mod.ProjectileType("projGenie"), 0, 0, 0); + Main.projectile[MyDzhin].timeLeft = 2; + player.buffTime[buffIndex] = 2; + } + } } \ No newline at end of file diff --git a/CheckMobs.cs b/CheckMobs.cs index 352da55f..6c1e5c47 100644 --- a/CheckMobs.cs +++ b/CheckMobs.cs @@ -6,22 +6,22 @@ namespace Tremor { - public class CheckMobs : ModPlayer - { - public override void PostUpdate() - { - for (int k = 0; k < 200; k++) - { - if (player.GetModPlayer(mod).ZoneRuins) - { - if (Main.npc[k].type == mod.NPCType("Youwarkee") || Main.npc[k].type == mod.NPCType("Varki") || Main.npc[k].type == mod.NPCType("NovaFlier") || Main.npc[k].type == mod.NPCType("Deadling") || Main.npc[k].type == mod.NPCType("NovaAlchemist")) - { - Main.npc[k].life = -1; - Main.npc[k].active = false; - Main.npc[k].checkDead(); - } - } - } - } - } + public class CheckMobs : ModPlayer + { + public override void PostUpdate() + { + for (int k = 0; k < 200; k++) + { + if (player.GetModPlayer(mod).ZoneRuins) + { + if (Main.npc[k].type == mod.NPCType("Youwarkee") || Main.npc[k].type == mod.NPCType("Varki") || Main.npc[k].type == mod.NPCType("NovaFlier") || Main.npc[k].type == mod.NPCType("Deadling") || Main.npc[k].type == mod.NPCType("NovaAlchemist")) + { + Main.npc[k].life = -1; + Main.npc[k].active = false; + Main.npc[k].checkDead(); + } + } + } + } + } } diff --git a/CustomDrop.cs b/CustomDrop.cs index 72305561..3bad9625 100644 --- a/CustomDrop.cs +++ b/CustomDrop.cs @@ -6,20 +6,20 @@ namespace Tremor { - class CustomDrop : GlobalTile - { - public override bool Drop(int i, int j, int type) - { - if (type == TileID.Emerald) - { - if (Main.rand.Next(20) == 1) - { - Item.NewItem(i * 16, j * 16, 48, 32, mod.ItemType("EmeraldStone")); - goto il; - } - } - return true; - il: return false; - } - } + class CustomDrop : GlobalTile + { + public override bool Drop(int i, int j, int type) + { + if (type == TileID.Emerald) + { + if (Main.rand.Next(20) == 1) + { + Item.NewItem(i * 16, j * 16, 48, 32, mod.ItemType("EmeraldStone")); + goto il; + } + } + return true; + il: return false; + } + } } diff --git a/CustomWorldData.cs b/CustomWorldData.cs index 2bd1c3b1..0212a327 100644 --- a/CustomWorldData.cs +++ b/CustomWorldData.cs @@ -5,168 +5,168 @@ namespace Tremor { - public static class CustomWorldData - { - public const char SpaceChar = '~'; + public static class CustomWorldData + { + public const char SpaceChar = '~'; - public static Dictionary Number = new Dictionary(); - public static Dictionary Switch = new Dictionary(); - public static Dictionary String = new Dictionary(); + public static Dictionary Number = new Dictionary(); + public static Dictionary Switch = new Dictionary(); + public static Dictionary String = new Dictionary(); - public static string WorldName { get { return Main.worldPathName.Split(new char[] { '/', '\\' })[Main.worldPathName.Split(new char[] { '/', '\\' }).Length - 1].Remove(Main.worldPathName.Split(new char[] { '/', '\\' })[Main.worldPathName.Split(new char[] { '/', '\\' }).Length - 1].Length - 4); } } - public static string LastLoadedWorld = ""; + public static string WorldName { get { return Main.worldPathName.Split(new char[] { '/', '\\' })[Main.worldPathName.Split(new char[] { '/', '\\' }).Length - 1].Remove(Main.worldPathName.Split(new char[] { '/', '\\' })[Main.worldPathName.Split(new char[] { '/', '\\' }).Length - 1].Length - 4); } } + public static string LastLoadedWorld = ""; - public static void SetNumber(string Key, float Value) - { - if (Number.Count < 1 || LastLoadedWorld != WorldName) - Load(true); - if (Number.ContainsKey(Key)) - Number[Key] = Value; - else - Number.Add(Key, Value); - Save(true); - } + public static void SetNumber(string Key, float Value) + { + if (Number.Count < 1 || LastLoadedWorld != WorldName) + Load(true); + if (Number.ContainsKey(Key)) + Number[Key] = Value; + else + Number.Add(Key, Value); + Save(true); + } - public static void SetSwitch(string Key, bool Value) - { - if (Switch.Count < 1 || LastLoadedWorld != WorldName) - Load(false, true); - if (Switch.ContainsKey(Key)) - Switch[Key] = Value; - else - Switch.Add(Key, Value); - Save(false, true); - } + public static void SetSwitch(string Key, bool Value) + { + if (Switch.Count < 1 || LastLoadedWorld != WorldName) + Load(false, true); + if (Switch.ContainsKey(Key)) + Switch[Key] = Value; + else + Switch.Add(Key, Value); + Save(false, true); + } - public static void SetString(string Key, string Value) - { - if (String.Count < 1 || LastLoadedWorld != WorldName) - Load(false, false, true); - if (String.ContainsKey(Key)) - String[Key] = Value; - else - String.Add(Key, Value); - Save(false, false, true); - } + public static void SetString(string Key, string Value) + { + if (String.Count < 1 || LastLoadedWorld != WorldName) + Load(false, false, true); + if (String.ContainsKey(Key)) + String[Key] = Value; + else + String.Add(Key, Value); + Save(false, false, true); + } - public static float GetNumber(string Key) - { - if (Number.Count < 1 || LastLoadedWorld != WorldName) - Load(true); - if (Number.ContainsKey(Key)) - return Number[Key]; - return 0.0f; - } + public static float GetNumber(string Key) + { + if (Number.Count < 1 || LastLoadedWorld != WorldName) + Load(true); + if (Number.ContainsKey(Key)) + return Number[Key]; + return 0.0f; + } - public static bool GetSwitch(string Key) - { - if (Switch.Count < 1 || LastLoadedWorld != WorldName) - Load(false, true); - if (Switch.ContainsKey(Key)) - return Switch[Key]; - return false; - } + public static bool GetSwitch(string Key) + { + if (Switch.Count < 1 || LastLoadedWorld != WorldName) + Load(false, true); + if (Switch.ContainsKey(Key)) + return Switch[Key]; + return false; + } - public static string GetString(string Key) - { - if (String.Count < 1 || LastLoadedWorld != WorldName) - Load(false, false, true); - if (String.ContainsKey(Key)) - return String[Key]; - return ""; - } + public static string GetString(string Key) + { + if (String.Count < 1 || LastLoadedWorld != WorldName) + Load(false, false, true); + if (String.ContainsKey(Key)) + return String[Key]; + return ""; + } - public static void Save(bool Nu, bool Sw = false, bool St = false) - { - if (Number.Count > 0 && Nu) - { - string FileName = Main.WorldPath + "\\" + WorldName + ".tnu"; - FileStream FS = new FileStream(FileName, FileMode.Create); - StreamWriter SW = new StreamWriter(FS, System.Text.Encoding.Default); - foreach (string Key in Number.Keys) - SW.WriteLine(Key + SpaceChar + Number[Key]); - SW.Close(); - FS.Close(); - } - if (Switch.Count > 0 && Sw) - { - string FileName = Main.WorldPath + "\\" + WorldName + ".tsw"; - FileStream FS = new FileStream(FileName, FileMode.Create); - StreamWriter SW = new StreamWriter(FS, System.Text.Encoding.Default); - foreach (string Key in Switch.Keys) - SW.WriteLine(Key + SpaceChar + Switch[Key]); - SW.Close(); - FS.Close(); - } - if (String.Count > 0 && St) - { - string FileName = Main.WorldPath + "\\" + WorldName + ".tst"; - FileStream FS = new FileStream(FileName, FileMode.Create); - StreamWriter SW = new StreamWriter(FS, System.Text.Encoding.Default); - foreach (string Key in String.Keys) - SW.WriteLine(Key + SpaceChar + String[Key]); - SW.Close(); - FS.Close(); - } - } + public static void Save(bool Nu, bool Sw = false, bool St = false) + { + if (Number.Count > 0 && Nu) + { + string FileName = Main.WorldPath + "\\" + WorldName + ".tnu"; + FileStream FS = new FileStream(FileName, FileMode.Create); + StreamWriter SW = new StreamWriter(FS, System.Text.Encoding.Default); + foreach (string Key in Number.Keys) + SW.WriteLine(Key + SpaceChar + Number[Key]); + SW.Close(); + FS.Close(); + } + if (Switch.Count > 0 && Sw) + { + string FileName = Main.WorldPath + "\\" + WorldName + ".tsw"; + FileStream FS = new FileStream(FileName, FileMode.Create); + StreamWriter SW = new StreamWriter(FS, System.Text.Encoding.Default); + foreach (string Key in Switch.Keys) + SW.WriteLine(Key + SpaceChar + Switch[Key]); + SW.Close(); + FS.Close(); + } + if (String.Count > 0 && St) + { + string FileName = Main.WorldPath + "\\" + WorldName + ".tst"; + FileStream FS = new FileStream(FileName, FileMode.Create); + StreamWriter SW = new StreamWriter(FS, System.Text.Encoding.Default); + foreach (string Key in String.Keys) + SW.WriteLine(Key + SpaceChar + String[Key]); + SW.Close(); + FS.Close(); + } + } - public static void Load(bool Nu, bool Sw = false, bool St = false) - { - LastLoadedWorld = Main.worldPathName; - Number = new Dictionary(); - Switch = new Dictionary(); - String = new Dictionary(); - if (Nu) - { - string FileName = Main.WorldPath + "\\" + WorldName + ".tnu"; - FileStream FS = new FileStream(FileName, FileMode.OpenOrCreate); - StreamReader SR = new StreamReader(FS, System.Text.Encoding.Default); - while (!SR.EndOfStream) - { - try - { - string[] Part = SR.ReadLine().Split(SpaceChar); - Number.Add(Part[0], Convert.ToSingle(Part[1])); - } - catch { } - } - SR.Close(); - FS.Close(); - } - if (Sw) - { - string FileName = Main.WorldPath + "\\" + WorldName + ".tsw"; - FileStream FS = new FileStream(FileName, FileMode.OpenOrCreate); - StreamReader SR = new StreamReader(FS, System.Text.Encoding.Default); - while (!SR.EndOfStream) - { - try - { - string[] Part = SR.ReadLine().Split(SpaceChar); - Switch.Add(Part[0], Convert.ToBoolean(Part[1])); - } - catch { } - } - SR.Close(); - FS.Close(); - } - if (St) - { - string FileName = Main.WorldPath + "\\" + WorldName + ".tst"; - FileStream FS = new FileStream(FileName, FileMode.OpenOrCreate); - StreamReader SR = new StreamReader(FS, System.Text.Encoding.Default); - while (!SR.EndOfStream) - { - try - { - string[] Part = SR.ReadLine().Split(SpaceChar); - String.Add(Part[0], Part[1]); - } - catch { } - } - SR.Close(); - FS.Close(); - } - } - } + public static void Load(bool Nu, bool Sw = false, bool St = false) + { + LastLoadedWorld = Main.worldPathName; + Number = new Dictionary(); + Switch = new Dictionary(); + String = new Dictionary(); + if (Nu) + { + string FileName = Main.WorldPath + "\\" + WorldName + ".tnu"; + FileStream FS = new FileStream(FileName, FileMode.OpenOrCreate); + StreamReader SR = new StreamReader(FS, System.Text.Encoding.Default); + while (!SR.EndOfStream) + { + try + { + string[] Part = SR.ReadLine().Split(SpaceChar); + Number.Add(Part[0], Convert.ToSingle(Part[1])); + } + catch { } + } + SR.Close(); + FS.Close(); + } + if (Sw) + { + string FileName = Main.WorldPath + "\\" + WorldName + ".tsw"; + FileStream FS = new FileStream(FileName, FileMode.OpenOrCreate); + StreamReader SR = new StreamReader(FS, System.Text.Encoding.Default); + while (!SR.EndOfStream) + { + try + { + string[] Part = SR.ReadLine().Split(SpaceChar); + Switch.Add(Part[0], Convert.ToBoolean(Part[1])); + } + catch { } + } + SR.Close(); + FS.Close(); + } + if (St) + { + string FileName = Main.WorldPath + "\\" + WorldName + ".tst"; + FileStream FS = new FileStream(FileName, FileMode.OpenOrCreate); + StreamReader SR = new StreamReader(FS, System.Text.Encoding.Default); + while (!SR.EndOfStream) + { + try + { + string[] Part = SR.ReadLine().Split(SpaceChar); + String.Add(Part[0], Part[1]); + } + catch { } + } + SR.Close(); + FS.Close(); + } + } + } } \ No newline at end of file diff --git a/DungeonGenn/DungeonWorld.cs b/DungeonGenn/DungeonWorld.cs index 68de1605..72c2f921 100644 --- a/DungeonGenn/DungeonWorld.cs +++ b/DungeonGenn/DungeonWorld.cs @@ -14,255 +14,273 @@ namespace Tremor.DungeonGenn { - public class DungeonWorld : ModWorld - { - private const int saveVersion = 0; + public class DungeonWorld : ModWorld + { + private const int saveVersion = 0; - static public bool debuging = false; - static public bool debugingOcean = false; - static public bool showLog = false; + static public bool debuging = false; + static public bool debugingOcean = false; + static public bool showLog = false; - static public Dungeon[] dungeon; - static public int spawnTileX = 0; - static public int spawnTileY = 0; - static public int rockLayerFat = 0; - static public int lavaLayer = 0; - static public int densityDivider; - //public DungeonGen(ModBase modBase) : base(modBase){ } - static public bool[] zoneFleshRuin = new bool[256]; - static public bool[] zoneLavaRuin = new bool[256]; - static bool small, medium, large; - public int tick = 2147483647; - public override void ModifyWorldGenTasks(List tasks, ref float totalWeight) - { - int ShiniesIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Shinies")); - if (ShiniesIndex == -1) - { - // Shinies pass removed by some other mod. - return; - } - tasks.Insert(ShiniesIndex + 1, new PassLegacy("Generating dungeon", delegate (GenerationProgress progress) - { - progress.Message = "Generating ruines..."; - SetVars(); - GenerateLayout(); - GenerateOffset(); - Draw(); - })); - } + static public Dungeon[] dungeon; + static public int spawnTileX = 0; + static public int spawnTileY = 0; + static public int rockLayerFat = 0; + static public int lavaLayer = 0; + static public int densityDivider; + //public DungeonGen(ModBase modBase) : base(modBase){ } + static public bool[] zoneFleshRuin = new bool[256]; + static public bool[] zoneLavaRuin = new bool[256]; + static bool small, medium, large; + public int tick = 2147483647; + public override void ModifyWorldGenTasks(List tasks, ref float totalWeight) + { + int ShiniesIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Shinies")); + if (ShiniesIndex == -1) + { + // Shinies pass removed by some other mod. + return; + } + tasks.Insert(ShiniesIndex + 1, new PassLegacy("Generating dungeon", delegate (GenerationProgress progress) + { + progress.Message = "Generating ruines..."; + SetVars(); + GenerateLayout(); + GenerateOffset(); + Draw(); + })); + } - static public void SetVars() - { - //kiek sugeneruoti dungeon'su - //size Small-4200x1200, Medium-6400x1800, Large-8400x2400 - //rock Small~390, Medium~778 638, Large~900 - //old x*y = small-504, medium-1152, large-2016 - //x*(y-rock) = small~336, medium~640, large~1260 - small = Main.maxTilesY < 1500; - large = Main.maxTilesY > 2300; - medium = !small && !large; - rockLayerFat = (int)Main.maxTilesY - (int)Main.rockLayer; - //if(small) densityDivider = 50; - densityDivider = 35; - //with old 32 = small-15, medium-36, large-63 - //with new 32 = small~10, medium~20, large~39 - } - static public void GenerateLayout() - { - int dungeonNum = (int)(Main.maxTilesX / 100 * (Main.maxTilesY - Main.rockLayer) / 100 / densityDivider); - dungeon = new Dungeon[dungeonNum]; - for (int i = 0; i < dungeon.Length; i++) - { - if (i < dungeonNum * 0.2f) - { - dungeon[i] = new Dungeon(60); - DungeonSetting(i); - dungeon[i].GenerateTraitRich(); //lava layer - } - else if (i < dungeonNum * 0.4f) - { - dungeon[i] = new Dungeon(30); - DungeonSetting(i); - dungeon[i].GenerateTraitRich(); //mid rock layer - } - else - { - dungeon[i] = new Dungeon(10); - DungeonSetting(i); - dungeon[i].GenerateTraitRich(); //top rock layer - } - } - } - static public void DungeonSetting(int index) - { - if (small) - { - dungeon[index].sizeAddX = 100; - dungeon[index].sizeAddY = 20; - } - } - static public void GenerateOffset() - { - int dungeonNum = dungeon.Length; - int noDungeonZone = 0; - int DungeonZone = Main.maxTilesX - noDungeonZone * 2; - //int diff=350;//Main.maxTilesX/dungeon.Length/2; - for (int i = 0; i < dungeon.Length; i++) - { - bool TouchesDungeon = false; - bool repeat; - int loop = 0; - int curZone = DungeonZone / (dungeon.Length) * i + noDungeonZone; - do - { - TouchesDungeon = false; - if (loop++ > 100) - { - dungeon[i].isOk = false; - break; - } - //big - if (i < dungeonNum * 0.2f) - { - dungeon[i].GenerateOffset((int)(Main.maxTilesX * 0.05), (int)(Main.maxTilesX * 0.95), (int)(Main.rockLayer + rockLayerFat * 0.4), (int)Main.rockLayer + rockLayerFat); - } - //medium - else if (i < dungeonNum * 0.6f) - { - dungeon[i].GenerateOffset(0, Main.maxTilesX, (int)(Main.rockLayer + rockLayerFat * 0.1), (int)(Main.rockLayer + rockLayerFat * 0.6)); - } - //small - else - { - dungeon[i].GenerateOffset(0, Main.maxTilesX, (int)Main.worldSurface, (int)(Main.rockLayer + rockLayerFat * 0.1)); - } - for (int j = 0; j < i; j++) - { - if (dungeon[i].TouchesDungeon(dungeon[j])) - { - TouchesDungeon = true; - break; - } - } - bool offsetFits = dungeon[i].OffsetFits(); - //Log.WriteLine("offsetFits", offsetFits); - repeat = TouchesDungeon || !offsetFits; - //repeat = !dungeon[i].OffsetFits(); - } - while (repeat); - } - if (debuging) - { - int goTo = 3; - dungeon[goTo].room[0].SetAsPlayerSpawnRoom(dungeon[goTo].offsetX, dungeon[goTo].offsetY); - dungeon[goTo].isOk = true; - } - } - static public void Draw() - { - for (int i = 0; i < dungeon.Length; i++) dungeon[i].Fill(); - for (int i = 0; i < dungeon.Length; i++) dungeon[i].Carve(); - for (int i = 0; i < dungeon.Length; i++) - { - dungeon[i].FillWithBridges(); - dungeon[i].FillWithFurniture(); - dungeon[i].FillWithChests(); - } - } - } + static public void SetVars() + { + //kiek sugeneruoti dungeon'su + //size Small-4200x1200, Medium-6400x1800, Large-8400x2400 + //rock Small~390, Medium~778 638, Large~900 + //old x*y = small-504, medium-1152, large-2016 + //x*(y-rock) = small~336, medium~640, large~1260 + small = Main.maxTilesY < 1500; + large = Main.maxTilesY > 2300; + medium = !small && !large; + rockLayerFat = (int)Main.maxTilesY - (int)Main.rockLayer; + //if(small) densityDivider = 50; + densityDivider = 35; + //with old 32 = small-15, medium-36, large-63 + //with new 32 = small~10, medium~20, large~39 + } + static public void GenerateLayout() + { + int dungeonNum = (int)(Main.maxTilesX / 100 * (Main.maxTilesY - Main.rockLayer) / 100 / densityDivider); + dungeon = new Dungeon[dungeonNum]; + for (int i = 0; i < dungeon.Length; i++) + { + if (i < dungeonNum * 0.2f) + { + dungeon[i] = new Dungeon(60); + DungeonSetting(i); + dungeon[i].GenerateTraitRich(); //lava layer + } + else if (i < dungeonNum * 0.4f) + { + dungeon[i] = new Dungeon(30); + DungeonSetting(i); + dungeon[i].GenerateTraitRich(); //mid rock layer + } + else + { + dungeon[i] = new Dungeon(10); + DungeonSetting(i); + dungeon[i].GenerateTraitRich(); //top rock layer + } + } + } + static public void DungeonSetting(int index) + { + if (small) + { + dungeon[index].sizeAddX = 100; + dungeon[index].sizeAddY = 20; + } + } + static public void GenerateOffset() + { + int dungeonNum = dungeon.Length; + int noDungeonZone = 0; + int DungeonZone = Main.maxTilesX - noDungeonZone * 2; + //int diff=350;//Main.maxTilesX/dungeon.Length/2; + for (int i = 0; i < dungeon.Length; i++) + { + bool TouchesDungeon = false; + bool repeat; + int loop = 0; + int curZone = DungeonZone / (dungeon.Length) * i + noDungeonZone; + do + { + TouchesDungeon = false; + if (loop++ > 100) + { + dungeon[i].isOk = false; + break; + } + //big + if (i < dungeonNum * 0.2f) + { + dungeon[i].GenerateOffset((int)(Main.maxTilesX * 0.05), (int)(Main.maxTilesX * 0.95), (int)(Main.rockLayer + rockLayerFat * 0.4), (int)Main.rockLayer + rockLayerFat); + } + //medium + else if (i < dungeonNum * 0.6f) + { + dungeon[i].GenerateOffset(0, Main.maxTilesX, (int)(Main.rockLayer + rockLayerFat * 0.1), (int)(Main.rockLayer + rockLayerFat * 0.6)); + } + //small + else + { + dungeon[i].GenerateOffset(0, Main.maxTilesX, (int)Main.worldSurface, (int)(Main.rockLayer + rockLayerFat * 0.1)); + } + for (int j = 0; j < i; j++) + { + if (dungeon[i].TouchesDungeon(dungeon[j])) + { + TouchesDungeon = true; + break; + } + } + bool offsetFits = dungeon[i].OffsetFits(); + //Log.WriteLine("offsetFits", offsetFits); + repeat = TouchesDungeon || !offsetFits; + //repeat = !dungeon[i].OffsetFits(); + } + while (repeat); + } + if (debuging) + { + int goTo = 3; + dungeon[goTo].room[0].SetAsPlayerSpawnRoom(dungeon[goTo].offsetX, dungeon[goTo].offsetY); + dungeon[goTo].isOk = true; + } + } + static public void Draw() + { + for (int i = 0; i < dungeon.Length; i++) dungeon[i].Fill(); + for (int i = 0; i < dungeon.Length; i++) dungeon[i].Carve(); + for (int i = 0; i < dungeon.Length; i++) + { + dungeon[i].FillWithBridges(); + dungeon[i].FillWithFurniture(); + dungeon[i].FillWithChests(); + } + } + } - public class Dungeon - { - public ushort type = 120; public ushort wall = 24; private int roomNum = 5; + public class Dungeon + { + public ushort type = 120; + public ushort wall = 24; + private int roomNum = 5; - public Trait[] trait; - public int changeTraitChance = 35; - public int minTrait = 1; - public int maxTrait = 4; - public int spawnRoomChance = 20; public int itemType = 0; public int chestRoomChance = 1; public int MinChestRoomNum = 2;//2 - public int MaxChestRoomNum = 4;//4 - public int connectChance = 75;//out - public int steepness = 50; - public int destroyedChance = 25; public int maxH = 15; public int minH = 6; public int maxW = 25; public int minW = 10; public int maxDistBeetweenRooms = 15; public int corridorSize = 4; - public int modifyChance = 2; - public int modifyLimit = 2; - //} - //{architecture context - public int lowestId; public int pickedCenter; public bool madeBelow = false; public bool madeOnTop = false; - //} - //{other - public int dungeonSizeX1; - public int dungeonSizeY1; - public int dungeonSizeX2; - public int dungeonSizeY2; - public int sizeAddX = 150; - public int sizeAddY = 100; + public Trait[] trait; + public int changeTraitChance = 35; + public int minTrait = 1; + public int maxTrait = 4; - public int offsetX = Main.spawnTileX - 10; - public int offsetY = Main.spawnTileY - 5; + public int spawnRoomChance = 20; + public int itemType = 0; + public int chestRoomChance = 1; + public int MinChestRoomNum = 2;//2 + public int MaxChestRoomNum = 4;//4 + public int connectChance = 75;//out + public int steepness = 50; + public int destroyedChance = 25; - public Room[] room; - public Room[] corridor; - public Graph graph; - public int CorridorNum = 0; + public int maxH = 15; + public int minH = 6; + public int maxW = 25; + public int minW = 10; + public int maxDistBeetweenRooms = 15; + public int corridorSize = 4; + public int modifyChance = 2; + public int modifyLimit = 2; + //} + //{architecture context + public int lowestId; + public int pickedCenter; + public bool madeBelow = false; + public bool madeOnTop = false; + //} + //{other + public int dungeonSizeX1; + public int dungeonSizeY1; + public int dungeonSizeX2; + public int dungeonSizeY2; + public int sizeAddX = 150; + public int sizeAddY = 100; - public bool isOk = true; + public int offsetX = Main.spawnTileX - 10; + public int offsetY = Main.spawnTileY - 5; - public Dungeon(int newRoomNum) - { - roomNum = newRoomNum; - AfterContructor(); - } - public Dungeon() - { - AfterContructor(); - } - public void AfterContructor() - { - room = new Room[roomNum]; - for (int i = 0; i < room.Length; i++) - { - room[i] = new Room(); - } - graph = new Graph(roomNum); - TileList.PickRandom(this); - GenerateTraits(); - } - public void GenerateTraits() - { - trait = new Trait[WorldGen.genRand.Next(minTrait, maxTrait)]; - for (int i = 0; i < trait.Length; i++) - { - trait[i] = new Trait(); - } - } - //} - //{DUNGEON TYPE METHODS - public void MutateAllTraits() - { - for (int i = 0; i < trait.Length; i++) - { - trait[i].Mutate(); - } - } - public void GenerateTraitRich() - { - int currentTrait = WorldGen.genRand.Next(trait.Length); - for (int i = 0; i < room.Length; i++) { - if (HitChance(changeTraitChance)) currentTrait = WorldGen.genRand.Next(trait.Length); GenerateSproutRoom(i, currentTrait); - //trait[currentTrait].Mutate(); - } - AfterGenerate(); - } + public Room[] room; + public Room[] corridor; + public Graph graph; + public int CorridorNum = 0; - public static bool HitChance(int chance) - { - return (WorldGen.genRand.Next(100) < chance); - } + public bool isOk = true; - public void GenerateOcean() - { - /*maxDistBeetweenRooms/=2; + public Dungeon(int newRoomNum) + { + roomNum = newRoomNum; + AfterContructor(); + } + public Dungeon() + { + AfterContructor(); + } + public void AfterContructor() + { + room = new Room[roomNum]; + for (int i = 0; i < room.Length; i++) + { + room[i] = new Room(); + } + graph = new Graph(roomNum); + TileList.PickRandom(this); + GenerateTraits(); + } + public void GenerateTraits() + { + trait = new Trait[WorldGen.genRand.Next(minTrait, maxTrait)]; + for (int i = 0; i < trait.Length; i++) + { + trait[i] = new Trait(); + } + } + //} + //{DUNGEON TYPE METHODS + public void MutateAllTraits() + { + for (int i = 0; i < trait.Length; i++) + { + trait[i].Mutate(); + } + } + public void GenerateTraitRich() + { + int currentTrait = WorldGen.genRand.Next(trait.Length); + for (int i = 0; i < room.Length; i++) + { + if (HitChance(changeTraitChance)) currentTrait = WorldGen.genRand.Next(trait.Length); + GenerateSproutRoom(i, currentTrait); + //trait[currentTrait].Mutate(); + } + AfterGenerate(); + } + + public static bool HitChance(int chance) + { + return (WorldGen.genRand.Next(100) < chance); + } + + public void GenerateOcean() + { + /*maxDistBeetweenRooms/=2; for(int i=0; i 0) sproutRoom = WorldGen.genRand.Next(i); - direction = WorldGen.genRand.Next(4); - if (direction == 0) - { - room[i].GenerateRightTo(room[sproutRoom], trait[traitId]); - } - else if (direction == 1) - { - room[i].GenerateLeftTo(room[sproutRoom], trait[traitId]); - } - else if (direction == 2) - { - room[i].GenerateUnder(room[sproutRoom], trait[traitId]); - } - else if (direction == 3) - { - room[i].GenerateOnTopOf(room[sproutRoom], trait[traitId]); - } - //tikrinama ar kambariia lieciasi - for (int j = 0; j < i; j++) - { if (room[i].TouchesRoom(room[j])) { TouchesRoom = true; break; } - } - looped++; - } - while (TouchesRoom && looped < 10); - graph.Connect(i, sproutRoom); - } - public void GenerateTraitRichRoom(int i, int traitId) - { - /*room[i,j] = new Room(); bool TouchesRoom=false; int debugI=0; + } + private void AfterGenerate() + { + GenerateCorridors(); + DetermineSize(); + FixRoomPositions(); + } + //} + //{ROOM LAYOUT METHODS + public void GeneratePureRandomRoom(int i, int traitId) + { + bool TouchesRoom; + int direction; + int sproutRoom; + int looped = 0; + do + { + TouchesRoom = false; + sproutRoom = WorldGen.genRand.Next(i); + direction = WorldGen.genRand.Next(4); + if (direction == 0) + { + room[i].GenerateRightTo(room[sproutRoom], trait[traitId]); + } + else if (direction == 1) + { + room[i].GenerateLeftTo(room[sproutRoom], trait[traitId]); + } + else if (direction == 2) + { + room[i].GenerateUnder(room[sproutRoom], trait[traitId]); + } + else if (direction == 3) + { + room[i].GenerateOnTopOf(room[sproutRoom], trait[traitId]); + } + //tikrinama ar kambariia lieciasi + for (int j = 0; j < i; j++) + { + if (room[i].TouchesRoom(room[j])) + { + TouchesRoom = true; + break; + } + } + looped++; + } + while (TouchesRoom && looped < 10); + graph.Connect(i, sproutRoom); + } + public void GenerateSproutRoom(int i, int traitId) + { + bool TouchesRoom; + int direction; + int sproutRoom = i - 1; + if (sproutRoom < 0) sproutRoom = 0; + int looped = 0; + do + { + TouchesRoom = false; + if (looped > 0) sproutRoom = WorldGen.genRand.Next(i); + direction = WorldGen.genRand.Next(4); + if (direction == 0) + { + room[i].GenerateRightTo(room[sproutRoom], trait[traitId]); + } + else if (direction == 1) + { + room[i].GenerateLeftTo(room[sproutRoom], trait[traitId]); + } + else if (direction == 2) + { + room[i].GenerateUnder(room[sproutRoom], trait[traitId]); + } + else if (direction == 3) + { + room[i].GenerateOnTopOf(room[sproutRoom], trait[traitId]); + } + //tikrinama ar kambariia lieciasi + for (int j = 0; j < i; j++) + { + if (room[i].TouchesRoom(room[j])) + { + TouchesRoom = true; + break; + } + } + looped++; + } + while (TouchesRoom && looped < 10); + graph.Connect(i, sproutRoom); + } + public void GenerateTraitRichRoom(int i, int traitId) + { + /*room[i,j] = new Room(); bool TouchesRoom=false; int debugI=0; if(HitChance(trait[traitId].destroyedChance)) room[i,j].isDestroyed = true; if(HitChance(25)) room[i,j].wallState = 0; do { TouchesRoom=false; debugI++; @@ -381,856 +409,894 @@ public void GenerateTraitRichRoom(int i, int traitId) //replaced from findLowestIdInFloor; lowestId=WorldGen.genRand.Next(roomNum); room[i,j].GenerateUnder(room[i-1, lowestId], trait[traitId].minW, trait[traitId].maxW, trait[traitId].minH, trait[traitId].maxH, trait[traitId].maxDistBeetweenRooms); graph[GetRoomFullId(i, j), GetRoomFullId(i-1, lowestId)]=true; pickedCenter=WorldGen.genRand.Next(roomNum); } //iprastas kambariu kurimas else { if(HitChance(steepness)) { if(HitChance(50)) room[i,j].GenerateUnder(room[i, j-1], trait[traitId].minW, trait[traitId].maxW, trait[traitId].minH, trait[traitId].maxH, trait[traitId].maxDistBeetweenRooms); else room[i,j].GenerateOnTopOf(room[i, j-1], trait[traitId].minW, trait[traitId].maxW, trait[traitId].minH, trait[traitId].maxH, trait[traitId].maxDistBeetweenRooms); graph[GetRoomFullId(i, j), GetRoomFullId(i, j-1)]=true; } else { if(j 70 || corridor[CorridorNum - 1].w > 70) - { - corridor[CorridorNum].isFake = true; - corridor[CorridorNum - 1].isFake = true; - } - CorridorNum++; - } - else if (roomX) - { - corridor[CorridorNum] = new Room(); - corridor[CorridorNum].isDestroyed = true; - corridor[CorridorNum].GenerateBetweenX(room[graph.room1], room[graph.room2], corridorSize); - if (corridor[CorridorNum].w > 70) corridor[CorridorNum].isFake = true; - CorridorNum++; - } - else if (roomY) - { - corridor[CorridorNum] = new Room(); - corridor[CorridorNum].isDestroyed = true; - corridor[CorridorNum].isBridged = true; - corridor[CorridorNum].GenerateBetweenY(room[graph.room1], room[graph.room2], corridorSize); - if (corridor[CorridorNum].h > 70) corridor[CorridorNum].isFake = true; - CorridorNum++; - } - } - } - //} - //{OFFSET METHODS - public void DetermineSize() - { - for (int i = 0; i < room.Length; i++) - { if (room[i].x < dungeonSizeX1) dungeonSizeX1 = room[i].x; if (room[i].y < dungeonSizeY1) dungeonSizeY1 = room[i].y; if (room[i].x + room[i].w > dungeonSizeX2) dungeonSizeX2 = room[i].x + room[i].w; if (room[i].y + room[i].h > dungeonSizeY2) dungeonSizeY2 = room[i].y + room[i].h; } - for (int i = 0; i < CorridorNum; i++) - { - if (corridor[i].x < dungeonSizeX1) dungeonSizeX1 = corridor[i].x; - if (corridor[i].y < dungeonSizeY1) dungeonSizeY1 = corridor[i].x; - if (corridor[i].x + corridor[i].w > dungeonSizeX2) dungeonSizeX2 = corridor[i].x + corridor[i].w; - if (corridor[i].y + corridor[i].h > dungeonSizeY2) dungeonSizeY2 = corridor[i].y + corridor[i].h; - } - } - public void FixRoomPositions() - { - for (int i = 0; i < room.Length; i++) - { room[i].x -= dungeonSizeX1; - room[i].y -= dungeonSizeY1; } - for (int i = 0; i < CorridorNum; i++) - { corridor[i].x -= dungeonSizeX1; - corridor[i].y -= dungeonSizeY1; - } - dungeonSizeX2 = dungeonSizeX2 - dungeonSizeX1 + sizeAddX; - dungeonSizeY2 = dungeonSizeY2 - dungeonSizeY1 + sizeAddY; - dungeonSizeX1 = 0 - sizeAddX; - dungeonSizeY1 = 0 - sizeAddY; - } - public void GenerateOffsetBeach() - { - int side;//=WorldGen.genRand.Next(2); - if (WorldGen.dungeonX > Main.maxTilesX / 2) side = 0; - else side = 1; - int oceanLevel = -1; - int oceanEndX = -1; - if (side == 0) - { - //find ocean level - for (int i = 0; i <= Main.rockLayer; i++) - { - if (Main.tile[0, i].liquid == 255) - { - oceanLevel = i; - break; - } - } - //find ocean size - for (int i = 0; i < Main.maxTilesX / 2; i++) - { - if (Main.tile[i, oceanLevel].liquid != 255) - { - oceanEndX = i; - break; - } - } - offsetX = WorldGen.genRand.Next(oceanEndX / 10, oceanEndX - 30); - } - else if (side == 1) - { - //find ocean level - for (int i = 0; i <= Main.rockLayer; i++) - { - if (Main.tile[Main.maxTilesX - 1, i].liquid == 255) - { - oceanLevel = i; - break; - } - } - //find ocean size - for (int i = Main.maxTilesX - 1; i > Main.maxTilesX / 2; i--) - { - if (Main.tile[i, oceanLevel].liquid != 255) - { - oceanEndX = i; - break; - } - } - int oceanSize = Main.maxTilesX - oceanEndX; - offsetX = WorldGen.genRand.Next(oceanEndX + 30, oceanEndX + oceanSize - oceanSize / 10); - } - //find ocean bootom - for (int i = oceanLevel; i < Main.rockLayer; i++) - { - if (Main.tile[offsetX, i].type == 53) - { - offsetY = i - 5; - break; - } - } - if (DungeonWorld.debugingOcean) - { - DungeonWorld.spawnTileX = oceanEndX; - DungeonWorld.spawnTileY = oceanLevel - 2; - } - if (oceanLevel == Main.rockLayer) isOk = false; - } - public void GenerateOffset(int minX, int maxX, int minY, int maxY) - { - offsetX = WorldGen.genRand.Next(minX, maxX); - offsetY = WorldGen.genRand.Next(minY, maxY); - } - public void GenerateOffset(int maxX, int maxY) - { - offsetX = maxX; - offsetY = maxY; - } - public bool OffsetFits() - { - for (int i = offsetX + dungeonSizeX1; i <= offsetX + dungeonSizeX2; i++) - for (int j = offsetY + dungeonSizeY1; j <= offsetY + dungeonSizeY2; j++) - { - //jei nuejo i sona tada offset netinka - if (i < 0 || j < 0 || i >= Main.maxTilesX || j >= Main.maxTilesY) return false; - //jei rastas dungeon tile arba mushroom biome tada offset netinka - if (Main.tile[i, j].type == 41//dungeon brick + //hotizontalus koridorius + corridor[CorridorNum] = new Room(); + corridor[CorridorNum].isDestroyed = true; + corridor[CorridorNum].isBridged = true; + if (room[graph.room1].IsBelowTo(room[graph.room2])) corridor[CorridorNum].GenerateBetweenY(room[graph.room1], corridor[CorridorNum - 1], corridorSize); + else corridor[CorridorNum].GenerateBetweenY(room[graph.room2], corridor[CorridorNum - 1], corridorSize); + if (corridor[CorridorNum].h > 70 || corridor[CorridorNum - 1].w > 70) + { + corridor[CorridorNum].isFake = true; + corridor[CorridorNum - 1].isFake = true; + } + CorridorNum++; + } + else if (roomX) + { + corridor[CorridorNum] = new Room(); + corridor[CorridorNum].isDestroyed = true; + corridor[CorridorNum].GenerateBetweenX(room[graph.room1], room[graph.room2], corridorSize); + if (corridor[CorridorNum].w > 70) corridor[CorridorNum].isFake = true; + CorridorNum++; + } + else if (roomY) + { + corridor[CorridorNum] = new Room(); + corridor[CorridorNum].isDestroyed = true; + corridor[CorridorNum].isBridged = true; + corridor[CorridorNum].GenerateBetweenY(room[graph.room1], room[graph.room2], corridorSize); + if (corridor[CorridorNum].h > 70) corridor[CorridorNum].isFake = true; + CorridorNum++; + } + } + } + //} + //{OFFSET METHODS + public void DetermineSize() + { + for (int i = 0; i < room.Length; i++) + { + if (room[i].x < dungeonSizeX1) dungeonSizeX1 = room[i].x; + if (room[i].y < dungeonSizeY1) dungeonSizeY1 = room[i].y; + if (room[i].x + room[i].w > dungeonSizeX2) dungeonSizeX2 = room[i].x + room[i].w; + if (room[i].y + room[i].h > dungeonSizeY2) dungeonSizeY2 = room[i].y + room[i].h; + } + for (int i = 0; i < CorridorNum; i++) + { + if (corridor[i].x < dungeonSizeX1) dungeonSizeX1 = corridor[i].x; + if (corridor[i].y < dungeonSizeY1) dungeonSizeY1 = corridor[i].x; + if (corridor[i].x + corridor[i].w > dungeonSizeX2) dungeonSizeX2 = corridor[i].x + corridor[i].w; + if (corridor[i].y + corridor[i].h > dungeonSizeY2) dungeonSizeY2 = corridor[i].y + corridor[i].h; + } + } + public void FixRoomPositions() + { + for (int i = 0; i < room.Length; i++) + { + room[i].x -= dungeonSizeX1; + room[i].y -= dungeonSizeY1; + } + for (int i = 0; i < CorridorNum; i++) + { + corridor[i].x -= dungeonSizeX1; + corridor[i].y -= dungeonSizeY1; + } + dungeonSizeX2 = dungeonSizeX2 - dungeonSizeX1 + sizeAddX; + dungeonSizeY2 = dungeonSizeY2 - dungeonSizeY1 + sizeAddY; + dungeonSizeX1 = 0 - sizeAddX; + dungeonSizeY1 = 0 - sizeAddY; + } + public void GenerateOffsetBeach() + { + int side;//=WorldGen.genRand.Next(2); + if (WorldGen.dungeonX > Main.maxTilesX / 2) side = 0; + else side = 1; + int oceanLevel = -1; + int oceanEndX = -1; + if (side == 0) + { + //find ocean level + for (int i = 0; i <= Main.rockLayer; i++) + { + if (Main.tile[0, i].liquid == 255) + { + oceanLevel = i; + break; + } + } + //find ocean size + for (int i = 0; i < Main.maxTilesX / 2; i++) + { + if (Main.tile[i, oceanLevel].liquid != 255) + { + oceanEndX = i; + break; + } + } + offsetX = WorldGen.genRand.Next(oceanEndX / 10, oceanEndX - 30); + } + else if (side == 1) + { + //find ocean level + for (int i = 0; i <= Main.rockLayer; i++) + { + if (Main.tile[Main.maxTilesX - 1, i].liquid == 255) + { + oceanLevel = i; + break; + } + } + //find ocean size + for (int i = Main.maxTilesX - 1; i > Main.maxTilesX / 2; i--) + { + if (Main.tile[i, oceanLevel].liquid != 255) + { + oceanEndX = i; + break; + } + } + int oceanSize = Main.maxTilesX - oceanEndX; + offsetX = WorldGen.genRand.Next(oceanEndX + 30, oceanEndX + oceanSize - oceanSize / 10); + } + //find ocean bootom + for (int i = oceanLevel; i < Main.rockLayer; i++) + { + if (Main.tile[offsetX, i].type == 53) + { + offsetY = i - 5; + break; + } + } + if (DungeonWorld.debugingOcean) + { + DungeonWorld.spawnTileX = oceanEndX; + DungeonWorld.spawnTileY = oceanLevel - 2; + } + if (oceanLevel == Main.rockLayer) isOk = false; + } + public void GenerateOffset(int minX, int maxX, int minY, int maxY) + { + offsetX = WorldGen.genRand.Next(minX, maxX); + offsetY = WorldGen.genRand.Next(minY, maxY); + } + public void GenerateOffset(int maxX, int maxY) + { + offsetX = maxX; + offsetY = maxY; + } + public bool OffsetFits() + { + for (int i = offsetX + dungeonSizeX1; i <= offsetX + dungeonSizeX2; i++) + for (int j = offsetY + dungeonSizeY1; j <= offsetY + dungeonSizeY2; j++) + { + //jei nuejo i sona tada offset netinka + if (i < 0 || j < 0 || i >= Main.maxTilesX || j >= Main.maxTilesY) return false; + //jei rastas dungeon tile arba mushroom biome tada offset netinka + if (Main.tile[i, j].type == 41//dungeon brick || Main.tile[i, j].type == 43//dungeon brick || Main.tile[i, j].type == 44//dungeon brick || Main.tile[i, j].type == 57//underworld || Main.tile[i, j].type == 225//bees? || Main.tile[i, j].type == 229//bees? || Main.tile[i, j].type == 226)//jungle temple? - //|| Main.tile[i,j].wall==15)//jungle - //|| AmountOfTilesFound(59, 200)) - //|| Main.tile[i,j].type==70//mushroom world - //|| Main.tile[i,j].type==71//mushroom world - //|| Main.tile[i,j].type==72)//mushroom world - { - //Log.WriteLine("Main.tile[i,j].type", Main.tile[i,j].type); - return false; - } - } - return true; - } - public bool AmountOfTilesFound(byte tile, int minTileNum) - { - int n = 0; - for (int i = offsetX + dungeonSizeX1; i <= offsetX + dungeonSizeX2; i += 10) - for (int j = offsetY + dungeonSizeY1; j <= offsetY + dungeonSizeY2; j += 10) - { - if (i < 0 || j < 0 || i >= Main.maxTilesX || j >= Main.maxTilesY) continue; - if (Main.tile[i, j].type == tile) - { - if (n++ > minTileNum) return true; - } - } - return false; - } - public bool TouchesDungeon(Dungeon dungeon) - { - if (!dungeon.isOk) return false; - bool xAxis; - bool yAxis; - xAxis = dungeon.offsetX + dungeon.dungeonSizeX1 < offsetX + dungeonSizeX1 && offsetX + dungeonSizeX1 < dungeon.offsetX + dungeon.dungeonSizeX2 - || dungeon.offsetX + dungeon.dungeonSizeX1 < offsetX + dungeonSizeX2 && offsetX + dungeonSizeX2 < dungeon.offsetX + dungeon.dungeonSizeX2; - yAxis = dungeon.offsetY + dungeon.dungeonSizeY1 < offsetY + dungeonSizeY1 && offsetY + dungeonSizeY1 < dungeon.offsetY + dungeon.dungeonSizeY2 - || dungeon.offsetY + dungeon.dungeonSizeY1 < offsetY + dungeonSizeY2 && offsetY + dungeonSizeY2 < dungeon.offsetY + dungeon.dungeonSizeY2; - bool flag = xAxis && yAxis; - return (flag); - } - //} - //{ANALIZE - public void Analize() - { - for (int i = 0; i < room.Length; i++) - { - int prec = room[i].CouldBeDestroyedBy(offsetX, offsetY); - if (prec > 45 && prec < 50) - { - room[i].isDestroyed = true; - /*for(int m=0; m= Main.maxTilesX || j >= Main.maxTilesY) continue; + if (Main.tile[i, j].type == tile) + { + if (n++ > minTileNum) return true; + } + } + return false; + } + public bool TouchesDungeon(Dungeon dungeon) + { + if (!dungeon.isOk) return false; + bool xAxis; + bool yAxis; + xAxis = dungeon.offsetX + dungeon.dungeonSizeX1 < offsetX + dungeonSizeX1 && offsetX + dungeonSizeX1 < dungeon.offsetX + dungeon.dungeonSizeX2 + || dungeon.offsetX + dungeon.dungeonSizeX1 < offsetX + dungeonSizeX2 && offsetX + dungeonSizeX2 < dungeon.offsetX + dungeon.dungeonSizeX2; + yAxis = dungeon.offsetY + dungeon.dungeonSizeY1 < offsetY + dungeonSizeY1 && offsetY + dungeonSizeY1 < dungeon.offsetY + dungeon.dungeonSizeY2 + || dungeon.offsetY + dungeon.dungeonSizeY1 < offsetY + dungeonSizeY2 && offsetY + dungeonSizeY2 < dungeon.offsetY + dungeon.dungeonSizeY2; + bool flag = xAxis && yAxis; + return (flag); + } + //} + //{ANALIZE + public void Analize() + { + for (int i = 0; i < room.Length; i++) + { + int prec = room[i].CouldBeDestroyedBy(offsetX, offsetY); + if (prec > 45 && prec < 50) + { + room[i].isDestroyed = true; + /*for(int m=0; m mutateLimit) return; - if (HitChance(mutateChance)) - { - if (HitChance(50)) steepness += 5; - else steepness -= 5; - mutated++; - } - if (HitChance(mutateChance)) - { - if (HitChance(50)) destroyedChance += 5; - else destroyedChance -= 5; - mutated++; - } - if (HitChance(mutateChance)) - { - if (HitChance(50)) - { - maxH += 5; - } - else - { - maxH -= 5; - if (maxH < minH) maxH = minH; - } - mutated++; - } - if (HitChance(mutateChance)) - { - if (HitChance(50)) - { - maxW += 5; - minW += 5; - } - else - { - maxW -= 5; - if (maxW < minW) maxW = minW; - } - mutated++; - } - if (HitChance(mutateChance)) - { - if (HitChance(50)) maxDistBeetweenRooms += 5; - else maxDistBeetweenRooms -= 5; - mutated++; - } - Fix(); - Main.statusText = ("end Mutate"); - } - public void Fix() - { - Main.statusText = ("called Fix"); - if (maxH > maxHLimit) maxH = maxHLimit; - if (minH < minHLimit) minH = minHLimit; - if (maxW > maxWLimit) maxW = maxWLimit; - if (minW < minWLimit) minW = minWLimit; - if (maxH < minH) maxH = minH; - if (minH > maxH) minH = maxH; - if (maxW < minW) maxW = minW; - if (minW > maxW) minW = maxW; - if (steepness < steepnessLimit[0]) steepness = steepnessLimit[0]; - else if (steepness > steepnessLimit[1]) steepness = steepnessLimit[1]; - if (destroyedChance < destroyedChanceLimit[0]) destroyedChance = destroyedChanceLimit[0]; - else if (destroyedChance > destroyedChanceLimit[1]) destroyedChance = destroyedChanceLimit[1]; - if (maxDistBeetweenRooms < maxDistBeetweenRoomsLimit[0]) maxDistBeetweenRooms = maxDistBeetweenRoomsLimit[0]; - else if (maxDistBeetweenRooms > maxDistBeetweenRoomsLimit[1]) maxDistBeetweenRooms = maxDistBeetweenRoomsLimit[1]; - Main.statusText = ("called Fix"); - } - } + maxDistBeetweenRooms = WorldGen.genRand.Next(5, 30); + Fix(); + Main.statusText = ("end Trait"); + } + public Trait() + { + Main.statusText = ("called Trait"); + steepness = WorldGen.genRand.Next(30, 40); - public class Room - { - //{VARS - public int x = 0;//active part - public int y = 0;//active part - public int w = 0; - public int h = 0; - public int wallState = 1; //0 full wall, 1 destroyed, 2 no wall - public bool isTreasureRoom = false; - public bool isSpawnRoom = false; - public bool isCorridor = false; - public bool isDestroyed = false; - public bool isFake = false; - public bool isBridged = false; - public bool isFlooded = false; - public bool isAroundSand = false; - public bool canConnectBetweenFloors = true; - //} - //{ROOM COMPARING METHODS - //object is in right to room - public bool IsRightTo(Room room) - { - if (room.x + room.w <= x) return true; - return false; - } - public bool IsLeftTo(Room room) - { - if (x + w <= room.x) return true; - return false; - } - public bool IsBelowTo(Room room) - { - if (room.y + room.h <= y) return true; - return false; - } - public bool FundationHigherThen(Room room) - { - if (y + h <= room.y + room.h) return true; - return false; - } - public bool RightWallFurtherThen(Room room) - { - if (x + w >= room.x + room.w) return true; - return false; - } - public bool LeftWallFurtherThen(Room room) - { - if (x <= room.x) return true; - return false; - } - public bool TouchesRoom(Room room) - { - bool xAxis; - bool yAxis; - xAxis = room.x < x && x < room.x + room.w - || room.x < x + w && x + w < room.x + room.w; - yAxis = room.y < y && y < room.y + room.h - || room.y < y + h && y + h < room.y + room.h; - return (xAxis && yAxis); - } - public bool IsNear(Room room, int maxDist = 10) - { - bool nearByX; - bool nearByY; - nearByX = x + w < room.x - maxDist || room.x + room.w < x - maxDist; - nearByY = y + h < room.y - maxDist || room.y + room.h < y - maxDist; - return (nearByX && nearByY); - } - public int CouldBeDestroyedBy(int offsetX, int offsetY, int wallSize = 8) - { - int destroyedTiles = 0; - int tileCount = 0; - for (int i = x + offsetX - wallSize; i < x + w + offsetX + wallSize; i++) - { - if (x + offsetX < i && i < x + offsetX + w) continue; - for (int j = y + offsetY - wallSize; j < y + h + offsetY + wallSize; j++) - { - //prieiti prie kito x ir y jei dabartiniai uz mapo ribu - if (i < 0 || j < 0 || i >= Main.maxTilesX || j >= Main.maxTilesY) continue; - if (y + offsetY < j && j < y + offsetY + h) continue; - if (!Main.tile[i, j].active()) destroyedTiles++; - tileCount++; - } - } - return ((int)((float)destroyedTiles / (float)tileCount * 100)); - } - public bool IsInRoom(int posX, int posY, int offsetX, int offsetY) - { - bool inX = posX >= x + offsetX - 5 && posX <= x + w + offsetX + 5; - bool inY = posY >= y + offsetY - 5 && posY <= y + h + offsetY + 5; - return (inX && inY); - } - //} - //{ROOM GENERATING METHODS - public void GenerateRoom(int minW, int maxW, int minH, int maxH, int X = 0, int Y = 0) - { - x = X; - y = Y; - w = WorldGen.genRand.Next(minW, maxW); - h = WorldGen.genRand.Next(minH, maxH); - } + if (HitChance(70)) destroyedChance = WorldGen.genRand.Next(10, 45); + else destroyedChance = WorldGen.genRand.Next(45, 60); - public void GenerateRightTo(Room room, Trait trait) - { - //generuojamas platformos skirtumas - int maxWalkDif; - if (WorldGen.genRand.Next(0, 2) == 0) maxWalkDif = trait.maxWalkDif2; - else maxWalkDif = trait.maxWalkDif1; - int WalkDif = WorldGen.genRand.Next(maxWalkDif / 2, maxWalkDif); - int i = WorldGen.genRand.Next(3); - if (i == 0) WalkDif *= 1; - else if (i == 1) WalkDif *= -1; - else WalkDif *= 0; + if (HitChance(70)) maxH = WorldGen.genRand.Next(5, 15); + else maxH = WorldGen.genRand.Next(15, 25); + minH = WorldGen.genRand.Next(5, maxH) / 2; - h = WorldGen.genRand.Next(trait.minH, trait.maxH); - y = room.h - h + room.y + WalkDif; - x = room.x + room.w + WorldGen.genRand.Next(trait.maxDistBeetweenRooms); - //if(x-2 < room.x + room.w) x=room.x + room.w; - w = WorldGen.genRand.Next(trait.minW, trait.maxW); - } + if (HitChance(70)) maxW = WorldGen.genRand.Next(10, 20); + else maxW = WorldGen.genRand.Next(20, 30); + minW = WorldGen.genRand.Next(10, maxW) / 2; - public void GenerateLeftTo(Room room, Trait trait) - { - //generuojamas platformos skirtumas - int maxWalkDif; - if (WorldGen.genRand.Next(0, 2) == 0) maxWalkDif = trait.maxWalkDif2; - else maxWalkDif = trait.maxWalkDif1; - int WalkDif = WorldGen.genRand.Next(maxWalkDif / 2, maxWalkDif); - int i = WorldGen.genRand.Next(3); - if (i == 0) WalkDif *= 1; - else if (i == 1) WalkDif *= -1; - else WalkDif *= 0; + maxDistBeetweenRooms = WorldGen.genRand.Next(5, 30); + Fix(); + Main.statusText = ("end Trait"); + } + public Trait(bool exaggerate) + { + Main.statusText = ("called Trait"); + steepness = WorldGen.genRand.Next(25, 75); + if (!exaggerate) destroyedChance = WorldGen.genRand.Next(10, 25); + else destroyedChance = WorldGen.genRand.Next(25, 60); + if (!exaggerate) maxH = WorldGen.genRand.Next(8, 15); + else maxH = WorldGen.genRand.Next(15, 25); + minH = WorldGen.genRand.Next(8, maxH) / 2; + if (!exaggerate) maxW = WorldGen.genRand.Next(10, 25); + else maxW = WorldGen.genRand.Next(25, 30); + minW = WorldGen.genRand.Next(10, maxW) / 2; + maxDistBeetweenRooms = WorldGen.genRand.Next(5, 20); + Fix(); + Main.statusText = ("end Trait"); + } + public void Mutate() + { + Main.statusText = ("called Mutate"); + if (mutated > mutateLimit) return; + if (HitChance(mutateChance)) + { + if (HitChance(50)) steepness += 5; + else steepness -= 5; + mutated++; + } + if (HitChance(mutateChance)) + { + if (HitChance(50)) destroyedChance += 5; + else destroyedChance -= 5; + mutated++; + } + if (HitChance(mutateChance)) + { + if (HitChance(50)) + { + maxH += 5; + } + else + { + maxH -= 5; + if (maxH < minH) maxH = minH; + } + mutated++; + } + if (HitChance(mutateChance)) + { + if (HitChance(50)) + { + maxW += 5; + minW += 5; + } + else + { + maxW -= 5; + if (maxW < minW) maxW = minW; + } + mutated++; + } + if (HitChance(mutateChance)) + { + if (HitChance(50)) maxDistBeetweenRooms += 5; + else maxDistBeetweenRooms -= 5; + mutated++; + } + Fix(); + Main.statusText = ("end Mutate"); + } + public void Fix() + { + Main.statusText = ("called Fix"); + if (maxH > maxHLimit) maxH = maxHLimit; + if (minH < minHLimit) minH = minHLimit; + if (maxW > maxWLimit) maxW = maxWLimit; + if (minW < minWLimit) minW = minWLimit; + if (maxH < minH) maxH = minH; + if (minH > maxH) minH = maxH; + if (maxW < minW) maxW = minW; + if (minW > maxW) minW = maxW; + if (steepness < steepnessLimit[0]) steepness = steepnessLimit[0]; + else if (steepness > steepnessLimit[1]) steepness = steepnessLimit[1]; + if (destroyedChance < destroyedChanceLimit[0]) destroyedChance = destroyedChanceLimit[0]; + else if (destroyedChance > destroyedChanceLimit[1]) destroyedChance = destroyedChanceLimit[1]; + if (maxDistBeetweenRooms < maxDistBeetweenRoomsLimit[0]) maxDistBeetweenRooms = maxDistBeetweenRoomsLimit[0]; + else if (maxDistBeetweenRooms > maxDistBeetweenRoomsLimit[1]) maxDistBeetweenRooms = maxDistBeetweenRoomsLimit[1]; + Main.statusText = ("called Fix"); + } + } - h = WorldGen.genRand.Next(trait.minH, trait.maxH); - y = room.h - h + room.y + WalkDif; - w = WorldGen.genRand.Next(trait.minW, trait.maxW); - x = room.x - WorldGen.genRand.Next(trait.maxDistBeetweenRooms) - w; - //if(room.x-2 < x + w) w+=2; - } + public class Room + { + //{VARS + public int x = 0;//active part + public int y = 0;//active part + public int w = 0; + public int h = 0; + public int wallState = 1; //0 full wall, 1 destroyed, 2 no wall + public bool isTreasureRoom = false; + public bool isSpawnRoom = false; + public bool isCorridor = false; + public bool isDestroyed = false; + public bool isFake = false; + public bool isBridged = false; + public bool isFlooded = false; + public bool isAroundSand = false; + public bool canConnectBetweenFloors = true; + //} + //{ROOM COMPARING METHODS + //object is in right to room + public bool IsRightTo(Room room) + { + if (room.x + room.w <= x) return true; + return false; + } + public bool IsLeftTo(Room room) + { + if (x + w <= room.x) return true; + return false; + } + public bool IsBelowTo(Room room) + { + if (room.y + room.h <= y) return true; + return false; + } + public bool FundationHigherThen(Room room) + { + if (y + h <= room.y + room.h) return true; + return false; + } + public bool RightWallFurtherThen(Room room) + { + if (x + w >= room.x + room.w) return true; + return false; + } + public bool LeftWallFurtherThen(Room room) + { + if (x <= room.x) return true; + return false; + } + public bool TouchesRoom(Room room) + { + bool xAxis; + bool yAxis; + xAxis = room.x < x && x < room.x + room.w + || room.x < x + w && x + w < room.x + room.w; + yAxis = room.y < y && y < room.y + room.h + || room.y < y + h && y + h < room.y + room.h; + return (xAxis && yAxis); + } + public bool IsNear(Room room, int maxDist = 10) + { + bool nearByX; + bool nearByY; + nearByX = x + w < room.x - maxDist || room.x + room.w < x - maxDist; + nearByY = y + h < room.y - maxDist || room.y + room.h < y - maxDist; + return (nearByX && nearByY); + } + public int CouldBeDestroyedBy(int offsetX, int offsetY, int wallSize = 8) + { + int destroyedTiles = 0; + int tileCount = 0; + for (int i = x + offsetX - wallSize; i < x + w + offsetX + wallSize; i++) + { + if (x + offsetX < i && i < x + offsetX + w) continue; + for (int j = y + offsetY - wallSize; j < y + h + offsetY + wallSize; j++) + { + //prieiti prie kito x ir y jei dabartiniai uz mapo ribu + if (i < 0 || j < 0 || i >= Main.maxTilesX || j >= Main.maxTilesY) continue; + if (y + offsetY < j && j < y + offsetY + h) continue; + if (!Main.tile[i, j].active()) destroyedTiles++; + tileCount++; + } + } + return ((int)((float)destroyedTiles / (float)tileCount * 100)); + } + public bool IsInRoom(int posX, int posY, int offsetX, int offsetY) + { + bool inX = posX >= x + offsetX - 5 && posX <= x + w + offsetX + 5; + bool inY = posY >= y + offsetY - 5 && posY <= y + h + offsetY + 5; + return (inX && inY); + } + //} + //{ROOM GENERATING METHODS + public void GenerateRoom(int minW, int maxW, int minH, int maxH, int X = 0, int Y = 0) + { + x = X; + y = Y; + w = WorldGen.genRand.Next(minW, maxW); + h = WorldGen.genRand.Next(minH, maxH); + } - public void GenerateBetweenX(Room room1, Room room2, int newH = 3) - { - // kuris kurioje puseje - if (room1.IsLeftTo(room2))//room1.x= Main.maxTilesX || j >= Main.maxTilesY) continue; - bool active = true; - if (isDestroyed) - active = - Main.tile[i, j].active() - && Main.tile[i, j].type != 5 - && Main.tile[i, j].type != 30 - && Main.tile[i, j].type != 53 - && Main.tile[i, j].type != 52 - && Main.tile[i, j].type != 51 - && Main.tile[i, j].type != 62 - && Main.tile[i, j].type != 72; - if (active) - { - Main.tile[i, j].active(true); - Main.tile[i, j].type = type; - } + public void GenerateBetweenY(Room room1, Room room2, int newW = 3) + { + if (room1.y < room2.y) + { + y = room1.y + room1.h - 1; + h = room2.y - (room1.y + room1.h); + } + else + { + y = room2.y + room2.h - 1; + h = room1.y - (room2.y + room2.h); + } + w = newW; + if (room2.RightWallFurtherThen(room1))//room1.x+room1.w < room2.x+room2.w) + { + x = room1.x + room1.w - w; + //random judinamas x po pagrindiniu pagrindu + if (room1.LeftWallFurtherThen(room2))//room1.x= Main.maxTilesX || j >= Main.maxTilesY) continue; - if (!Main.tile[i, j].active()) - { - WorldGen.PlaceTile(i, j, 53, true, true);//sand - } - } - } + //not tested + public void GenerateOnTopOf(Room room, Trait trait) + { + h = WorldGen.genRand.Next(trait.minH, trait.maxH); + y = room.y - WorldGen.genRand.Next(trait.maxDistBeetweenRooms) - h; + w = WorldGen.genRand.Next(trait.minW, trait.maxW); + x = WorldGen.genRand.Next(room.x - w - trait.maxDistBeetweenRooms, room.x + room.w + trait.maxDistBeetweenRooms); + } - public void CarveRoom(int offsetX, int offsetY) - { - if (isFake) return; - bool placeCandle = HitChance(10); - bool candleIsPlaced = false; - for (int i = x + offsetX; i <= x + w + offsetX; i++) - for (int j = y + offsetY; j <= y + h + offsetY; j++) - { - //prieiti prie kito x ir y jei dabartiniai uz mapo ribu - if (i < 0 || j < 0 || i >= Main.maxTilesX || j >= Main.maxTilesY) continue; - Main.tile[i, j].active(false); - Main.tile[i, j].slope(0); - if (isFlooded) Main.tile[i, j].liquid = 255; - if (j - 5 > y + offsetY && placeCandle && !candleIsPlaced) - { - if (HitChance(2)) - { - WorldGen.PlaceTile(i, j, 19); - WorldGen.PlaceTile(i, j - 1, 49, true, false, -1, 0); - candleIsPlaced = true; - } - } - } - } + public static bool HitChance(int chance) + { + return (WorldGen.genRand.Next(100) < chance); + } - public void FillWithOrbs(byte orb, int offsetX, int offsetY) - { - if (isFake) return; - if (!isSpawnRoom) return; - int X = offsetX + x + (w / 2); - int Y; - if (WorldGen.genRand.Next(5) != 1) Y = offsetY + y + h - 3; - else Y = offsetY + y + 3; - WorldGen.PlaceTile(X, Y, orb, true, true); - } + //} + //{DRAW METHODS + public void SetAsPlayerSpawnRoom(int offsetX, int offsetY) + { + DungeonWorld.spawnTileX = offsetX + x + w / 2; + DungeonWorld.spawnTileY = offsetY + y + h; + //Main.spawnTileX = DungeonGen.spawnTileX; + //Main.spawnTileY = DungeonGen.spawnTileY; + } - public void FillWithBridges(int offsetX, int offsetY) - { - if (isFake) return; - if (!isBridged) return; - int X = offsetX + x; - int newY = offsetY + y; - for (int Y = newY + 2; Y < newY + 10; Y++) - { - try - { - //jei randama patogi vieta pastatomas tiltas ir return - //kiru atveju neradus patogios vietos ciklas pasibaigs ir metodas baigsis - if (X - 1 < 0 || X - 1 >= Main.maxTilesX) return; - if (X + w + 1 < 0 || X + w + 1 >= Main.maxTilesX) return; - if (Main.tile[X - 1, Y].active() || Main.tile[X + w + 1, Y].active()) - { - for (int i = X; i <= X + w; i++) - { - //prieiti prie kito x ir y jei dabartiniai uz mapo ribu - if (i < 0 || Y < 0 || i >= Main.maxTilesX || Y >= Main.maxTilesY) continue; - WorldGen.PlaceTile(i, Y, 19, true, false, -1, 9);//Wood Platform - } - return; - } - } - catch { }; - } - } + public void FillRoom(ushort type, ushort wall, int offsetX, int offsetY, int wallSize = 8) + { + if (isFake) return; + bool lowDensWall = WorldGen.genRand.Next(5) == 1; + for (int i = x - wallSize + offsetX; i <= x + w + wallSize + offsetX; i++) + for (int j = y - wallSize + offsetY; j <= y + h + wallSize + offsetY; j++) + { + //prieiti prie kito x ir y jei dabartiniai uz mapo ribu + if (i < 0 || j < 0 || i >= Main.maxTilesX || j >= Main.maxTilesY) continue; + bool active = true; + if (isDestroyed) + active = + Main.tile[i, j].active() + && Main.tile[i, j].type != 5 + && Main.tile[i, j].type != 30 + && Main.tile[i, j].type != 53 + && Main.tile[i, j].type != 52 + && Main.tile[i, j].type != 51 + && Main.tile[i, j].type != 62 + && Main.tile[i, j].type != 72; + if (active) + { + Main.tile[i, j].active(true); + Main.tile[i, j].type = type; + } - public static int AddChestInCube(int x, int y, int w = 50, int h = 20) - { - for (int i = x; i <= x + w; i++) - { - for (int j = y; j <= y + h; j++) - { - //prieiti prie kito x ir y jei dabartiniai uz mapo ribu - if (i < 0 || j < 0 || i >= Main.maxTilesX || j >= Main.maxTilesY) continue; - try - { - /*if(WorldGen.genRand.Next(100)<10) + //avoid background wall outside box + if (i != x - wallSize - 1 + offsetX && i != i + w + wallSize + 1 + offsetX && j != y - wallSize - 1 + offsetY && j != y + h + wallSize + 1 + offsetY) + { + if (wallState == 0) Main.tile[i, j].wall = wall; + else if (wallState == 1) + { + if (lowDensWall) + { + if (HitChance(20)) Main.tile[i, j].wall = wall; + } + else + { + if (HitChance(50)) Main.tile[i, j].wall = wall; + } + } + } + } + if (isAroundSand) + for (int i = x - wallSize + offsetX - 50; i <= x + w + wallSize + offsetX + 50; i++) + for (int j = y - wallSize + offsetY - 50; j <= y + h + wallSize + offsetY + 50; j++) + { + if (i < 0 || j < 0 || i >= Main.maxTilesX || j >= Main.maxTilesY) continue; + if (!Main.tile[i, j].active()) + { + WorldGen.PlaceTile(i, j, 53, true, true);//sand + } + } + } + + public void CarveRoom(int offsetX, int offsetY) + { + if (isFake) return; + bool placeCandle = HitChance(10); + bool candleIsPlaced = false; + for (int i = x + offsetX; i <= x + w + offsetX; i++) + for (int j = y + offsetY; j <= y + h + offsetY; j++) + { + //prieiti prie kito x ir y jei dabartiniai uz mapo ribu + if (i < 0 || j < 0 || i >= Main.maxTilesX || j >= Main.maxTilesY) continue; + Main.tile[i, j].active(false); + Main.tile[i, j].slope(0); + if (isFlooded) Main.tile[i, j].liquid = 255; + if (j - 5 > y + offsetY && placeCandle && !candleIsPlaced) + { + if (HitChance(2)) + { + WorldGen.PlaceTile(i, j, 19); + WorldGen.PlaceTile(i, j - 1, 49, true, false, -1, 0); + candleIsPlaced = true; + } + } + } + } + + public void FillWithOrbs(byte orb, int offsetX, int offsetY) + { + if (isFake) return; + if (!isSpawnRoom) return; + int X = offsetX + x + (w / 2); + int Y; + if (WorldGen.genRand.Next(5) != 1) Y = offsetY + y + h - 3; + else Y = offsetY + y + 3; + WorldGen.PlaceTile(X, Y, orb, true, true); + } + + public void FillWithBridges(int offsetX, int offsetY) + { + if (isFake) return; + if (!isBridged) return; + int X = offsetX + x; + int newY = offsetY + y; + for (int Y = newY + 2; Y < newY + 10; Y++) + { + try + { + //jei randama patogi vieta pastatomas tiltas ir return + //kiru atveju neradus patogios vietos ciklas pasibaigs ir metodas baigsis + if (X - 1 < 0 || X - 1 >= Main.maxTilesX) return; + if (X + w + 1 < 0 || X + w + 1 >= Main.maxTilesX) return; + if (Main.tile[X - 1, Y].active() || Main.tile[X + w + 1, Y].active()) + { + for (int i = X; i <= X + w; i++) + { + //prieiti prie kito x ir y jei dabartiniai uz mapo ribu + if (i < 0 || Y < 0 || i >= Main.maxTilesX || Y >= Main.maxTilesY) continue; + WorldGen.PlaceTile(i, Y, 19, true, false, -1, 9);//Wood Platform + } + return; + } + } + catch { }; + } + } + + public static int AddChestInCube(int x, int y, int w = 50, int h = 20) + { + for (int i = x; i <= x + w; i++) + { + for (int j = y; j <= y + h; j++) + { + //prieiti prie kito x ir y jei dabartiniai uz mapo ribu + if (i < 0 || j < 0 || i >= Main.maxTilesX || j >= Main.maxTilesY) continue; + try + { + /*if(WorldGen.genRand.Next(100)<10) { if(WorldGen.AddBuriedChest(i, j, 0, false, 4)) return true; } @@ -1242,164 +1308,171 @@ public static int AddChestInCube(int x, int y, int w = 50, int h = 20) { if(WorldGen.AddBuriedChest(i, j, 0, false, 1)) return true; }*/ - if (WorldGen.AddBuriedChest(i, j, 0, false, 1)) - return (Chest.FindChest(i, j)); - } - catch { } - } - } - return -1; - } - public static void AddPotsInCube(int x, int y, int w = 40, int h = 0, int maxQ = 10) - { - for (int i = x; i <= x + w; i++) - { - //if(HitChance(90)) - //{ - for (int j = y; j <= y + h; j++) - { - //prieiti prie kito x ir y jei dabartiniai uz mapo ribu - if (i < 0 || j < 0 || i >= Main.maxTilesX || j >= Main.maxTilesY) continue; - try - { - if (WorldGen.PlacePot(i, j)) - { - i++; - break; - } - } - catch { } - } - //} - } - return; - } - public void FillWithFurniture(int offsetX, int offsetY) - { - if (isFake) return; - //if(isDestroyed) return; - //if(HitChance(65)) return; - bool catacomb = false; - /*bool blacksmith = false; + if (WorldGen.AddBuriedChest(i, j, 0, false, 1)) + return (Chest.FindChest(i, j)); + } + catch { } + } + } + return -1; + } + public static void AddPotsInCube(int x, int y, int w = 40, int h = 0, int maxQ = 10) + { + for (int i = x; i <= x + w; i++) + { + //if(HitChance(90)) + //{ + for (int j = y; j <= y + h; j++) + { + //prieiti prie kito x ir y jei dabartiniai uz mapo ribu + if (i < 0 || j < 0 || i >= Main.maxTilesX || j >= Main.maxTilesY) continue; + try + { + if (WorldGen.PlacePot(i, j)) + { + i++; + break; + } + } + catch { } + } + //} + } + return; + } + public void FillWithFurniture(int offsetX, int offsetY) + { + if (isFake) return; + //if(isDestroyed) return; + //if(HitChance(65)) return; + bool catacomb = false; + /*bool blacksmith = false; bool library = false; bool alchemy = false; bool workshop = false;*/ - int caseNum = WorldGen.genRand.Next(0, 100); - if (caseNum < 10) catacomb = true; - /*else if(caseNum<70) blacksmith = true; + int caseNum = WorldGen.genRand.Next(0, 100); + if (caseNum < 10) catacomb = true; + /*else if(caseNum<70) blacksmith = true; else if(caseNum<80) library = true; else if(caseNum<90) alchemy = true; else if(caseNum<100) workshop = true;*/ - int furnitureNum = 1; - for (int i = 0; i < furnitureNum; i++) - { - int putX = x + w / furnitureNum * i + offsetX; - int putY = y + h + offsetY; - if (catacomb) WorldGen.PlaceTile(putX, putY, 105, true, false, -1, Utils.SelectRandom(WorldGen.genRand, 2, 4, 7, 12, 20, 21, 22, 26, 30, 34, 38)); - else - { - switch (Main.rand.Next(0, 2)) - { - case 0: - if (HitChance(40)) WorldGen.PlaceTile(putX, putY, 14, true, false, -1, 10); break; - case 1: - if (HitChance(40)) WorldGen.PlaceTile(putX, putY, 15, true, false, -1, 7); break; - } - //if (HitChance(40)) WorldGen.PlaceTile(putX + 1, putY - 2, 49, true, false, -1, 0); - switch (Main.rand.Next(0, 2)) - { - case 0: - break; - case 1: - if (HitChance(120)) WorldGen.PlaceTile(putX, putY, (ushort)ModLoader.GetMod("Tremor").TileType("RuinAltar")); break; - } - } - } - } - bool FirstAI = true; - public void FillWithChests(int offsetX, int offsetY) - { - if (isFake) return; - //if(isDestroyed) return; - //if(HitChance(65)) return; - bool catacomb = false; - /*bool blacksmith = false; + int furnitureNum = 1; + for (int i = 0; i < furnitureNum; i++) + { + int putX = x + w / furnitureNum * i + offsetX; + int putY = y + h + offsetY; + if (catacomb) WorldGen.PlaceTile(putX, putY, 105, true, false, -1, Utils.SelectRandom(WorldGen.genRand, 2, 4, 7, 12, 20, 21, 22, 26, 30, 34, 38)); + else + { + switch (Main.rand.Next(0, 2)) + { + case 0: + if (HitChance(40)) WorldGen.PlaceTile(putX, putY, 14, true, false, -1, 10); break; + case 1: + if (HitChance(40)) WorldGen.PlaceTile(putX, putY, 15, true, false, -1, 7); break; + } + //if (HitChance(40)) WorldGen.PlaceTile(putX + 1, putY - 2, 49, true, false, -1, 0); + switch (Main.rand.Next(0, 2)) + { + case 0: + break; + case 1: + if (HitChance(120)) WorldGen.PlaceTile(putX, putY, (ushort)ModLoader.GetMod("Tremor").TileType("RuinAltar")); break; + } + } + } + } + bool FirstAI = true; + public void FillWithChests(int offsetX, int offsetY) + { + if (isFake) return; + //if(isDestroyed) return; + //if(HitChance(65)) return; + bool catacomb = false; + /*bool blacksmith = false; bool library = false; bool alchemy = false; bool workshop = false;*/ - int caseNum = WorldGen.genRand.Next(0, 100); - if (caseNum < 10) catacomb = true; - /*else if(caseNum<70) blacksmith = true; + int caseNum = WorldGen.genRand.Next(0, 100); + if (caseNum < 10) catacomb = true; + /*else if(caseNum<70) blacksmith = true; else if(caseNum<80) library = true; else if(caseNum<90) alchemy = true; else if(caseNum<100) workshop = true;*/ - int furnitureNum = WorldGen.genRand.Next(1, 5); - int putX = x + w / furnitureNum + offsetX; - int putY = y + h + offsetY; - if (FirstAI) - { - FirstAI = false; - if (HitChance(40)) WorldGen.PlaceChest(putX, putY, (ushort)ModLoader.GetMod("Tremor").TileType("RuinChest"), false, 2); - } - } - } + int furnitureNum = WorldGen.genRand.Next(1, 5); + int putX = x + w / furnitureNum + offsetX; + int putY = y + h + offsetY; + if (FirstAI) + { + FirstAI = false; + if (HitChance(40)) WorldGen.PlaceChest(putX, putY, (ushort)ModLoader.GetMod("Tremor").TileType("RuinChest"), false, 2); + } + } + } - public class Graph - { - public int room1; - public int room2; + public class Graph + { + public int room1; + public int room2; - private int I = 0; - private Connection[] connection; + private int I = 0; + private Connection[] connection; - public Graph(int roomNum) - { - connection = new Connection[roomNum * 2]; - for (int i = 0; i < connection.Length; i++) - { - connection[i] = new Connection(); - } - } - public void Connect(int r1, int r2) - { - for (int i = 0; i < connection.Length; i++) - { - if (!connection[i].connected) - { - connection[i].Connect(r1, r2); - break; - } - } - } - public int Count() - { - int n = 0; - for (int i = 0; i < connection.Length; i++) if (connection[i].connected) n++; - return n; - } - public bool Next() - { - for (int i = I; i < connection.Length; i++) - { - I = i + 1; if (connection[i].connected) { room1 = connection[i].room1; room2 = connection[i].room2; return true; } - } - //I = 0; - return false; - } - } + public Graph(int roomNum) + { + connection = new Connection[roomNum * 2]; + for (int i = 0; i < connection.Length; i++) + { + connection[i] = new Connection(); + } + } + public void Connect(int r1, int r2) + { + for (int i = 0; i < connection.Length; i++) + { + if (!connection[i].connected) + { + connection[i].Connect(r1, r2); + break; + } + } + } + public int Count() + { + int n = 0; + for (int i = 0; i < connection.Length; i++) + if (connection[i].connected) n++; + return n; + } + public bool Next() + { + for (int i = I; i < connection.Length; i++) + { + I = i + 1; + if (connection[i].connected) + { + room1 = connection[i].room1; + room2 = connection[i].room2; + return true; + } + } + //I = 0; + return false; + } + } - public class Connection - { - public int room1; - public int room2; - public bool connected = false; - public void Connect(int r1, int r2) - { - room1 = r1; - room2 = r2; - connected = true; - } - /*public static bool operator ==(Connection conn, bool b) + public class Connection + { + public int room1; + public int room2; + public bool connected = false; + public void Connect(int r1, int r2) + { + room1 = r1; + room2 = r2; + connected = true; + } + /*public static bool operator ==(Connection conn, bool b) { if (conn == null) return false; @@ -1410,61 +1483,61 @@ public void Connect(int r1, int r2) { return !(conn == b); }*/ - } + } - public class TileList - { - static public void PickRandom(Dungeon dungeon) - { - dungeon.type = 120; - dungeon.wall = 24; - } - } + public class TileList + { + static public void PickRandom(Dungeon dungeon) + { + dungeon.type = 120; + dungeon.wall = 24; + } + } - public class ItemList - { - static public string[] lowTier = { - "IceKey", - }; - static public string[] highTier = { - "Gold Coin", - }; - } + public class ItemList + { + static public string[] lowTier = { + "IceKey", + }; + static public string[] highTier = { + "Gold Coin", + }; + } - public class ChestManager - { - static public void Begin() - { - for (int i = 0; i < Main.chest.Length; i++) - { - bool isInDungeon = false; - if (Main.chest[i] == null) continue; - if (Main.chest[i].y < (int)(Main.rockLayer)) - { - continue; - } - for (int j = 0; j < DungeonWorld.dungeon.Length; j++) - { - if (DungeonWorld.dungeon[j].IsInDungeon(Main.chest[i].x, Main.chest[i].y)) - { - isInDungeon = true; - break; - } - } - int[] itemsToPlaceInGlassChestsSecondary = new int[] { ModLoader.GetMod("Tremor").ItemType("IceKey"), 73 }; - int itemsToPlaceInGlassChestsSecondaryChoice = 0; - if (isInDungeon) - { - itemsToPlaceInGlassChestsSecondaryChoice = Main.rand.Next(itemsToPlaceInGlassChestsSecondary.Length); - Main.chest[i].item[0].type = itemsToPlaceInGlassChestsSecondary[itemsToPlaceInGlassChestsSecondaryChoice]; - } - } - } + public class ChestManager + { + static public void Begin() + { + for (int i = 0; i < Main.chest.Length; i++) + { + bool isInDungeon = false; + if (Main.chest[i] == null) continue; + if (Main.chest[i].y < (int)(Main.rockLayer)) + { + continue; + } + for (int j = 0; j < DungeonWorld.dungeon.Length; j++) + { + if (DungeonWorld.dungeon[j].IsInDungeon(Main.chest[i].x, Main.chest[i].y)) + { + isInDungeon = true; + break; + } + } + int[] itemsToPlaceInGlassChestsSecondary = new int[] { ModLoader.GetMod("Tremor").ItemType("IceKey"), 73 }; + int itemsToPlaceInGlassChestsSecondaryChoice = 0; + if (isInDungeon) + { + itemsToPlaceInGlassChestsSecondaryChoice = Main.rand.Next(itemsToPlaceInGlassChestsSecondary.Length); + Main.chest[i].item[0].type = itemsToPlaceInGlassChestsSecondary[itemsToPlaceInGlassChestsSecondaryChoice]; + } + } + } - public static bool HitChance(int chance) - { - return (WorldGen.genRand.Next(100) < chance); - } - } + public static bool HitChance(int chance) + { + return (WorldGen.genRand.Next(100) < chance); + } + } } diff --git a/Dusts/SoulofHopeDust.cs b/Dusts/SoulofHopeDust.cs index b5d8e0cd..88a4bf75 100644 --- a/Dusts/SoulofHopeDust.cs +++ b/Dusts/SoulofHopeDust.cs @@ -9,16 +9,16 @@ public class SoulofHopeDust : ModDust public override void OnSpawn(Dust dust) { dust.noGravity = true; - dust.frame = new Rectangle(0, 0, 10, 10); - } + dust.frame = new Rectangle(0, 0, 10, 10); + } public override bool Update(Dust dust) { dust.position += dust.velocity; dust.rotation += dust.velocity.X; dust.scale -= 0.01f; - Lighting.AddLight(dust.position, 1.0f, 0.1f, 0.65f); - if (dust.scale < 0.5f) + Lighting.AddLight(dust.position, 1.0f, 0.1f, 0.65f); + if (dust.scale < 0.5f) { dust.active = false; } diff --git a/Dusts/SoulofTrustDust.cs b/Dusts/SoulofTrustDust.cs index e3a51837..7a1c17e0 100644 --- a/Dusts/SoulofTrustDust.cs +++ b/Dusts/SoulofTrustDust.cs @@ -9,16 +9,16 @@ public class SoulofTrustDust : ModDust public override void OnSpawn(Dust dust) { dust.noGravity = true; - dust.frame = new Rectangle(0, 0, 10, 10); - } + dust.frame = new Rectangle(0, 0, 10, 10); + } public override bool Update(Dust dust) { dust.position += dust.velocity; dust.rotation += dust.velocity.X; dust.scale -= 0.01f; - Lighting.AddLight(dust.position, 0.0f, 1.27f, 0.64f); - if (dust.scale < 0.5f) + Lighting.AddLight(dust.position, 0.0f, 1.27f, 0.64f); + if (dust.scale < 0.5f) { dust.active = false; } diff --git a/Dusts/SoulofTruthDust.cs b/Dusts/SoulofTruthDust.cs index bd400150..b57ed84f 100644 --- a/Dusts/SoulofTruthDust.cs +++ b/Dusts/SoulofTruthDust.cs @@ -9,16 +9,16 @@ public class SoulofTruthDust : ModDust public override void OnSpawn(Dust dust) { dust.noGravity = true; - dust.frame = new Rectangle(0, 0, 10, 10); - } + dust.frame = new Rectangle(0, 0, 10, 10); + } public override bool Update(Dust dust) { dust.position += dust.velocity; dust.rotation += dust.velocity.X; dust.scale -= 0.01f; - Lighting.AddLight(dust.position, 1.0f, 1.0f, 0.0f); - if (dust.scale < 0.5f) + Lighting.AddLight(dust.position, 1.0f, 1.0f, 0.0f); + if (dust.scale < 0.5f) { dust.active = false; } diff --git a/GItem.cs b/GItem.cs index 22d88373..de0c4a0d 100644 --- a/GItem.cs +++ b/GItem.cs @@ -6,27 +6,27 @@ namespace Tremor { - public class GItem : GlobalItem - { - public override void ModifyHitNPC(Item item, Player player, NPC target, ref int damage, ref float knockBack, ref bool crit) - { - // If the item we're using to damage someone/something is an AlchemistItem. - if (item.modItem != null && item.modItem is AlchemistItem) - { - MPlayer mp = player.GetModPlayer(mod); - // We want to multiply the damage we do by our alchemistDamage modifier. - damage = (int)(damage * mp.alchemistDamage); - } - } - public override bool Shoot(Item item, Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - // Same for projectiles. - if (item.modItem != null && item.modItem is AlchemistItem) - { - MPlayer mp = player.GetModPlayer(mod); - damage = (int)(damage * mp.alchemistDamage); - } - return true; - } - } + public class GItem : GlobalItem + { + public override void ModifyHitNPC(Item item, Player player, NPC target, ref int damage, ref float knockBack, ref bool crit) + { + // If the item we're using to damage someone/something is an AlchemistItem. + if (item.modItem != null && item.modItem is AlchemistItem) + { + MPlayer mp = player.GetModPlayer(mod); + // We want to multiply the damage we do by our alchemistDamage modifier. + damage = (int)(damage * mp.alchemistDamage); + } + } + public override bool Shoot(Item item, Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + // Same for projectiles. + if (item.modItem != null && item.modItem is AlchemistItem) + { + MPlayer mp = player.GetModPlayer(mod); + damage = (int)(damage * mp.alchemistDamage); + } + return true; + } + } } diff --git a/GlobalNPC.cs b/GlobalNPC.cs index 04926348..928eef02 100644 --- a/GlobalNPC.cs +++ b/GlobalNPC.cs @@ -5,17 +5,17 @@ namespace Tremor { - public class GlobalNPCRule : GlobalNPC - { - public override void AI(NPC npc) - { - if (npc.type == 36 && Main.npc[(int)npc.ai[1]].type == mod.NPCType("CogLord")) - { - npc.aiStyle = 0; - npc.hide = true; - npc.scale /= 1000000; - npc.life = -1; - } - } - } + public class GlobalNPCRule : GlobalNPC + { + public override void AI(NPC npc) + { + if (npc.type == 36 && Main.npc[(int)npc.ai[1]].type == mod.NPCType("CogLord")) + { + npc.aiStyle = 0; + npc.hide = true; + npc.scale /= 1000000; + npc.life = -1; + } + } + } } \ No newline at end of file diff --git a/Helper.cs b/Helper.cs index 0e029ecc..deebd924 100644 --- a/Helper.cs +++ b/Helper.cs @@ -1,7 +1,7 @@ using Terraria; using Microsoft.Xna.Framework; using System; -using System.Linq; +using System.Linq; using System.Collections.Generic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -9,315 +9,319 @@ namespace Tremor { - public delegate void ExtraAction(); - public static class Helper - { - /// - /// *ИÑпользуетÑÑ Ð´Ð»Ñ Ð¿ÐµÑ€ÐµÐ²Ð¾Ð´Ð° градуÑов в радианы* - /// - /// ГрадуÑов - /// ВозвращÑет радианы - public static float GradtoRad(float Grad) - { - return Grad * (float)Math.PI / 180.0f; - } - + public delegate void ExtraAction(); + public static class Helper + { + /// + /// *ИÑпользуетÑÑ Ð´Ð»Ñ Ð¿ÐµÑ€ÐµÐ²Ð¾Ð´Ð° градуÑов в радианы* + /// + /// ГрадуÑов + /// ВозвращÑет радианы + public static float GradtoRad(float Grad) + { + return Grad * (float)Math.PI / 180.0f; + } + public static Vector2 RandomPositin(Vector2 pos1, Vector2 pos2) - { - Random rnd = new Random(); - return new Vector2(rnd.Next((int)pos1.X, (int)pos2.X) + 1, rnd.Next((int)pos1.Y, (int)pos2.Y) + 1); - } - + { + Random rnd = new Random(); + return new Vector2(rnd.Next((int)pos1.X, (int)pos2.X) + 1, rnd.Next((int)pos1.Y, (int)pos2.Y) + 1); + } + public static int GetNearestAlivePlayer(Terraria.NPC npc) - { - float NearestPlayerDist = 4815162342f; - int NearestPlayer = -1; - foreach (Player player in Main.player) - { - if (player.Distance(npc.Center) < NearestPlayerDist && player.active) - { - NearestPlayerDist = player.Distance(npc.Center); - NearestPlayer = player.whoAmI; - } - } - return NearestPlayer; - } - + { + float NearestPlayerDist = 4815162342f; + int NearestPlayer = -1; + foreach (Player player in Main.player) + { + if (player.Distance(npc.Center) < NearestPlayerDist && player.active) + { + NearestPlayerDist = player.Distance(npc.Center); + NearestPlayer = player.whoAmI; + } + } + return NearestPlayer; + } + public static Vector2 VelocityFPTP(Vector2 pos1, Vector2 pos2, float speed) - { - Vector2 move = pos2 - pos1; - //speed2 = speed * 0.5; - return move * (speed / (float)Math.Sqrt(move.X * move.X + move.Y * move.Y)); - } + { + Vector2 move = pos2 - pos1; + //speed2 = speed * 0.5; + return move * (speed / (float)Math.Sqrt(move.X * move.X + move.Y * move.Y)); + } - /// - /// *ИÑпользуетÑÑ Ð´Ð»Ñ Ð¿ÐµÑ€ÐµÐ²Ð¾Ð´Ð° радиан в градуÑÑ‹* - /// - /// Радианов - /// ВозвращÑет градуÑÑ‹ - public static float RadtoGrad(float Rad) - { - return Rad * 180.0f / (float)Math.PI; - } + /// + /// *ИÑпользуетÑÑ Ð´Ð»Ñ Ð¿ÐµÑ€ÐµÐ²Ð¾Ð´Ð° радиан в градуÑÑ‹* + /// + /// Радианов + /// ВозвращÑет градуÑÑ‹ + public static float RadtoGrad(float Rad) + { + return Rad * 180.0f / (float)Math.PI; + } - /// - /// *ИÑпользуетÑÑ Ð´Ð»Ñ Ð½Ð°Ñ…Ð¾Ð¶Ð´ÐµÐ½Ð¸Ñ ID ближайшего NPC к точке* - /// - /// Точка - /// СчитаютÑÑ Ð»Ð¸ мирные NPC? - /// Ðе возвращÑÑ‚ÑŒ боÑÑов - /// ВозвращÑет ID ближайшего NPC к точке Ñ Ð·Ð°Ð´Ð°Ð½Ñ‹Ð¼Ð¸ параметрами - public static int GetNearestNPC(Vector2 Point, bool Friendly = false, bool NoBoss = false) - { - float NearestNPCDist = -1; - int NearestNPC = -1; - foreach (NPC npc in Main.npc) - { - if (!npc.active) - continue; - if (NoBoss && npc.boss) - continue; - if (!Friendly && (npc.friendly || npc.lifeMax <= 5)) - continue; - if (NearestNPCDist == -1 || npc.Distance(Point) < NearestNPCDist) - { - NearestNPCDist = npc.Distance(Point); - NearestNPC = npc.whoAmI; - } - } - return NearestNPC; - } + /// + /// *ИÑпользуетÑÑ Ð´Ð»Ñ Ð½Ð°Ñ…Ð¾Ð¶Ð´ÐµÐ½Ð¸Ñ ID ближайшего NPC к точке* + /// + /// Точка + /// СчитаютÑÑ Ð»Ð¸ мирные NPC? + /// Ðе возвращÑÑ‚ÑŒ боÑÑов + /// ВозвращÑет ID ближайшего NPC к точке Ñ Ð·Ð°Ð´Ð°Ð½Ñ‹Ð¼Ð¸ параметрами + public static int GetNearestNPC(Vector2 Point, bool Friendly = false, bool NoBoss = false) + { + float NearestNPCDist = -1; + int NearestNPC = -1; + foreach (NPC npc in Main.npc) + { + if (!npc.active) + continue; + if (NoBoss && npc.boss) + continue; + if (!Friendly && (npc.friendly || npc.lifeMax <= 5)) + continue; + if (NearestNPCDist == -1 || npc.Distance(Point) < NearestNPCDist) + { + NearestNPCDist = npc.Distance(Point); + NearestNPC = npc.whoAmI; + } + } + return NearestNPC; + } - /// - /// *ИÑпользуетÑÑ Ð´Ð»Ñ Ð½Ð°Ñ…Ð¾Ð¶Ð´ÐµÐ½Ð¸Ñ ID ближайшего игрока к точке* - /// - /// Точка - /// Ðужны ли только живые игроки - /// ВозвращÑет ID ближайшего игрока к точке Ñ Ð·Ð°Ð´Ð°Ð½Ñ‹Ð¼Ð¸ параметрами - public static int GetNearestPlayer(Vector2 Point, bool Alive = false) - { - float NearestPlayerDist = -1; - int NearestPlayer = -1; - foreach (Player player in Main.player) - { - if (Alive && (!player.active || player.dead)) - continue; - if (NearestPlayerDist == -1 || player.Distance(Point) < NearestPlayerDist) - { - NearestPlayerDist = player.Distance(Point); - NearestPlayer = player.whoAmI; - } - } - return NearestPlayer; - } + /// + /// *ИÑпользуетÑÑ Ð´Ð»Ñ Ð½Ð°Ñ…Ð¾Ð¶Ð´ÐµÐ½Ð¸Ñ ID ближайшего игрока к точке* + /// + /// Точка + /// Ðужны ли только живые игроки + /// ВозвращÑет ID ближайшего игрока к точке Ñ Ð·Ð°Ð´Ð°Ð½Ñ‹Ð¼Ð¸ параметрами + public static int GetNearestPlayer(Vector2 Point, bool Alive = false) + { + float NearestPlayerDist = -1; + int NearestPlayer = -1; + foreach (Player player in Main.player) + { + if (Alive && (!player.active || player.dead)) + continue; + if (NearestPlayerDist == -1 || player.Distance(Point) < NearestPlayerDist) + { + NearestPlayerDist = player.Distance(Point); + NearestPlayer = player.whoAmI; + } + } + return NearestPlayer; + } - /// - /// *ИÑпользуетÑÑ Ð´Ð»Ñ Ð²Ñ‹Ñ‡Ð¸ÑÐ»Ð¸ÐµÐ½Ð¸Ñ Ð¸Ð½ÐµÑ€Ñ†Ð¸Ð¸ от точки до точки Ñ Ð·Ð°Ð´Ð°Ð½Ð¾Ð¹ ÑкороÑтью* - /// - /// Точка Ð - /// Точка Ð’ - /// СкороÑÑ‚ÑŒ - /// ВозвращÑет инерцию - public static Vector2 VelocityToPoint(Vector2 A, Vector2 B, float Speed) - { - Vector2 Move = (B - A); - return Move * (Speed / (float)Math.Sqrt(Move.X * Move.X + Move.Y * Move.Y)); - } + /// + /// *ИÑпользуетÑÑ Ð´Ð»Ñ Ð²Ñ‹Ñ‡Ð¸ÑÐ»Ð¸ÐµÐ½Ð¸Ñ Ð¸Ð½ÐµÑ€Ñ†Ð¸Ð¸ от точки до точки Ñ Ð·Ð°Ð´Ð°Ð½Ð¾Ð¹ ÑкороÑтью* + /// + /// Точка Ð + /// Точка Ð’ + /// СкороÑÑ‚ÑŒ + /// ВозвращÑет инерцию + public static Vector2 VelocityToPoint(Vector2 A, Vector2 B, float Speed) + { + Vector2 Move = (B - A); + return Move * (Speed / (float)Math.Sqrt(Move.X * Move.X + Move.Y * Move.Y)); + } - /// - /// *ВычеÑление Ñлучайной точки в прÑмоугольнике* - /// - /// Точка прÑмоугольника A - /// Точка прÑмоугольника B - /// Случайную точку в прÑмоугольнике из заданых точек - public static Vector2 RandomPointInArea(Vector2 A, Vector2 B) - { - return new Vector2(Main.rand.Next((int)A.X, (int)B.X) + 1, Main.rand.Next((int)A.Y, (int)B.Y) + 1); - } + /// + /// *ВычеÑление Ñлучайной точки в прÑмоугольнике* + /// + /// Точка прÑмоугольника A + /// Точка прÑмоугольника B + /// Случайную точку в прÑмоугольнике из заданых точек + public static Vector2 RandomPointInArea(Vector2 A, Vector2 B) + { + return new Vector2(Main.rand.Next((int)A.X, (int)B.X) + 1, Main.rand.Next((int)A.Y, (int)B.Y) + 1); + } - /// - /// *ВычеÑление Ñлучайной точки в прÑмоугольнике* - /// - /// ПрÑмоугольник - /// Случайную точку в заданом прÑмоугольнике - public static Vector2 RandomPointInArea(Rectangle Area) - { - return new Vector2(Main.rand.Next(Area.X, Area.X + Area.Width), Main.rand.Next(Area.Y, Area.Y + Area.Height)); - } + /// + /// *ВычеÑление Ñлучайной точки в прÑмоугольнике* + /// + /// ПрÑмоугольник + /// Случайную точку в заданом прÑмоугольнике + public static Vector2 RandomPointInArea(Rectangle Area) + { + return new Vector2(Main.rand.Next(Area.X, Area.X + Area.Width), Main.rand.Next(Area.Y, Area.Y + Area.Height)); + } - /// - /// *ИÑпользуетÑÑ Ð´Ð»Ñ Ð¿Ð¾Ð²Ð¾Ñ€Ð¾Ñ‚Ð° объекта между Ð´Ð²ÑƒÐ¼Ñ Ñ‚Ð¾Ñ‡ÐºÐ°Ð¼Ð¸* - /// - /// Точка Ð - /// Точка B - /// Угол поворота между данными точками в раданах - public static float rotateBetween2Points(Vector2 A, Vector2 B) - { - return (float)Math.Atan2(A.Y - B.Y, A.X - B.X); - } + /// + /// *ИÑпользуетÑÑ Ð´Ð»Ñ Ð¿Ð¾Ð²Ð¾Ñ€Ð¾Ñ‚Ð° объекта между Ð´Ð²ÑƒÐ¼Ñ Ñ‚Ð¾Ñ‡ÐºÐ°Ð¼Ð¸* + /// + /// Точка Ð + /// Точка B + /// Угол поворота между данными точками в раданах + public static float rotateBetween2Points(Vector2 A, Vector2 B) + { + return (float)Math.Atan2(A.Y - B.Y, A.X - B.X); + } - /// - /// *ВычиÑÐ»ÐµÐ½Ð¸Ñ Ð¿Ð¾Ð·Ð¸Ñ†Ð¸Ð¸ между Ð´Ð²ÑƒÐ¼Ñ Ñ‚Ð¾Ñ‡ÐºÐ°Ð¼Ð¸* - /// - /// Точка A - /// Точка B - /// Точку между точками A и B - public static Vector2 CenterPoint(Vector2 A, Vector2 B) - { - return new Vector2((A.X + B.X) / 2.0f, (A.Y + B.Y) / 2.0f); - } + /// + /// *ВычиÑÐ»ÐµÐ½Ð¸Ñ Ð¿Ð¾Ð·Ð¸Ñ†Ð¸Ð¸ между Ð´Ð²ÑƒÐ¼Ñ Ñ‚Ð¾Ñ‡ÐºÐ°Ð¼Ð¸* + /// + /// Точка A + /// Точка B + /// Точку между точками A и B + public static Vector2 CenterPoint(Vector2 A, Vector2 B) + { + return new Vector2((A.X + B.X) / 2.0f, (A.Y + B.Y) / 2.0f); + } - /// - /// *ВычиÑление позици точки Ñ Ð¿Ð¾Ð»Ñрным Ñмещением от другой* - /// - /// ÐÐ°Ñ‡Ð°Ð»ÑŒÐ½Ð°Ñ Ñ‚Ð¾Ñ‡ÐºÐ° - /// ДиÑÑ‚Ð°Ð½Ñ†Ð¸Ñ ÑÐ¼ÐµÑ‰ÐµÐ½Ð¸Ñ - /// Угол ÑÐ¼ÐµÑ‰ÐµÐ½Ð¸Ñ Ð² радианах - /// Смещение по X - /// Смещение по Y - /// ВозвращÑет точку Ñмещённую по заданым параметрам - public static Vector2 PolarPos(Vector2 Point, float Distance, float Angle, int XOffset = 0, int YOffset = 0) - { - Vector2 ReturnedValue = new Vector2(); - ReturnedValue.X = (Distance * (float)Math.Sin((double)Helper.RadtoGrad(Angle)) + Point.X) + XOffset; - ReturnedValue.Y = (Distance * (float)Math.Cos((double)Helper.RadtoGrad(Angle)) + Point.Y) + YOffset; - return ReturnedValue; - } + /// + /// *ВычиÑление позици точки Ñ Ð¿Ð¾Ð»Ñрным Ñмещением от другой* + /// + /// ÐÐ°Ñ‡Ð°Ð»ÑŒÐ½Ð°Ñ Ñ‚Ð¾Ñ‡ÐºÐ° + /// ДиÑÑ‚Ð°Ð½Ñ†Ð¸Ñ ÑÐ¼ÐµÑ‰ÐµÐ½Ð¸Ñ + /// Угол ÑÐ¼ÐµÑ‰ÐµÐ½Ð¸Ñ Ð² радианах + /// Смещение по X + /// Смещение по Y + /// ВозвращÑет точку Ñмещённую по заданым параметрам + public static Vector2 PolarPos(Vector2 Point, float Distance, float Angle, int XOffset = 0, int YOffset = 0) + { + Vector2 ReturnedValue = new Vector2(); + ReturnedValue.X = (Distance * (float)Math.Sin((double)Helper.RadtoGrad(Angle)) + Point.X) + XOffset; + ReturnedValue.Y = (Distance * (float)Math.Cos((double)Helper.RadtoGrad(Angle)) + Point.Y) + YOffset; + return ReturnedValue; + } - /// *ВычиÑÐ»ÐµÐ½Ð¸Ñ Ñ‚Ð¾Ð³Ð¾, произойдёт ли Ñобытие Ñ Ð·Ð°Ð´Ð°Ð½Ñ‹Ð¼ шанÑом в Ñтот раз, или нет* - /// Ð¨Ð°Ð½Ñ ÑÐ¾Ð±Ñ‹Ñ‚Ð¸Ñ - /// Произойдёт ли Ñобытие Ñ Ð·Ð°Ð´Ð°Ð½Ñ‹Ð¼ шанÑом, или нет - public static bool Chance(float chance) - { - return (Main.rand.NextFloat() <= chance); - } + /// *ВычиÑÐ»ÐµÐ½Ð¸Ñ Ñ‚Ð¾Ð³Ð¾, произойдёт ли Ñобытие Ñ Ð·Ð°Ð´Ð°Ð½Ñ‹Ð¼ шанÑом в Ñтот раз, или нет* + /// Ð¨Ð°Ð½Ñ ÑÐ¾Ð±Ñ‹Ñ‚Ð¸Ñ + /// Произойдёт ли Ñобытие Ñ Ð·Ð°Ð´Ð°Ð½Ñ‹Ð¼ шанÑом, или нет + public static bool Chance(float chance) + { + return (Main.rand.NextFloat() <= chance); + } - /// - /// *ИÑпользуетÑÑ Ð´Ð»Ñ Ð¿Ð»Ð°Ð²Ð½Ð¾Ð³Ð¾ перехода одного вектора в другой* - /// ДобавлÑет во входÑщий вектор From разницу To и From делённую на Smooth - /// - /// ИÑходный вектор - /// Конечный вектор - /// ПлавноÑÑ‚ÑŒ перехода - /// ВозвращÑет вектор From который был приближен к вектору To Ñ Ð¿Ð»Ð°Ð²Ð½Ð¾Ñтью Smooth - public static Vector2 SmoothFromTo(Vector2 From, Vector2 To, float Smooth = 60f) - { - return From + ((To - From) / Smooth); - } + /// + /// *ИÑпользуетÑÑ Ð´Ð»Ñ Ð¿Ð»Ð°Ð²Ð½Ð¾Ð³Ð¾ перехода одного вектора в другой* + /// ДобавлÑет во входÑщий вектор From разницу To и From делённую на Smooth + /// + /// ИÑходный вектор + /// Конечный вектор + /// ПлавноÑÑ‚ÑŒ перехода + /// ВозвращÑет вектор From который был приближен к вектору To Ñ Ð¿Ð»Ð°Ð²Ð½Ð¾Ñтью Smooth + public static Vector2 SmoothFromTo(Vector2 From, Vector2 To, float Smooth = 60f) + { + return From + ((To - From) / Smooth); + } - public static float DistortFloat(float Float, float Percent) - { - float DistortNumber = Float * Percent; - int Counter = 0; - while (DistortNumber.ToString().Split(',').Length > 1) - { - DistortNumber *= 10; - Counter++; - } - return Float + (((float)(Main.rand.Next(0, (int)DistortNumber + 1)) / (float)(Math.Pow(10, Counter))) * ((Main.rand.Next(2) == 0) ? -1 : 1)); - } + public static float DistortFloat(float Float, float Percent) + { + float DistortNumber = Float * Percent; + int Counter = 0; + while (DistortNumber.ToString().Split(',').Length > 1) + { + DistortNumber *= 10; + Counter++; + } + return Float + (((float)(Main.rand.Next(0, (int)DistortNumber + 1)) / (float)(Math.Pow(10, Counter))) * ((Main.rand.Next(2) == 0) ? -1 : 1)); + } - public static void Explode(int index, int sizeX, int sizeY, ExtraAction visualAction = null) - { - Terraria.Projectile projectile = Main.projectile[index]; - if (!projectile.active) - { - return; - } - projectile.tileCollide = false; - projectile.alpha = 255; - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); - projectile.width = sizeX; - projectile.height = sizeY; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - projectile.Damage(); - Main.projectileIdentity[projectile.owner, projectile.identity] = -1; - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); - projectile.width = (int)((float)sizeX / 5.8f); - projectile.height = (int)((float)sizeY / 5.8f); - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - if (visualAction == null) - { - for (int i = 0; i < 30; i++) - { - int num = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 1.5f); - Main.dust[num].velocity *= 1.4f; - } - for (int j = 0; j < 20; j++) - { - int num2 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 3.5f); - Main.dust[num2].noGravity = true; - Main.dust[num2].velocity *= 7f; - num2 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 1.5f); - Main.dust[num2].velocity *= 3f; - } - for (int k = 0; k < 2; k++) - { - float scaleFactor = 0.4f; - if (k == 1) - { - scaleFactor = 0.8f; - } - int num3 = Gore.NewGore(new Vector2(projectile.position.X, projectile.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); - Main.gore[num3].velocity *= scaleFactor; - Gore gore = Main.gore[num3]; - gore.velocity.X = gore.velocity.X + 1f; - Gore gore2 = Main.gore[num3]; - gore2.velocity.Y = gore2.velocity.Y + 1f; - num3 = Gore.NewGore(new Vector2(projectile.position.X, projectile.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); - Main.gore[num3].velocity *= scaleFactor; - Gore gore3 = Main.gore[num3]; - gore3.velocity.X = gore3.velocity.X - 1f; - Gore gore4 = Main.gore[num3]; - gore4.velocity.Y = gore4.velocity.Y + 1f; - num3 = Gore.NewGore(new Vector2(projectile.position.X, projectile.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); - Main.gore[num3].velocity *= scaleFactor; - Gore gore5 = Main.gore[num3]; - gore5.velocity.X = gore5.velocity.X + 1f; - Gore gore6 = Main.gore[num3]; - gore6.velocity.Y = gore6.velocity.Y - 1f; - num3 = Gore.NewGore(new Vector2(projectile.position.X, projectile.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); - Main.gore[num3].velocity *= scaleFactor; - Gore gore7 = Main.gore[num3]; - gore7.velocity.X = gore7.velocity.X - 1f; - Gore gore8 = Main.gore[num3]; - gore8.velocity.Y = gore8.velocity.Y - 1f; - } - return; - } - visualAction(); - } + public static void Explode(int index, int sizeX, int sizeY, ExtraAction visualAction = null) + { + Terraria.Projectile projectile = Main.projectile[index]; + if (!projectile.active) + { + return; + } + projectile.tileCollide = false; + projectile.alpha = 255; + projectile.position.X = projectile.position.X + (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.width = sizeX; + projectile.height = sizeY; + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.Damage(); + Main.projectileIdentity[projectile.owner, projectile.identity] = -1; + projectile.position.X = projectile.position.X + (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.width = (int)((float)sizeX / 5.8f); + projectile.height = (int)((float)sizeY / 5.8f); + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + if (visualAction == null) + { + for (int i = 0; i < 30; i++) + { + int num = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num].velocity *= 1.4f; + } + for (int j = 0; j < 20; j++) + { + int num2 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 3.5f); + Main.dust[num2].noGravity = true; + Main.dust[num2].velocity *= 7f; + num2 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num2].velocity *= 3f; + } + for (int k = 0; k < 2; k++) + { + float scaleFactor = 0.4f; + if (k == 1) + { + scaleFactor = 0.8f; + } + int num3 = Gore.NewGore(new Vector2(projectile.position.X, projectile.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num3].velocity *= scaleFactor; + Gore gore = Main.gore[num3]; + gore.velocity.X = gore.velocity.X + 1f; + Gore gore2 = Main.gore[num3]; + gore2.velocity.Y = gore2.velocity.Y + 1f; + num3 = Gore.NewGore(new Vector2(projectile.position.X, projectile.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num3].velocity *= scaleFactor; + Gore gore3 = Main.gore[num3]; + gore3.velocity.X = gore3.velocity.X - 1f; + Gore gore4 = Main.gore[num3]; + gore4.velocity.Y = gore4.velocity.Y + 1f; + num3 = Gore.NewGore(new Vector2(projectile.position.X, projectile.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num3].velocity *= scaleFactor; + Gore gore5 = Main.gore[num3]; + gore5.velocity.X = gore5.velocity.X + 1f; + Gore gore6 = Main.gore[num3]; + gore6.velocity.Y = gore6.velocity.Y - 1f; + num3 = Gore.NewGore(new Vector2(projectile.position.X, projectile.position.Y), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num3].velocity *= scaleFactor; + Gore gore7 = Main.gore[num3]; + gore7.velocity.X = gore7.velocity.X - 1f; + Gore gore8 = Main.gore[num3]; + gore8.velocity.Y = gore8.velocity.Y - 1f; + } + return; + } + visualAction(); + } - public static void DrawAroundOrigin(int index, Color lightColor) - { - Terraria.Projectile projectile = Main.projectile[index]; - Texture2D texture2D = Main.projectileTexture[projectile.type]; - Vector2 origin = new Vector2((float)texture2D.Width * 0.5f, (float)(texture2D.Height / Main.projFrames[projectile.type]) * 0.5f); - SpriteEffects effects = (projectile.direction == -1) ? SpriteEffects.FlipHorizontally : SpriteEffects.None; - Main.spriteBatch.Draw(texture2D, projectile.Center - Main.screenPosition, new Rectangle?(Utils.Frame(texture2D, 1, Main.projFrames[projectile.type], 0, projectile.frame)), lightColor, projectile.rotation, origin, projectile.scale, effects, 0f); - } + public static void DrawAroundOrigin(int index, Color lightColor) + { + Terraria.Projectile projectile = Main.projectile[index]; + Texture2D texture2D = Main.projectileTexture[projectile.type]; + Vector2 origin = new Vector2((float)texture2D.Width * 0.5f, (float)(texture2D.Height / Main.projFrames[projectile.type]) * 0.5f); + SpriteEffects effects = (projectile.direction == -1) ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + Main.spriteBatch.Draw(texture2D, projectile.Center - Main.screenPosition, new Rectangle?(Utils.Frame(texture2D, 1, Main.projFrames[projectile.type], 0, projectile.frame)), lightColor, projectile.rotation, origin, projectile.scale, effects, 0f); + } - public static void DropItem(Rectangle Area, params Drop[] Drops) { -List Sh = new List(); -Drops -.ToList() -.ForEach(drop => { -for (int index = 0; index < drop.Chance; index++) -Sh.Add(drop); -}); -Drop DroppedItem = Sh[Main.rand.Next(Sh.Count)]; -Item.NewItem((int)Area.X, (int)Area.Y, Area.Height, Area.Width, DroppedItem.Item, DroppedItem.Count); -} + public static void DropItem(Rectangle Area, params Drop[] Drops) + { + List Sh = new List(); + Drops + .ToList() + .ForEach(drop => + { + for (int index = 0; index < drop.Chance; index++) + Sh.Add(drop); + }); + Drop DroppedItem = Sh[Main.rand.Next(Sh.Count)]; + Item.NewItem((int)Area.X, (int)Area.Y, Area.Height, Area.Width, DroppedItem.Item, DroppedItem.Count); + } -} - public struct Drop { -public int Item; public int Count; public int Chance; -public Drop(int item, int count, int chance) { -Item = item; Count = count; Chance = chance; -} -} + } + public struct Drop + { + public int Item; public int Count; public int Chance; + public Drop(int item, int count, int chance) + { + Item = item; Count = count; Chance = chance; + } + } } \ No newline at end of file diff --git a/Helper2.cs b/Helper2.cs index f9f8f6e8..496e8dca 100644 --- a/Helper2.cs +++ b/Helper2.cs @@ -5,54 +5,54 @@ namespace Tremor { - public static class Helper2 - { - public static int GetNearestPlayer(Terraria.NPC npc) - { - float NearestPlayerDist = 4815162342f; - int NearestPlayer = -1; - foreach (Player player in Main.player) - { - if (player.Distance(npc.Center) < NearestPlayerDist) - { - NearestPlayerDist = player.Distance(npc.Center); - NearestPlayer = player.whoAmI; - } - } - return NearestPlayer; - } + public static class Helper2 + { + public static int GetNearestPlayer(Terraria.NPC npc) + { + float NearestPlayerDist = 4815162342f; + int NearestPlayer = -1; + foreach (Player player in Main.player) + { + if (player.Distance(npc.Center) < NearestPlayerDist) + { + NearestPlayerDist = player.Distance(npc.Center); + NearestPlayer = player.whoAmI; + } + } + return NearestPlayer; + } - public static int GetNearestAlivePlayer(Terraria.NPC npc) - { - float NearestPlayerDist = 4815162342f; - int NearestPlayer = -1; - foreach (Player player in Main.player) - { - if (player.Distance(npc.Center) < NearestPlayerDist && player.active) - { - NearestPlayerDist = player.Distance(npc.Center); - NearestPlayer = player.whoAmI; - } - } - return NearestPlayer; - } + public static int GetNearestAlivePlayer(Terraria.NPC npc) + { + float NearestPlayerDist = 4815162342f; + int NearestPlayer = -1; + foreach (Player player in Main.player) + { + if (player.Distance(npc.Center) < NearestPlayerDist && player.active) + { + NearestPlayerDist = player.Distance(npc.Center); + NearestPlayer = player.whoAmI; + } + } + return NearestPlayer; + } - public static Vector2 VelocityFPTP(Vector2 pos1, Vector2 pos2, float speed) - { - Vector2 move = pos2 - pos1; - return move * (speed / (float)Math.Sqrt(move.X * move.X + move.Y * move.Y)); - } + public static Vector2 VelocityFPTP(Vector2 pos1, Vector2 pos2, float speed) + { + Vector2 move = pos2 - pos1; + return move * (speed / (float)Math.Sqrt(move.X * move.X + move.Y * move.Y)); + } - public static Vector2 RandomPositin(Vector2 pos1, Vector2 pos2) - { - Random rnd = new Random(); - return new Vector2(rnd.Next((int)pos1.X, (int)pos2.X) + 1, rnd.Next((int)pos1.Y, (int)pos2.Y) + 1); - } + public static Vector2 RandomPositin(Vector2 pos1, Vector2 pos2) + { + Random rnd = new Random(); + return new Vector2(rnd.Next((int)pos1.X, (int)pos2.X) + 1, rnd.Next((int)pos1.Y, (int)pos2.Y) + 1); + } - public static float rotateBetween2Points(Vector2 point1, Vector2 point2) - { - float rotation = (float)Math.Atan2(point1.Y - (point2.Y), point1.X - (point2.X)); - return rotation; - } - } + public static float rotateBetween2Points(Vector2 point1, Vector2 point2) + { + float rotation = (float)Math.Atan2(point1.Y - (point2.Y), point1.X - (point2.X)); + return rotation; + } + } } \ No newline at end of file diff --git a/Ice/Dungeon/DungeonBlock.cs b/Ice/Dungeon/DungeonBlock.cs index 7df67ffe..d5e1307e 100644 --- a/Ice/Dungeon/DungeonBlock.cs +++ b/Ice/Dungeon/DungeonBlock.cs @@ -10,12 +10,12 @@ public override void SetDefaults() { Main.tileSolid[Type] = true; Main.tileMergeDirt[Type] = true; - Main.tileMerge[Type][mod.TileType("IceBlock")] = true; - Main.tileMerge[Type][mod.TileType("VeryVeryIce")] = true; - Main.tileMerge[Type][147] = true; + Main.tileMerge[Type][mod.TileType("IceBlock")] = true; + Main.tileMerge[Type][mod.TileType("VeryVeryIce")] = true; + Main.tileMerge[Type][147] = true; dustType = mod.DustType("IceDust"); drop = mod.ItemType("DungeonBlockItem"); - AddMapEntry(new Color(70, 156, 213)); + AddMapEntry(new Color(70, 156, 213)); } public override void NumDust(int i, int j, bool fail, ref int num) diff --git a/Ice/Dungeon/DungeonBlockItem.cs b/Ice/Dungeon/DungeonBlockItem.cs index 66b17e7a..735bb919 100644 --- a/Ice/Dungeon/DungeonBlockItem.cs +++ b/Ice/Dungeon/DungeonBlockItem.cs @@ -9,7 +9,7 @@ public class DungeonBlockItem : ModItem public override void SetDefaults() { - item.width = 12; + item.width = 12; item.height = 12; item.maxStack = 999; item.useTurn = true; @@ -19,29 +19,29 @@ public override void SetDefaults() item.useStyle = 1; item.consumable = true; item.createTile = mod.TileType("DungeonBlock"); - ItemID.Sets.ExtractinatorMode[item.type] = item.type; - } + ItemID.Sets.ExtractinatorMode[item.type] = item.type; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Frost Brick"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Frost Brick"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "IceBlockB", 2); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "IceBlockB", 2); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "DungeonWallItem", 4); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } + recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "DungeonWallItem", 4); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } } } diff --git a/Ice/Dungeon/DungeonWallItem.cs b/Ice/Dungeon/DungeonWallItem.cs index 142ada1a..57a7deb6 100644 --- a/Ice/Dungeon/DungeonWallItem.cs +++ b/Ice/Dungeon/DungeonWallItem.cs @@ -18,23 +18,23 @@ public override void SetDefaults() item.useStyle = 1; item.consumable = true; item.createWall = mod.WallType("DungeonWall"); - ItemID.Sets.ExtractinatorMode[item.type] = item.type; - } + ItemID.Sets.ExtractinatorMode[item.type] = item.type; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Frost Brick Wall"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Frost Brick Wall"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "DungeonBlockItem"); - recipe.SetResult(this, 4); - recipe.AddTile(18); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "DungeonBlockItem"); + recipe.SetResult(this, 4); + recipe.AddTile(18); + recipe.AddRecipe(); + } } } diff --git a/Ice/Dungeon/IceChestItem.cs b/Ice/Dungeon/IceChestItem.cs index 49c3f4c3..9540de4a 100644 --- a/Ice/Dungeon/IceChestItem.cs +++ b/Ice/Dungeon/IceChestItem.cs @@ -3,30 +3,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Ice.Dungeon { -public class IceChestItem : ModItem +namespace Tremor.Ice.Dungeon { - public override void SetDefaults() - { + public class IceChestItem : ModItem + { + public override void SetDefaults() + { - item.width = 50; - item.height = 26; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 150; - item.createTile = mod.TileType("IceChest"); - ItemID.Sets.ExtractinatorMode[item.type] = item.type; - } + item.width = 50; + item.height = 26; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 150; + item.createTile = mod.TileType("IceChest"); + ItemID.Sets.ExtractinatorMode[item.type] = item.type; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Frostbite Chest"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Frostbite Chest"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Ice/IceBlock.cs b/Ice/IceBlock.cs index 4044dc2c..ed83600c 100644 --- a/Ice/IceBlock.cs +++ b/Ice/IceBlock.cs @@ -19,29 +19,29 @@ public override void SetDefaults() soundType = 21; soundStyle = 2; AddMapEntry(new Color(84, 166, 229)); - Main.tileMerge[Type][mod.TileType("IceOre")] = true; - Main.tileMerge[Type][mod.TileType("VeryVeryIce")] = true; - Main.tileMerge[Type][mod.TileType("DungeonBlock")] = true; - Main.tileMerge[Type][161] = true; - Main.tileMerge[Type][162] = true; - Main.tileMerge[Type][163] = true; - Main.tileMerge[Type][164] = true; + Main.tileMerge[Type][mod.TileType("IceOre")] = true; + Main.tileMerge[Type][mod.TileType("VeryVeryIce")] = true; + Main.tileMerge[Type][mod.TileType("DungeonBlock")] = true; + Main.tileMerge[Type][161] = true; + Main.tileMerge[Type][162] = true; + Main.tileMerge[Type][163] = true; + Main.tileMerge[Type][164] = true; Main.tileMerge[Type][147] = true; } - public bool CanGrow(int i, int j) - { - bool flag = false; - for (int x = 0; x < 3; x++) - for (int y = 0; y < 3; y++) - { - if (!Main.tile[i - 1 + x, j - 1 + y].active()) - flag = true; - } - return flag; - } + public bool CanGrow(int i, int j) + { + bool flag = false; + for (int x = 0; x < 3; x++) + for (int y = 0; y < 3; y++) + { + if (!Main.tile[i - 1 + x, j - 1 + y].active()) + flag = true; + } + return flag; + } - /*public override void NearbyEffects(int i, int j, bool closer) + /*public override void NearbyEffects(int i, int j, bool closer) { if (closer) { @@ -54,7 +54,7 @@ public bool CanGrow(int i, int j) } } */ - /*public override void RandomUpdate(int i, int j) + /*public override void RandomUpdate(int i, int j) { if (Main.tile[i - 1, j].type > 0 && CanGrow(i - 1, j)) { @@ -73,5 +73,5 @@ public bool CanGrow(int i, int j) Main.tile[i, j + 1].type = (ushort)mod.TileType("IceBlock"); } } */ - } + } } \ No newline at end of file diff --git a/Ice/IceBlockB.cs b/Ice/IceBlockB.cs index 2b41f792..5954a93f 100644 --- a/Ice/IceBlockB.cs +++ b/Ice/IceBlockB.cs @@ -19,13 +19,13 @@ public override void SetDefaults() item.useStyle = 1; item.consumable = true; item.createTile = mod.TileType("VeryVeryIce"); - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Everfrost Block"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Everfrost Block"); + Tooltip.SetDefault(""); + } } } diff --git a/Ice/IceChest.cs b/Ice/IceChest.cs index f4e81829..f079b0bd 100644 --- a/Ice/IceChest.cs +++ b/Ice/IceChest.cs @@ -9,228 +9,228 @@ namespace Tremor.Ice { - public class IceChest : ModTile - { - public override void SetDefaults() - { - Main.tileSpelunker[Type] = true; - Main.tileContainer[Type] = true; - Main.tileShine2[Type] = true; - Main.tileShine[Type] = 1200; - Main.tileFrameImportant[Type] = true; - Main.tileNoAttach[Type] = true; - Main.tileValue[Type] = 500; - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); - TileObjectData.newTile.Origin = new Point16(0, 1); - TileObjectData.newTile.CoordinateHeights = new int[] { 16, 18 }; - TileObjectData.newTile.HookCheck = new PlacementHook(new Func(Chest.FindEmptyChest), -1, 0, true); - TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(new Func(Chest.AfterPlacement_Hook), -1, 0, false); - TileObjectData.newTile.AnchorInvalidTiles = new int[] { 127 }; - TileObjectData.newTile.StyleHorizontal = true; - TileObjectData.newTile.LavaDeath = false; - TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); - TileObjectData.addTile(Type); - AddMapEntry(new Color(70, 156, 213)); - disableSmartCursor = true; - adjTiles = new int[] { TileID.Containers }; - chest = "Ice Chest"; - TileID.Sets.BasicChest[Type] = true; - } + public class IceChest : ModTile + { + public override void SetDefaults() + { + Main.tileSpelunker[Type] = true; + Main.tileContainer[Type] = true; + Main.tileShine2[Type] = true; + Main.tileShine[Type] = 1200; + Main.tileFrameImportant[Type] = true; + Main.tileNoAttach[Type] = true; + Main.tileValue[Type] = 500; + TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); + TileObjectData.newTile.Origin = new Point16(0, 1); + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 18 }; + TileObjectData.newTile.HookCheck = new PlacementHook(new Func(Chest.FindEmptyChest), -1, 0, true); + TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(new Func(Chest.AfterPlacement_Hook), -1, 0, false); + TileObjectData.newTile.AnchorInvalidTiles = new int[] { 127 }; + TileObjectData.newTile.StyleHorizontal = true; + TileObjectData.newTile.LavaDeath = false; + TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.SolidWithTop | AnchorType.SolidSide, TileObjectData.newTile.Width, 0); + TileObjectData.addTile(Type); + AddMapEntry(new Color(70, 156, 213)); + disableSmartCursor = true; + adjTiles = new int[] { TileID.Containers }; + chest = "Ice Chest"; + TileID.Sets.BasicChest[Type] = true; + } - public string MapChestName(string name, int i, int j) - { - int left = i; - int top = j; - Tile tile = Main.tile[i, j]; - if (tile.frameX % 36 != 0) - { - left--; - } - if (tile.frameY != 0) - { - top--; - } - int chest = Chest.FindChest(left, top); - if (Main.chest[chest].name == "") - { - return name; - } - else - { - return name + ": " + Main.chest[chest].name; - } - } - - public override void NumDust(int i, int j, bool fail, ref int num) - { - num = 1; - } - - public override bool CanKillTile(int i, int j, ref bool blockDamaged) - { - Tile tile = Main.tile[i, j]; - int left = i; - int top = j; - if (tile.frameX % 36 != 0) - { - left--; - } - if (tile.frameY != 0) - { - top--; - } - return Chest.CanDestroyChest(left, top); - } + public string MapChestName(string name, int i, int j) + { + int left = i; + int top = j; + Tile tile = Main.tile[i, j]; + if (tile.frameX % 36 != 0) + { + left--; + } + if (tile.frameY != 0) + { + top--; + } + int chest = Chest.FindChest(left, top); + if (Main.chest[chest].name == "") + { + return name; + } + else + { + return name + ": " + Main.chest[chest].name; + } + } - public override void KillMultiTile(int i, int j, int frameX, int frameY) - { - Item.NewItem(i * 16, j * 16, 32, 32, mod.ItemType("")); - Chest.DestroyChest(i, j); - } + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = 1; + } - const int XOffset = 400; - const int YOffset = 400; - public override void RightClick(int i, int j) - { - //Player player = Main.player[Main.myPlayer]; - Player player = Main.LocalPlayer; - if (player.showItemIcon2 == mod.ItemType("IceKey")) - { - for (int num66 = 0; num66 < 58; num66++) - { - if (player.inventory[num66].type == mod.ItemType("IceKey") && player.inventory[num66].stack > 0) - { - player.inventory[num66].stack--; - Chest.Unlock(i, j); - Chest.Unlock(i - 1, j - 1); - Chest.Unlock(i, j - 1); - Chest.Unlock(i - 1, j); - } - } - } - Tile tile = Main.tile[i, j]; - if (tile.frameX != 72 && tile.frameX != 90) - { - Main.mouseRightRelease = false; - int left = i; - int top = j; - if (tile.frameX % 36 != 0) - { - left--; - } - if (tile.frameY != 0) - { - top--; - } -if (player.sign >= 0) + public override bool CanKillTile(int i, int j, ref bool blockDamaged) + { + Tile tile = Main.tile[i, j]; + int left = i; + int top = j; + if (tile.frameX % 36 != 0) { - Main.PlaySound(SoundID.MenuClose); - player.sign = -1; - Main.editSign = false; - Main.npcChatText = ""; + left--; } - if (Main.editChest) + if (tile.frameY != 0) { - Main.PlaySound(SoundID.MenuTick); - Main.editChest = false; - Main.npcChatText = ""; + top--; } - if (player.editedChestName) + return Chest.CanDestroyChest(left, top); + } + + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 32, 32, mod.ItemType("")); + Chest.DestroyChest(i, j); + } + + const int XOffset = 400; + const int YOffset = 400; + public override void RightClick(int i, int j) + { + //Player player = Main.player[Main.myPlayer]; + Player player = Main.LocalPlayer; + if (player.showItemIcon2 == mod.ItemType("IceKey")) { - //NetMessage.SendData(33, -1, -1, NetworkText.FromLiteral(Main.chest[player.chest].name), player.chest, 1f, 0f, 0f, 0, 0, 0); - player.editedChestName = false; + for (int num66 = 0; num66 < 58; num66++) + { + if (player.inventory[num66].type == mod.ItemType("IceKey") && player.inventory[num66].stack > 0) + { + player.inventory[num66].stack--; + Chest.Unlock(i, j); + Chest.Unlock(i - 1, j - 1); + Chest.Unlock(i, j - 1); + Chest.Unlock(i - 1, j); + } + } } - if (Main.netMode == 1) + Tile tile = Main.tile[i, j]; + if (tile.frameX != 72 && tile.frameX != 90) { - if (left == player.chestX && top == player.chestY && player.chest >= 0) + Main.mouseRightRelease = false; + int left = i; + int top = j; + if (tile.frameX % 36 != 0) + { + left--; + } + if (tile.frameY != 0) + { + top--; + } + if (player.sign >= 0) { - player.chest = -1; - Recipe.FindRecipes(); Main.PlaySound(SoundID.MenuClose); + player.sign = -1; + Main.editSign = false; + Main.npcChatText = ""; } - else + if (Main.editChest) { - NetMessage.SendData(31, -1, -1, null, left, (float)top, 0f, 0f, 0, 0, 0); - Main.stackSplit = 600; + Main.PlaySound(SoundID.MenuTick); + Main.editChest = false; + Main.npcChatText = ""; } - } - else - { - int chest = Chest.FindChest(left, top); - if (chest >= 0) + if (player.editedChestName) + { + //NetMessage.SendData(33, -1, -1, NetworkText.FromLiteral(Main.chest[player.chest].name), player.chest, 1f, 0f, 0f, 0, 0, 0); + player.editedChestName = false; + } + if (Main.netMode == 1) { - Main.stackSplit = 600; - if (chest == player.chest) + if (left == player.chestX && top == player.chestY && player.chest >= 0) { player.chest = -1; + Recipe.FindRecipes(); Main.PlaySound(SoundID.MenuClose); } else { - player.chest = chest; - Main.playerInventory = true; - Main.recBigList = false; - player.chestX = left; - player.chestY = top; - Main.PlaySound(player.chest < 0 ? SoundID.MenuOpen : SoundID.MenuTick); + NetMessage.SendData(31, -1, -1, null, left, (float)top, 0f, 0f, 0, 0, 0); + Main.stackSplit = 600; + } + } + else + { + int chest = Chest.FindChest(left, top); + if (chest >= 0) + { + Main.stackSplit = 600; + if (chest == player.chest) + { + player.chest = -1; + Main.PlaySound(SoundID.MenuClose); + } + else + { + player.chest = chest; + Main.playerInventory = true; + Main.recBigList = false; + player.chestX = left; + player.chestY = top; + Main.PlaySound(player.chest < 0 ? SoundID.MenuOpen : SoundID.MenuTick); + } + Recipe.FindRecipes(); } - Recipe.FindRecipes(); } } - } - } + } - public override void MouseOver(int i, int j) - { - //Player player = Main.player[Main.myPlayer]; + public override void MouseOver(int i, int j) + { + //Player player = Main.player[Main.myPlayer]; Player player = Main.LocalPlayer; - Tile tile = Main.tile[i, j]; - int left = i; - int top = j; - if (tile.frameX % 36 != 0) - { - left--; - } - if (tile.frameY != 0) - { - top--; - } - int chest = Chest.FindChest(left, top); - player.showItemIcon2 = -1; - if (chest < 0) - { - player.showItemIconText = Lang.chestType[0].Value; - } - else - { - player.showItemIconText = Main.chest[chest].name.Length > 0 ? Main.chest[chest].name : "Ice Chest"; - if (player.showItemIconText == "Ice Chest") - { - if (tile.frameX == 72 || tile.frameX == 90) - { - player.showItemIcon2 = mod.ItemType("IceKey"); - player.showItemIconText = ""; - } - else - { - player.showItemIcon2 = mod.ItemType("IceChest"); - } - } - } - player.noThrow = 2; - player.showItemIcon = true; - } + Tile tile = Main.tile[i, j]; + int left = i; + int top = j; + if (tile.frameX % 36 != 0) + { + left--; + } + if (tile.frameY != 0) + { + top--; + } + int chest = Chest.FindChest(left, top); + player.showItemIcon2 = -1; + if (chest < 0) + { + player.showItemIconText = Lang.chestType[0].Value; + } + else + { + player.showItemIconText = Main.chest[chest].name.Length > 0 ? Main.chest[chest].name : "Ice Chest"; + if (player.showItemIconText == "Ice Chest") + { + if (tile.frameX == 72 || tile.frameX == 90) + { + player.showItemIcon2 = mod.ItemType("IceKey"); + player.showItemIconText = ""; + } + else + { + player.showItemIcon2 = mod.ItemType("IceChest"); + } + } + } + player.noThrow = 2; + player.showItemIcon = true; + } - public override void MouseOverFar(int i, int j) - { - MouseOver(i, j); - //Player player = Main.player[Main.myPlayer]; + public override void MouseOverFar(int i, int j) + { + MouseOver(i, j); + //Player player = Main.player[Main.myPlayer]; Player player = Main.LocalPlayer; - if (player.showItemIconText == "") - { - player.showItemIcon = false; - player.showItemIcon2 = 0; - } - } - } + if (player.showItemIconText == "") + { + player.showItemIcon = false; + player.showItemIcon2 = 0; + } + } + } } \ No newline at end of file diff --git a/Ice/IceColl1.cs b/Ice/IceColl1.cs index 034863fe..c60778a1 100644 --- a/Ice/IceColl1.cs +++ b/Ice/IceColl1.cs @@ -17,40 +17,40 @@ public override void SetDefaults() Main.tileCut[Type] = true; //Main.tileAlch[Type] = true; Main.tileNoFail[Type] = true; - //Main.tileLavaDeath[Type] = true; - //dustType = -1; - //disableSmartCursor = true; - //AddMapEntry(new Color(13, 88, 130), "Banner"); - //TileObjectData.newTile.Width = 1; - //TileObjectData.newTile.Height = 2; - //TileObjectData.newTile.Origin = Point16.Zero; - //TileObjectData.newTile.UsesCustomCanPlace = true; - //TileObjectData.newTile.CoordinateHeights = new int[] - //{ - // 20 - //}; - //TileObjectData.newTile.CoordinateWidth = 16; - //TileObjectData.newTile.CoordinatePadding = 2; - //TileObjectData.newTile.DrawYOffset = -1; - //TileObjectData.newTile.StyleHorizontal = true; - //TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.AlternateTile, TileObjectData.newTile.Width, 0); - //TileObjectData.newTile.WaterPlacement = LiquidPlacement.NotAllowed; - //TileObjectData.newTile.LavaDeath = true; - //TileObjectData.newTile.LavaPlacement = LiquidPlacement.NotAllowed; - //TileObjectData.addBaseTile(out TileObjectData.StyleAlch); - Main.tileWaterDeath[Type] = false; - dustType = 3; - TileObjectData.newTile.LavaPlacement = LiquidPlacement.NotAllowed; - TileObjectData.newTile.CopyFrom(TileObjectData.StyleAlch); + //Main.tileLavaDeath[Type] = true; + //dustType = -1; + //disableSmartCursor = true; + //AddMapEntry(new Color(13, 88, 130), "Banner"); + //TileObjectData.newTile.Width = 1; + //TileObjectData.newTile.Height = 2; + //TileObjectData.newTile.Origin = Point16.Zero; + //TileObjectData.newTile.UsesCustomCanPlace = true; + //TileObjectData.newTile.CoordinateHeights = new int[] + //{ + // 20 + //}; + //TileObjectData.newTile.CoordinateWidth = 16; + //TileObjectData.newTile.CoordinatePadding = 2; + //TileObjectData.newTile.DrawYOffset = -1; + //TileObjectData.newTile.StyleHorizontal = true; + //TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.AlternateTile, TileObjectData.newTile.Width, 0); + //TileObjectData.newTile.WaterPlacement = LiquidPlacement.NotAllowed; + //TileObjectData.newTile.LavaDeath = true; + //TileObjectData.newTile.LavaPlacement = LiquidPlacement.NotAllowed; + //TileObjectData.addBaseTile(out TileObjectData.StyleAlch); + Main.tileWaterDeath[Type] = false; + dustType = 3; + TileObjectData.newTile.LavaPlacement = LiquidPlacement.NotAllowed; + TileObjectData.newTile.CopyFrom(TileObjectData.StyleAlch); TileObjectData.newTile.AnchorValidTiles = new int[] { mod.TileType("IceBlock") }; - dustType = mod.DustType("IceDust"); - soundType = 21; - soundStyle = 2; - TileObjectData.newTile.WaterDeath = false; - TileObjectData.addTile(Type); + dustType = mod.DustType("IceDust"); + soundType = 21; + soundStyle = 2; + TileObjectData.newTile.WaterDeath = false; + TileObjectData.addTile(Type); //drop = mod.ItemType() } public override void SetSpriteEffects(int i, int j, ref SpriteEffects spriteEffects) diff --git a/Ice/IceColl2.cs b/Ice/IceColl2.cs index 3626f4d9..ac71089e 100644 --- a/Ice/IceColl2.cs +++ b/Ice/IceColl2.cs @@ -14,42 +14,42 @@ public class IceColl2 : ModTile public override void SetDefaults() { Main.tileFrameImportant[Type] = true; - Main.tileCut[Type] = false; - //Main.tileAlch[Type] = true; - Main.tileNoFail[Type] = true; - //Main.tileLavaDeath[Type] = true; - //dustType = -1; - //disableSmartCursor = true; - //AddMapEntry(new Color(13, 88, 130), "Banner"); - //TileObjectData.newTile.Width = 1; - //TileObjectData.newTile.Height = 2; - //TileObjectData.newTile.Origin = Point16.Zero; - //TileObjectData.newTile.UsesCustomCanPlace = true; - //TileObjectData.newTile.CoordinateHeights = new int[] - //{ - // 20 - //}; - //TileObjectData.newTile.CoordinateWidth = 16; - //TileObjectData.newTile.CoordinatePadding = 2; - //TileObjectData.newTile.DrawYOffset = -1; - //TileObjectData.newTile.StyleHorizontal = true; - //TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.AlternateTile, TileObjectData.newTile.Width, 0); - //TileObjectData.newTile.WaterPlacement = LiquidPlacement.NotAllowed; - //TileObjectData.newTile.LavaDeath = true; - //TileObjectData.newTile.LavaPlacement = LiquidPlacement.NotAllowed; - //TileObjectData.addBaseTile(out TileObjectData.StyleAlch); - Main.tileWaterDeath[Type] = false; - TileObjectData.newTile.LavaPlacement = LiquidPlacement.NotAllowed; - TileObjectData.newTile.CopyFrom(TileObjectData.StyleAlch); + Main.tileCut[Type] = false; + //Main.tileAlch[Type] = true; + Main.tileNoFail[Type] = true; + //Main.tileLavaDeath[Type] = true; + //dustType = -1; + //disableSmartCursor = true; + //AddMapEntry(new Color(13, 88, 130), "Banner"); + //TileObjectData.newTile.Width = 1; + //TileObjectData.newTile.Height = 2; + //TileObjectData.newTile.Origin = Point16.Zero; + //TileObjectData.newTile.UsesCustomCanPlace = true; + //TileObjectData.newTile.CoordinateHeights = new int[] + //{ + // 20 + //}; + //TileObjectData.newTile.CoordinateWidth = 16; + //TileObjectData.newTile.CoordinatePadding = 2; + //TileObjectData.newTile.DrawYOffset = -1; + //TileObjectData.newTile.StyleHorizontal = true; + //TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile | AnchorType.AlternateTile, TileObjectData.newTile.Width, 0); + //TileObjectData.newTile.WaterPlacement = LiquidPlacement.NotAllowed; + //TileObjectData.newTile.LavaDeath = true; + //TileObjectData.newTile.LavaPlacement = LiquidPlacement.NotAllowed; + //TileObjectData.addBaseTile(out TileObjectData.StyleAlch); + Main.tileWaterDeath[Type] = false; + TileObjectData.newTile.LavaPlacement = LiquidPlacement.NotAllowed; + TileObjectData.newTile.CopyFrom(TileObjectData.StyleAlch); TileObjectData.newTile.AnchorValidTiles = new int[] { mod.TileType("IceBlock") }; - dustType = mod.DustType("IceDust"); - soundType = 21; - soundStyle = 2; - TileObjectData.newTile.WaterDeath = false; - TileObjectData.addTile(Type); + dustType = mod.DustType("IceDust"); + soundType = 21; + soundStyle = 2; + TileObjectData.newTile.WaterDeath = false; + TileObjectData.addTile(Type); //drop = mod.ItemType() } public override void SetSpriteEffects(int i, int j, ref SpriteEffects spriteEffects) diff --git a/Ice/IceKey.cs b/Ice/IceKey.cs index 9b01bd33..8b277bd9 100644 --- a/Ice/IceKey.cs +++ b/Ice/IceKey.cs @@ -13,14 +13,14 @@ public override void SetDefaults() item.maxStack = 999; item.value = 100000; item.rare = 3; - item.consumable = true; + item.consumable = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ice Key"); - Tooltip.SetDefault("Opens the Frozen Chest once"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ice Key"); + Tooltip.SetDefault("Opens the Frozen Chest once"); + } } } diff --git a/Ice/IceOre.cs b/Ice/IceOre.cs index 961c2bf4..dadd1d47 100644 --- a/Ice/IceOre.cs +++ b/Ice/IceOre.cs @@ -13,18 +13,18 @@ public override void SetDefaults() Main.tileSolid[Type] = true; Main.tileMergeDirt[Type] = true; Main.tileBlockLight[Type] = false; - Main.tileMerge[Type][161] = true; - Main.tileMerge[Type][162] = true; - Main.tileMerge[Type][163] = true; - Main.tileMerge[Type][164] = true; - Main.tileMerge[Type][147] = true; - //Main.tileMinPick[Type] = 200; - minPick = 95; - soundType = 21; - soundStyle = 2; - Main.tileLighted[Type] = true; + Main.tileMerge[Type][161] = true; + Main.tileMerge[Type][162] = true; + Main.tileMerge[Type][163] = true; + Main.tileMerge[Type][164] = true; + Main.tileMerge[Type][147] = true; + //Main.tileMinPick[Type] = 200; + minPick = 95; + soundType = 21; + soundStyle = 2; + Main.tileLighted[Type] = true; drop = mod.ItemType("Icicle"); AddMapEntry(new Color(117, 187, 253)); } - } + } } \ No newline at end of file diff --git a/Ice/IceWall.cs b/Ice/IceWall.cs index 7977f274..72914223 100644 --- a/Ice/IceWall.cs +++ b/Ice/IceWall.cs @@ -4,51 +4,52 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Ice { -public class IceWall : ModWall +namespace Tremor.Ice { - public override void SetDefaults() - { - Main.wallHouse[Type] = false; - dustType = 80; - soundType = 21; - soundStyle = 2; - AddMapEntry(new Color(50, 123, 179)); - } + public class IceWall : ModWall + { + public override void SetDefaults() + { + Main.wallHouse[Type] = false; + dustType = 80; + soundType = 21; + soundStyle = 2; + AddMapEntry(new Color(50, 123, 179)); + } - public override void RandomUpdate(int i, int j) - { - if (Main.tile[i - 1, j].wall > 0 && CanGrow(i - 1, j)) - { - Main.tile[i - 1, j].wall = (ushort)mod.WallType("IceWall"); - } + public override void RandomUpdate(int i, int j) + { + if (Main.tile[i - 1, j].wall > 0 && CanGrow(i - 1, j)) + { + Main.tile[i - 1, j].wall = (ushort)mod.WallType("IceWall"); + } - if (Main.tile[i + 1, j].wall > 0 && CanGrow(i + 1, j)) - { - Main.tile[i + 1, j].wall = (ushort)mod.WallType("IceWall"); - } + if (Main.tile[i + 1, j].wall > 0 && CanGrow(i + 1, j)) + { + Main.tile[i + 1, j].wall = (ushort)mod.WallType("IceWall"); + } - if (Main.tile[i, j - 1].wall > 0 && CanGrow(i, j - 1)) - { - Main.tile[i, j - 1].wall = (ushort)mod.WallType("IceWall"); - } + if (Main.tile[i, j - 1].wall > 0 && CanGrow(i, j - 1)) + { + Main.tile[i, j - 1].wall = (ushort)mod.WallType("IceWall"); + } - if (Main.tile[i, j + 1].wall > 0 && CanGrow(i, j + 1)) - { - Main.tile[i, j + 1].wall = (ushort)mod.WallType("IceWall"); - } - } + if (Main.tile[i, j + 1].wall > 0 && CanGrow(i, j + 1)) + { + Main.tile[i, j + 1].wall = (ushort)mod.WallType("IceWall"); + } + } - public bool CanGrow(int i, int j) - { - bool flag = false; - for (int x = 0; x < 3; x++) - for (int y = 0; y < 3; y++) - { - if (!Main.tile[i - 1 + x, j - 1 + y].active()) - flag = true; - } - return flag; - } - } + public bool CanGrow(int i, int j) + { + bool flag = false; + for (int x = 0; x < 3; x++) + for (int y = 0; y < 3; y++) + { + if (!Main.tile[i - 1 + x, j - 1 + y].active()) + flag = true; + } + return flag; + } + } } \ No newline at end of file diff --git a/Ice/IceWallW.cs b/Ice/IceWallW.cs index aae1330c..96457590 100644 --- a/Ice/IceWallW.cs +++ b/Ice/IceWallW.cs @@ -18,14 +18,14 @@ public override void SetDefaults() item.useStyle = 1; item.consumable = true; item.createWall = mod.WallType("IceWall"); - ItemID.Sets.ExtractinatorMode[item.type] = item.type; - } + ItemID.Sets.ExtractinatorMode[item.type] = item.type; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Everfrost Wall"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Everfrost Wall"); + Tooltip.SetDefault(""); + } } } diff --git a/Ice/Items/BlueQuartz.cs b/Ice/Items/BlueQuartz.cs index e241f8c3..b3ef10fe 100644 --- a/Ice/Items/BlueQuartz.cs +++ b/Ice/Items/BlueQuartz.cs @@ -6,37 +6,39 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Ice.Items { -public class BlueQuartz : ModItem +namespace Tremor.Ice.Items { + public class BlueQuartz : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 38; - item.height = 22; - item.value = 17500; - item.rare = 1; - item.accessory = true; - } + item.width = 38; + item.height = 22; + item.value = 17500; + item.rare = 1; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Blue Quartz"); - Tooltip.SetDefault("Increases maximum health by 50 \n6% increased all damage if in Glacier or Snow biome"); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 4)); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Blue Quartz"); + Tooltip.SetDefault("Increases maximum health by 50 \n6% increased all damage if in Glacier or Snow biome"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 4)); + } - public override void UpdateEquip(Player player) - { - if(player.ZoneSnow) - { - player.statLifeMax2 += 50; - player.meleeDamage += 0.06f; - player.rangedDamage += 0.06f; - player.magicDamage += 0.06f; - player.thrownDamage += 0.06f; - player.GetModPlayer(mod).alchemistDamage += 0.06f; - } - } -}} + public override void UpdateEquip(Player player) + { + if (player.ZoneSnow) + { + player.statLifeMax2 += 50; + player.meleeDamage += 0.06f; + player.rangedDamage += 0.06f; + player.magicDamage += 0.06f; + player.thrownDamage += 0.06f; + player.GetModPlayer(mod).alchemistDamage += 0.06f; + } + } + } +} diff --git a/Ice/Items/FrostByteEye.cs b/Ice/Items/FrostByteEye.cs index cb69a3fe..f58c009d 100644 --- a/Ice/Items/FrostByteEye.cs +++ b/Ice/Items/FrostByteEye.cs @@ -3,33 +3,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Ice.Items { -public class FrostByteEye : ModItem +namespace Tremor.Ice.Items { + public class FrostByteEye : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 24; - item.height = 22; - item.value = 6000; + item.width = 24; + item.height = 22; + item.value = 6000; - item.rare = 1; - item.accessory = true; - item.defense = 1; - } + item.rare = 1; + item.accessory = true; + item.defense = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Frostbyte Eye"); - Tooltip.SetDefault("10% increased move speed and increased jump height"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Frostbyte Eye"); + Tooltip.SetDefault("10% increased move speed and increased jump height"); + } - public override void UpdateAccessory(Player player, bool hideVisual) + public override void UpdateAccessory(Player player, bool hideVisual) - { - player.moveSpeed += 0.1f; - player.jumpBoost = true; - } -}} + { + player.moveSpeed += 0.1f; + player.jumpBoost = true; + } + } +} diff --git a/Ice/Items/FrostGuardian.cs b/Ice/Items/FrostGuardian.cs index 5f5700c6..d78378df 100644 --- a/Ice/Items/FrostGuardian.cs +++ b/Ice/Items/FrostGuardian.cs @@ -5,41 +5,43 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Ice.Items { -[AutoloadEquip(EquipType.Shield)] -public class FrostGuardian : ModItem +namespace Tremor.Ice.Items { - public override void SetDefaults() - { + [AutoloadEquip(EquipType.Shield)] + public class FrostGuardian : ModItem + { + public override void SetDefaults() + { - item.width = 26; - item.height = 34; - item.value = 110; - item.rare = 1; - item.accessory = true; - item.defense = 4; - } + item.width = 26; + item.height = 34; + item.value = 110; + item.rare = 1; + item.accessory = true; + item.defense = 4; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Frost Guardian"); - Tooltip.SetDefault("Grants immunity to all frost debuffs \n5% increased melee damage and speed"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Frost Guardian"); + Tooltip.SetDefault("Grants immunity to all frost debuffs \n5% increased melee damage and speed"); + } - public override void UpdateEquip(Player player) - { - player.moveSpeed += 0.20f; - } + public override void UpdateEquip(Player player) + { + player.moveSpeed += 0.20f; + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.meleeDamage += 0.05f; - player.meleeSpeed += 0.05f; - player.buffImmune[44] = true; - player.buffImmune[45] = true; - player.buffImmune[46] = true; - player.buffImmune[47] = true; - } -}} + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.meleeDamage += 0.05f; + player.meleeSpeed += 0.05f; + player.buffImmune[44] = true; + player.buffImmune[45] = true; + player.buffImmune[46] = true; + player.buffImmune[47] = true; + } + } +} diff --git a/Ice/Items/FrostLance.cs b/Ice/Items/FrostLance.cs index d5799d69..8fbb84ef 100644 --- a/Ice/Items/FrostLance.cs +++ b/Ice/Items/FrostLance.cs @@ -5,38 +5,40 @@ using Terraria.ModLoader; using Microsoft.Xna.Framework; -namespace Tremor.Ice.Items { -public class FrostLance : ModItem +namespace Tremor.Ice.Items { - public override void SetDefaults() - { + public class FrostLance : ModItem + { + public override void SetDefaults() + { - item.damage = 23; - item.width = 76; - item.height = 76; - item.noUseGraphic = true; - item.melee = true; - item.useTime = 35; - item.shoot = mod.ProjectileType("FrostLancePro"); - item.shootSpeed = 3f; - item.useAnimation = 35; - item.useStyle = 5; - item.knockBack = 9; - item.value = 1000; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 23; + item.width = 76; + item.height = 76; + item.noUseGraphic = true; + item.melee = true; + item.useTime = 35; + item.shoot = mod.ProjectileType("FrostLancePro"); + item.shootSpeed = 3f; + item.useAnimation = 35; + item.useStyle = 5; + item.knockBack = 9; + item.value = 1000; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Frost Lance"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Frost Lance"); + Tooltip.SetDefault(""); + } - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(44, 60); - } -}} + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(44, 60); + } + } +} diff --git a/Ice/Items/FrostLancePro.cs b/Ice/Items/FrostLancePro.cs index c02d1163..967a309d 100644 --- a/Ice/Items/FrostLancePro.cs +++ b/Ice/Items/FrostLancePro.cs @@ -5,19 +5,21 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Ice.Items { -public class FrostLancePro : ModProjectile +namespace Tremor.Ice.Items { - public override void SetDefaults() - { + public class FrostLancePro : ModProjectile + { + public override void SetDefaults() + { projectile.CloneDefaults(66); aiType = 66; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Frost Lance"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Frost Lance"); + } -}} + } +} diff --git a/Ice/Items/FrostLiquidFlask.cs b/Ice/Items/FrostLiquidFlask.cs index 753d69f8..8314aec1 100644 --- a/Ice/Items/FrostLiquidFlask.cs +++ b/Ice/Items/FrostLiquidFlask.cs @@ -8,35 +8,36 @@ namespace Tremor.Ice.Items { public class FrostLiquidFlask : AlchemistItem - { + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.damage = 10; - //item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("FrostLiquidFlaskPro"); - item.shootSpeed = 8f; - item.useStyle = 1; - item.knockBack = 1; - item.UseSound = SoundID.Item106; - item.value = 30; - item.rare = 1; - item.autoReuse = false; + item.damage = 10; + //item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("FrostLiquidFlaskPro"); + item.shootSpeed = 8f; + item.useStyle = 1; + item.knockBack = 1; + item.UseSound = SoundID.Item106; + item.value = 30; + item.rare = 1; + item.autoReuse = false; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Frost Liquid Flask"); - Tooltip.SetDefault("Throws a flask that explodes into frost bolts"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Frost Liquid Flask"); + Tooltip.SetDefault("Throws a flask that explodes into frost bolts"); + } -}} + } +} diff --git a/Ice/Items/FrostLiquidFlaskPro.cs b/Ice/Items/FrostLiquidFlaskPro.cs index cbc63f6c..fff6fe2a 100644 --- a/Ice/Items/FrostLiquidFlaskPro.cs +++ b/Ice/Items/FrostLiquidFlaskPro.cs @@ -4,45 +4,47 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Ice.Items { -public class FrostLiquidFlaskPro : ModProjectile +namespace Tremor.Ice.Items { - public override void SetDefaults() - { - projectile.width = 18; - projectile.height = 28; - projectile.friendly = true; - projectile.aiStyle = 2; - projectile.timeLeft = 1200; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; - ProjectileID.Sets.TrailingMode[projectile.type] = 2; - } + public class FrostLiquidFlaskPro : ModProjectile + { + public override void SetDefaults() + { + projectile.width = 18; + projectile.height = 28; + projectile.friendly = true; + projectile.aiStyle = 2; + projectile.timeLeft = 1200; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Frost Liquid Flask Pro"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Frost Liquid Flask Pro"); + } - public override void Kill(int timeLeft) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 107); - Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 704, 1f); - Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 705, 1f); - Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 705, 1f); - Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 705, 1f); - if (projectile.owner == Main.myPlayer) + public override void Kill(int timeLeft) { - int num220 = Main.rand.Next(6, 20); - for (int num221 = 0; num221 < num220; num221++) + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 107); + Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 704, 1f); + Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 705, 1f); + Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 705, 1f); + Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 705, 1f); + if (projectile.owner == Main.myPlayer) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, 118, projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + int num220 = Main.rand.Next(6, 20); + for (int num221 = 0; num221 < num220; num221++) + { + Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value17.Normalize(); + value17 *= (float)Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, 118, projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + } } } - } -}} + } +} diff --git a/Ice/Items/FrostWind.cs b/Ice/Items/FrostWind.cs index 10371a2b..362a4daa 100644 --- a/Ice/Items/FrostWind.cs +++ b/Ice/Items/FrostWind.cs @@ -5,32 +5,34 @@ using Terraria.ModLoader; using Microsoft.Xna.Framework; -namespace Tremor.Ice.Items { -public class FrostWind : ModItem +namespace Tremor.Ice.Items { - public override void SetDefaults() - { + public class FrostWind : ModItem + { + public override void SetDefaults() + { - item.damage = 20; - item.melee = true; - item.width = 46; - item.height = 46; - item.useTime = 25; - item.useAnimation = 25; - item.useStyle = 1; - item.knockBack = 5; - item.value = 15000; - item.rare = 2; - item.UseSound = SoundID.Item71; - item.autoReuse = false; - item.shoot = mod.ProjectileType("FrostwindPro"); - item.shootSpeed = 12f; - } + item.damage = 20; + item.melee = true; + item.width = 46; + item.height = 46; + item.useTime = 25; + item.useAnimation = 25; + item.useStyle = 1; + item.knockBack = 5; + item.value = 15000; + item.rare = 2; + item.UseSound = SoundID.Item71; + item.autoReuse = false; + item.shoot = mod.ProjectileType("FrostwindPro"); + item.shootSpeed = 12f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Frost Wind"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Frost Wind"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Ice/Items/Frostex.cs b/Ice/Items/Frostex.cs index a3d9635d..30918256 100644 --- a/Ice/Items/Frostex.cs +++ b/Ice/Items/Frostex.cs @@ -6,31 +6,33 @@ using Terraria.ModLoader; using Microsoft.Xna.Framework; -namespace Tremor.Ice.Items { -public class Frostex : ModItem +namespace Tremor.Ice.Items { + public class Frostex : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 38; - item.height = 22; + item.width = 38; + item.height = 22; - item.value = 12000; - item.rare = 1; - item.accessory = true; - } + item.value = 12000; + item.rare = 1; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Frostex"); - Tooltip.SetDefault("10% increased melee and ranged damage"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Frostex"); + Tooltip.SetDefault("10% increased melee and ranged damage"); + } - public override void UpdateEquip(Player player) - { - player.meleeDamage += 0.1f; - player.rangedDamage += 0.1f; - } -}} + public override void UpdateEquip(Player player) + { + player.meleeDamage += 0.1f; + player.rangedDamage += 0.1f; + } + } +} diff --git a/Ice/Items/FrozenPaxe.cs b/Ice/Items/FrozenPaxe.cs index eb82a0fd..84dd374c 100644 --- a/Ice/Items/FrozenPaxe.cs +++ b/Ice/Items/FrozenPaxe.cs @@ -5,40 +5,42 @@ using Terraria.ID; using Microsoft.Xna.Framework; -namespace Tremor.Ice.Items { -public class FrozenPaxe : ModItem +namespace Tremor.Ice.Items { - public override void SetDefaults() - { + public class FrozenPaxe : ModItem + { + public override void SetDefaults() + { - item.damage = 22; - item.melee = true; - item.width = 48; - item.height = 40; - item.useTime = 13; - item.useAnimation = 22; - item.useStyle = 1; - item.knockBack = 5; - item.value = 20000; - item.rare = 3; - item.axe = 10; - item.pick = 60; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 22; + item.melee = true; + item.width = 48; + item.height = 40; + item.useTime = 13; + item.useAnimation = 22; + item.useStyle = 1; + item.knockBack = 5; + item.value = 20000; + item.rare = 3; + item.axe = 10; + item.pick = 60; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Frozen Paxe"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Frozen Paxe"); + Tooltip.SetDefault(""); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if(Main.rand.Next(3) == 0) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 80); - } - } -}} + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.Next(3) == 0) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 80); + } + } + } +} diff --git a/Ice/Items/Furniture/IceBathtub.cs b/Ice/Items/Furniture/IceBathtub.cs index 492f6021..76f9443b 100644 --- a/Ice/Items/Furniture/IceBathtub.cs +++ b/Ice/Items/Furniture/IceBathtub.cs @@ -8,12 +8,12 @@ namespace Tremor.Ice.Items.Furniture { public class IceBathtub : ModItem { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Glacier Wood Bathtub"); - Tooltip.SetDefault(""); - } - public override void SetDefaults() + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Glacier Wood Bathtub"); + Tooltip.SetDefault(""); + } + public override void SetDefaults() { item.width = 64; item.height = 32; @@ -23,19 +23,19 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("IceBathtubTile"); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GlacierWood", 14); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GlacierWood", 14); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } } } \ No newline at end of file diff --git a/Ice/Items/Furniture/IceBathtubTile.cs b/Ice/Items/Furniture/IceBathtubTile.cs index dff6080b..924d16de 100644 --- a/Ice/Items/Furniture/IceBathtubTile.cs +++ b/Ice/Items/Furniture/IceBathtubTile.cs @@ -14,7 +14,7 @@ public override void SetDefaults() Main.tileFrameImportant[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style4x2); //this style already takes care of direction for us - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); AddMapEntry(new Color(87, 144, 165)); diff --git a/Ice/Items/Furniture/IceBed.cs b/Ice/Items/Furniture/IceBed.cs index ca9eb752..8a18a123 100644 --- a/Ice/Items/Furniture/IceBed.cs +++ b/Ice/Items/Furniture/IceBed.cs @@ -8,12 +8,12 @@ namespace Tremor.Ice.Items.Furniture { public class IceBed : ModItem { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Glacier Wood Bed"); - Tooltip.SetDefault(""); - } - public override void SetDefaults() + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Glacier Wood Bed"); + Tooltip.SetDefault(""); + } + public override void SetDefaults() { item.width = 64; item.height = 26; @@ -23,20 +23,20 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("IceBedTile"); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GlacierWood", 15); - recipe.AddIngredient(ItemID.Silk, 5); - recipe.SetResult(this); - recipe.AddTile(106); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GlacierWood", 15); + recipe.AddIngredient(ItemID.Silk, 5); + recipe.SetResult(this); + recipe.AddTile(106); + recipe.AddRecipe(); + } } } \ No newline at end of file diff --git a/Ice/Items/Furniture/IceBedTile.cs b/Ice/Items/Furniture/IceBedTile.cs index 997072c4..c2c1292c 100644 --- a/Ice/Items/Furniture/IceBedTile.cs +++ b/Ice/Items/Furniture/IceBedTile.cs @@ -14,11 +14,11 @@ public override void SetDefaults() Main.tileFrameImportant[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style4x2); //this style already takes care of direction for us - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16 }; TileObjectData.addTile(Type); AddMapEntry(new Color(87, 144, 165)); - adjTiles = new int[]{ TileID.Beds }; - AddToArray(ref TileID.Sets.RoomNeeds.CountsAsChair); + adjTiles = new int[] { TileID.Beds }; + AddToArray(ref TileID.Sets.RoomNeeds.CountsAsChair); bed = true; } diff --git a/Ice/Items/Furniture/IceBookcase.cs b/Ice/Items/Furniture/IceBookcase.cs index 7e98ea94..c209e853 100644 --- a/Ice/Items/Furniture/IceBookcase.cs +++ b/Ice/Items/Furniture/IceBookcase.cs @@ -8,12 +8,12 @@ namespace Tremor.Ice.Items.Furniture { public class IceBookcase : ModItem { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Glacier Wood Bookcase"); - Tooltip.SetDefault(""); - } - public override void SetDefaults() + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Glacier Wood Bookcase"); + Tooltip.SetDefault(""); + } + public override void SetDefaults() { item.width = 42; item.height = 16; @@ -23,20 +23,20 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("IceBookcaseTile"); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GlacierWood", 20); - recipe.AddIngredient(149, 10); - recipe.SetResult(this); - recipe.AddTile(106); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GlacierWood", 20); + recipe.AddIngredient(149, 10); + recipe.SetResult(this); + recipe.AddTile(106); + recipe.AddRecipe(); + } } } \ No newline at end of file diff --git a/Ice/Items/Furniture/IceBookcaseTile.cs b/Ice/Items/Furniture/IceBookcaseTile.cs index c2ff5b87..03cd4ffb 100644 --- a/Ice/Items/Furniture/IceBookcaseTile.cs +++ b/Ice/Items/Furniture/IceBookcaseTile.cs @@ -17,7 +17,7 @@ public override void SetDefaults() Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4); - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16, 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); AddMapEntry(new Color(87, 144, 165)); diff --git a/Ice/Items/Furniture/IceCandelabra.cs b/Ice/Items/Furniture/IceCandelabra.cs index 3566992a..f7c693c1 100644 --- a/Ice/Items/Furniture/IceCandelabra.cs +++ b/Ice/Items/Furniture/IceCandelabra.cs @@ -8,12 +8,12 @@ namespace Tremor.Ice.Items.Furniture { public class IceCandelabra : ModItem { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Glacier Wood Candelabra"); - Tooltip.SetDefault(""); - } - public override void SetDefaults() + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Glacier Wood Candelabra"); + Tooltip.SetDefault(""); + } + public override void SetDefaults() { item.width = 22; item.height = 32; @@ -23,20 +23,20 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("IceCandelabraTile"); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GlacierWood", 5); - recipe.AddIngredient(ItemID.Torch, 3); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GlacierWood", 5); + recipe.AddIngredient(ItemID.Torch, 3); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } } } \ No newline at end of file diff --git a/Ice/Items/Furniture/IceCandelabraTile.cs b/Ice/Items/Furniture/IceCandelabraTile.cs index d41d57f9..3b4c934d 100644 --- a/Ice/Items/Furniture/IceCandelabraTile.cs +++ b/Ice/Items/Furniture/IceCandelabraTile.cs @@ -8,36 +8,38 @@ using Terraria.ObjectData; -namespace Tremor.Ice.Items.Furniture { -public class IceCandelabraTile : ModTile +namespace Tremor.Ice.Items.Furniture { - public override void SetDefaults() - { - Main.tileFrameImportant[Type] = true; - Main.tileLavaDeath[Type] = true; - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); - TileObjectData.newTile.StyleHorizontal = true; - //TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.Table, TileObjectData.newTile.Width, 0); - TileObjectData.newTile.StyleWrapLimit = 36; - TileObjectData.addTile(Type); - dustType = 7; - Main.tileLighted[Type] = true; - AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); + public class IceCandelabraTile : ModTile + { + public override void SetDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileLavaDeath[Type] = true; + TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); + TileObjectData.newTile.StyleHorizontal = true; + //TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.Table, TileObjectData.newTile.Width, 0); + TileObjectData.newTile.StyleWrapLimit = 36; + TileObjectData.addTile(Type); + dustType = 7; + Main.tileLighted[Type] = true; + AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); AddMapEntry(new Color(87, 144, 165)); - } + } - public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) - { - r = 0.9f; - g = 0.9f; - b = 0.9f; - } + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + r = 0.9f; + g = 0.9f; + b = 0.9f; + } - public override void KillMultiTile(int i, int j, int frameX, int frameY) - { - if(frameX == 0) - { - Item.NewItem(i * 16, j * 16, 48, 48, mod.ItemType("IceCandelabra")); - } - } -}} \ No newline at end of file + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + if (frameX == 0) + { + Item.NewItem(i * 16, j * 16, 48, 48, mod.ItemType("IceCandelabra")); + } + } + } +} \ No newline at end of file diff --git a/Ice/Items/Furniture/IceCandle.cs b/Ice/Items/Furniture/IceCandle.cs index 5e4f145b..95792966 100644 --- a/Ice/Items/Furniture/IceCandle.cs +++ b/Ice/Items/Furniture/IceCandle.cs @@ -8,12 +8,12 @@ namespace Tremor.Ice.Items.Furniture { public class IceCandle : ModItem { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Glacier Wood Candle"); - Tooltip.SetDefault(""); - } - public override void SetDefaults() + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Glacier Wood Candle"); + Tooltip.SetDefault(""); + } + public override void SetDefaults() { item.width = 16; item.height = 16; @@ -23,20 +23,20 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("IceCandleTile"); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GlacierWood", 4); - recipe.AddIngredient(ItemID.Torch, 1); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GlacierWood", 4); + recipe.AddIngredient(ItemID.Torch, 1); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } } } \ No newline at end of file diff --git a/Ice/Items/Furniture/IceCandleTile.cs b/Ice/Items/Furniture/IceCandleTile.cs index 6cbedffe..248f855e 100644 --- a/Ice/Items/Furniture/IceCandleTile.cs +++ b/Ice/Items/Furniture/IceCandleTile.cs @@ -5,35 +5,37 @@ using Terraria.ModLoader; using Terraria.ObjectData; -namespace Tremor.Ice.Items.Furniture { -public class IceCandleTile : ModTile +namespace Tremor.Ice.Items.Furniture { - public override void SetDefaults() - { - Main.tileFrameImportant[Type] = true; - Main.tileLavaDeath[Type] = true; - TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1); - TileObjectData.newTile.StyleHorizontal = true; - TileObjectData.newTile.StyleWrapLimit = 36; - TileObjectData.addTile(Type); - dustType = 7; - Main.tileLighted[Type] = true; - AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); + public class IceCandleTile : ModTile + { + public override void SetDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileLavaDeath[Type] = true; + TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1); + TileObjectData.newTile.StyleHorizontal = true; + TileObjectData.newTile.StyleWrapLimit = 36; + TileObjectData.addTile(Type); + dustType = 7; + Main.tileLighted[Type] = true; + AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); AddMapEntry(new Color(87, 144, 165)); - } + } - public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) - { - r = 0.9f; - g = 0.9f; - b = 0.9f; - } + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + r = 0.9f; + g = 0.9f; + b = 0.9f; + } -public override void KillTile(int i, int j, ref bool fail, ref bool effectOnly, ref bool noItem) - { - if(Main.tile[i, j].frameX == 0 && Main.tile[i, j].frameY == 0) - { - Item.NewItem(i * 16, j * 16, 48, 48, mod.ItemType("IceCandle")); - } - } -}} \ No newline at end of file + public override void KillTile(int i, int j, ref bool fail, ref bool effectOnly, ref bool noItem) + { + if (Main.tile[i, j].frameX == 0 && Main.tile[i, j].frameY == 0) + { + Item.NewItem(i * 16, j * 16, 48, 48, mod.ItemType("IceCandle")); + } + } + } +} \ No newline at end of file diff --git a/Ice/Items/Furniture/IceChair.cs b/Ice/Items/Furniture/IceChair.cs index 35c95f75..407768b0 100644 --- a/Ice/Items/Furniture/IceChair.cs +++ b/Ice/Items/Furniture/IceChair.cs @@ -8,12 +8,12 @@ namespace Tremor.Ice.Items.Furniture { public class IceChair : ModItem { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Glacier Wood Chair"); - Tooltip.SetDefault(""); - } - public override void SetDefaults() + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Glacier Wood Chair"); + Tooltip.SetDefault(""); + } + public override void SetDefaults() { item.width = 16; item.height = 32; @@ -23,19 +23,19 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("IceChairTile"); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GlacierWood", 4); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GlacierWood", 4); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } } } \ No newline at end of file diff --git a/Ice/Items/Furniture/IceChairTile.cs b/Ice/Items/Furniture/IceChairTile.cs index 16a3b56f..46a2e09a 100644 --- a/Ice/Items/Furniture/IceChairTile.cs +++ b/Ice/Items/Furniture/IceChairTile.cs @@ -6,30 +6,32 @@ using Terraria.ModLoader; using Terraria.ObjectData; -namespace Tremor.Ice.Items.Furniture { -public class IceChairTile : ModTile +namespace Tremor.Ice.Items.Furniture { - public override void SetDefaults() - { - Main.tileFrameImportant[Type] = true; - Main.tileNoAttach[Type] = true; - Main.tileLavaDeath[Type] = true; - TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2); - TileObjectData.newTile.CoordinateHeights = new int[]{16, 16}; - TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; - TileObjectData.newTile.StyleWrapLimit = 2; //not really necessary but allows me to add more subtypes of chairs below the example chair texture - TileObjectData.newTile.StyleMultiplier = 2; //same as above - TileObjectData.newTile.StyleHorizontal = true; - TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); - TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; //allows me to place example chairs facing the same way as the player - TileObjectData.addAlternate(1); //facing right will use the second texture style - TileObjectData.addTile(Type); - AddToArray(ref TileID.Sets.RoomNeeds.CountsAsChair); + public class IceChairTile : ModTile + { + public override void SetDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileNoAttach[Type] = true; + Main.tileLavaDeath[Type] = true; + TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2); + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16 }; + TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; + TileObjectData.newTile.StyleWrapLimit = 2; //not really necessary but allows me to add more subtypes of chairs below the example chair texture + TileObjectData.newTile.StyleMultiplier = 2; //same as above + TileObjectData.newTile.StyleHorizontal = true; + TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); + TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; //allows me to place example chairs facing the same way as the player + TileObjectData.addAlternate(1); //facing right will use the second texture style + TileObjectData.addTile(Type); + AddToArray(ref TileID.Sets.RoomNeeds.CountsAsChair); AddMapEntry(new Color(87, 144, 165)); - } + } - public override void KillMultiTile(int i, int j, int frameX, int frameY) - { - Item.NewItem(i * 16, j * 16, 32, 16, mod.ItemType("IceChair")); - } -}} \ No newline at end of file + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 32, 16, mod.ItemType("IceChair")); + } + } +} \ No newline at end of file diff --git a/Ice/Items/Furniture/IceChandelier.cs b/Ice/Items/Furniture/IceChandelier.cs index 47ce2b21..53af3dac 100644 --- a/Ice/Items/Furniture/IceChandelier.cs +++ b/Ice/Items/Furniture/IceChandelier.cs @@ -8,12 +8,12 @@ namespace Tremor.Ice.Items.Furniture { public class IceChandelier : ModItem { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Glacier Wood Chandelier"); - Tooltip.SetDefault(""); - } - public override void SetDefaults() + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Glacier Wood Chandelier"); + Tooltip.SetDefault(""); + } + public override void SetDefaults() { item.width = 22; item.height = 32; @@ -23,21 +23,21 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("IceChandelierTile"); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GlacierWood", 4); - recipe.AddIngredient(ItemID.Torch, 4); - recipe.AddIngredient(ItemID.Chain, 1); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GlacierWood", 4); + recipe.AddIngredient(ItemID.Torch, 4); + recipe.AddIngredient(ItemID.Chain, 1); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } } } \ No newline at end of file diff --git a/Ice/Items/Furniture/IceChandelierTile.cs b/Ice/Items/Furniture/IceChandelierTile.cs index a4e29c83..56686309 100644 --- a/Ice/Items/Furniture/IceChandelierTile.cs +++ b/Ice/Items/Furniture/IceChandelierTile.cs @@ -5,40 +5,42 @@ using Terraria.ModLoader; using Terraria.ObjectData; -namespace Tremor.Ice.Items.Furniture { -public class IceChandelierTile : ModTile +namespace Tremor.Ice.Items.Furniture { - public override void SetDefaults() - { - Main.tileFrameImportant[Type] = true; - Main.tileNoAttach[Type] = true; - Main.tileLavaDeath[Type] = true; - TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2Top); - TileObjectData.newTile.Height = 3; - TileObjectData.newTile.Width = 3; - TileObjectData.newTile.CoordinateHeights = new int[]{16, 16, 16}; - TileObjectData.newTile.StyleHorizontal = true; - TileObjectData.newTile.StyleWrapLimit = 111; - TileObjectData.addTile(Type); - dustType = -1; - AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); - Main.tileLighted[Type] = true; + public class IceChandelierTile : ModTile + { + public override void SetDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileNoAttach[Type] = true; + Main.tileLavaDeath[Type] = true; + TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2Top); + TileObjectData.newTile.Height = 3; + TileObjectData.newTile.Width = 3; + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16 }; + TileObjectData.newTile.StyleHorizontal = true; + TileObjectData.newTile.StyleWrapLimit = 111; + TileObjectData.addTile(Type); + dustType = -1; + AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); + Main.tileLighted[Type] = true; AddMapEntry(new Color(87, 144, 165)); - } + } - public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) - { - r = 0.9f; - g = 0.9f; - b = 0.9f; - } + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + r = 0.9f; + g = 0.9f; + b = 0.9f; + } - public override void KillMultiTile(int i, int j, int frameX, int frameY) - { - if(frameX == 0) - { - Item.NewItem(i * 16, j * 16, 48, 48, mod.ItemType("IceChandelier")); - } - } -}} \ No newline at end of file + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + if (frameX == 0) + { + Item.NewItem(i * 16, j * 16, 48, 48, mod.ItemType("IceChandelier")); + } + } + } +} \ No newline at end of file diff --git a/Ice/Items/Furniture/IceChest.cs b/Ice/Items/Furniture/IceChest.cs index 08e419ec..34fcbb6d 100644 --- a/Ice/Items/Furniture/IceChest.cs +++ b/Ice/Items/Furniture/IceChest.cs @@ -8,12 +8,12 @@ namespace Tremor.Ice.Items.Furniture { public class IceChest : ModItem { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Glacier Wood Chest"); - Tooltip.SetDefault(""); - } - public override void SetDefaults() + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Glacier Wood Chest"); + Tooltip.SetDefault(""); + } + public override void SetDefaults() { item.width = 32; item.height = 18; @@ -23,27 +23,27 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("IceChestTile"); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GlacierWood", 8); - recipe.AddIngredient(ItemID.IronBar, 2); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GlacierWood", 8); + recipe.AddIngredient(ItemID.IronBar, 2); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GlacierWood", 8); - recipe.AddIngredient(ItemID.LeadBar, 2); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } + recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GlacierWood", 8); + recipe.AddIngredient(ItemID.LeadBar, 2); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } } } \ No newline at end of file diff --git a/Ice/Items/Furniture/IceChestTile.cs b/Ice/Items/Furniture/IceChestTile.cs index 6b9870bc..0da189e0 100644 --- a/Ice/Items/Furniture/IceChestTile.cs +++ b/Ice/Items/Furniture/IceChestTile.cs @@ -35,10 +35,10 @@ public override void SetDefaults() adjTiles = new int[] { TileID.Containers }; chest = "Glacier Wood Chest"; chestDrop = mod.ItemType("IceChest"); - TileID.Sets.BasicChest[Type] = true; + TileID.Sets.BasicChest[Type] = true; } - public string MapChestName(string name, int i, int j) + public string MapChestName(string name, int i, int j) { int left = i; int top = j; diff --git a/Ice/Items/Furniture/IceDoor.cs b/Ice/Items/Furniture/IceDoor.cs index 7af64247..c154be4e 100644 --- a/Ice/Items/Furniture/IceDoor.cs +++ b/Ice/Items/Furniture/IceDoor.cs @@ -8,12 +8,12 @@ namespace Tremor.Ice.Items.Furniture { public class IceDoor : ModItem { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Glacier Wood Door"); - Tooltip.SetDefault(""); - } - public override void SetDefaults() + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Glacier Wood Door"); + Tooltip.SetDefault(""); + } + public override void SetDefaults() { item.width = 24; item.height = 48; @@ -23,19 +23,19 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 10; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 150; item.createTile = mod.TileType("IceDoorClosed"); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GlacierWood", 6); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GlacierWood", 6); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } } } \ No newline at end of file diff --git a/Ice/Items/Furniture/IceDoorClosed.cs b/Ice/Items/Furniture/IceDoorClosed.cs index 65c9b0c1..0e762ad1 100644 --- a/Ice/Items/Furniture/IceDoorClosed.cs +++ b/Ice/Items/Furniture/IceDoorClosed.cs @@ -25,7 +25,7 @@ public override void SetDefaults() TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile, TileObjectData.newTile.Width, 0); TileObjectData.newTile.UsesCustomCanPlace = true; TileObjectData.newTile.LavaDeath = true; - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16 }; TileObjectData.newTile.CoordinateWidth = 16; TileObjectData.newTile.CoordinatePadding = 2; TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); @@ -37,7 +37,7 @@ public override void SetDefaults() TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsDoor); AddMapEntry(new Color(87, 144, 165)); - adjTiles = new int[]{ TileID.ClosedDoor }; + adjTiles = new int[] { TileID.ClosedDoor }; openDoorID = mod.TileType("IceDoorOpen"); } diff --git a/Ice/Items/Furniture/IceDoorOpen.cs b/Ice/Items/Furniture/IceDoorOpen.cs index fcd0d09a..fd19fb77 100644 --- a/Ice/Items/Furniture/IceDoorOpen.cs +++ b/Ice/Items/Furniture/IceDoorOpen.cs @@ -24,7 +24,7 @@ public override void SetDefaults() TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile, 1, 0); TileObjectData.newTile.UsesCustomCanPlace = true; TileObjectData.newTile.LavaDeath = true; - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16 }; TileObjectData.newTile.CoordinateWidth = 16; TileObjectData.newTile.CoordinatePadding = 2; TileObjectData.newTile.StyleHorizontal = true; @@ -59,7 +59,7 @@ public override void SetDefaults() AddToArray(ref TileID.Sets.RoomNeeds.CountsAsDoor); TileID.Sets.HousingWalls[Type] = true; //needed for non-solid blocks to count as walls AddMapEntry(new Color(87, 144, 165)); - adjTiles = new int[]{ TileID.OpenDoor }; + adjTiles = new int[] { TileID.OpenDoor }; closeDoorID = mod.TileType("IceDoorClosed"); } diff --git a/Ice/Items/Furniture/IceDresser.cs b/Ice/Items/Furniture/IceDresser.cs index d0fe482f..423731a2 100644 --- a/Ice/Items/Furniture/IceDresser.cs +++ b/Ice/Items/Furniture/IceDresser.cs @@ -8,12 +8,12 @@ namespace Tremor.Ice.Items.Furniture { public class IceDresser : ModItem { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Glacier Wood Dresser"); - Tooltip.SetDefault(""); - } - public override void SetDefaults() + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Glacier Wood Dresser"); + Tooltip.SetDefault(""); + } + public override void SetDefaults() { item.width = 48; item.height = 32; @@ -23,19 +23,19 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("IceDresserTile"); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GlacierWood", 16); - recipe.SetResult(this); - recipe.AddTile(106); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GlacierWood", 16); + recipe.SetResult(this); + recipe.AddTile(106); + recipe.AddRecipe(); + } } } \ No newline at end of file diff --git a/Ice/Items/Furniture/IceDresserTile.cs b/Ice/Items/Furniture/IceDresserTile.cs index fd81dd15..dc5a94af 100644 --- a/Ice/Items/Furniture/IceDresserTile.cs +++ b/Ice/Items/Furniture/IceDresserTile.cs @@ -140,7 +140,7 @@ public override void MouseOverFar(int i, int j) if (chestIndex < 0) { player.showItemIconText = "Glacier Wood Dresser"; - } + } else { if (Main.chest[chestIndex].name != "") @@ -182,7 +182,7 @@ public override void MouseOver(int i, int j) if (num138 < 0) { player.showItemIconText = "Glacier Wood Dresser"; - } + } else { if (Main.chest[num138].name != "") diff --git a/Ice/Items/Furniture/IceGrandfatherClock.cs b/Ice/Items/Furniture/IceGrandfatherClock.cs index d7198f64..51d4ca12 100644 --- a/Ice/Items/Furniture/IceGrandfatherClock.cs +++ b/Ice/Items/Furniture/IceGrandfatherClock.cs @@ -8,12 +8,12 @@ namespace Tremor.Ice.Items.Furniture { public class IceGrandfatherClock : ModItem { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Glacier Wood Grandfather Clock"); - Tooltip.SetDefault(""); - } - public override void SetDefaults() + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Glacier Wood Grandfather Clock"); + Tooltip.SetDefault(""); + } + public override void SetDefaults() { item.width = 32; item.height = 74; @@ -23,30 +23,30 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("IceGrandfatherClockTile"); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.IronBar, 3); - recipe.AddIngredient(ItemID.Glass, 6); - recipe.AddIngredient(null, "GlacierWood", 10); - recipe.SetResult(this); - recipe.AddTile(106); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.IronBar, 3); + recipe.AddIngredient(ItemID.Glass, 6); + recipe.AddIngredient(null, "GlacierWood", 10); + recipe.SetResult(this); + recipe.AddTile(106); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.LeadBar, 3); - recipe.AddIngredient(ItemID.Glass, 6); - recipe.AddIngredient(null, "GlacierWood", 10); - recipe.SetResult(this); - recipe.AddTile(106); - recipe.AddRecipe(); - } + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.LeadBar, 3); + recipe.AddIngredient(ItemID.Glass, 6); + recipe.AddIngredient(null, "GlacierWood", 10); + recipe.SetResult(this); + recipe.AddTile(106); + recipe.AddRecipe(); + } } } \ No newline at end of file diff --git a/Ice/Items/Furniture/IceGrandfatherClockTile.cs b/Ice/Items/Furniture/IceGrandfatherClockTile.cs index ab3699d8..c84e3d2c 100644 --- a/Ice/Items/Furniture/IceGrandfatherClockTile.cs +++ b/Ice/Items/Furniture/IceGrandfatherClockTile.cs @@ -14,11 +14,11 @@ public override void SetDefaults() Main.tileFrameImportant[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); - TileObjectData.newTile.Height = 5; - TileObjectData.newTile.CoordinateHeights = new int[]{16, 16, 16, 16, 16}; - TileObjectData.newTile.StyleHorizontal = true; - TileObjectData.newTile.StyleWrapLimit = 36; - TileObjectData.addTile(Type); + TileObjectData.newTile.Height = 5; + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16, 16, 16 }; + TileObjectData.newTile.StyleHorizontal = true; + TileObjectData.newTile.StyleWrapLimit = 36; + TileObjectData.addTile(Type); AddMapEntry(new Color(87, 144, 165)); adjTiles = new int[] { TileID.GrandfatherClocks }; } @@ -27,7 +27,7 @@ public override void KillMultiTile(int i, int j, int frameX, int frameY) { Item.NewItem(i * 16, j * 16, 32, 16, mod.ItemType("IceGrandfatherClock")); } -public override void RightClick(int x, int y) + public override void RightClick(int x, int y) { { string text = "AM"; diff --git a/Ice/Items/Furniture/IceLamp.cs b/Ice/Items/Furniture/IceLamp.cs index 64b6fb6b..7a233f31 100644 --- a/Ice/Items/Furniture/IceLamp.cs +++ b/Ice/Items/Furniture/IceLamp.cs @@ -8,14 +8,14 @@ namespace Tremor.Ice.Items.Furniture { public class IceLamp : ModItem { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Glacier Wood Lamp"); - Tooltip.SetDefault(""); - } - public override void SetDefaults() + public override void SetStaticDefaults() { - + DisplayName.SetDefault("Glacier Wood Lamp"); + Tooltip.SetDefault(""); + } + public override void SetDefaults() + { + item.width = 16; item.height = 48; item.maxStack = 99; @@ -24,20 +24,20 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("IceLampTile"); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GlacierWood", 3); - recipe.AddIngredient(ItemID.Torch, 1); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GlacierWood", 3); + recipe.AddIngredient(ItemID.Torch, 1); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } } } \ No newline at end of file diff --git a/Ice/Items/Furniture/IceLampTile.cs b/Ice/Items/Furniture/IceLampTile.cs index 999fc705..1c71b7ec 100644 --- a/Ice/Items/Furniture/IceLampTile.cs +++ b/Ice/Items/Furniture/IceLampTile.cs @@ -5,34 +5,36 @@ using Terraria.ModLoader; using Terraria.ObjectData; -namespace Tremor.Ice.Items.Furniture { -public class IceLampTile : ModTile +namespace Tremor.Ice.Items.Furniture { - public override void SetDefaults() - { - Main.tileFrameImportant[Type] = true; - Main.tileLavaDeath[Type] = true; - TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2); - TileObjectData.newTile.Height = 3; - TileObjectData.newTile.CoordinateHeights = new int[]{16, 16, 16}; - TileObjectData.newTile.StyleHorizontal = true; - TileObjectData.newTile.StyleWrapLimit = 36; - TileObjectData.addTile(Type); - dustType = 7; - Main.tileLighted[Type] = true; - AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); + public class IceLampTile : ModTile + { + public override void SetDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileLavaDeath[Type] = true; + TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2); + TileObjectData.newTile.Height = 3; + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16 }; + TileObjectData.newTile.StyleHorizontal = true; + TileObjectData.newTile.StyleWrapLimit = 36; + TileObjectData.addTile(Type); + dustType = 7; + Main.tileLighted[Type] = true; + AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); AddMapEntry(new Color(87, 144, 165)); - } + } - public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) - { - r = 0.9f; - g = 0.9f; - b = 0.9f; - } + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + r = 0.9f; + g = 0.9f; + b = 0.9f; + } public override void KillMultiTile(int i, int j, int frameX, int frameY) { Item.NewItem(i * 16, j * 16, 32, 16, mod.ItemType("IceLamp")); } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/Ice/Items/Furniture/IceLantern.cs b/Ice/Items/Furniture/IceLantern.cs index 231adb70..31a355b9 100644 --- a/Ice/Items/Furniture/IceLantern.cs +++ b/Ice/Items/Furniture/IceLantern.cs @@ -8,12 +8,12 @@ namespace Tremor.Ice.Items.Furniture { public class IceLantern : ModItem { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Glacier Wood Lantern"); - Tooltip.SetDefault(""); - } - public override void SetDefaults() + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Glacier Wood Lantern"); + Tooltip.SetDefault(""); + } + public override void SetDefaults() { item.width = 16; item.height = 32; @@ -23,20 +23,20 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("IceLanternTile"); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GlacierWood", 6); - recipe.AddIngredient(ItemID.Torch, 1); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GlacierWood", 6); + recipe.AddIngredient(ItemID.Torch, 1); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } } } \ No newline at end of file diff --git a/Ice/Items/Furniture/IceLanternTile.cs b/Ice/Items/Furniture/IceLanternTile.cs index 00f7cd7f..ec80f065 100644 --- a/Ice/Items/Furniture/IceLanternTile.cs +++ b/Ice/Items/Furniture/IceLanternTile.cs @@ -5,38 +5,40 @@ using Terraria.ModLoader; using Terraria.ObjectData; -namespace Tremor.Ice.Items.Furniture { -public class IceLanternTile : ModTile +namespace Tremor.Ice.Items.Furniture { - public override void SetDefaults() - { - Main.tileFrameImportant[Type] = true; - Main.tileNoAttach[Type] = true; - Main.tileLavaDeath[Type] = true; - TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2Top); - TileObjectData.newTile.Height = 2; - TileObjectData.newTile.CoordinateHeights = new int[]{16, 16}; - TileObjectData.newTile.StyleHorizontal = true; - TileObjectData.newTile.StyleWrapLimit = 111; - TileObjectData.addTile(Type); - dustType = -1; - Main.tileLighted[Type] = true; - AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); + public class IceLanternTile : ModTile + { + public override void SetDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileNoAttach[Type] = true; + Main.tileLavaDeath[Type] = true; + TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2Top); + TileObjectData.newTile.Height = 2; + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16 }; + TileObjectData.newTile.StyleHorizontal = true; + TileObjectData.newTile.StyleWrapLimit = 111; + TileObjectData.addTile(Type); + dustType = -1; + Main.tileLighted[Type] = true; + AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); AddMapEntry(new Color(87, 144, 165)); - } + } - public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) - { - r = 0.9f; - g = 0.9f; - b = 0.9f; - } + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + r = 0.9f; + g = 0.9f; + b = 0.9f; + } - public override void KillMultiTile(int i, int j, int frameX, int frameY) - { - if(frameX == 0) - { - Item.NewItem(i * 16, j * 16, 48, 48, mod.ItemType("IceLantern")); - } - } -}} \ No newline at end of file + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + if (frameX == 0) + { + Item.NewItem(i * 16, j * 16, 48, 48, mod.ItemType("IceLantern")); + } + } + } +} \ No newline at end of file diff --git a/Ice/Items/Furniture/IcePiano.cs b/Ice/Items/Furniture/IcePiano.cs index e16993ea..be2eca29 100644 --- a/Ice/Items/Furniture/IcePiano.cs +++ b/Ice/Items/Furniture/IcePiano.cs @@ -8,12 +8,12 @@ namespace Tremor.Ice.Items.Furniture { public class IcePiano : ModItem { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Glacier Wood Piano"); - Tooltip.SetDefault(""); - } - public override void SetDefaults() + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Glacier Wood Piano"); + Tooltip.SetDefault(""); + } + public override void SetDefaults() { item.width = 62; item.height = 32; @@ -23,21 +23,21 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("IcePianoTile"); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(154, 4); - recipe.AddIngredient(null, "GlacierWood", 15); - recipe.AddIngredient(149); - recipe.SetResult(this); - recipe.AddTile(106); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(154, 4); + recipe.AddIngredient(null, "GlacierWood", 15); + recipe.AddIngredient(149); + recipe.SetResult(this); + recipe.AddTile(106); + recipe.AddRecipe(); + } } } \ No newline at end of file diff --git a/Ice/Items/Furniture/IcePianoTile.cs b/Ice/Items/Furniture/IcePianoTile.cs index 34797ebc..78a801aa 100644 --- a/Ice/Items/Furniture/IcePianoTile.cs +++ b/Ice/Items/Furniture/IcePianoTile.cs @@ -17,7 +17,7 @@ public override void SetDefaults() Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style4x2); - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); AddMapEntry(new Color(87, 144, 165)); diff --git a/Ice/Items/Furniture/IcePlatform.cs b/Ice/Items/Furniture/IcePlatform.cs index 8199feb2..ffb47f3f 100644 --- a/Ice/Items/Furniture/IcePlatform.cs +++ b/Ice/Items/Furniture/IcePlatform.cs @@ -8,12 +8,12 @@ namespace Tremor.Ice.Items.Furniture { public class IcePlatform : ModItem { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Glacier Wood Platform"); - Tooltip.SetDefault(""); - } - public override void SetDefaults() + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Glacier Wood Platform"); + Tooltip.SetDefault(""); + } + public override void SetDefaults() { item.width = 16; item.height = 16; @@ -23,19 +23,19 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("IcePlatformTile"); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GlacierWood", 1); - recipe.SetResult(this, 2); - recipe.AddTile(18); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GlacierWood", 1); + recipe.SetResult(this, 2); + recipe.AddTile(18); + recipe.AddRecipe(); + } } } \ No newline at end of file diff --git a/Ice/Items/Furniture/IcePlatformTile.cs b/Ice/Items/Furniture/IcePlatformTile.cs index 18980dfd..6096f64b 100644 --- a/Ice/Items/Furniture/IcePlatformTile.cs +++ b/Ice/Items/Furniture/IcePlatformTile.cs @@ -18,7 +18,7 @@ public override void SetDefaults() Main.tileNoAttach[Type] = true; Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; - TileObjectData.newTile.CoordinateHeights = new int[]{ 16 }; + TileObjectData.newTile.CoordinateHeights = new int[] { 16 }; TileObjectData.newTile.CoordinateWidth = 16; TileObjectData.newTile.CoordinatePadding = 2; TileObjectData.newTile.StyleHorizontal = true; @@ -30,7 +30,7 @@ public override void SetDefaults() AddToArray(ref TileID.Sets.RoomNeeds.CountsAsDoor); AddMapEntry(new Color(87, 144, 165)); drop = mod.ItemType("IcePlatform"); - adjTiles = new int[]{ TileID.Platforms }; + adjTiles = new int[] { TileID.Platforms }; TileID.Sets.Platforms[Type] = true; } diff --git a/Ice/Items/Furniture/IceSink.cs b/Ice/Items/Furniture/IceSink.cs index 5f9fef4e..e5d9fd8a 100644 --- a/Ice/Items/Furniture/IceSink.cs +++ b/Ice/Items/Furniture/IceSink.cs @@ -8,12 +8,12 @@ namespace Tremor.Ice.Items.Furniture { public class IceSink : ModItem { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Glacier Wood Sink"); - Tooltip.SetDefault(""); - } - public override void SetDefaults() + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Glacier Wood Sink"); + Tooltip.SetDefault(""); + } + public override void SetDefaults() { item.width = 30; item.height = 32; @@ -23,20 +23,20 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("IceSinkTile"); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GlacierWood", 6); - recipe.AddIngredient(206); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GlacierWood", 6); + recipe.AddIngredient(206); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } } } \ No newline at end of file diff --git a/Ice/Items/Furniture/IceSinkTile.cs b/Ice/Items/Furniture/IceSinkTile.cs index 57585996..d49c5471 100644 --- a/Ice/Items/Furniture/IceSinkTile.cs +++ b/Ice/Items/Furniture/IceSinkTile.cs @@ -16,7 +16,7 @@ public override void SetDefaults() Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x2); - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); AddMapEntry(new Color(87, 144, 165)); diff --git a/Ice/Items/Furniture/IceTable.cs b/Ice/Items/Furniture/IceTable.cs index cfad6ffc..cb8f0d50 100644 --- a/Ice/Items/Furniture/IceTable.cs +++ b/Ice/Items/Furniture/IceTable.cs @@ -8,12 +8,12 @@ namespace Tremor.Ice.Items.Furniture { public class IceTable : ModItem { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Glacier Wood Table"); - Tooltip.SetDefault(""); - } - public override void SetDefaults() + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Glacier Wood Table"); + Tooltip.SetDefault(""); + } + public override void SetDefaults() { item.width = 48; item.height = 32; @@ -23,19 +23,19 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("IceTableTile"); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GlacierWood", 8); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GlacierWood", 8); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } } } \ No newline at end of file diff --git a/Ice/Items/Furniture/IceTableTile.cs b/Ice/Items/Furniture/IceTableTile.cs index 48880581..03fcc635 100644 --- a/Ice/Items/Furniture/IceTableTile.cs +++ b/Ice/Items/Furniture/IceTableTile.cs @@ -17,7 +17,7 @@ public override void SetDefaults() Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16 }; TileObjectData.addTile(Type); AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); AddMapEntry(new Color(87, 144, 165)); diff --git a/Ice/Items/Furniture/IceWorkbench.cs b/Ice/Items/Furniture/IceWorkbench.cs index b7f361f4..fe769d3b 100644 --- a/Ice/Items/Furniture/IceWorkbench.cs +++ b/Ice/Items/Furniture/IceWorkbench.cs @@ -8,12 +8,12 @@ namespace Tremor.Ice.Items.Furniture { public class IceWorkbench : ModItem { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Glacier Wood Work Bench"); - Tooltip.SetDefault(""); - } - public override void SetDefaults() + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Glacier Wood Work Bench"); + Tooltip.SetDefault(""); + } + public override void SetDefaults() { //item.name = "Glacier Wood Workbench"; item.width = 32; @@ -24,19 +24,19 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("IceWorkbenchTile"); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GlacierWood", 10); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GlacierWood", 10); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } } } \ No newline at end of file diff --git a/Ice/Items/Furniture/IceWorkbenchTile.cs b/Ice/Items/Furniture/IceWorkbenchTile.cs index 1a6611dc..e12f80f0 100644 --- a/Ice/Items/Furniture/IceWorkbenchTile.cs +++ b/Ice/Items/Furniture/IceWorkbenchTile.cs @@ -17,9 +17,9 @@ public override void SetDefaults() Main.tileTable[Type] = true; Main.tileLavaDeath[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style2x1); - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16 }; + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16 }; TileObjectData.addTile(Type); - adjTiles = new int[]{ TileID.WorkBenches }; + adjTiles = new int[] { TileID.WorkBenches }; AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); AddMapEntry(new Color(233, 211, 123)); } diff --git a/Ice/Items/GlacierArmchair.cs b/Ice/Items/GlacierArmchair.cs index a305fd94..73fddc67 100644 --- a/Ice/Items/GlacierArmchair.cs +++ b/Ice/Items/GlacierArmchair.cs @@ -4,40 +4,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Ice.Items { -public class GlacierArmchair : ModItem +namespace Tremor.Ice.Items { - public override void SetDefaults() - { + public class GlacierArmchair : ModItem + { + public override void SetDefaults() + { - item.width = 42; - item.height = 32; - item.maxStack = 99; - item.value = 100; - item.rare = 1; - item.createTile = mod.TileType("GlacierArmchairTile"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - } + item.width = 42; + item.height = 32; + item.maxStack = 99; + item.value = 100; + item.rare = 1; + item.createTile = mod.TileType("GlacierArmchairTile"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Glacier Wood Armchair"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Glacier Wood Armchair"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GlacierWood", 15); - recipe.AddIngredient(ItemID.Silk, 6); - recipe.SetResult(this); - recipe.AddTile(106); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GlacierWood", 15); + recipe.AddIngredient(ItemID.Silk, 6); + recipe.SetResult(this); + recipe.AddTile(106); + recipe.AddRecipe(); + } + } +} diff --git a/Ice/Items/GlacierArmchairTile.cs b/Ice/Items/GlacierArmchairTile.cs index c1b58c24..b2b08bb0 100644 --- a/Ice/Items/GlacierArmchairTile.cs +++ b/Ice/Items/GlacierArmchairTile.cs @@ -6,30 +6,32 @@ using Terraria.ModLoader; using Terraria.ObjectData; -namespace Tremor.Ice.Items { -public class GlacierArmchairTile : ModTile +namespace Tremor.Ice.Items { - public override void SetDefaults() - { - Main.tileFrameImportant[Type] = true; - Main.tileNoAttach[Type] = true; - Main.tileLavaDeath[Type] = true; - TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); - TileObjectData.newTile.CoordinateHeights = new int[]{16, 16}; - TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; - TileObjectData.newTile.StyleWrapLimit = 2; //not really necessary but allows me to add more subtypes of chairs below the example chair texture - TileObjectData.newTile.StyleMultiplier = 2; //same as above - TileObjectData.newTile.StyleHorizontal = true; - TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); - TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; //allows me to place example chairs facing the same way as the player - TileObjectData.addAlternate(1); //facing right will use the second texture style - TileObjectData.addTile(Type); - AddToArray(ref TileID.Sets.RoomNeeds.CountsAsChair); - AddMapEntry(new Color(116, 150, 252)); - } + public class GlacierArmchairTile : ModTile + { + public override void SetDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileNoAttach[Type] = true; + Main.tileLavaDeath[Type] = true; + TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2); + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16 }; + TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; + TileObjectData.newTile.StyleWrapLimit = 2; //not really necessary but allows me to add more subtypes of chairs below the example chair texture + TileObjectData.newTile.StyleMultiplier = 2; //same as above + TileObjectData.newTile.StyleHorizontal = true; + TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); + TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; //allows me to place example chairs facing the same way as the player + TileObjectData.addAlternate(1); //facing right will use the second texture style + TileObjectData.addTile(Type); + AddToArray(ref TileID.Sets.RoomNeeds.CountsAsChair); + AddMapEntry(new Color(116, 150, 252)); + } - public override void KillMultiTile(int i, int j, int frameX, int frameY) - { - Item.NewItem(i * 16, j * 16, 32, 16, mod.ItemType("GlacierArmchair")); - } -}} + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + Item.NewItem(i * 16, j * 16, 32, 16, mod.ItemType("GlacierArmchair")); + } + } +} diff --git a/Ice/Items/GlacierFence.cs b/Ice/Items/GlacierFence.cs index 16411dc8..ff46a6d2 100644 --- a/Ice/Items/GlacierFence.cs +++ b/Ice/Items/GlacierFence.cs @@ -4,37 +4,39 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Ice.Items { -public class GlacierFence : ModItem +namespace Tremor.Ice.Items { - public override void SetDefaults() - { + public class GlacierFence : ModItem + { + public override void SetDefaults() + { - item.width = 12; - item.height = 12; - item.maxStack = 999; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 7; - item.useStyle = 1; - item.consumable = true; - item.createWall = mod.WallType("GlacierFenceWall"); - } + item.width = 12; + item.height = 12; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 7; + item.useStyle = 1; + item.consumable = true; + item.createWall = mod.WallType("GlacierFenceWall"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Glacier Wood Fence"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Glacier Wood Fence"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GlacierWood", 1); - recipe.SetResult(this, 4); - recipe.AddTile(18); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GlacierWood", 1); + recipe.SetResult(this, 4); + recipe.AddTile(18); + recipe.AddRecipe(); + } + } +} diff --git a/Ice/Items/GlacierFenceWall.cs b/Ice/Items/GlacierFenceWall.cs index 828ca369..57fa67df 100644 --- a/Ice/Items/GlacierFenceWall.cs +++ b/Ice/Items/GlacierFenceWall.cs @@ -4,14 +4,16 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Ice.Items { -public class GlacierFenceWall : ModWall +namespace Tremor.Ice.Items { - public override void SetDefaults() - { - Main.wallHouse[Type] = true; - drop = mod.ItemType("GlacierFence"); - AddMapEntry(new Color(36, 43, 102)); - } + public class GlacierFenceWall : ModWall + { + public override void SetDefaults() + { + Main.wallHouse[Type] = true; + drop = mod.ItemType("GlacierFence"); + AddMapEntry(new Color(36, 43, 102)); + } -}} + } +} diff --git a/Ice/Items/GlacierKnives.cs b/Ice/Items/GlacierKnives.cs index e67693e1..b1b40a80 100644 --- a/Ice/Items/GlacierKnives.cs +++ b/Ice/Items/GlacierKnives.cs @@ -4,63 +4,65 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Ice.Items { -public class GlacierKnives : ModItem +namespace Tremor.Ice.Items { - public override void SetDefaults() - { + public class GlacierKnives : ModItem + { + public override void SetDefaults() + { - item.damage = 32; - item.magic = true; - item.width = 36; - item.mana = 11; - item.height = 46; + item.damage = 32; + item.magic = true; + item.width = 36; + item.mana = 11; + item.height = 46; - item.useTime = 19; - item.useAnimation = 19; - item.useStyle = 1; - item.noMelee = true; - item.noUseGraphic = true; - item.knockBack = 5; - item.value = 10000; - item.rare = 5; - item.UseSound = SoundID.Item20; - item.autoReuse = true; - item.shoot = mod.ProjectileType("GlacierKnivesProj"); - item.shootSpeed = 1f; - } + item.useTime = 19; + item.useAnimation = 19; + item.useStyle = 1; + item.noMelee = true; + item.noUseGraphic = true; + item.knockBack = 5; + item.value = 10000; + item.rare = 5; + item.UseSound = SoundID.Item20; + item.autoReuse = true; + item.shoot = mod.ProjectileType("GlacierKnivesProj"); + item.shootSpeed = 1f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Glacier Knives"); - Tooltip.SetDefault("Spreads out glacier knives"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Glacier Knives"); + Tooltip.SetDefault("Spreads out glacier knives"); + } - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - int ShotAmt = 5; - int spread = 15; - float spreadMult = 0.35f; + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + int ShotAmt = 5; + int spread = 15; + float spreadMult = 0.35f; Vector2 vector2 = new Vector2(); - - for(int i = 0; i < ShotAmt; i++) - { - float vX = 8*speedX+(float)Main.rand.Next(-spread,spread+1) * spreadMult; - float vY = 8*speedY+(float)Main.rand.Next(-spread,spread+1) * spreadMult; - - float angle = (float)Math.Atan(vY/vX); - vector2 = new Vector2(position.X+75f*(float)Math.Cos(angle), position.Y+75f*(float)Math.Sin(angle)); + + for (int i = 0; i < ShotAmt; i++) + { + float vX = 8 * speedX + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + float vY = 8 * speedY + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + + float angle = (float)Math.Atan(vY / vX); + vector2 = new Vector2(position.X + 75f * (float)Math.Cos(angle), position.Y + 75f * (float)Math.Sin(angle)); float mouseX = (float)Main.mouseX + Main.screenPosition.X; - if(mouseX < player.position.X) + if (mouseX < player.position.X) { - vector2 = new Vector2(position.X-75f*(float)Math.Cos(angle), position.Y-75f*(float)Math.Sin(angle)); + vector2 = new Vector2(position.X - 75f * (float)Math.Cos(angle), position.Y - 75f * (float)Math.Sin(angle)); } - Projectile.NewProjectile(vector2.X,vector2.Y,vX,vY,mod.ProjectileType("GlacierKnivesProj"),damage,knockBack,Main.myPlayer); + Projectile.NewProjectile(vector2.X, vector2.Y, vX, vY, mod.ProjectileType("GlacierKnivesProj"), damage, knockBack, Main.myPlayer); + - - } - return false; - } -}} + } + return false; + } + } +} diff --git a/Ice/Items/GlacierKnivesProj.cs b/Ice/Items/GlacierKnivesProj.cs index 4748dded..6e71aabf 100644 --- a/Ice/Items/GlacierKnivesProj.cs +++ b/Ice/Items/GlacierKnivesProj.cs @@ -3,66 +3,67 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Ice.Items { -public class GlacierKnivesProj : ModProjectile +namespace Tremor.Ice.Items { - public override void SetDefaults() - { - projectile.width = 10; - projectile.height = 26; - projectile.friendly = true; - projectile.magic = false; - projectile.penetrate = 1; - projectile.tileCollide = true; - projectile.hostile = false; - projectile.timeLeft = 1000; - projectile.aiStyle = 2; - } + public class GlacierKnivesProj : ModProjectile + { + public override void SetDefaults() + { + projectile.width = 10; + projectile.height = 26; + projectile.friendly = true; + projectile.magic = false; + projectile.penetrate = 1; + projectile.tileCollide = true; + projectile.hostile = false; + projectile.timeLeft = 1000; + projectile.aiStyle = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Glacier Knives"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Glacier Knives"); + } - public override void AI() - { + public override void AI() + { - float num472 = projectile.Center.X; - float num473 = projectile.Center.Y; - float num474 = 400f; - bool flag17 = false; - for (int num475 = 0; num475 < 200; num475++) - { - if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1)) - { - float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2); - float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2); - float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); - if (num478 < num474) - { - num474 = num478; - num472 = num476; - num473 = num477; - flag17 = true; - } - } - } - if (flag17) - { - float num483 = 8f; - Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num484 = num472 - vector35.X; - float num485 = num473 - vector35.Y; - float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485)); - num486 = num483 / num486; - num484 *= num486; - num485 *= num486; - projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f; - projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f; - return; - } - } + float num472 = projectile.Center.X; + float num473 = projectile.Center.Y; + float num474 = 400f; + bool flag17 = false; + for (int num475 = 0; num475 < 200; num475++) + { + if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1)) + { + float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2); + float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2); + float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); + if (num478 < num474) + { + num474 = num478; + num472 = num476; + num473 = num477; + flag17 = true; + } + } + } + if (flag17) + { + float num483 = 8f; + Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num484 = num472 - vector35.X; + float num485 = num473 - vector35.Y; + float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485)); + num486 = num483 / num486; + num484 *= num486; + num485 *= num486; + projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f; + projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f; + return; + } + } - } + } } diff --git a/Ice/Items/GlacierWood.cs b/Ice/Items/GlacierWood.cs index 071271ab..41c6de4a 100644 --- a/Ice/Items/GlacierWood.cs +++ b/Ice/Items/GlacierWood.cs @@ -1,46 +1,47 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Ice.Items { +namespace Tremor.Ice.Items +{ public class GlacierWood : ModItem { public override void SetDefaults() { item.width = 12; - item.value = 1; + item.value = 1; item.height = 12; item.maxStack = 999; item.useTurn = true; item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.rare = 1; + item.rare = 1; item.useStyle = 1; item.consumable = true; item.createTile = mod.TileType("GlacierWoodTile"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Glacier Wood"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Glacier Wood"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GlacierWoodWall", 4); - recipe.SetResult(this, 1); - recipe.AddTile(18); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GlacierWoodWall", 4); + recipe.SetResult(this, 1); + recipe.AddTile(18); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GlacierFence", 4); - recipe.SetResult(this, 1); - recipe.AddTile(18); - recipe.AddRecipe(); - } + recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GlacierFence", 4); + recipe.SetResult(this, 1); + recipe.AddTile(18); + recipe.AddRecipe(); + } } } diff --git a/Ice/Items/GlacierWoodBow.cs b/Ice/Items/GlacierWoodBow.cs index f23300cf..a6a41f56 100644 --- a/Ice/Items/GlacierWoodBow.cs +++ b/Ice/Items/GlacierWoodBow.cs @@ -5,47 +5,49 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Ice.Items { -public class GlacierWoodBow : ModItem +namespace Tremor.Ice.Items { - public override void SetDefaults() - { + public class GlacierWoodBow : ModItem + { + public override void SetDefaults() + { - item.damage = 9; - item.ranged = true; - item.width = 16; - item.height = 32; - item.useTime = 29; - item.shoot = 1; - item.shootSpeed = 11f; - item.useAnimation = 29; - item.useStyle = 5; - item.knockBack = 0; - item.value = 20; - item.useAmmo = AmmoID.Arrow; - item.rare = 1; - item.UseSound = SoundID.Item5; - item.autoReuse = false; - } + item.damage = 9; + item.ranged = true; + item.width = 16; + item.height = 32; + item.useTime = 29; + item.shoot = 1; + item.shootSpeed = 11f; + item.useAnimation = 29; + item.useStyle = 5; + item.knockBack = 0; + item.value = 20; + item.useAmmo = AmmoID.Arrow; + item.rare = 1; + item.UseSound = SoundID.Item5; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Glacier Wood Bow"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Glacier Wood Bow"); + Tooltip.SetDefault(""); + } - public override Vector2? HoldoutOffset() - { - return new Vector2(-1, 0); - } + public override Vector2? HoldoutOffset() + { + return new Vector2(-1, 0); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GlacierWood", 10); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GlacierWood", 10); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } + } +} diff --git a/Ice/Items/GlacierWoodChestplate.cs b/Ice/Items/GlacierWoodChestplate.cs index c0b8b1e2..392b572a 100644 --- a/Ice/Items/GlacierWoodChestplate.cs +++ b/Ice/Items/GlacierWoodChestplate.cs @@ -5,33 +5,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Ice.Items { -[AutoloadEquip(EquipType.Body)] -public class GlacierWoodChestplate : ModItem +namespace Tremor.Ice.Items { - public override void SetDefaults() - { + [AutoloadEquip(EquipType.Body)] + public class GlacierWoodChestplate : ModItem + { + public override void SetDefaults() + { - item.width = 26; - item.height = 18; - item.value = 600; - item.rare = 1; - item.defense = 3; - } + item.width = 26; + item.height = 18; + item.value = 600; + item.rare = 1; + item.defense = 3; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Glacier Wood Chestplate"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Glacier Wood Chestplate"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GlacierWood", 30); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GlacierWood", 30); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } + } +} diff --git a/Ice/Items/GlacierWoodHammer.cs b/Ice/Items/GlacierWoodHammer.cs index f6f74357..33e014b3 100644 --- a/Ice/Items/GlacierWoodHammer.cs +++ b/Ice/Items/GlacierWoodHammer.cs @@ -4,41 +4,43 @@ using Terraria.ModLoader; using Terraria.ID; -namespace Tremor.Ice.Items { -public class GlacierWoodHammer : ModItem +namespace Tremor.Ice.Items { - public override void SetDefaults() - { + public class GlacierWoodHammer : ModItem + { + public override void SetDefaults() + { - item.damage = 2; - item.melee = true; - item.width = 32; - item.height = 32; - item.useTime = 36; - item.useAnimation = 36; - item.useStyle = 1; - item.knockBack = 5; - item.value = 10; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - item.hammer = 25; - } + item.damage = 2; + item.melee = true; + item.width = 32; + item.height = 32; + item.useTime = 36; + item.useAnimation = 36; + item.useStyle = 1; + item.knockBack = 5; + item.value = 10; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + item.hammer = 25; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Glacier Wood Hammer"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Glacier Wood Hammer"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GlacierWood", 8); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GlacierWood", 8); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } -}} + } +} diff --git a/Ice/Items/GlacierWoodHelmet.cs b/Ice/Items/GlacierWoodHelmet.cs index 74196cd5..a194d0fa 100644 --- a/Ice/Items/GlacierWoodHelmet.cs +++ b/Ice/Items/GlacierWoodHelmet.cs @@ -4,44 +4,46 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Ice.Items { -[AutoloadEquip(EquipType.Head)] -public class GlacierWoodHelmet : ModItem +namespace Tremor.Ice.Items { - public override void SetDefaults() - { + [AutoloadEquip(EquipType.Head)] + public class GlacierWoodHelmet : ModItem + { + public override void SetDefaults() + { - item.width = 32; - item.height = 26; - item.value = 400; - item.rare = 1; - item.defense = 2; - } + item.width = 32; + item.height = 26; + item.value = 400; + item.rare = 1; + item.defense = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Glacier Wood Helmet"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Glacier Wood Helmet"); + Tooltip.SetDefault(""); + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("GlacierWoodChestplate") && legs.type == mod.ItemType("GlacierWoodLeggings"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("GlacierWoodChestplate") && legs.type == mod.ItemType("GlacierWoodLeggings"); + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "1 defense"; - player.statDefense += 1; - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "1 defense"; + player.statDefense += 1; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GlacierWood", 20); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GlacierWood", 20); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } + } +} diff --git a/Ice/Items/GlacierWoodLeggings.cs b/Ice/Items/GlacierWoodLeggings.cs index 33df87a2..4059c07c 100644 --- a/Ice/Items/GlacierWoodLeggings.cs +++ b/Ice/Items/GlacierWoodLeggings.cs @@ -4,33 +4,35 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Ice.Items { -[AutoloadEquip(EquipType.Legs)] -public class GlacierWoodLeggings : ModItem +namespace Tremor.Ice.Items { - public override void SetDefaults() - { + [AutoloadEquip(EquipType.Legs)] + public class GlacierWoodLeggings : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 18; - item.value = 500; - item.rare = 1; - item.defense = 2; - } + item.width = 22; + item.height = 18; + item.value = 500; + item.rare = 1; + item.defense = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Glacier Wood Leggings"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Glacier Wood Leggings"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GlacierWood", 25); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GlacierWood", 25); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } + } +} diff --git a/Ice/Items/GlacierWoodShield.cs b/Ice/Items/GlacierWoodShield.cs index ac01414e..982a1e0a 100644 --- a/Ice/Items/GlacierWoodShield.cs +++ b/Ice/Items/GlacierWoodShield.cs @@ -5,33 +5,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Ice.Items { -[AutoloadEquip(EquipType.Shield)] -public class GlacierWoodShield : ModItem +namespace Tremor.Ice.Items { - public override void SetDefaults() - { + [AutoloadEquip(EquipType.Shield)] + public class GlacierWoodShield : ModItem + { + public override void SetDefaults() + { - item.width = 24; - item.height = 24; - item.value = 110; - item.rare = 0; - item.accessory = true; - item.defense = 2; - } + item.width = 24; + item.height = 24; + item.value = 110; + item.rare = 0; + item.accessory = true; + item.defense = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Glacier Wood Shield"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Glacier Wood Shield"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GlacierWood", 15); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GlacierWood", 15); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } + } +} diff --git a/Ice/Items/GlacierWoodSword.cs b/Ice/Items/GlacierWoodSword.cs index 1d6b9060..4c6d8b37 100644 --- a/Ice/Items/GlacierWoodSword.cs +++ b/Ice/Items/GlacierWoodSword.cs @@ -4,40 +4,42 @@ using Terraria.ModLoader; using Terraria.ID; -namespace Tremor.Ice.Items { -public class GlacierWoodSword : ModItem +namespace Tremor.Ice.Items { - public override void SetDefaults() - { + public class GlacierWoodSword : ModItem + { + public override void SetDefaults() + { - item.damage = 10; - item.melee = true; - item.width = 32; - item.height = 32; - item.useTime = 24; - item.useAnimation = 24; - item.useStyle = 1; - item.knockBack = 4; - item.value = 20; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 10; + item.melee = true; + item.width = 32; + item.height = 32; + item.useTime = 24; + item.useAnimation = 24; + item.useStyle = 1; + item.knockBack = 4; + item.value = 20; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Glacier Wood Sword"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Glacier Wood Sword"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GlacierWood", 7); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GlacierWood", 7); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } -}} + } +} diff --git a/Ice/Items/GlacierWoodTile.cs b/Ice/Items/GlacierWoodTile.cs index 0bb5f18f..bd4e5739 100644 --- a/Ice/Items/GlacierWoodTile.cs +++ b/Ice/Items/GlacierWoodTile.cs @@ -4,24 +4,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Ice.Items { -public class GlacierWoodTile : ModTile +namespace Tremor.Ice.Items { - public override void SetDefaults() - { - Main.tileSolid[Type] = true; - Main.tileMergeDirt[Type] = true; - Main.tileBlockLight[Type] = true; - Main.tileLighted[Type] = true; - dustType = 80; - AddMapEntry(new Color(0, 191, 255)); - drop = mod.ItemType("GlacierWood"); -Main.tileMerge[Type][mod.TileType("IceBlock")] = true; -Main.tileMerge[Type][161] = true; -Main.tileMerge[Type][162] = true; -Main.tileMerge[Type][163] = true; -Main.tileMerge[Type][164] = true; -Main.tileMerge[Type][147] = true; - } + public class GlacierWoodTile : ModTile + { + public override void SetDefaults() + { + Main.tileSolid[Type] = true; + Main.tileMergeDirt[Type] = true; + Main.tileBlockLight[Type] = true; + Main.tileLighted[Type] = true; + dustType = 80; + AddMapEntry(new Color(0, 191, 255)); + drop = mod.ItemType("GlacierWood"); + Main.tileMerge[Type][mod.TileType("IceBlock")] = true; + Main.tileMerge[Type][161] = true; + Main.tileMerge[Type][162] = true; + Main.tileMerge[Type][163] = true; + Main.tileMerge[Type][164] = true; + Main.tileMerge[Type][147] = true; + } -}} + } +} diff --git a/Ice/Items/GlacierWoodWall.cs b/Ice/Items/GlacierWoodWall.cs index dc5666c7..8829746b 100644 --- a/Ice/Items/GlacierWoodWall.cs +++ b/Ice/Items/GlacierWoodWall.cs @@ -4,37 +4,39 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Ice.Items { -public class GlacierWoodWall : ModItem +namespace Tremor.Ice.Items { - public override void SetDefaults() - { + public class GlacierWoodWall : ModItem + { + public override void SetDefaults() + { - item.width = 12; - item.height = 12; - item.maxStack = 999; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 7; - item.useStyle = 1; - item.consumable = true; - item.createWall = mod.WallType("GlacierWoodWallWall"); - } + item.width = 12; + item.height = 12; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 7; + item.useStyle = 1; + item.consumable = true; + item.createWall = mod.WallType("GlacierWoodWallWall"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Glacier Wood Wall"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Glacier Wood Wall"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GlacierWood", 1); - recipe.SetResult(this, 4); - recipe.AddTile(18); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GlacierWood", 1); + recipe.SetResult(this, 4); + recipe.AddTile(18); + recipe.AddRecipe(); + } + } +} diff --git a/Ice/Items/GlacierWoodWallWall.cs b/Ice/Items/GlacierWoodWallWall.cs index 284f050f..8b0472a9 100644 --- a/Ice/Items/GlacierWoodWallWall.cs +++ b/Ice/Items/GlacierWoodWallWall.cs @@ -4,14 +4,16 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Ice.Items { -public class GlacierWoodWallWall : ModWall +namespace Tremor.Ice.Items { - public override void SetDefaults() - { - Main.wallHouse[Type] = true; - drop = mod.ItemType("GlacierWoodWall"); - AddMapEntry(new Color(36, 43, 102)); - } + public class GlacierWoodWallWall : ModWall + { + public override void SetDefaults() + { + Main.wallHouse[Type] = true; + drop = mod.ItemType("GlacierWoodWall"); + AddMapEntry(new Color(36, 43, 102)); + } -}} + } +} diff --git a/Ice/Items/IceCross.cs b/Ice/Items/IceCross.cs index 762830d7..138cadf4 100644 --- a/Ice/Items/IceCross.cs +++ b/Ice/Items/IceCross.cs @@ -5,33 +5,35 @@ using Terraria.ModLoader; using Microsoft.Xna.Framework; -namespace Tremor.Ice.Items { -public class IceCross : ModItem +namespace Tremor.Ice.Items { - public override void SetDefaults() - { + public class IceCross : ModItem + { + public override void SetDefaults() + { - item.damage = 21; - item.width = 26; - item.height = 24; - item.magic = true; - item.mana = 40; - item.useTime = 35; - item.shoot = mod.ProjectileType("Icoj"); - item.shootSpeed = 0f; - item.useAnimation = 35; - item.useStyle = 1; - item.value = 1000; - item.rare = 1; - item.UseSound = SoundID.Item43; + item.damage = 21; + item.width = 26; + item.height = 24; + item.magic = true; + item.mana = 40; + item.useTime = 35; + item.shoot = mod.ProjectileType("Icoj"); + item.shootSpeed = 0f; + item.useAnimation = 35; + item.useStyle = 1; + item.value = 1000; + item.rare = 1; + item.UseSound = SoundID.Item43; - item.autoReuse = false; - } + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ice Cross"); - Tooltip.SetDefault("Summons an giant stationary frozen boulder that damages enemies and explodes into icicles after some time"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ice Cross"); + Tooltip.SetDefault("Summons an giant stationary frozen boulder that damages enemies and explodes into icicles after some time"); + } -}} + } +} diff --git a/Ice/Items/Icicle.cs b/Ice/Items/Icicle.cs index edc43ca1..76113dea 100644 --- a/Ice/Items/Icicle.cs +++ b/Ice/Items/Icicle.cs @@ -3,23 +3,25 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Ice.Items { -public class Icicle : ModItem +namespace Tremor.Ice.Items { - public override void SetDefaults() - { + public class Icicle : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 999; - item.value = 60; - item.rare = 1; - } + item.width = 30; + item.height = 24; + item.maxStack = 999; + item.value = 60; + item.rare = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Icicle"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Icicle"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Ice/Items/Icoj.cs b/Ice/Items/Icoj.cs index 710fe750..7f2f14e3 100644 --- a/Ice/Items/Icoj.cs +++ b/Ice/Items/Icoj.cs @@ -8,11 +8,11 @@ namespace Tremor.Ice.Items { public class Icoj : ModProjectile { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ice Proj"); - } - float rotationProj = 0.0f; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ice Proj"); + } + float rotationProj = 0.0f; public override void SetDefaults() { projectile.width = 92; @@ -32,31 +32,31 @@ public override void SetDefaults() //aiType = ProjectileID.Bullet; } - int timer = 0; + int timer = 0; public override void AI() { timer++; rotationProj += 0.097f; - projectile.rotation = rotationProj; - projectile.velocity.X = 0f; + projectile.rotation = rotationProj; + projectile.velocity.X = 0f; projectile.velocity.Y = 0f; - + if (timer >= 350) { projectile.alpha++; projectile.alpha++; } - - if(projectile.alpha >= 255) + + if (projectile.alpha >= 255) { - Projectile.NewProjectile(projectile.position.X+40, projectile.position.Y+40, -7,0, 119, projectile.damage, 0, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(projectile.position.X+40, projectile.position.Y+40, 7, 0, 119, projectile.damage, 0, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(projectile.position.X+40, projectile.position.Y+40, 0, 7, 119, projectile.damage, 0, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(projectile.position.X+40, projectile.position.Y+40, 0, -7, 119, projectile.damage, 0, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(projectile.position.X+40, projectile.position.Y+40, -7,-7, 119, projectile.damage, 0, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(projectile.position.X+40, projectile.position.Y+40, 7, -7, 119, projectile.damage, 0, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(projectile.position.X+40, projectile.position.Y+40, -7, 7, 119, projectile.damage, 0, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(projectile.position.X+40, projectile.position.Y+40, 7, 7, 119, projectile.damage, 0, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(projectile.position.X + 40, projectile.position.Y + 40, -7, 0, 119, projectile.damage, 0, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(projectile.position.X + 40, projectile.position.Y + 40, 7, 0, 119, projectile.damage, 0, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(projectile.position.X + 40, projectile.position.Y + 40, 0, 7, 119, projectile.damage, 0, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(projectile.position.X + 40, projectile.position.Y + 40, 0, -7, 119, projectile.damage, 0, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(projectile.position.X + 40, projectile.position.Y + 40, -7, -7, 119, projectile.damage, 0, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(projectile.position.X + 40, projectile.position.Y + 40, 7, -7, 119, projectile.damage, 0, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(projectile.position.X + 40, projectile.position.Y + 40, -7, 7, 119, projectile.damage, 0, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(projectile.position.X + 40, projectile.position.Y + 40, 7, 7, 119, projectile.damage, 0, Main.myPlayer, 0f, 0f); projectile.Kill(); } } diff --git a/Ice/Mobs/ColdtrapChain.cs b/Ice/Mobs/ColdtrapChain.cs index 2be38709..ca8a0800 100644 --- a/Ice/Mobs/ColdtrapChain.cs +++ b/Ice/Mobs/ColdtrapChain.cs @@ -5,282 +5,284 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Ice.Mobs { -public class ColdtrapChain : ModProjectile +namespace Tremor.Ice.Mobs { - public float width - { - get - { - return projectile.ai[0]; - } - set - { - projectile.ai[0] = value; - } - } - public float length - { - get - { - return projectile.ai[1]; - } - set - { - projectile.ai[1] = value; - } - } - public float minAngle - { - get - { - return projectile.localAI[0]; - } - set - { - projectile.localAI[0] = value; - } - } - public float maxAngle - { - get - { - return projectile.localAI[1]; - } - set - { - projectile.localAI[1] = value; - } - } - public float angleSpeed = 0f; - public float lengthSpeed = 0f; - public int arm = -1; - private int netUpdateCounter = 0; - private const float maxAngleSpeed = 0.1f; - private const float angleBuffer = (float)Math.PI / 12f; - public const float minLength = 80f; - private const float maxLength = 400f; - private const float maxLengthSpeed = 2.5f; + public class ColdtrapChain : ModProjectile + { + public float width + { + get + { + return projectile.ai[0]; + } + set + { + projectile.ai[0] = value; + } + } + public float length + { + get + { + return projectile.ai[1]; + } + set + { + projectile.ai[1] = value; + } + } + public float minAngle + { + get + { + return projectile.localAI[0]; + } + set + { + projectile.localAI[0] = value; + } + } + public float maxAngle + { + get + { + return projectile.localAI[1]; + } + set + { + projectile.localAI[1] = value; + } + } + public float angleSpeed = 0f; + public float lengthSpeed = 0f; + public int arm = -1; + private int netUpdateCounter = 0; + private const float maxAngleSpeed = 0.1f; + private const float angleBuffer = (float)Math.PI / 12f; + public const float minLength = 80f; + private const float maxLength = 400f; + private const float maxLengthSpeed = 2.5f; public override void SetStaticDefaults() { DisplayName.SetDefault("Coldtrap"); } - - public override void SetDefaults() - { - projectile.width = 1; - projectile.height = 1; - projectile.hostile = true; - projectile.timeLeft = 2; - projectile.penetrate = -1; - projectile.tileCollide = false; - projectile.ignoreWater = true; - } - public override void AI() - { - NPC npc = Main.npc[arm]; - if(!npc.active || npc.type != mod.NPCType("Dot")) - { - return; - } - projectile.timeLeft = 2; - Player player = Main.player[npc.target]; - projectile.position = npc.Center; - Vector2 offset = player.Center - projectile.position; - float distance = offset.Length() + 32f; + public override void SetDefaults() + { + projectile.width = 1; + projectile.height = 1; + projectile.hostile = true; + projectile.timeLeft = 2; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.ignoreWater = true; + } - Angle currAngle = new Angle(projectile.rotation); - Angle angleToPlayer = new Angle((float)Math.Atan2(offset.Y, offset.X)); - Angle min = new Angle(minAngle); - Angle max = new Angle(maxAngle); - Angle limit = new Angle((minAngle + maxAngle) / 2f); - if(limit.Between(min, max)) - { - limit = limit.Opposite(); - } - Angle buffer = new Angle(angleBuffer); + public override void AI() + { + NPC npc = Main.npc[arm]; + if (!npc.active || npc.type != mod.NPCType("Dot")) + { + return; + } + projectile.timeLeft = 2; + Player player = Main.player[npc.target]; + projectile.position = npc.Center; + Vector2 offset = player.Center - projectile.position; + float distance = offset.Length() + 32f; - if(angleToPlayer.Between(min - buffer, max + buffer)) - { - if(currAngle.Between(max, limit)) - { - angleSpeed -= maxAngleSpeed / 10f; - } - else if(currAngle.Between(limit, min)) - { - angleSpeed += maxAngleSpeed / 10f; - } - else if(currAngle.ClockwiseFrom(angleToPlayer)) - { - angleSpeed += maxAngleSpeed / 10f; - } - else - { - angleSpeed -= maxAngleSpeed / 10f; - } + Angle currAngle = new Angle(projectile.rotation); + Angle angleToPlayer = new Angle((float)Math.Atan2(offset.Y, offset.X)); + Angle min = new Angle(minAngle); + Angle max = new Angle(maxAngle); + Angle limit = new Angle((minAngle + maxAngle) / 2f); + if (limit.Between(min, max)) + { + limit = limit.Opposite(); + } + Angle buffer = new Angle(angleBuffer); - if(length > maxLength) - { - lengthSpeed -= maxLengthSpeed / 10f; - } - else if(length < minLength) - { - lengthSpeed += maxLengthSpeed / 10f; - } - else if(distance > length) - { - lengthSpeed += maxLengthSpeed / 10f; - } - else if(distance < length) - { - lengthSpeed -= maxLengthSpeed / 10f; - } - } - else - { - if(currAngle.Between(max, limit)) - { - angleSpeed -= maxAngleSpeed / 10f; - } - else if(currAngle.Between(limit, min)) - { - angleSpeed += maxAngleSpeed / 10f; - } - else if(angleSpeed > 0f) - { - angleSpeed += maxAngleSpeed / 20f; - } - else if(angleSpeed < 0f) - { - angleSpeed -= maxAngleSpeed / 20f; - } - else - { - angleSpeed = maxAngleSpeed / 20f; - } + if (angleToPlayer.Between(min - buffer, max + buffer)) + { + if (currAngle.Between(max, limit)) + { + angleSpeed -= maxAngleSpeed / 10f; + } + else if (currAngle.Between(limit, min)) + { + angleSpeed += maxAngleSpeed / 10f; + } + else if (currAngle.ClockwiseFrom(angleToPlayer)) + { + angleSpeed += maxAngleSpeed / 10f; + } + else + { + angleSpeed -= maxAngleSpeed / 10f; + } - if(length > minLength) - { - lengthSpeed -= maxLengthSpeed / 10f; - } - else - { - lengthSpeed += maxLengthSpeed / 10f; - } - } + if (length > maxLength) + { + lengthSpeed -= maxLengthSpeed / 10f; + } + else if (length < minLength) + { + lengthSpeed += maxLengthSpeed / 10f; + } + else if (distance > length) + { + lengthSpeed += maxLengthSpeed / 10f; + } + else if (distance < length) + { + lengthSpeed -= maxLengthSpeed / 10f; + } + } + else + { + if (currAngle.Between(max, limit)) + { + angleSpeed -= maxAngleSpeed / 10f; + } + else if (currAngle.Between(limit, min)) + { + angleSpeed += maxAngleSpeed / 10f; + } + else if (angleSpeed > 0f) + { + angleSpeed += maxAngleSpeed / 20f; + } + else if (angleSpeed < 0f) + { + angleSpeed -= maxAngleSpeed / 20f; + } + else + { + angleSpeed = maxAngleSpeed / 20f; + } - if(angleSpeed > maxAngleSpeed) - { - angleSpeed = maxAngleSpeed; - } - else if(angleSpeed < -maxAngleSpeed) - { - angleSpeed = -maxAngleSpeed; - } - if(lengthSpeed > maxLengthSpeed) - { - lengthSpeed = maxLengthSpeed; - } - else if(lengthSpeed < -maxLengthSpeed) - { - lengthSpeed = -maxLengthSpeed; - } - projectile.rotation += angleSpeed; - length += lengthSpeed; + if (length > minLength) + { + lengthSpeed -= maxLengthSpeed / 10f; + } + else + { + lengthSpeed += maxLengthSpeed / 10f; + } + } - if(Main.netMode == 2) - { - netUpdateCounter++; - if(netUpdateCounter >= 300) - { - projectile.netUpdate = true; - netUpdateCounter = 0; - } - } - } + if (angleSpeed > maxAngleSpeed) + { + angleSpeed = maxAngleSpeed; + } + else if (angleSpeed < -maxAngleSpeed) + { + angleSpeed = -maxAngleSpeed; + } + if (lengthSpeed > maxLengthSpeed) + { + lengthSpeed = maxLengthSpeed; + } + else if (lengthSpeed < -maxLengthSpeed) + { + lengthSpeed = -maxLengthSpeed; + } + projectile.rotation += angleSpeed; + length += lengthSpeed; - public override void SendExtraAI(BinaryWriter writer) - { - writer.Write(projectile.rotation); - writer.Write(minAngle); - writer.Write(maxAngle); - writer.Write(angleSpeed); - writer.Write(lengthSpeed); - writer.Write((short)arm); - } + if (Main.netMode == 2) + { + netUpdateCounter++; + if (netUpdateCounter >= 300) + { + projectile.netUpdate = true; + netUpdateCounter = 0; + } + } + } - public override void ReceiveExtraAI(BinaryReader reader) - { - projectile.rotation = reader.ReadSingle(); - minAngle = reader.ReadSingle(); - maxAngle = reader.ReadSingle(); - angleSpeed = reader.ReadSingle(); - lengthSpeed = reader.ReadSingle(); - arm = reader.ReadInt16(); - } + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(projectile.rotation); + writer.Write(minAngle); + writer.Write(maxAngle); + writer.Write(angleSpeed); + writer.Write(lengthSpeed); + writer.Write((short)arm); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + projectile.rotation = reader.ReadSingle(); + minAngle = reader.ReadSingle(); + maxAngle = reader.ReadSingle(); + angleSpeed = reader.ReadSingle(); + lengthSpeed = reader.ReadSingle(); + arm = reader.ReadInt16(); + } - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) - { - float point = 0f; - return Collision.CheckAABBvLineCollision(new Vector2(targetHitbox.X, targetHitbox.Y), new Vector2(targetHitbox.Width, targetHitbox.Height), projectile.position, projectile.position + length * new Vector2((float)Math.Cos(projectile.rotation), (float)Math.Sin(projectile.rotation)), width, ref point); - } + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + float point = 0f; + return Collision.CheckAABBvLineCollision(new Vector2(targetHitbox.X, targetHitbox.Y), new Vector2(targetHitbox.Width, targetHitbox.Height), projectile.position, projectile.position + length * new Vector2((float)Math.Cos(projectile.rotation), (float)Math.Sin(projectile.rotation)), width, ref point); + } - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.AddBuff(44, 840); - projectile.rotation %= 2f * (float)Math.PI; - if(projectile.rotation % (float)Math.PI == 0f) - { - projectile.direction = -target.direction; - } - else if(projectile.rotation % (float)Math.PI / 2f == 0f) - { - projectile.direction = target.Center.X < projectile.position.X ? -1 : 1; - } - else - { - float yOffset = target.Center.Y - projectile.position.Y; - float x = projectile.position.X + yOffset / (float)Math.Tan(projectile.rotation); - projectile.direction = target.Center.X < x ? -1 : 1; - } - } + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.AddBuff(44, 840); + projectile.rotation %= 2f * (float)Math.PI; + if (projectile.rotation % (float)Math.PI == 0f) + { + projectile.direction = -target.direction; + } + else if (projectile.rotation % (float)Math.PI / 2f == 0f) + { + projectile.direction = target.Center.X < projectile.position.X ? -1 : 1; + } + else + { + float yOffset = target.Center.Y - projectile.position.Y; + float x = projectile.position.X + yOffset / (float)Math.Tan(projectile.rotation); + projectile.direction = target.Center.X < x ? -1 : 1; + } + } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Texture2D unit = Main.projectileTexture[projectile.type]; - int unitLength = unit.Width; - int numUnits = (int)Math.Ceiling(length / unitLength); - float increment = 0f; - if(numUnits > 1) - { - increment = (length - unitLength) / (numUnits - 1); - } - Vector2 direction = new Vector2((float)Math.Cos(projectile.rotation), (float)Math.Sin(projectile.rotation)); - SpriteEffects effects = SpriteEffects.None; - if(projectile.spriteDirection == -1) - { - effects = SpriteEffects.FlipVertically; - } - for(int k = 1; k <= numUnits; k++) - { - Texture2D image = unit; - if(k == numUnits) - { - image = mod.GetTexture("Ice/Mobs/Coldtrap"); - } - Vector2 pos = projectile.position + direction * (increment * (k - 1) + unitLength / 2f); - Color color = Lighting.GetColor((int)(pos.X / 16f), (int)(pos.Y / 16f)); - spriteBatch.Draw(image, pos - Main.screenPosition, null, projectile.GetAlpha(color), projectile.rotation, new Vector2(unit.Width / 2, unit.Height / 2), 1f, effects, 0f); - } - return false; - } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D unit = Main.projectileTexture[projectile.type]; + int unitLength = unit.Width; + int numUnits = (int)Math.Ceiling(length / unitLength); + float increment = 0f; + if (numUnits > 1) + { + increment = (length - unitLength) / (numUnits - 1); + } + Vector2 direction = new Vector2((float)Math.Cos(projectile.rotation), (float)Math.Sin(projectile.rotation)); + SpriteEffects effects = SpriteEffects.None; + if (projectile.spriteDirection == -1) + { + effects = SpriteEffects.FlipVertically; + } + for (int k = 1; k <= numUnits; k++) + { + Texture2D image = unit; + if (k == numUnits) + { + image = mod.GetTexture("Ice/Mobs/Coldtrap"); + } + Vector2 pos = projectile.position + direction * (increment * (k - 1) + unitLength / 2f); + Color color = Lighting.GetColor((int)(pos.X / 16f), (int)(pos.Y / 16f)); + spriteBatch.Draw(image, pos - Main.screenPosition, null, projectile.GetAlpha(color), projectile.rotation, new Vector2(unit.Width / 2, unit.Height / 2), 1f, effects, 0f); + } + return false; + } - public override void PostDraw(SpriteBatch sb, Color lightColor) - { - Main.instance.DrawNPC(arm, false); - } -}} \ No newline at end of file + public override void PostDraw(SpriteBatch sb, Color lightColor) + { + Main.instance.DrawNPC(arm, false); + } + } +} \ No newline at end of file diff --git a/Ice/Mobs/Dot.cs b/Ice/Mobs/Dot.cs index 0f2955c8..c4218e87 100644 --- a/Ice/Mobs/Dot.cs +++ b/Ice/Mobs/Dot.cs @@ -6,82 +6,83 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Ice.Mobs { -public class Dot : ModNPC +namespace Tremor.Ice.Mobs { + public class Dot : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Coldtrap"); } - - public override void SetDefaults() - { - npc.lifeMax = 20; - npc.damage = 0; - //Main.npcFrameCount[npc.type] = 4; - npc.defense = 0; - npc.knockBackResist = 0f; - npc.width = 78; - npc.height = 54; - //animationType = 3; - npc.aiStyle = 0; - npc.npcSlots = 1f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.value = Item.buyPrice(0, 0, 10, 5); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 20; + npc.damage = 0; + //Main.npcFrameCount[npc.type] = 4; + npc.defense = 0; + npc.knockBackResist = 0f; + npc.width = 78; + npc.height = 54; + //animationType = 3; + npc.aiStyle = 0; + npc.npcSlots = 1f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.value = Item.buyPrice(0, 0, 10, 5); + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int[] TileArray2 = { mod.TileType("IceOre"), mod.TileType("IceBlock"), mod.TileType("VeryVeryIce"), mod.TileType("DungeonBlock") }; - return TileArray2.Contains(Main.tile[spawnInfo.spawnTileX, spawnInfo.spawnTileY].type) && !NPC.AnyNPCs(422) && !NPC.AnyNPCs(493) && !NPC.AnyNPCs(507) && !NPC.AnyNPCs(517) ? 15f : 0f; - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void AI() - { - if (npc.localAI[0] == 0f) - { - int damage = 15; + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int[] TileArray2 = { mod.TileType("IceOre"), mod.TileType("IceBlock"), mod.TileType("VeryVeryIce"), mod.TileType("DungeonBlock") }; + return TileArray2.Contains(Main.tile[spawnInfo.spawnTileX, spawnInfo.spawnTileY].type) && !NPC.AnyNPCs(422) && !NPC.AnyNPCs(493) && !NPC.AnyNPCs(507) && !NPC.AnyNPCs(517) ? 15f : 0f; + } - for (int k = 1; k < 5; k++) - { - int proj = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, 0f, 0f, mod.ProjectileType("ColdtrapChain"), damage, 0, Main.myPlayer); + public override void AI() + { + if (npc.localAI[0] == 0f) + { + int damage = 15; - if (proj == 100) - { - npc.active = false; - return; - } - ColdtrapChain arm = Main.projectile[proj].modProjectile as ColdtrapChain; - arm.arm = npc.whoAmI; - arm.width = 16f; - arm.length = Ice.Mobs.ColdtrapChain.minLength; - arm.minAngle = (k - 0.05f) * (float)Math.PI / 3f; - arm.maxAngle = (k + 0.25f) * (float)Math.PI / 3f; - Main.projectile[proj].rotation = (arm.minAngle + arm.maxAngle) / 3f; - Main.projectile[proj].netUpdate = true; - } - npc.localAI[0] = 1f; - } - base.AI(); - } + for (int k = 1; k < 5; k++) + { + int proj = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, 0f, 0f, mod.ProjectileType("ColdtrapChain"), damage, 0, Main.myPlayer); - public override void NPCLoot() - { - if (Main.rand.Next(25) == 0) - Item.NewItem((int)npc.position.X, (int)npc.position.Y, 12, 12, mod.ItemType("IceKey"), 1); - } + if (proj == 100) + { + npc.active = false; + return; + } + ColdtrapChain arm = Main.projectile[proj].modProjectile as ColdtrapChain; + arm.arm = npc.whoAmI; + arm.width = 16f; + arm.length = Ice.Mobs.ColdtrapChain.minLength; + arm.minAngle = (k - 0.05f) * (float)Math.PI / 3f; + arm.maxAngle = (k + 0.25f) * (float)Math.PI / 3f; + Main.projectile[proj].rotation = (arm.minAngle + arm.maxAngle) / 3f; + Main.projectile[proj].netUpdate = true; + } + npc.localAI[0] = 1f; + } + base.AI(); + } + + public override void NPCLoot() + { + if (Main.rand.Next(25) == 0) + Item.NewItem((int)npc.position.X, (int)npc.position.Y, 12, 12, mod.ItemType("IceKey"), 1); + } - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.AddBuff(44, 60); - } - } + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.AddBuff(44, 60); + } + } } \ No newline at end of file diff --git a/Ice/Mobs/Frostbyte.cs b/Ice/Mobs/Frostbyte.cs index c8e1dc1d..9056a57b 100644 --- a/Ice/Mobs/Frostbyte.cs +++ b/Ice/Mobs/Frostbyte.cs @@ -6,78 +6,79 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Ice.Mobs { -public class Frostbyte : ModNPC +namespace Tremor.Ice.Mobs { + public class Frostbyte : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Frostbyte"); Main.npcFrameCount[npc.type] = 3; } - - public override void SetDefaults() - { - npc.lifeMax = 50; - npc.damage = 13; - npc.defense = 12; - npc.knockBackResist = 0.6f; - npc.width = 25; - npc.height = 20; - animationType = 3; - npc.aiStyle = -1; - npc.npcSlots = 1f; - npc.value = Item.buyPrice(0, 0, 10, 5); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 50; + npc.damage = 13; + npc.defense = 12; + npc.knockBackResist = 0.6f; + npc.width = 25; + npc.height = 20; + animationType = 3; + npc.aiStyle = -1; + npc.npcSlots = 1f; + npc.value = Item.buyPrice(0, 0, 10, 5); + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int[] TileArray2 = { mod.TileType("IceOre"), mod.TileType("IceBlock"), mod.TileType("VeryVeryIce"), mod.TileType("DungeonBlock") }; - return TileArray2.Contains(Main.tile[spawnInfo.spawnTileX, spawnInfo.spawnTileY].type) && !NPC.AnyNPCs(422) && !NPC.AnyNPCs(493) && !NPC.AnyNPCs(507) && !NPC.AnyNPCs(517) ? 15f : 0f; - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.rand.Next(28) == 0) - Item.NewItem((int)npc.position.X, (int)npc.position.Y, 12, 12, mod.ItemType("FrostbyteEye"), 1); - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int[] TileArray2 = { mod.TileType("IceOre"), mod.TileType("IceBlock"), mod.TileType("VeryVeryIce"), mod.TileType("DungeonBlock") }; + return TileArray2.Contains(Main.tile[spawnInfo.spawnTileX, spawnInfo.spawnTileY].type) && !NPC.AnyNPCs(422) && !NPC.AnyNPCs(493) && !NPC.AnyNPCs(507) && !NPC.AnyNPCs(517) ? 15f : 0f; + } - public override void AI() - { - int tileX = (int)(npc.Bottom.Y / 16f), tileY = (int)(npc.Bottom.Y / 16f); - int height = (int)Math.Min(10, tileX); - float velX = MathHelper.Lerp(5f, 3f, (float)height / 10f), velY = MathHelper.Lerp(-3f, -6f, (float)height / 10f); - npc.aiStyle = 1; - if (npc.target >= 0 && npc.target <= 255 && Main.player[npc.target].Bottom.Y < npc.Center.Y && npc.collideX && npc.velocity.Y != 0) - { - npc.netUpdate = true; - if (Main.netMode != 2) - { - for (int m = 0; m < 2; m++) - { - float xPos = npc.velocity.X > 0 ? npc.Right.X : npc.Left.X; - int dustID = Dust.NewDust(new Vector2(xPos, npc.Center.Y), 1, 1, 80, xPos < npc.Center.X ? -4f : 4f, (float)Math.Abs(npc.velocity.Y) * 0.2f, 100, Color.White, 1.5f); - Main.dust[dustID].noGravity = true; - } - } - npc.direction *= -1; - npc.velocity.Y = -5f; npc.velocity.X = 5f * npc.direction; - } - else - if (npc.velocity.Y == 0) npc.TargetClosest(true); - if (npc.velocity.Y == 0 && npc.ai[0] < -20) npc.ai[0] = -20; - if (npc.velocity.X != 0) npc.spriteDirection = npc.velocity.X > 0 ? 1 : -1; - } + public override void NPCLoot() + { + if (Main.rand.Next(28) == 0) + Item.NewItem((int)npc.position.X, (int)npc.position.Y, 12, 12, mod.ItemType("FrostbyteEye"), 1); + } + + public override void AI() + { + int tileX = (int)(npc.Bottom.Y / 16f), tileY = (int)(npc.Bottom.Y / 16f); + int height = (int)Math.Min(10, tileX); + float velX = MathHelper.Lerp(5f, 3f, (float)height / 10f), velY = MathHelper.Lerp(-3f, -6f, (float)height / 10f); + npc.aiStyle = 1; + if (npc.target >= 0 && npc.target <= 255 && Main.player[npc.target].Bottom.Y < npc.Center.Y && npc.collideX && npc.velocity.Y != 0) + { + npc.netUpdate = true; + if (Main.netMode != 2) + { + for (int m = 0; m < 2; m++) + { + float xPos = npc.velocity.X > 0 ? npc.Right.X : npc.Left.X; + int dustID = Dust.NewDust(new Vector2(xPos, npc.Center.Y), 1, 1, 80, xPos < npc.Center.X ? -4f : 4f, (float)Math.Abs(npc.velocity.Y) * 0.2f, 100, Color.White, 1.5f); + Main.dust[dustID].noGravity = true; + } + } + npc.direction *= -1; + npc.velocity.Y = -5f; npc.velocity.X = 5f * npc.direction; + } + else + if (npc.velocity.Y == 0) npc.TargetClosest(true); + if (npc.velocity.Y == 0 && npc.ai[0] < -20) npc.ai[0] = -20; + if (npc.velocity.X != 0) npc.spriteDirection = npc.velocity.X > 0 ? 1 : -1; + } - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.AddBuff(44, 60); - } - } + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.AddBuff(44, 60); + } + } } \ No newline at end of file diff --git a/Ice/Mobs/Glacier.cs b/Ice/Mobs/Glacier.cs index 9e9287f6..821c5175 100644 --- a/Ice/Mobs/Glacier.cs +++ b/Ice/Mobs/Glacier.cs @@ -6,72 +6,74 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Ice.Mobs { - -public class Glacier : ModNPC +namespace Tremor.Ice.Mobs { + + public class Glacier : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Glacier"); } - - public override void SetDefaults() - { - npc.lifeMax = 50; - npc.damage = 10; - npc.defense = 8; - npc.knockBackResist = 0f; - npc.width = 68; - npc.height = 78; - //animationType = 156; - npc.aiStyle = 2; - aiType = 180; - npc.npcSlots = 15f; - npc.noTileCollide = true; - npc.noGravity = true; - npc.HitSound = SoundID.NPCHit3; - npc.noGravity = true; - npc.DeathSound = SoundID.NPCDeath5; - npc.value = Item.buyPrice(0, 0, 1, 0); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 50; + npc.damage = 10; + npc.defense = 8; + npc.knockBackResist = 0f; + npc.width = 68; + npc.height = 78; + //animationType = 156; + npc.aiStyle = 2; + aiType = 180; + npc.npcSlots = 15f; + npc.noTileCollide = true; + npc.noGravity = true; + npc.HitSound = SoundID.NPCHit3; + npc.noGravity = true; + npc.DeathSound = SoundID.NPCDeath5; + npc.value = Item.buyPrice(0, 0, 1, 0); + } - public override void NPCLoot() - { - if (Main.rand.Next(30) == 0) - Item.NewItem((int)npc.position.X, (int)npc.position.Y, 12, 12, mod.ItemType("Frostex"), 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void AI() - { - Dust.NewDust(npc.position, npc.width, npc.height, 80, 0, -1f, 0, default(Color), 0.7f); - } + public override void NPCLoot() + { + if (Main.rand.Next(30) == 0) + Item.NewItem((int)npc.position.X, (int)npc.position.Y, 12, 12, mod.ItemType("Frostex"), 1); + } - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.AddBuff(44, 60); - } + public override void AI() + { + Dust.NewDust(npc.position, npc.width, npc.height, 80, 0, -1f, 0, default(Color), 0.7f); + } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.AddBuff(44, 60); + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int[] TileArray2 = { mod.TileType("IceOre"), mod.TileType("IceBlock"), mod.TileType("VeryVeryIce"), mod.TileType("DungeonBlock") }; - return TileArray2.Contains(Main.tile[spawnInfo.spawnTileX, spawnInfo.spawnTileY].type) && !NPC.AnyNPCs(422) && !NPC.AnyNPCs(493) && !NPC.AnyNPCs(507) && !NPC.AnyNPCs(517) ? 15f : 0f; - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int[] TileArray2 = { mod.TileType("IceOre"), mod.TileType("IceBlock"), mod.TileType("VeryVeryIce"), mod.TileType("DungeonBlock") }; + return TileArray2.Contains(Main.tile[spawnInfo.spawnTileX, spawnInfo.spawnTileY].type) && !NPC.AnyNPCs(422) && !NPC.AnyNPCs(493) && !NPC.AnyNPCs(507) && !NPC.AnyNPCs(517) ? 15f : 0f; + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GlacierGore"), 1f); - } -} -}} \ No newline at end of file + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GlacierGore"), 1f); + } + } + } +} \ No newline at end of file diff --git a/Ice/Mobs/IceWolf.cs b/Ice/Mobs/IceWolf.cs index 4afc6993..43b0696c 100644 --- a/Ice/Mobs/IceWolf.cs +++ b/Ice/Mobs/IceWolf.cs @@ -6,76 +6,78 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Ice.Mobs { -public class IceWolf : ModNPC +namespace Tremor.Ice.Mobs { + public class IceWolf : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Ice Wolf"); Main.npcFrameCount[npc.type] = 3; } - - public override void SetDefaults() - { - npc.lifeMax = 20; - npc.damage = 6; - npc.defense = 10; - npc.knockBackResist = 0f; - npc.width = 58; - npc.height = 32; - animationType = 3; - npc.aiStyle = 26; - npc.npcSlots = 1f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.value = Item.buyPrice(0, 0, 4, 0); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 20; + npc.damage = 6; + npc.defense = 10; + npc.knockBackResist = 0f; + npc.width = 58; + npc.height = 32; + animationType = 3; + npc.aiStyle = 26; + npc.npcSlots = 1f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.value = Item.buyPrice(0, 0, 4, 0); + } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.AddBuff(44, 60); - } - public override void AI() - { + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.AddBuff(44, 60); + } - } + public override void AI() + { - public override void NPCLoot() - { - if (Main.rand.Next(60) == 0 && Main.hardMode) - Item.NewItem((int)npc.position.X, (int)npc.position.Y, 12, 12, mod.ItemType("BlueQuartz"), 1); - if (Main.rand.Next(60) == 0 && Main.hardMode) - Item.NewItem((int)npc.position.X, (int)npc.position.Y, 12, 12, mod.ItemType("GlacierKnives"), 1); - } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int[] TileArray2 = { mod.TileType("IceOre"), mod.TileType("IceBlock"), mod.TileType("VeryVeryIce"), mod.TileType("DungeonBlock") }; - return TileArray2.Contains(Main.tile[spawnInfo.spawnTileX, spawnInfo.spawnTileY].type) && !NPC.AnyNPCs(422) && !NPC.AnyNPCs(493) && !NPC.AnyNPCs(507) && !NPC.AnyNPCs(517) ? 15f : 0f; - } + public override void NPCLoot() + { + if (Main.rand.Next(60) == 0 && Main.hardMode) + Item.NewItem((int)npc.position.X, (int)npc.position.Y, 12, 12, mod.ItemType("BlueQuartz"), 1); + if (Main.rand.Next(60) == 0 && Main.hardMode) + Item.NewItem((int)npc.position.X, (int)npc.position.Y, 12, 12, mod.ItemType("GlacierKnives"), 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IceWolfGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IceWolfGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IceWolfGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IceWolfGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IceWolfGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IceWolfGore3"), 1f); - } -} -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int[] TileArray2 = { mod.TileType("IceOre"), mod.TileType("IceBlock"), mod.TileType("VeryVeryIce"), mod.TileType("DungeonBlock") }; + return TileArray2.Contains(Main.tile[spawnInfo.spawnTileX, spawnInfo.spawnTileY].type) && !NPC.AnyNPCs(422) && !NPC.AnyNPCs(493) && !NPC.AnyNPCs(507) && !NPC.AnyNPCs(517) ? 15f : 0f; + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IceWolfGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IceWolfGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IceWolfGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IceWolfGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IceWolfGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IceWolfGore3"), 1f); + } + } + } +} \ No newline at end of file diff --git a/Ice/Mobs/WhiteHound.cs b/Ice/Mobs/WhiteHound.cs index f926ba0f..972cdf7a 100644 --- a/Ice/Mobs/WhiteHound.cs +++ b/Ice/Mobs/WhiteHound.cs @@ -6,59 +6,61 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Ice.Mobs { - -public class WhiteHound : ModNPC +namespace Tremor.Ice.Mobs { + + public class WhiteHound : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("White Hound"); Main.npcFrameCount[npc.type] = 10; } - - public override void SetDefaults() - { - npc.lifeMax = 150; - npc.damage = 76; - npc.defense = 35; - npc.knockBackResist = 0.3f; - npc.width = 62; - npc.height = 32; - animationType = 329; - npc.aiStyle = 26; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit6; - npc.DeathSound = SoundID.NPCDeath5; - npc.value = Item.buyPrice(0, 0, 5, 3); - } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WhiteHoundGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WhiteHoundGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WhiteHoundGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WhiteHoundGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WhiteHoundGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WhiteHoundGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WhiteHoundGore3"), 1f); - } -} + public override void SetDefaults() + { + npc.lifeMax = 150; + npc.damage = 76; + npc.defense = 35; + npc.knockBackResist = 0.3f; + npc.width = 62; + npc.height = 32; + animationType = 329; + npc.aiStyle = 26; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit6; + npc.DeathSound = SoundID.NPCDeath5; + npc.value = Item.buyPrice(0, 0, 5, 3); + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WhiteHoundGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WhiteHoundGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WhiteHoundGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WhiteHoundGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WhiteHoundGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WhiteHoundGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WhiteHoundGore3"), 1f); + } + } - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.AddBuff(44, 60); - } + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.AddBuff(44, 60); + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int[] TileArray2 = { mod.TileType("IceOre"), mod.TileType("IceBlock"), mod.TileType("VeryVeryIce"), mod.TileType("DungeonBlock") }; + return TileArray2.Contains(Main.tile[spawnInfo.spawnTileX, spawnInfo.spawnTileY].type) && Main.hardMode && !NPC.AnyNPCs(422) && !NPC.AnyNPCs(493) && !NPC.AnyNPCs(507) && !NPC.AnyNPCs(517) ? 15f : 0f; + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int[] TileArray2 = { mod.TileType("IceOre"), mod.TileType("IceBlock"), mod.TileType("VeryVeryIce"), mod.TileType("DungeonBlock") }; - return TileArray2.Contains(Main.tile[spawnInfo.spawnTileX, spawnInfo.spawnTileY].type) && Main.hardMode && !NPC.AnyNPCs(422) && !NPC.AnyNPCs(493) && !NPC.AnyNPCs(507) && !NPC.AnyNPCs(517) ? 15f : 0f; - } - -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/Ice/Mobs/WhiteWalker.cs b/Ice/Mobs/WhiteWalker.cs index 0588b027..15da697c 100644 --- a/Ice/Mobs/WhiteWalker.cs +++ b/Ice/Mobs/WhiteWalker.cs @@ -6,73 +6,74 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Ice.Mobs { -public class WhiteWalker : ModNPC +namespace Tremor.Ice.Mobs { + public class WhiteWalker : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("White Walker"); Main.npcFrameCount[npc.type] = 3; } - - public override void SetDefaults() - { - npc.lifeMax = 90; - npc.damage = 2; - npc.defense = 12; - npc.knockBackResist = 0.3f; - npc.width = 56; - npc.height = 48; - animationType = 3; - npc.aiStyle = 3; - npc.npcSlots = 1f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.value = Item.buyPrice(0, 0, 15, 5); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 90; + npc.damage = 2; + npc.defense = 12; + npc.knockBackResist = 0.3f; + npc.width = 56; + npc.height = 48; + animationType = 3; + npc.aiStyle = 3; + npc.npcSlots = 1f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.value = Item.buyPrice(0, 0, 15, 5); + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int[] TileArray2 = { mod.TileType("IceOre"), mod.TileType("IceBlock"), mod.TileType("VeryVeryIce"), mod.TileType("DungeonBlock") }; - return TileArray2.Contains(Main.tile[spawnInfo.spawnTileX, spawnInfo.spawnTileY].type) && !NPC.AnyNPCs(422) && !NPC.AnyNPCs(493) && !NPC.AnyNPCs(507) && !NPC.AnyNPCs(517) ? 15f : 0f; - } - public override void AI() - { - npc.spriteDirection = npc.direction; - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.rand.Next(25) == 0) - Item.NewItem((int)npc.position.X, (int)npc.position.Y, 12, 12, mod.ItemType("IceCross"), 1); - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int[] TileArray2 = { mod.TileType("IceOre"), mod.TileType("IceBlock"), mod.TileType("VeryVeryIce"), mod.TileType("DungeonBlock") }; + return TileArray2.Contains(Main.tile[spawnInfo.spawnTileX, spawnInfo.spawnTileY].type) && !NPC.AnyNPCs(422) && !NPC.AnyNPCs(493) && !NPC.AnyNPCs(507) && !NPC.AnyNPCs(517) ? 15f : 0f; + } + public override void AI() + { + npc.spriteDirection = npc.direction; + } - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - target.AddBuff(44, 60); - } + public override void NPCLoot() + { + if (Main.rand.Next(25) == 0) + Item.NewItem((int)npc.position.X, (int)npc.position.Y, 12, 12, mod.ItemType("IceCross"), 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WhiteWalkerGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WhiteWalkerGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WhiteWalkerGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WhiteWalkerGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WhiteWalkerGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WhiteWalkerGore3"), 1f); - } -} - } + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.AddBuff(44, 60); + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WhiteWalkerGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WhiteWalkerGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WhiteWalkerGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WhiteWalkerGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WhiteWalkerGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WhiteWalkerGore3"), 1f); + } + } + } } \ No newline at end of file diff --git a/Ice/Tree/TremorSapling.cs b/Ice/Tree/TremorSapling.cs index dda525f6..49792c54 100644 --- a/Ice/Tree/TremorSapling.cs +++ b/Ice/Tree/TremorSapling.cs @@ -21,10 +21,10 @@ public override void SetDefaults() TileObjectData.newTile.Origin = new Point16(0, 1); TileObjectData.newTile.AnchorBottom = new AnchorData(AnchorType.SolidTile, TileObjectData.newTile.Width, 0); TileObjectData.newTile.UsesCustomCanPlace = true; - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 18 }; + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 18 }; TileObjectData.newTile.CoordinateWidth = 16; TileObjectData.newTile.CoordinatePadding = 2; - TileObjectData.newTile.AnchorValidTiles = new int[]{ mod.TileType("VeryVeryIce") }; + TileObjectData.newTile.AnchorValidTiles = new int[] { mod.TileType("VeryVeryIce") }; TileObjectData.newTile.StyleHorizontal = true; TileObjectData.newTile.DrawFlipHorizontal = true; TileObjectData.newTile.WaterPlacement = LiquidPlacement.NotAllowed; @@ -34,7 +34,7 @@ public override void SetDefaults() sapling = true; AddMapEntry(new Color(200, 200, 200)); dustType = mod.DustType("TreeCrash"); - adjTiles = new int[]{ TileID.Saplings }; + adjTiles = new int[] { TileID.Saplings }; } public override void NumDust(int i, int j, bool fail, ref int num) diff --git a/Ice/Tree/TremorTree.cs b/Ice/Tree/TremorTree.cs index 2136355e..dadde571 100644 --- a/Ice/Tree/TremorTree.cs +++ b/Ice/Tree/TremorTree.cs @@ -12,7 +12,7 @@ private Mod mod return ModLoader.GetMod("Tremor"); } } - + public override int CreateDust() { return mod.DustType("TreeCrash"); @@ -22,22 +22,22 @@ public override int GrowthFXGore() { return mod.GetGoreSlot("Ice/Tree/TremorTreeFX"); } - + public override int DropWood() { return mod.ItemType("GlacierWood"); } - + public override Texture2D GetTexture() { return mod.GetTexture("Ice/Tree/TremorTree"); } - + public override Texture2D GetBranchTextures(int i, int j, int trunkOffset, ref int frame) { - return mod.GetTexture("Ice/Tree/TremorTree_Branches"); + return mod.GetTexture("Ice/Tree/TremorTree_Branches"); } - + public override Texture2D GetTopTextures(int i, int j, ref int frame, ref int frameWidth, ref int frameHeight, ref int xOffsetLeft, ref int yOffset) { return mod.GetTexture("Ice/Tree/TremorTree_Tops"); diff --git a/Ice/Tree/VeryVeryIce.cs b/Ice/Tree/VeryVeryIce.cs index 6978ec88..4cd00a45 100644 --- a/Ice/Tree/VeryVeryIce.cs +++ b/Ice/Tree/VeryVeryIce.cs @@ -15,75 +15,75 @@ public class VeryVeryIce : ModTile public override void SetDefaults() { Main.tileSolid[Type] = true; - //Main.tileMerge[Type][mod.TileType("TremorTree")] = true; - Main.tileMerge[Type][mod.TileType("IceBlock")] = true; - Main.tileMerge[Type][161] = true; - Main.tileMerge[Type][162] = true; - Main.tileMerge[Type][163] = true; - Main.tileMerge[Type][164] = true; - Main.tileMerge[Type][147] = true; - Main.tileMergeDirt[Type] = true; + //Main.tileMerge[Type][mod.TileType("TremorTree")] = true; + Main.tileMerge[Type][mod.TileType("IceBlock")] = true; + Main.tileMerge[Type][161] = true; + Main.tileMerge[Type][162] = true; + Main.tileMerge[Type][163] = true; + Main.tileMerge[Type][164] = true; + Main.tileMerge[Type][147] = true; + Main.tileMergeDirt[Type] = true; Main.tileBlockLight[Type] = false; - //Main.tileMinPick[Type] = 200; - dustType = 80; - soundType = 21; - soundStyle = 2; - Main.tileLighted[Type] = true; + //Main.tileMinPick[Type] = 200; + dustType = 80; + soundType = 21; + soundStyle = 2; + Main.tileLighted[Type] = true; AddMapEntry(new Color(104, 155, 195)); - SetModTree(new TremorTree()); + SetModTree(new TremorTree()); drop = mod.ItemType("IceBlockB"); - } + } - public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) - { - Vector2 zero = new Vector2(Main.offScreenRange, Main.offScreenRange); - Tile tile = Main.tile[i, j]; - int height = tile.frameY == 36 ? 18 : 16; - int animate = 0; - if (tile.frameY >= 56) - { - animate = Main.tileFrame[Type] * animationFrameHeight; - } - Texture2D texture = Main.tileTexture[Type]; - Main.spriteBatch.Draw(texture, new Vector2(i * 16 - (int)Main.screenPosition.X, j * 16 - (int)Main.screenPosition.Y) + zero, new Rectangle(tile.frameX, tile.frameY + animate, 16, height), Lighting.GetColor(i, j), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); - return false; - } - public override void RandomUpdate(int i, int j) - { - if (Main.tile[i - 1, j].type == TileID.SnowBlock && CanGrow(i - 1, j)) - { - Main.tile[i - 1, j].type = (ushort)mod.TileType("IceBlock"); - } - if (Main.tile[i + 1, j].type == TileID.SnowBlock && CanGrow(i + 1, j)) - { - Main.tile[i + 1, j].type = (ushort)mod.TileType("IceBlock"); - } - if (Main.tile[i, j - 1].type == TileID.SnowBlock && CanGrow(i, j - 1)) - { - Main.tile[i, j - 1].type = (ushort)mod.TileType("IceBlock"); - } - if (Main.tile[i, j + 1].type == TileID.SnowBlock && CanGrow(i, j + 1)) - { - Main.tile[i, j + 1].type = (ushort)mod.TileType("IceBlock"); - } - } + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) + { + Vector2 zero = new Vector2(Main.offScreenRange, Main.offScreenRange); + Tile tile = Main.tile[i, j]; + int height = tile.frameY == 36 ? 18 : 16; + int animate = 0; + if (tile.frameY >= 56) + { + animate = Main.tileFrame[Type] * animationFrameHeight; + } + Texture2D texture = Main.tileTexture[Type]; + Main.spriteBatch.Draw(texture, new Vector2(i * 16 - (int)Main.screenPosition.X, j * 16 - (int)Main.screenPosition.Y) + zero, new Rectangle(tile.frameX, tile.frameY + animate, 16, height), Lighting.GetColor(i, j), 0f, default(Vector2), 1f, SpriteEffects.None, 0f); + return false; + } + public override void RandomUpdate(int i, int j) + { + if (Main.tile[i - 1, j].type == TileID.SnowBlock && CanGrow(i - 1, j)) + { + Main.tile[i - 1, j].type = (ushort)mod.TileType("IceBlock"); + } + if (Main.tile[i + 1, j].type == TileID.SnowBlock && CanGrow(i + 1, j)) + { + Main.tile[i + 1, j].type = (ushort)mod.TileType("IceBlock"); + } + if (Main.tile[i, j - 1].type == TileID.SnowBlock && CanGrow(i, j - 1)) + { + Main.tile[i, j - 1].type = (ushort)mod.TileType("IceBlock"); + } + if (Main.tile[i, j + 1].type == TileID.SnowBlock && CanGrow(i, j + 1)) + { + Main.tile[i, j + 1].type = (ushort)mod.TileType("IceBlock"); + } + } - public bool CanGrow(int i, int j) - { - bool flag = false; - for (int x = 0; x < 3; x++) - for (int y = 0; y < 3; y++) - { - if (!Main.tile[i - 1 + x, j - 1 + y].active()) - flag = true; - } - return flag; - } + public bool CanGrow(int i, int j) + { + bool flag = false; + for (int x = 0; x < 3; x++) + for (int y = 0; y < 3; y++) + { + if (!Main.tile[i - 1 + x, j - 1 + y].active()) + flag = true; + } + return flag; + } - public override int SaplingGrowthType(ref int style) - { - style = 0; - return mod.TileType("TremorSapling"); - } - } + public override int SaplingGrowthType(ref int style) + { + style = 0; + return mod.TileType("TremorSapling"); + } + } } \ No newline at end of file diff --git a/Invasion/AncientWatch.cs b/Invasion/AncientWatch.cs index dc64686b..2e24bac8 100644 --- a/Invasion/AncientWatch.cs +++ b/Invasion/AncientWatch.cs @@ -7,65 +7,65 @@ namespace Tremor.Invasion { - public class AncientWatch : ModItem - { - public override void SetDefaults() - { + public class AncientWatch : ModItem + { + public override void SetDefaults() + { - item.width = 40; - item.height = 28; - item.maxStack = 20; - item.value = 100; - item.rare = 11; - item.useAnimation = 15; - item.useTime = 15; - item.useStyle = 4; - item.consumable = true; + item.width = 40; + item.height = 28; + item.maxStack = 20; + item.value = 100; + item.rare = 11; + item.useAnimation = 15; + item.useTime = 15; + item.useStyle = 4; + item.consumable = true; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ancient Watch"); - Tooltip.SetDefault("Summons Paradox Cohort"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ancient Watch"); + Tooltip.SetDefault("Summons Paradox Cohort"); + } - public override bool CanUseItem(Player player) - { - Mod mod = ModLoader.GetMod("Tremor"); - CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer(mod); - if (InvasionWorld.CyberWrath) - return false; - return true; - } + public override bool CanUseItem(Player player) + { + Mod mod = ModLoader.GetMod("Tremor"); + CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer(mod); + if (InvasionWorld.CyberWrath) + return false; + return true; + } - public override bool UseItem(Player player) - { - Mod mod = ModLoader.GetMod("Tremor"); - CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer(mod); - Main.NewText("Paradox Cohort is striking from nowhere!", 39, 86, 134); - Main.PlaySound(mod.GetSoundSlot(SoundType.Music, "Sounds/Music/Wrath1"), (int)player.position.X, (int)player.position.Y, 0); - Main.PlaySound(15, (int)player.position.X, (int)player.position.Y, 0); - if(Main.netMode !=1) - { - NPC.NewNPC((int)player.Center.X, (int)player.Center.Y - 200, mod.NPCType("Titan_")); - } - InvasionWorld.CyberWrath = true; - return true; - } + public override bool UseItem(Player player) + { + Mod mod = ModLoader.GetMod("Tremor"); + CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer(mod); + Main.NewText("Paradox Cohort is striking from nowhere!", 39, 86, 134); + Main.PlaySound(mod.GetSoundSlot(SoundType.Music, "Sounds/Music/Wrath1"), (int)player.position.X, (int)player.position.Y, 0); + Main.PlaySound(15, (int)player.position.X, (int)player.position.Y, 0); + if (Main.netMode != 1) + { + NPC.NewNPC((int)player.Center.X, (int)player.Center.Y - 200, mod.NPCType("Titan_")); + } + InvasionWorld.CyberWrath = true; + return true; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "NightmareBar", 5); - recipe.AddIngredient(null, "SoulofFight", 3); - recipe.AddIngredient(ItemID.Glass, 5); - recipe.AddIngredient(null, "HuskofDusk", 2); - recipe.AddIngredient(null, "LapisLazuli", 1); - recipe.SetResult(this); - recipe.AddTile(null, "StarvilTile"); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "NightmareBar", 5); + recipe.AddIngredient(null, "SoulofFight", 3); + recipe.AddIngredient(ItemID.Glass, 5); + recipe.AddIngredient(null, "HuskofDusk", 2); + recipe.AddIngredient(null, "LapisLazuli", 1); + recipe.SetResult(this); + recipe.AddTile(null, "StarvilTile"); + recipe.AddRecipe(); + } + } } diff --git a/Invasion/ClockofTime.cs b/Invasion/ClockofTime.cs index 842072a3..53b8002d 100644 --- a/Invasion/ClockofTime.cs +++ b/Invasion/ClockofTime.cs @@ -19,40 +19,40 @@ public override void SetDefaults() item.rare = 5; item.useTurn = true; item.autoReuse = false; - item.useStyle = 4; + item.useStyle = 4; item.useAnimation = 15; item.useTime = 15; item.maxStack = 1; - item.mana = 100; - item.UseSound = SoundID.Item8; + item.mana = 100; + item.UseSound = SoundID.Item8; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Paradox Clock"); - Tooltip.SetDefault("Allows you to control the time"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Paradox Clock"); + Tooltip.SetDefault("Allows you to control the time"); + } - - public override bool UseItem(Player player) - { + + public override bool UseItem(Player player) + { if (player.altFunctionUse == 2) { Main.bloodMoon = true; return true; } else - { + { if (Main.netMode != 1) { Main.dayTime = !Main.dayTime; Main.time = (Main.dayTime ? 10000f : 0f); return true; - } + } } return true; - } - + } + public override bool AltFunctionUse(Player player) { return true; diff --git a/Invasion/Crystyle.cs b/Invasion/Crystyle.cs index 4ec85ec6..61928d95 100644 --- a/Invasion/Crystyle.cs +++ b/Invasion/Crystyle.cs @@ -4,40 +4,41 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Invasion { -public class Crystyle : ModItem +namespace Tremor.Invasion { - public override void SetDefaults() - { + public class Crystyle : ModItem + { + public override void SetDefaults() + { - item.damage = 266; - item.melee = true; - item.width = 50; - item.height = 52; - item.useTime = 15; - item.useAnimation = 15; - item.useStyle = 1; - item.shoot = 173; - item.shootSpeed = 7f; - item.knockBack = 4; - item.value = 100000; - item.rare = 11; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 266; + item.melee = true; + item.width = 50; + item.height = 52; + item.useTime = 15; + item.useAnimation = 15; + item.useStyle = 1; + item.shoot = 173; + item.shootSpeed = 7f; + item.knockBack = 4; + item.value = 100000; + item.rare = 11; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crystyle"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crystyle"); + Tooltip.SetDefault(""); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 59); - } + public override void MeleeEffects(Player player, Rectangle hitbox) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 59); + } -} + } } diff --git a/Invasion/CyberDust.cs b/Invasion/CyberDust.cs index 04c3951c..c340c1d4 100644 --- a/Invasion/CyberDust.cs +++ b/Invasion/CyberDust.cs @@ -9,19 +9,19 @@ public class CyberDust : ModDust public override void OnSpawn(Dust dust) { dust.noGravity = true; - } + } public override bool Update(Dust dust) { dust.position += dust.velocity; dust.rotation += dust.velocity.X; dust.scale -= 0.01f; - Lighting.AddLight(dust.position, 0.0f, 1.27f, 0.64f); - if (dust.scale < 0.5f) + Lighting.AddLight(dust.position, 0.0f, 1.27f, 0.64f); + if (dust.scale < 0.5f) { dust.active = false; } return false; } - } + } } \ No newline at end of file diff --git a/Invasion/CyberLaser.cs b/Invasion/CyberLaser.cs index 532bc774..983180da 100644 --- a/Invasion/CyberLaser.cs +++ b/Invasion/CyberLaser.cs @@ -15,54 +15,54 @@ public override void SetDefaults() projectile.width = 14; projectile.height = 14; projectile.aiStyle = 1; - projectile.light = 0.5f; - projectile.damage = 50; + projectile.light = 0.5f; + projectile.damage = 50; projectile.friendly = true; projectile.penetrate = 2; projectile.magic = true; projectile.ignoreWater = true; - projectile.tileCollide = false; + projectile.tileCollide = false; aiType = 598; } - public override void OnHitNPC(NPC target1, int damage, float knockback, bool crit) - { - Player target = Main.player[Main.myPlayer]; - if (Main.rand.Next(2) == 0) - target.AddBuff(mod.BuffType("Light"), 300); - } - - public override void AI() - { - if (projectile.localAI[0] == 0f) + public override void OnHitNPC(NPC target1, int damage, float knockback, bool crit) { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + Player target = Main.player[Main.myPlayer]; + if (Main.rand.Next(2) == 0) + target.AddBuff(mod.BuffType("Light"), 300); } - projectile.localAI[0] += 1f; - if (projectile.localAI[0] > 3f) + + public override void AI() { - int num90 = 1; - if (projectile.localAI[0] > 5f) - { - num90 = 2; - } - for (int num91 = 0; num91 < num90; num91++) + if (projectile.localAI[0] == 0f) { - int num92 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 2f), projectile.width, projectile.height, mod.DustType("CyberDust"), projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.1f, 100, default(Color), 0.4f); - Main.dust[num92].noGravity = true; - Dust expr_46AC_cp_0 = Main.dust[num92]; - expr_46AC_cp_0.velocity.X = expr_46AC_cp_0.velocity.X * 0.3f; - Dust expr_46CA_cp_0 = Main.dust[num92]; - expr_46CA_cp_0.velocity.Y = expr_46CA_cp_0.velocity.Y * 0.3f; - Main.dust[num92].noLight = true; + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); } - if (projectile.wet && !projectile.lavaWet) + projectile.localAI[0] += 1f; + if (projectile.localAI[0] > 3f) { - projectile.Kill(); - return; + int num90 = 1; + if (projectile.localAI[0] > 5f) + { + num90 = 2; + } + for (int num91 = 0; num91 < num90; num91++) + { + int num92 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 2f), projectile.width, projectile.height, mod.DustType("CyberDust"), projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.1f, 100, default(Color), 0.4f); + Main.dust[num92].noGravity = true; + Dust expr_46AC_cp_0 = Main.dust[num92]; + expr_46AC_cp_0.velocity.X = expr_46AC_cp_0.velocity.X * 0.3f; + Dust expr_46CA_cp_0 = Main.dust[num92]; + expr_46CA_cp_0.velocity.Y = expr_46CA_cp_0.velocity.Y * 0.3f; + Main.dust[num92].noLight = true; + } + if (projectile.wet && !projectile.lavaWet) + { + projectile.Kill(); + return; + } } } - } } } diff --git a/Invasion/CyberLaserBat.cs b/Invasion/CyberLaserBat.cs index 936b0d8d..80a4b804 100644 --- a/Invasion/CyberLaserBat.cs +++ b/Invasion/CyberLaserBat.cs @@ -7,35 +7,35 @@ namespace Tremor.Invasion { - public class CyberLaserBat : ModProjectile - { + public class CyberLaserBat : ModProjectile + { public override void SetStaticDefaults() { DisplayName.SetDefault("Cyber Laser"); } - public override void SetDefaults() - { - projectile.CloneDefaults(38); - aiType = 38; - projectile.width = 20; - projectile.height = 38; - projectile.scale = 1f; - } + public override void SetDefaults() + { + projectile.CloneDefaults(38); + aiType = 38; + projectile.width = 20; + projectile.height = 38; + projectile.scale = 1f; + } - public override void PostAI() - { - Vector2 center = projectile.Center; - Vector2 lookTarget = projectile.Center + projectile.velocity; - float rotX = lookTarget.X - center.X; - float rotY = lookTarget.Y - center.Y; - projectile.rotation = -((float)Math.Atan2((double)rotX, (double)rotY)) - 1.57f; - if (Main.netMode != 2) - { - int dustID = Dust.NewDust(projectile.position, projectile.width, projectile.height, mod.DustType("CyberDust"), projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, Color.White, 0.6f); - int dustID2 = Dust.NewDust(projectile.position, projectile.width, projectile.height, mod.DustType("CyberDust"), projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, Color.White, 0.8f); - } - } - } + public override void PostAI() + { + Vector2 center = projectile.Center; + Vector2 lookTarget = projectile.Center + projectile.velocity; + float rotX = lookTarget.X - center.X; + float rotY = lookTarget.Y - center.Y; + projectile.rotation = -((float)Math.Atan2((double)rotX, (double)rotY)) - 1.57f; + if (Main.netMode != 2) + { + int dustID = Dust.NewDust(projectile.position, projectile.width, projectile.height, mod.DustType("CyberDust"), projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, Color.White, 0.6f); + int dustID2 = Dust.NewDust(projectile.position, projectile.width, projectile.height, mod.DustType("CyberDust"), projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, Color.White, 0.8f); + } + } + } } \ No newline at end of file diff --git a/Invasion/CyberWrathInvasion.cs b/Invasion/CyberWrathInvasion.cs index 9b7ab635..911afddf 100644 --- a/Invasion/CyberWrathInvasion.cs +++ b/Invasion/CyberWrathInvasion.cs @@ -1,4 +1,4 @@ - using System; +using System; using System.Diagnostics; using System.Collections.Generic; using System.IO; @@ -20,163 +20,163 @@ namespace Tremor { public class CyberWrathInvasion : ModPlayer { - public override void UpdateDead() - { - - } - - public static readonly PlayerLayer MiscEffects = new PlayerLayer("Tremor", "MiscEffects", PlayerLayer.MiscEffectsFront, delegate (PlayerDrawInfo drawInfo) - { - Player drawPlayer = drawInfo.drawPlayer; - Mod mod = ModLoader.GetMod("Tremor"); - CyberWrathInvasion modPlayer = drawPlayer.GetModPlayer(mod); - - Texture2D CyberWrathI = mod.GetTexture("Invasion/System/System1"); - Texture2D CyberWrathI1 = mod.GetTexture("Invasion/System/System2"); - Texture2D CyberWrathI2 = mod.GetTexture("Invasion/System/System3"); - Texture2D CyberWrathI3 = mod.GetTexture("Invasion/System/System4"); - Texture2D CyberWrathI4 = mod.GetTexture("Invasion/System/System5"); - Texture2D CyberWrathI5 = mod.GetTexture("Invasion/System/System6"); - Texture2D CyberWrathI6 = mod.GetTexture("Invasion/System/System7"); - Texture2D CyberWrathI7 = mod.GetTexture("Invasion/System/System8"); - Texture2D CyberWrathI8 = mod.GetTexture("Invasion/System/System9"); - Texture2D CyberWrathI9 = mod.GetTexture("Invasion/System/System10"); - Texture2D texture1 = mod.GetTexture("Invasion/System/System"); - SpriteBatch sb1 = Main.spriteBatch; - - int iH1 = texture1.Height; - int iW1 = texture1.Width; - - int sX1 = 37; - int sY1 = 30; - - int eH = CyberWrathI.Height; - int eW = CyberWrathI.Width; - - int XX1 = (int)(((24 - iW1) / 2) + Main.screenWidth - sX1); - int YY1 = (int)(((24 - iH1) / 2) + sY1 + (int)(280 * 1.4) + (24 - iW1) * (-1) + 20); - - int eX = XX1 - 333; - int eY = YY1 - 430 + (24 - eW) * (-1); - - bool _number = true; - int number = 1; - }); - - public override void ModifyDrawLayers(List layers) - { - MiscEffects.visible = true; - layers.Add(MiscEffects); - layers.Insert(0, MiscEffects); - } - - public override void PostUpdateBuffs() - { - - } - - public override void PostUpdate() - { + public override void UpdateDead() + { + + } + + public static readonly PlayerLayer MiscEffects = new PlayerLayer("Tremor", "MiscEffects", PlayerLayer.MiscEffectsFront, delegate (PlayerDrawInfo drawInfo) + { + Player drawPlayer = drawInfo.drawPlayer; + Mod mod = ModLoader.GetMod("Tremor"); + CyberWrathInvasion modPlayer = drawPlayer.GetModPlayer(mod); + + Texture2D CyberWrathI = mod.GetTexture("Invasion/System/System1"); + Texture2D CyberWrathI1 = mod.GetTexture("Invasion/System/System2"); + Texture2D CyberWrathI2 = mod.GetTexture("Invasion/System/System3"); + Texture2D CyberWrathI3 = mod.GetTexture("Invasion/System/System4"); + Texture2D CyberWrathI4 = mod.GetTexture("Invasion/System/System5"); + Texture2D CyberWrathI5 = mod.GetTexture("Invasion/System/System6"); + Texture2D CyberWrathI6 = mod.GetTexture("Invasion/System/System7"); + Texture2D CyberWrathI7 = mod.GetTexture("Invasion/System/System8"); + Texture2D CyberWrathI8 = mod.GetTexture("Invasion/System/System9"); + Texture2D CyberWrathI9 = mod.GetTexture("Invasion/System/System10"); + Texture2D texture1 = mod.GetTexture("Invasion/System/System"); + SpriteBatch sb1 = Main.spriteBatch; + + int iH1 = texture1.Height; + int iW1 = texture1.Width; + + int sX1 = 37; + int sY1 = 30; + + int eH = CyberWrathI.Height; + int eW = CyberWrathI.Width; + + int XX1 = (int)(((24 - iW1) / 2) + Main.screenWidth - sX1); + int YY1 = (int)(((24 - iH1) / 2) + sY1 + (int)(280 * 1.4) + (24 - iW1) * (-1) + 20); + + int eX = XX1 - 333; + int eY = YY1 - 430 + (24 - eW) * (-1); + + bool _number = true; + int number = 1; + }); + + public override void ModifyDrawLayers(List layers) + { + MiscEffects.visible = true; + layers.Add(MiscEffects); + layers.Insert(0, MiscEffects); + } + + public override void PostUpdateBuffs() + { + + } + + public override void PostUpdate() + { bool First = true; - const int XOffset = 400; - const int YOffset = 400; - - CyberWrathInvasion modPlayer = player.GetModPlayer(mod); - if (!InvasionWorld.CyberWrath) - { - InvasionWorld.CyberWrathPoints1 = 0; - } - - if (InvasionWorld.CyberWrath) - { - //Main.spriteBatch.Draw(Main.blackTileTexture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), new Color(200, 200, 200) * 0.5f); + const int XOffset = 400; + const int YOffset = 400; + + CyberWrathInvasion modPlayer = player.GetModPlayer(mod); + if (!InvasionWorld.CyberWrath) + { + InvasionWorld.CyberWrathPoints1 = 0; + } + + if (InvasionWorld.CyberWrath) + { + //Main.spriteBatch.Draw(Main.blackTileTexture, new Rectangle(0, 0, Main.screenWidth, Main.screenHeight), new Color(200, 200, 200) * 0.5f); + if (Main.rand.Next(700) == 1) + NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y, mod.NPCType("InvisibleSoul")); if (Main.rand.Next(700) == 1) - NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y, mod.NPCType("InvisibleSoul")); - if (Main.rand.Next(700) == 1) - NPC.NewNPC((int)player.Center.X - XOffset, (int)player.Center.Y, mod.NPCType("InvisibleSoul")); - - if (Main.rand.Next(150) == 1) - NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y + YOffset, mod.NPCType("CyberBat")); - if (Main.rand.Next(150) == 1) - NPC.NewNPC((int)player.Center.X - XOffset, (int)player.Center.Y - YOffset, mod.NPCType("CyberBat")); - - if (Main.rand.Next(500) == 1) - NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y + YOffset, mod.NPCType("ParadoxSun")); - if (Main.rand.Next(500) == 1) - NPC.NewNPC((int)player.Center.X - XOffset, (int)player.Center.Y - YOffset, mod.NPCType("ParadoxSun")); - } - - InvasionWorld.CyberWrathPoints = InvasionWorld.CyberWrathPoints1; - - - if (InvasionWorld.CyberWrathPoints1 == 15) - { - NPC.NewNPC((int)player.Center.X, (int)player.Center.Y - YOffset, mod.NPCType("Violeum")); - InvasionWorld.CyberWrathPoints1 = 16; - } - + NPC.NewNPC((int)player.Center.X - XOffset, (int)player.Center.Y, mod.NPCType("InvisibleSoul")); + + if (Main.rand.Next(150) == 1) + NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y + YOffset, mod.NPCType("CyberBat")); + if (Main.rand.Next(150) == 1) + NPC.NewNPC((int)player.Center.X - XOffset, (int)player.Center.Y - YOffset, mod.NPCType("CyberBat")); + + if (Main.rand.Next(500) == 1) + NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y + YOffset, mod.NPCType("ParadoxSun")); + if (Main.rand.Next(500) == 1) + NPC.NewNPC((int)player.Center.X - XOffset, (int)player.Center.Y - YOffset, mod.NPCType("ParadoxSun")); + } + + InvasionWorld.CyberWrathPoints = InvasionWorld.CyberWrathPoints1; + + + if (InvasionWorld.CyberWrathPoints1 == 15) + { + NPC.NewNPC((int)player.Center.X, (int)player.Center.Y - YOffset, mod.NPCType("Violeum")); + InvasionWorld.CyberWrathPoints1 = 16; + } + if (InvasionWorld.CyberWrathPoints1 == 35) - { - NPC.NewNPC((int)player.Center.X, (int)player.Center.Y - YOffset, mod.NPCType("Violeum")); - InvasionWorld.CyberWrathPoints1 = 36; - } - - if (InvasionWorld.CyberWrathPoints1 == 50) - { - NPC.NewNPC((int)player.Center.X, (int)player.Center.Y - YOffset, mod.NPCType("Violeum")); - InvasionWorld.CyberWrathPoints1 = 51; - } - - if (InvasionWorld.CyberWrathPoints1 == 85) - { - NPC.NewNPC((int)player.Center.X, (int)player.Center.Y - YOffset, mod.NPCType("Violeum")); - InvasionWorld.CyberWrathPoints1 = 86; - } - - if (InvasionWorld.CyberWrathPoints1 >= 100 && !NPC.AnyNPCs(mod.NPCType("Titan"))) - { - //Main.NewText("Wave 1: Complete!", 255, 255, 0); - //Main.NewText("Wave 2: Complete 0%", 0, 255, 255); - InvasionWorld.CyberWrath = false; - } - - if (InvasionWorld.CyberWrathPoints1 > 100 && !NPC.AnyNPCs(mod.NPCType("Titan"))) - { - InvasionWorld.CyberWrathPoints1 = 100; - } - + { + NPC.NewNPC((int)player.Center.X, (int)player.Center.Y - YOffset, mod.NPCType("Violeum")); + InvasionWorld.CyberWrathPoints1 = 36; + } + + if (InvasionWorld.CyberWrathPoints1 == 50) + { + NPC.NewNPC((int)player.Center.X, (int)player.Center.Y - YOffset, mod.NPCType("Violeum")); + InvasionWorld.CyberWrathPoints1 = 51; + } + + if (InvasionWorld.CyberWrathPoints1 == 85) + { + NPC.NewNPC((int)player.Center.X, (int)player.Center.Y - YOffset, mod.NPCType("Violeum")); + InvasionWorld.CyberWrathPoints1 = 86; + } + + if (InvasionWorld.CyberWrathPoints1 >= 100 && !NPC.AnyNPCs(mod.NPCType("Titan"))) + { + //Main.NewText("Wave 1: Complete!", 255, 255, 0); + //Main.NewText("Wave 2: Complete 0%", 0, 255, 255); + InvasionWorld.CyberWrath = false; + } + + if (InvasionWorld.CyberWrathPoints1 > 100 && !NPC.AnyNPCs(mod.NPCType("Titan"))) + { + InvasionWorld.CyberWrathPoints1 = 100; + } + if (InvasionWorld.CyberWrathPoints1 > 98 && NPC.AnyNPCs(mod.NPCType("Titan"))) - { - InvasionWorld.CyberWrathPoints1 = 98; - } - + { + InvasionWorld.CyberWrathPoints1 = 98; + } + if (NPC.AnyNPCs(mod.NPCType("Titan_")) && InvasionWorld.CyberWrathPoints1 == 98) { InvasionWorld.CyberWrathPoints1 = 98; } - + if (NPC.AnyNPCs(mod.NPCType("Titan")) && InvasionWorld.CyberWrathPoints1 == 98) { InvasionWorld.CyberWrathPoints1 = 98; } - + if (!NPC.AnyNPCs(mod.NPCType("Titan_")) && InvasionWorld.CyberWrath && InvasionWorld.CyberWrathPoints1 < 98) { NPC.NewNPC((int)player.Center.X, (int)player.Center.Y - 200, mod.NPCType("Titan_")); } - + /*if (modPlayer.CyberWrathPoints1 == 94) { NPC.NewNPC((int)player.position.X, (int)player.position.Y - 200, mod.NPCType("Titan")); Main.NewText("Your life happens?", Color.Red.R, Color.Orange.G, Color.Red.B); modPlayer.CyberWrathPoints1 = 95; } */ - + if (NPC.AnyNPCs(mod.NPCType("Titan")) && InvasionWorld.CyberWrathPoints1 > 98) { InvasionWorld.CyberWrathPoints1 = 98; } - + if (NPC.AnyNPCs(mod.NPCType("Zerokk")) && InvasionWorld.CyberWrathPoints1 == 98) { InvasionWorld.CyberWrathPoints1 = 98; @@ -186,29 +186,29 @@ public override void PostUpdate() { InvasionWorld.CyberWrathPoints1 = 98; } - + if (NPC.AnyNPCs(mod.NPCType("Zerokk")) && InvasionWorld.CyberWrathPoints1 > 98) { InvasionWorld.CyberWrathPoints1 = 98; } - - if (InvasionWorld.CyberWrathPoints1 == 100 && !NPC.AnyNPCs(mod.NPCType("Titan_")) && !NPC.AnyNPCs(mod.NPCType("Titan"))) - { - Main.NewText("Paradox Cohort has been defeated!", 39, 86, 134); - InvasionWorld.CyberWrathPoints1 = 0; - } - } + + if (InvasionWorld.CyberWrathPoints1 == 100 && !NPC.AnyNPCs(mod.NPCType("Titan_")) && !NPC.AnyNPCs(mod.NPCType("Titan"))) + { + Main.NewText("Paradox Cohort has been defeated!", 39, 86, 134); + InvasionWorld.CyberWrathPoints1 = 0; + } + } public override bool PreKill(double damage, int hitDirection, bool pvp, ref bool playSound, ref bool genGore, ref PlayerDeathReason damageSource) - { - return true; - } - - public override void UpdateBiomeVisuals() - { - bool usePurity = InvasionWorld.CyberWrath; - player.ManageSpecialBiomeVisuals("Tremor:Invasion", usePurity); - } - } + { + return true; + } + + public override void UpdateBiomeVisuals() + { + bool usePurity = InvasionWorld.CyberWrath; + player.ManageSpecialBiomeVisuals("Tremor:Invasion", usePurity); + } + } } diff --git a/Invasion/EndlessPain.cs b/Invasion/EndlessPain.cs index 66b5bdcb..58997d42 100644 --- a/Invasion/EndlessPain.cs +++ b/Invasion/EndlessPain.cs @@ -5,38 +5,39 @@ using Terraria.ModLoader; using Terraria.DataStructures; -namespace Tremor.Invasion { -public class EndlessPain : ModItem +namespace Tremor.Invasion { - public override void SetDefaults() - { + public class EndlessPain : ModItem + { + public override void SetDefaults() + { - item.damage = 215; - item.width = 18; - item.height = 56; - item.useTime = 18; - item.magic = true; - item.mana = 25; - item.shoot = mod.ProjectileType("EndlessPainPro"); - item.shootSpeed = 4f; - item.useAnimation = 18; - item.noMelee = true; - item.useStyle = 5; - item.noUseGraphic = true; - item.knockBack = 5; - item.value = 250000; - item.rare = 11; - item.UseSound = SoundID.Item44; - item.autoReuse = false; - ItemID.Sets.ItemNoGravity[item.type] = true; - } + item.damage = 215; + item.width = 18; + item.height = 56; + item.useTime = 18; + item.magic = true; + item.mana = 25; + item.shoot = mod.ProjectileType("EndlessPainPro"); + item.shootSpeed = 4f; + item.useAnimation = 18; + item.noMelee = true; + item.useStyle = 5; + item.noUseGraphic = true; + item.knockBack = 5; + item.value = 250000; + item.rare = 11; + item.UseSound = SoundID.Item44; + item.autoReuse = false; + ItemID.Sets.ItemNoGravity[item.type] = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("The Endless Pain"); - Tooltip.SetDefault("Shoots a shadowflame orb\nOrb shoots shadowflames at nearby enemies"); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(5, 4)); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("The Endless Pain"); + Tooltip.SetDefault("Shoots a shadowflame orb\nOrb shoots shadowflames at nearby enemies"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(5, 4)); + } public override void AddRecipes() { @@ -48,5 +49,6 @@ public override void AddRecipes() recipe.AddTile(412); recipe.SetResult(this); recipe.AddRecipe(); - } -}} + } + } +} diff --git a/Invasion/EndlessPainPro.cs b/Invasion/EndlessPainPro.cs index 00ed6fa8..56c01ac9 100644 --- a/Invasion/EndlessPainPro.cs +++ b/Invasion/EndlessPainPro.cs @@ -5,100 +5,102 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Invasion { -public class EndlessPainPro : ModProjectile +namespace Tremor.Invasion { - - const int ShootRate = 20; // ����� ����५� (1 ᥪ㭤� = 60��.) - const float ShootDistance = 300f; // ���쭮��� ��५�� - const float ShootSpeed = 12f; // ������� ᭠�鸞 - const int ShootDamage = 210; // �஭ ᭠�鸞 - const float ShootKnockback = 2; // ���� ᭠�鸞 - int ShootType = 496; // ��� ����५� (�᫨ �� �����쭮� �ન) - int TimeToShoot = ShootRate; - string ShootTypeMod; - - public override void SetDefaults() - { + public class EndlessPainPro : ModProjectile + { - projectile.friendly = true; - projectile.width = 16; - projectile.height = 16; - projectile.aiStyle = 0; - Main.projFrames[projectile.type] = 4; - projectile.timeLeft = 1200; - projectile.penetrate = -1; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; - ProjectileID.Sets.TrailingMode[projectile.type] = 2; - } + const int ShootRate = 20; // ����� ����५� (1 ᥪ㭤� = 60��.) + const float ShootDistance = 300f; // ���쭮��� ��५�� + const float ShootSpeed = 12f; // ������� ᭠�鸞 + const int ShootDamage = 210; // �஭ ᭠�鸞 + const float ShootKnockback = 2; // ���� ᭠�鸞 + int ShootType = 496; // ��� ����५� (�᫨ �� �����쭮� �ન) + int TimeToShoot = ShootRate; + string ShootTypeMod; - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Endless Pain"); - - } - - public override void Kill(int timeLeft) - { - for(int k = 0; k < 5; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 27, projectile.oldVelocity.X * 0.1f, projectile.oldVelocity.Y * 0.1f); - } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 109); - } - - void Shoot() - { - if (--TimeToShoot <= 0) - { - TimeToShoot = ShootRate; - if (ShootType == -1) - ShootType = mod.ProjectileType(ShootTypeMod); + public override void SetDefaults() + { - float NearestNPCDist = ShootDistance; - int NearestNPC = -1; - foreach (NPC npc in Main.npc) - { - if (!npc.active) - continue; - if (npc.friendly || npc.lifeMax <= 5) - continue; - if (NearestNPCDist == -1 || npc.Distance(projectile.Center) < NearestNPCDist && Collision.CanHitLine(projectile.Center, 16, 16, npc.Center, 16, 16)) - { - NearestNPCDist = npc.Distance(projectile.Center); - NearestNPC = npc.whoAmI; - } - } - if (NearestNPC == -1) - return; - Vector2 Velocity = Helper.VelocityToPoint(projectile.Center, Main.npc[NearestNPC].Center, ShootSpeed); - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, Velocity.X, Velocity.Y, ShootType, ShootDamage, ShootKnockback, projectile.owner); - } - } + projectile.friendly = true; + projectile.width = 16; + projectile.height = 16; + projectile.aiStyle = 0; + Main.projFrames[projectile.type] = 4; + projectile.timeLeft = 1200; + projectile.penetrate = -1; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + } - public override void AI() - { - Shoot(); - int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 27, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 136, default(Color), 0.9f); - Main.dust[dust].noGravity = true; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Endless Pain"); - if(projectile.frameCounter < 5) + } + + public override void Kill(int timeLeft) + { + for (int k = 0; k < 5; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 27, projectile.oldVelocity.X * 0.1f, projectile.oldVelocity.Y * 0.1f); + } + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 109); + } + + void Shoot() + { + if (--TimeToShoot <= 0) + { + TimeToShoot = ShootRate; + if (ShootType == -1) + ShootType = mod.ProjectileType(ShootTypeMod); + + float NearestNPCDist = ShootDistance; + int NearestNPC = -1; + foreach (NPC npc in Main.npc) + { + if (!npc.active) + continue; + if (npc.friendly || npc.lifeMax <= 5) + continue; + if (NearestNPCDist == -1 || npc.Distance(projectile.Center) < NearestNPCDist && Collision.CanHitLine(projectile.Center, 16, 16, npc.Center, 16, 16)) + { + NearestNPCDist = npc.Distance(projectile.Center); + NearestNPC = npc.whoAmI; + } + } + if (NearestNPC == -1) + return; + Vector2 Velocity = Helper.VelocityToPoint(projectile.Center, Main.npc[NearestNPC].Center, ShootSpeed); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, Velocity.X, Velocity.Y, ShootType, ShootDamage, ShootKnockback, projectile.owner); + } + } + + public override void AI() + { + Shoot(); + int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 27, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 136, default(Color), 0.9f); + Main.dust[dust].noGravity = true; + + if (projectile.frameCounter < 5) projectile.frame = 0; - else if(projectile.frameCounter >= 5 && projectile.frameCounter < 10) + else if (projectile.frameCounter >= 5 && projectile.frameCounter < 10) projectile.frame = 1; - else if(projectile.frameCounter >= 10 && projectile.frameCounter < 15) + else if (projectile.frameCounter >= 10 && projectile.frameCounter < 15) projectile.frame = 2; - else if(projectile.frameCounter >= 15 && projectile.frameCounter < 20) + else if (projectile.frameCounter >= 15 && projectile.frameCounter < 20) projectile.frame = 3; else projectile.frameCounter = 0; projectile.frameCounter++; - } + } - public override Color? GetAlpha(Color lightColor) - { - return Color.White; - } + public override Color? GetAlpha(Color lightColor) + { + return Color.White; + } -}} + } +} diff --git a/Invasion/Hand.cs b/Invasion/Hand.cs index 24a3e5a9..9459bb11 100644 --- a/Invasion/Hand.cs +++ b/Invasion/Hand.cs @@ -5,43 +5,43 @@ namespace Tremor.Invasion { - public class Hand : ModNPC - { - //[1] id head + public class Hand : ModNPC + { + //[1] id head public override void SetStaticDefaults() { DisplayName.SetDefault("Paradox Titan Hand"); } - public override void SetDefaults() - { - npc.lifeMax = 40000; - npc.damage = 100; - npc.defense = 50; - npc.knockBackResist = 0.5f; - npc.width = 44; - npc.height = 84; - npc.aiStyle = 12; - npc.noGravity = true; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath14; - npc.value = Item.buyPrice(0, 0, 5, 0); - } + public override void SetDefaults() + { + npc.lifeMax = 40000; + npc.damage = 100; + npc.defense = 50; + npc.knockBackResist = 0.5f; + npc.width = 44; + npc.height = 84; + npc.aiStyle = 12; + npc.noGravity = true; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit4; + npc.DeathSound = SoundID.NPCDeath14; + npc.value = Item.buyPrice(0, 0, 5, 0); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { - } - } - public override bool PreNPCLoot() - { - npc.aiStyle = -1; - npc.ai[1] = -1; - return false; - } - } + } + } + public override bool PreNPCLoot() + { + npc.aiStyle = -1; + npc.ai[1] = -1; + return false; + } + } } \ No newline at end of file diff --git a/Invasion/Hand_.cs b/Invasion/Hand_.cs index e3a8e720..99fba470 100644 --- a/Invasion/Hand_.cs +++ b/Invasion/Hand_.cs @@ -5,43 +5,43 @@ namespace Tremor.Invasion { - public class Hand_ : ModNPC - { - //[1] id head + public class Hand_ : ModNPC + { + //[1] id head public override void SetStaticDefaults() { DisplayName.SetDefault("Paradox Titan Hand"); } - public override void SetDefaults() - { - npc.lifeMax = 40000; - npc.damage = 100; - npc.defense = 50; - npc.knockBackResist = 0.5f; - npc.width = 44; - npc.height = 84; - npc.aiStyle = 12; - npc.noGravity = true; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath14; - npc.value = Item.buyPrice(0, 0, 5, 0); - } + public override void SetDefaults() + { + npc.lifeMax = 40000; + npc.damage = 100; + npc.defense = 50; + npc.knockBackResist = 0.5f; + npc.width = 44; + npc.height = 84; + npc.aiStyle = 12; + npc.noGravity = true; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit4; + npc.DeathSound = SoundID.NPCDeath14; + npc.value = Item.buyPrice(0, 0, 5, 0); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { - } - } - public override bool PreNPCLoot() - { - npc.aiStyle = -1; - npc.ai[1] = -1; - return false; - } - } + } + } + public override bool PreNPCLoot() + { + npc.aiStyle = -1; + npc.ai[1] = -1; + return false; + } + } } \ No newline at end of file diff --git a/Invasion/InvasionWorld.cs b/Invasion/InvasionWorld.cs index c36077f4..6fd27ce1 100644 --- a/Invasion/InvasionWorld.cs +++ b/Invasion/InvasionWorld.cs @@ -13,38 +13,38 @@ namespace Tremor.Invasion { public class InvasionWorld : ModWorld { - private const int saveVersion = 0; - public static int CyberWrathPoints = 0; - public static int CyberWrathPoints1 = 0; - public static bool CyberWrath = false; + private const int saveVersion = 0; + public static int CyberWrathPoints = 0; + public static int CyberWrathPoints1 = 0; + public static bool CyberWrath = false; public override void ModifyWorldGenTasks(List tasks, ref float totalWeight) { - + } public override void PostWorldGen() { - - } + + } public override void Initialize() - { + { CyberWrathPoints1 = 0; CyberWrath = false; - } + } - public override void TileCountsAvailable(int[] tileCounts) + public override void TileCountsAvailable(int[] tileCounts) { - + } - + /*public override void SaveCustomData(BinaryWriter writer) { writer.Write(saveVersion); writer.Write(CyberWrath); writer.Write(CyberWrathPoints1); } */ - + public override TagCompound Save() { TagCompound save_data = new TagCompound(); @@ -52,7 +52,7 @@ public override TagCompound Save() save_data.Add("CyberWrathPoints1", CyberWrathPoints1); return save_data; } - + public override void NetSend(BinaryWriter writer) { writer.Write(CyberWrath); @@ -65,14 +65,14 @@ public override void NetReceive(BinaryReader reader) flags[0] = CyberWrath; CyberWrathPoints1 = reader.ReadInt32(); } - + int num; public override void Load(TagCompound tag) { CyberWrath = tag.GetBool("CyberWrath"); - CyberWrathPoints1 = tag.GetInt("CyberWrathPoints1"); + CyberWrathPoints1 = tag.GetInt("CyberWrathPoints1"); } - + public override void LoadLegacy(BinaryReader reader) { int loadVersion = reader.ReadInt32(); @@ -86,6 +86,6 @@ public override void LoadLegacy(BinaryReader reader) { ErrorLogger.Log("Tremor: Unknown loadVersion: " + loadVersion); } - } + } } } diff --git a/Invasion/InvisibleSoul.cs b/Invasion/InvisibleSoul.cs index 86feed47..78b28bce 100644 --- a/Invasion/InvisibleSoul.cs +++ b/Invasion/InvisibleSoul.cs @@ -6,276 +6,277 @@ using Terraria.ModLoader; -namespace Tremor.Invasion { - public class InvisibleSoul : ModNPC - { +namespace Tremor.Invasion +{ + public class InvisibleSoul : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Paradox Soul Warrior"); Main.npcFrameCount[npc.type] = 3; } - - public override void SetDefaults() - { - npc.lifeMax = 12250; - npc.damage = 100; - npc.defense = 65; - npc.knockBackResist = 0f; - npc.width = 34; - npc.height = 40; - animationType = 3; - npc.aiStyle = 3; - aiType = 77; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit55; - npc.DeathSound = SoundID.NPCDeath51; - npc.color = Color.White; - } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - Mod mod = ModLoader.GetMod("Tremor"); - CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer(mod); - float spawn = 20f; - if (InvasionWorld.CyberWrath) - return 1000f; - else - return 0f; + public override void SetDefaults() + { + npc.lifeMax = 12250; + npc.damage = 100; + npc.defense = 65; + npc.knockBackResist = 0f; + npc.width = 34; + npc.height = 40; + animationType = 3; + npc.aiStyle = 3; + aiType = 77; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit55; + npc.DeathSound = SoundID.NPCDeath51; + npc.color = Color.White; + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + Mod mod = ModLoader.GetMod("Tremor"); + CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer(mod); + float spawn = 20f; + if (InvasionWorld.CyberWrath) + return 1000f; + else + return 0f; - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return InvasionWorld.CyberWrath && y > Main.worldSurface ? 1f : 0f; - } + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return InvasionWorld.CyberWrath && y > Main.worldSurface ? 1f : 0f; + } + + public override void OnHitPlayer(Player player, int damage, bool crit) + { + if (Main.rand.Next(3) == 0) + { + player.AddBuff(164, 1000, true); + } + } - public override void OnHitPlayer(Player player, int damage, bool crit) - { - if(Main.rand.Next(3) == 0) - { - player.AddBuff(164, 1000, true); - } - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 10; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } - public override void HitEffect(int hitDirection, double damage) - { - if (npc.life <= 0) - { - for (int k = 0; k < 10; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } + CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer(mod); + if (InvasionWorld.CyberWrath && Main.rand.Next(3) == 1) + { + InvasionWorld.CyberWrathPoints1 += 3; + //Main.NewText(("Wave 1: Complete " + TremorWorld.CyberWrathPoints + "%"), 39, 86, 134); + } + } - CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer(mod); - if (InvasionWorld.CyberWrath && Main.rand.Next(3) == 1) - { - InvasionWorld.CyberWrathPoints1 += 3; - //Main.NewText(("Wave 1: Complete " + TremorWorld.CyberWrathPoints + "%"), 39, 86, 134); - } - } + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), (float)hitDirection, -1f, 0, default(Color), 0.7f); + } + } - for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ParadoxElement"), Main.rand.Next(5, 7)); + } + } + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ParadoxElement"), Main.rand.Next(5,7)); - } - } - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + float customAi1; + bool FirstState = false; + bool SecondState = false; + public Vector2 tilePos = default(Vector2); + public override void AI() + { + //PlayAnimation(); + if (npc.life > npc.lifeMax / 2) + { + FirstState = true; + } - float customAi1; - bool FirstState = false; - bool SecondState = false; - public Vector2 tilePos = default(Vector2); - public override void AI() - { - //PlayAnimation(); - if (npc.life > npc.lifeMax / 2) - { - FirstState = true; - } + if (npc.life < npc.lifeMax / 2) + { + FirstState = false; + SecondState = true; + } - if (npc.life < npc.lifeMax / 2) - { - FirstState = false; - SecondState = true; - } - - if (Main.rand.Next(2) == 0) - { - int num706 = Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), 0f, 0f, 200, npc.color, 0.5f); - Main.dust[num706].velocity *= 0.6f; - } - if (FirstState) - { - if (Main.player[this.npc.target].position.X > this.npc.position.X) - this.npc.spriteDirection = 1; - else - this.npc.spriteDirection = -1; + if (Main.rand.Next(2) == 0) + { + int num706 = Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), 0f, 0f, 200, npc.color, 0.5f); + Main.dust[num706].velocity *= 0.6f; + } + if (FirstState) + { + if (Main.player[this.npc.target].position.X > this.npc.position.X) + this.npc.spriteDirection = 1; + else + this.npc.spriteDirection = -1; - if (this.npc.direction == -1 && this.npc.velocity.X > -2f) - { - this.npc.velocity.X = this.npc.velocity.X - 0.1f; - if (this.npc.velocity.X > 2f) - { - this.npc.velocity.X = this.npc.velocity.X - 0.1f; - } - else - { - if (this.npc.velocity.X > 0f) - { - this.npc.velocity.X = this.npc.velocity.X + 0.05f; - } - } - if (this.npc.velocity.X < -2f) - { - this.npc.velocity.X = -2f; - } - } - else - { - if (this.npc.direction == 1 && this.npc.velocity.X < 2f) - { - this.npc.velocity.X = this.npc.velocity.X + 0.1f; - if (this.npc.velocity.X < -2f) - { - this.npc.velocity.X = this.npc.velocity.X + 0.1f; - } - else - { - if (this.npc.velocity.X < 0f) - { - this.npc.velocity.X = this.npc.velocity.X - 0.05f; - } - } - if (this.npc.velocity.X > 2f) - { - this.npc.velocity.X = 2f; - } - } - } - if (this.npc.directionY == -1 && (double)this.npc.velocity.Y > -1.5) - { - this.npc.velocity.Y = this.npc.velocity.Y - 0.05f; + if (this.npc.direction == -1 && this.npc.velocity.X > -2f) + { + this.npc.velocity.X = this.npc.velocity.X - 0.1f; + if (this.npc.velocity.X > 2f) + { + this.npc.velocity.X = this.npc.velocity.X - 0.1f; + } + else + { + if (this.npc.velocity.X > 0f) + { + this.npc.velocity.X = this.npc.velocity.X + 0.05f; + } + } + if (this.npc.velocity.X < -2f) + { + this.npc.velocity.X = -2f; + } + } + else + { + if (this.npc.direction == 1 && this.npc.velocity.X < 2f) + { + this.npc.velocity.X = this.npc.velocity.X + 0.1f; + if (this.npc.velocity.X < -2f) + { + this.npc.velocity.X = this.npc.velocity.X + 0.1f; + } + else + { + if (this.npc.velocity.X < 0f) + { + this.npc.velocity.X = this.npc.velocity.X - 0.05f; + } + } + if (this.npc.velocity.X > 2f) + { + this.npc.velocity.X = 2f; + } + } + } + if (this.npc.directionY == -1 && (double)this.npc.velocity.Y > -1.5) + { + this.npc.velocity.Y = this.npc.velocity.Y - 0.05f; - if ((double)this.npc.velocity.Y < -1.5) - { - this.npc.velocity.Y = -1.5f; - } - } - else - { - if (this.npc.directionY == 1 && (double)this.npc.velocity.Y < 1.5) - { - this.npc.velocity.Y = this.npc.velocity.Y + 0.05f; - if ((double)this.npc.velocity.Y > 1.5) - { - this.npc.velocity.Y = 1.5f; - } - } - } + if ((double)this.npc.velocity.Y < -1.5) + { + this.npc.velocity.Y = -1.5f; + } + } + else + { + if (this.npc.directionY == 1 && (double)this.npc.velocity.Y < 1.5) + { + this.npc.velocity.Y = this.npc.velocity.Y + 0.05f; + if ((double)this.npc.velocity.Y > 1.5) + { + this.npc.velocity.Y = 1.5f; + } + } + } - if (Main.rand.Next(160) == 0) - { - NPC.NewNPC((int)npc.position.X - 50, (int)npc.position.Y, mod.NPCType("MiniSoul")); - } - } + if (Main.rand.Next(160) == 0) + { + NPC.NewNPC((int)npc.position.X - 50, (int)npc.position.Y, mod.NPCType("MiniSoul")); + } + } - if (SecondState && !FirstState) - { - if (Main.player[this.npc.target].position.X > this.npc.position.X) - this.npc.spriteDirection = 1; - else - this.npc.spriteDirection = -1; + if (SecondState && !FirstState) + { + if (Main.player[this.npc.target].position.X > this.npc.position.X) + this.npc.spriteDirection = 1; + else + this.npc.spriteDirection = -1; - if (this.npc.direction == -1 && this.npc.velocity.X > -2f) - { - this.npc.velocity.X = this.npc.velocity.X - 0.1f; - if (this.npc.velocity.X > 2f) - { - this.npc.velocity.X = this.npc.velocity.X - 0.1f; - } - else - { - if (this.npc.velocity.X > 0f) - { - this.npc.velocity.X = this.npc.velocity.X + 0.05f; - } - } - if (this.npc.velocity.X < -2f) - { - this.npc.velocity.X = -2f; - } - } - else - { - if (this.npc.direction == 1 && this.npc.velocity.X < 2f) - { - this.npc.velocity.X = this.npc.velocity.X + 0.1f; - if (this.npc.velocity.X < -2f) - { - this.npc.velocity.X = this.npc.velocity.X + 0.1f; - } - else - { - if (this.npc.velocity.X < 0f) - { - this.npc.velocity.X = this.npc.velocity.X - 0.05f; - } - } - if (this.npc.velocity.X > 2f) - { - this.npc.velocity.X = 2f; - } - } - } - if (this.npc.directionY == -1 && (double)this.npc.velocity.Y > -1.5) - { - this.npc.velocity.Y = this.npc.velocity.Y - 0.05f; + if (this.npc.direction == -1 && this.npc.velocity.X > -2f) + { + this.npc.velocity.X = this.npc.velocity.X - 0.1f; + if (this.npc.velocity.X > 2f) + { + this.npc.velocity.X = this.npc.velocity.X - 0.1f; + } + else + { + if (this.npc.velocity.X > 0f) + { + this.npc.velocity.X = this.npc.velocity.X + 0.05f; + } + } + if (this.npc.velocity.X < -2f) + { + this.npc.velocity.X = -2f; + } + } + else + { + if (this.npc.direction == 1 && this.npc.velocity.X < 2f) + { + this.npc.velocity.X = this.npc.velocity.X + 0.1f; + if (this.npc.velocity.X < -2f) + { + this.npc.velocity.X = this.npc.velocity.X + 0.1f; + } + else + { + if (this.npc.velocity.X < 0f) + { + this.npc.velocity.X = this.npc.velocity.X - 0.05f; + } + } + if (this.npc.velocity.X > 2f) + { + this.npc.velocity.X = 2f; + } + } + } + if (this.npc.directionY == -1 && (double)this.npc.velocity.Y > -1.5) + { + this.npc.velocity.Y = this.npc.velocity.Y - 0.05f; - if ((double)this.npc.velocity.Y < -1.5) - { - this.npc.velocity.Y = -1.5f; - } - } - else - { - if (this.npc.directionY == 1 && (double)this.npc.velocity.Y < 1.5) - { - this.npc.velocity.Y = this.npc.velocity.Y + 0.05f; - if ((double)this.npc.velocity.Y > 1.5) - { - this.npc.velocity.Y = 1.5f; - } - } - } + if ((double)this.npc.velocity.Y < -1.5) + { + this.npc.velocity.Y = -1.5f; + } + } + else + { + if (this.npc.directionY == 1 && (double)this.npc.velocity.Y < 1.5) + { + this.npc.velocity.Y = this.npc.velocity.Y + 0.05f; + if ((double)this.npc.velocity.Y > 1.5) + { + this.npc.velocity.Y = 1.5f; + } + } + } - if (Main.rand.Next(120) == 0) - { - NPC.NewNPC((int)npc.position.X - 50, (int)npc.position.Y, mod.NPCType("MiniSoul")); - } + if (Main.rand.Next(120) == 0) + { + NPC.NewNPC((int)npc.position.X - 50, (int)npc.position.Y, mod.NPCType("MiniSoul")); + } - if (Main.rand.Next(200) == 0) - { - NPC.NewNPC((int)npc.position.X - 50, (int)npc.position.Y, mod.NPCType("CyberSoul")); - } - } - } - } + if (Main.rand.Next(200) == 0) + { + NPC.NewNPC((int)npc.position.X - 50, (int)npc.position.Y, mod.NPCType("CyberSoul")); + } + } + } + } } \ No newline at end of file diff --git a/Invasion/Light.cs b/Invasion/Light.cs index 4eacf010..89abb67e 100644 --- a/Invasion/Light.cs +++ b/Invasion/Light.cs @@ -16,20 +16,20 @@ public override void SetDefaults() public override void Update(Player player, ref int buffIndex) { - player.meleeSpeed += 0.03f; - player.detectCreature = true; - player.findTreasure = true; - player.meleeDamage += 0.03f; - player.rangedDamage += 0.03f; - player.thrownDamage += 0.03f; - player.minionDamage += 0.03f; - player.magicDamage += 0.03f; - player.moveSpeed += 0.2f; - player.rangedCrit += 2; - player.meleeCrit += 2; - player.magicCrit += 2; - player.thrownCrit += 2; - player.jumpSpeedBoost += 0.2f; - } + player.meleeSpeed += 0.03f; + player.detectCreature = true; + player.findTreasure = true; + player.meleeDamage += 0.03f; + player.rangedDamage += 0.03f; + player.thrownDamage += 0.03f; + player.minionDamage += 0.03f; + player.magicDamage += 0.03f; + player.moveSpeed += 0.2f; + player.rangedCrit += 2; + player.meleeCrit += 2; + player.magicCrit += 2; + player.thrownCrit += 2; + player.jumpSpeedBoost += 0.2f; + } } } \ No newline at end of file diff --git a/Invasion/MiniSoul.cs b/Invasion/MiniSoul.cs index 605cd0d7..168a9cd2 100644 --- a/Invasion/MiniSoul.cs +++ b/Invasion/MiniSoul.cs @@ -8,73 +8,73 @@ using Terraria.ModLoader; namespace Tremor.Invasion { - public class MiniSoul : ModNPC - { + public class MiniSoul : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Paradox Soul"); Main.npcFrameCount[npc.type] = 3; } - - int num = 0; - public readonly IList targets = new List(); - public static readonly int arenaWidth = (int)(1.3f * NPC.sWidth); - public static readonly int arenaHeight = (int)(1.3f * NPC.sHeight); - public override void SetDefaults() - { - npc.lifeMax = 450; - npc.damage = 150; - npc.defense = 30; - npc.knockBackResist = 0f; - npc.width = 28; - npc.height = 30; - npc.aiStyle = 87; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath42; - npc.value = Item.buyPrice(0, 3, 0, 0); - animationType = 3; - } + int num = 0; + public readonly IList targets = new List(); + public static readonly int arenaWidth = (int)(1.3f * NPC.sWidth); + public static readonly int arenaHeight = (int)(1.3f * NPC.sHeight); + public override void SetDefaults() + { + npc.lifeMax = 450; + npc.damage = 150; + npc.defense = 30; + npc.knockBackResist = 0f; + npc.width = 28; + npc.height = 30; + npc.aiStyle = 87; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath42; + npc.value = Item.buyPrice(0, 3, 0, 0); + animationType = 3; + } - public override void NPCLoot() - { - } + public override void NPCLoot() + { - private void SettingNumber() - { - if (Main.rand.Next(2) == 1) - { - num++; - } + } - else - { - num--; - } - } + private void SettingNumber() + { + if (Main.rand.Next(2) == 1) + { + num++; + } - public override void HitEffect(int hitDirection, double damage) - { - if (npc.life <= 0) - { - for (int k = 0; k < 10; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } + else + { + num--; + } + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 10; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } - CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer(mod); - if (InvasionWorld.CyberWrath && Main.rand.Next(4) == 1) - { - InvasionWorld.CyberWrathPoints1 += 1; - //Main.NewText(("Wave 1: Complete " + TremorWorld.CyberWrathPoints + "%"), 39, 86, 134); - } - } + CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer(mod); + if (InvasionWorld.CyberWrath && Main.rand.Next(4) == 1) + { + InvasionWorld.CyberWrathPoints1 += 1; + //Main.NewText(("Wave 1: Complete " + TremorWorld.CyberWrathPoints + "%"), 39, 86, 134); + } + } - for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } - } + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), (float)hitDirection, -1f, 0, default(Color), 0.7f); + } + } + } } \ No newline at end of file diff --git a/Invasion/Mini_Cyber.cs b/Invasion/Mini_Cyber.cs index d0d2831b..e5c08bd6 100644 --- a/Invasion/Mini_Cyber.cs +++ b/Invasion/Mini_Cyber.cs @@ -9,26 +9,26 @@ namespace Tremor.Invasion { public class Mini_Cyber : Minion { - const int ShootRate = 30; - const float ShootDistance = 450f; - const float ShootSpeed = 20f; - const int ShootDamage = 40; - const float ShootKnockback = 4; + const int ShootRate = 30; + const float ShootDistance = 450f; + const float ShootSpeed = 20f; + const int ShootDamage = 40; + const float ShootKnockback = 4; - int TimeToShoot = ShootRate; + int TimeToShoot = ShootRate; public override void SetStaticDefaults() { DisplayName.SetDefault("Mini-Cyber"); } - public override void SetDefaults() + public override void SetDefaults() { - projectile.netImportant = true; - projectile.CloneDefaults(388); - aiType = 388; - projectile.light = 2f; - projectile.width = 26; + projectile.netImportant = true; + projectile.CloneDefaults(388); + aiType = 388; + projectile.light = 2f; + projectile.width = 26; projectile.height = 30; Main.projFrames[projectile.type] = 3; projectile.friendly = true; @@ -37,21 +37,21 @@ public override void SetDefaults() projectile.penetrate = -1; projectile.timeLeft = 18000; projectile.ignoreWater = true; - projectile.tileCollide = false; - ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; + projectile.tileCollide = false; + ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; } public override bool OnTileCollide(Vector2 oldVelocity) { - if (projectile.velocity.X != oldVelocity.X) - { - projectile.velocity.X = oldVelocity.X; - } - if (projectile.velocity.Y != oldVelocity.Y) - { - projectile.velocity.Y = oldVelocity.Y; - } - return false; + if (projectile.velocity.X != oldVelocity.X) + { + projectile.velocity.X = oldVelocity.X; + } + if (projectile.velocity.Y != oldVelocity.Y) + { + projectile.velocity.Y = oldVelocity.Y; + } + return false; } public override void CheckActive() { @@ -68,37 +68,37 @@ public override void CheckActive() } - void Shoot() - { - float NearestNPCDist = ShootDistance; - int NearestNPC = -1; - foreach (NPC npc in Main.npc) - { - if (!npc.active) - continue; - if (npc.friendly || npc.lifeMax <= 5) - continue; - if (NearestNPCDist == -1 || npc.Distance(projectile.Center) < NearestNPCDist && Collision.CanHitLine(projectile.Center, 16, 16, npc.Center, 16, 16)) - { - NearestNPCDist = npc.Distance(projectile.Center); - NearestNPC = npc.whoAmI; - } - } - if (NearestNPC == -1) - return; - if (Main.mouseLeft) - if ((int)(Main.time % 60) == 0) - { - Player player = Main.player[Main.myPlayer]; - Vector2 Velocity = Helper.VelocityToPoint(projectile.Center, Main.npc[NearestNPC].Center, ShootSpeed); - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, Velocity.X, Velocity.Y, mod.ProjectileType("CyberLaser"), ShootDamage, ShootKnockback, projectile.owner); - } - } + void Shoot() + { + float NearestNPCDist = ShootDistance; + int NearestNPC = -1; + foreach (NPC npc in Main.npc) + { + if (!npc.active) + continue; + if (npc.friendly || npc.lifeMax <= 5) + continue; + if (NearestNPCDist == -1 || npc.Distance(projectile.Center) < NearestNPCDist && Collision.CanHitLine(projectile.Center, 16, 16, npc.Center, 16, 16)) + { + NearestNPCDist = npc.Distance(projectile.Center); + NearestNPC = npc.whoAmI; + } + } + if (NearestNPC == -1) + return; + if (Main.mouseLeft) + if ((int)(Main.time % 60) == 0) + { + Player player = Main.player[Main.myPlayer]; + Vector2 Velocity = Helper.VelocityToPoint(projectile.Center, Main.npc[NearestNPC].Center, ShootSpeed); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, Velocity.X, Velocity.Y, mod.ProjectileType("CyberLaser"), ShootDamage, ShootKnockback, projectile.owner); + } + } - public override void AI() - { - Shoot(); - base.AI(); - } - } + public override void AI() + { + Shoot(); + base.AI(); + } + } } \ No newline at end of file diff --git a/Invasion/ParadoxBat.cs b/Invasion/ParadoxBat.cs index 60136b1e..13cecdc8 100644 --- a/Invasion/ParadoxBat.cs +++ b/Invasion/ParadoxBat.cs @@ -6,78 +6,79 @@ using Terraria.ModLoader; -namespace Tremor.Invasion { - public class ParadoxBat : ModNPC - { +namespace Tremor.Invasion +{ + public class ParadoxBat : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Paradox Bat"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 750; - npc.damage = 105; - npc.defense = 35; - npc.knockBackResist = 0f; - npc.width = 34; - npc.height = 20; - animationType = 75; - npc.aiStyle = -1; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit55; - npc.noGravity = true; - npc.DeathSound = SoundID.NPCDeath44; - npc.color = Color.White; - } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - Mod mod = ModLoader.GetMod("Tremor"); - CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer(mod); - float spawn = 20f; - if (InvasionWorld.CyberWrath) - return 1000f; - else - return 0f; - - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return InvasionWorld.CyberWrath && y > Main.worldSurface ? 1f : 0f; - } + public override void SetDefaults() + { + npc.lifeMax = 750; + npc.damage = 105; + npc.defense = 35; + npc.knockBackResist = 0f; + npc.width = 34; + npc.height = 20; + animationType = 75; + npc.aiStyle = -1; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit55; + npc.noGravity = true; + npc.DeathSound = SoundID.NPCDeath44; + npc.color = Color.White; + } - public override void HitEffect(int hitDirection, double damage) - { - if (npc.life <= 0) - { - for (int k = 0; k < 10; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - - CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer(mod); - if (InvasionWorld.CyberWrath && Main.rand.Next(2) == 1) - { - InvasionWorld.CyberWrathPoints1 += 1; - //Main.NewText(("Wave 1: Complete " + TremorWorld.CyberWrathPoints + "%"), 39, 86, 134); - } - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + Mod mod = ModLoader.GetMod("Tremor"); + CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer(mod); + float spawn = 20f; + if (InvasionWorld.CyberWrath) + return 1000f; + else + return 0f; + + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return InvasionWorld.CyberWrath && y > Main.worldSurface ? 1f : 0f; + } - for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 10; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + + CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer(mod); + if (InvasionWorld.CyberWrath && Main.rand.Next(2) == 1) + { + InvasionWorld.CyberWrathPoints1 += 1; + //Main.NewText(("Wave 1: Complete " + TremorWorld.CyberWrathPoints + "%"), 39, 86, 134); + } + } + + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), (float)hitDirection, -1f, 0, default(Color), 0.7f); + } + } - int TimeToAnimation = 6; - int AnimationRate = 6; - int FrameCount = 4; - float DistortPercent = 0.15f; - int Frame = 0; + int TimeToAnimation = 6; + int AnimationRate = 6; + int FrameCount = 4; + float DistortPercent = 0.15f; + int Frame = 0; - /*void PlayAnimation() + /*void PlayAnimation() { if (--TimeToAnimation <= 0) { @@ -94,363 +95,363 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) return false; } */ - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } - - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ParadoxElement"), Main.rand.Next(3,5)); - } - if(Main.rand.Next(50) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SecondHand")); - } - } - } - - float customAi1; - bool FirstState = false; - bool SecondState = false; - public override void AI() - { - //PlayAnimation(); - if (npc.life > npc.lifeMax / 2) - { - FirstState = true; - } - - if (npc.life < npc.lifeMax / 2) - { - FirstState = false; - SecondState = true; - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - if (Main.rand.Next(150) == 0) - { - for (int num36 = 0; num36 < 25; num36++) - { - int dust = Dust.NewDust(new Vector2((float)npc.position.X, (float)npc.position.Y), npc.width, npc.height, mod.DustType("CyberDust"), npc.velocity.X + Main.rand.Next(-10, 10), npc.velocity.Y + Main.rand.Next(-10, 10), 1, npc.color, 1f); - Main.dust[dust].noGravity = true; - } - - npc.ai[3] = (float)(Main.rand.Next(360) * (Math.PI / 180)); - npc.ai[2] = 0; - npc.ai[1] = 0; - if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active) - { - npc.TargetClosest(true); - } - if (Main.player[npc.target].dead) - { - npc.position.X = 0; - npc.position.Y = 0; - if (npc.timeLeft > 10) - { - npc.timeLeft = 10; - return; - } - } - else - { - npc.position.X = Main.player[npc.target].position.X + (float)((250 * Math.Cos(npc.ai[3])) * -1); - npc.position.Y = Main.player[npc.target].position.Y + (float)((250 * Math.Sin(npc.ai[3])) * -1); - } - } - if (Main.rand.Next(2) == 0) - { - int num706 = Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), 0f, 0f, 200, npc.color, 0.5f); - Main.dust[num706].velocity *= 0.6f; - } - if (FirstState) - { - npc.TargetClosest(true); - Vector2 PTC = Main.player[npc.target].position + new Vector2(npc.width / 2, npc.height / 2); - Vector2 NPos = npc.position + new Vector2(npc.width / 2, npc.height / 2); - npc.netUpdate = true; - - if (npc.ai[1] == 0) - { - if (Main.player[npc.target].position.X < npc.position.X) - { - if (npc.velocity.X > -8) npc.velocity.X -= 0.10f; - } - - if (Main.player[npc.target].position.X > npc.position.X) - { - if (npc.velocity.X < 8) npc.velocity.X += 0.10f; - } - - if (Main.player[npc.target].position.Y < npc.position.Y + 200) - { - if (npc.velocity.Y < 0) - { - if (npc.velocity.Y > -4) npc.velocity.Y -= 0.4f; - } - else npc.velocity.Y -= 0.8f; - } - - if (Main.player[npc.target].position.Y > npc.position.Y + 200) - { - if (npc.velocity.Y > 0) - { - if (npc.velocity.Y < 4) npc.velocity.Y += 0.4f; - } - else npc.velocity.Y += 0.6f; - } - } - - customAi1 += (Main.rand.Next(2, 5) * 0.1f) * npc.scale; - if (customAi1 >= 4f) - if (Main.rand.Next(120) == 1) - { - Main.PlaySound(16, (int)npc.position.X, (int)npc.position.Y, 12); - float Angle = (float)Math.Atan2(NPos.Y - PTC.Y, NPos.X - PTC.X); - int SpitShot1 = Projectile.NewProjectile(NPos.X, NPos.Y, (float)((Math.Cos(Angle) * 22f) * -1), (float)((Math.Sin(Angle) * 22f) * -1), mod.ProjectileType("CyberLaserBat"), 30, 0f, 0); - //Main.projectile[SpitShot1].friendly = false; - Main.projectile[SpitShot1].timeLeft = 500; - customAi1 = 1f; - } - npc.netUpdate = true; - - if (Main.rand.Next(6) == 0) - { - int dust = Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), 0f, 0f, 200, npc.color, 0.4f); - Main.dust[dust].velocity *= 0.4f; - } - - if (npc.ai[1] == 1) - { - - } - - npc.ai[2] += 1; - if (npc.ai[2] >= 600) - { - if (npc.ai[1] == 0) npc.ai[1] = 1; - else npc.ai[1] = 0; - } - if (npc.life > 500) - { - Color color = new Color(); - int dust = Dust.NewDust(new Vector2((float)npc.position.X, (float)npc.position.Y), npc.width, npc.height, mod.DustType("CyberDust"), npc.velocity.X, npc.velocity.Y, 100, color, 0.6f); - Main.dust[dust].noGravity = true; - } - else if (npc.life <= 200) - { - Color color = new Color(); - int dust = Dust.NewDust(new Vector2((float)npc.position.X, (float)npc.position.Y), npc.width, npc.height, mod.DustType("CyberDust"), npc.velocity.X, npc.velocity.Y, 50, color, 0.8f); - Main.dust[dust].noGravity = true; - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ParadoxElement"), Main.rand.Next(3, 5)); + } + if (Main.rand.Next(50) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SecondHand")); + } + } + } - if (SecondState && !FirstState) - { - Vector2 PTC = Main.player[npc.target].position + new Vector2(npc.width / 2, npc.height / 2); - Vector2 NPos = npc.position + new Vector2(npc.width / 2, npc.height / 2); - if (Main.rand.Next(70) == 1) - { - Main.PlaySound(16, (int)npc.position.X, (int)npc.position.Y, 12); - float Angle = (float)Math.Atan2(NPos.Y - PTC.Y, NPos.X - PTC.X); - int SpitShot1 = Projectile.NewProjectile(NPos.X, NPos.Y, (float)((Math.Cos(Angle) * 22f) * -1), (float)((Math.Sin(Angle) * 22f) * -1), mod.ProjectileType("CyberLaserBat"), 30, 0f, 0); - //Main.projectile[SpitShot1].friendly = false; - Main.projectile[SpitShot1].timeLeft = 500; - customAi1 = 1f; - } - float npc_to_target_x = npc.position.X + (float)(npc.width / 2) - Main.player[npc.target].position.X - (float)(Main.player[npc.target].width / 2); - float npc_to_target_y = npc.position.Y + (float)npc.height - 59f - Main.player[npc.target].position.Y - (float)(Main.player[npc.target].height / 2); // 59(3.7 blocks) above bottom(slightly above center; ht is 110) to target center - float npc_to_target_angle = (float)Math.Atan2((double)npc_to_target_y, (double)npc_to_target_x) + 1.57f; // angle+pi/2 - if (npc_to_target_angle < 0f) // modulus - npc_to_target_angle += 6.283f; - else if ((double)npc_to_target_angle > 6.283) - npc_to_target_angle -= 6.283f; - float rotation_rate = 0.15f; - float top_speed = 4f; - float accel = 0.1f; - int close_side_of_target = 1; - if (npc.position.X + (float)(npc.width / 2) < Main.player[npc.target].position.X + (float)Main.player[npc.target].width) - close_side_of_target = -1; - - Vector2 npc_pos = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - npc_to_target_x = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) + (float)(close_side_of_target * 360) - npc_pos.X; - npc_to_target_y = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) + (float)(close_side_of_target * 160) - npc_pos.Y; - float dist_to_target = (float)Math.Sqrt((double)(npc_to_target_x * npc_to_target_x + npc_to_target_y * npc_to_target_y)); - dist_to_target = top_speed / dist_to_target; - npc_to_target_x *= dist_to_target; - npc_to_target_y *= dist_to_target; - - if (npc.velocity.X < npc_to_target_x) - { - npc.velocity.X = npc.velocity.X + accel; - if (npc.velocity.X < 0f && npc_to_target_x > 0f) - npc.velocity.X = npc.velocity.X + accel; - } - else if (npc.velocity.X > npc_to_target_x) - { - npc.velocity.X = npc.velocity.X - accel; - if (npc.velocity.X > 0f && npc_to_target_x < 0f) - npc.velocity.X = npc.velocity.X - accel; - } - if (npc.velocity.Y < npc_to_target_y) - { - npc.velocity.Y = npc.velocity.Y + accel; - if (npc.velocity.Y < 0f && npc_to_target_y > 0f) - npc.velocity.Y = npc.velocity.Y + accel; - } - else if (npc.velocity.Y > npc_to_target_y) - { - npc.velocity.Y = npc.velocity.Y - accel; - if (npc.velocity.Y > 0f && npc_to_target_y < 0f) - npc.velocity.Y = npc.velocity.Y - accel; - } - - bool target_dead = Main.player[npc.target].dead; - if (target_dead) - { - npc.velocity.Y = npc.velocity.Y - 0.04f; - if (npc.timeLeft > 10) - { - npc.timeLeft = 10; - return; - } - } - else - { - if (npc.ai[1] == 0f) - { - top_speed = 4f; - accel = 0.1f; - close_side_of_target = 1; - if (npc.position.X + (float)(npc.width / 2) < Main.player[npc.target].position.X + (float)Main.player[npc.target].width) - close_side_of_target = -1; - - npc_pos = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - npc_to_target_x = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) + (float)(close_side_of_target * 360) - npc_pos.X; //360 pix in front of target - npc_to_target_y = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) + (float)(close_side_of_target * 160) - npc_pos.Y; //160 pix above target - dist_to_target = (float)Math.Sqrt((double)(npc_to_target_x * npc_to_target_x + npc_to_target_y * npc_to_target_y)); - dist_to_target = top_speed / dist_to_target; - npc_to_target_x *= dist_to_target; - npc_to_target_y *= dist_to_target; - - if (npc.velocity.X < npc_to_target_x) - { - npc.velocity.X = npc.velocity.X + accel; - if (npc.velocity.X < 0f && npc_to_target_x > 0f) - npc.velocity.X = npc.velocity.X + accel; - } - else if (npc.velocity.X > npc_to_target_x) - { - npc.velocity.X = npc.velocity.X - accel; - if (npc.velocity.X > 0f && npc_to_target_x < 0f) - npc.velocity.X = npc.velocity.X - accel; - } - if (npc.velocity.Y < npc_to_target_y) - { - npc.velocity.Y = npc.velocity.Y + accel; - if (npc.velocity.Y < 0f && npc_to_target_y > 0f) - npc.velocity.Y = npc.velocity.Y + accel; - } - else if (npc.velocity.Y > npc_to_target_y) - { - npc.velocity.Y = npc.velocity.Y - accel; - if (npc.velocity.Y > 0f && npc_to_target_y < 0f) - npc.velocity.Y = npc.velocity.Y - accel; - } - - npc.ai[2] += 1f; // inc count till charge - if (npc.ai[2] >= 400f) // charge after 400 ticks - { - npc.ai[1] = 1f; // transition state to 'start charge' - npc.ai[2] = 0f; - npc.ai[3] = 0f; - npc.target = 255; // retarget - npc.netUpdate = true; - } - if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) - { - npc.localAI[2] += 1f; // ??? - if (Main.netMode != 1) // is server - { // localAI[1] grows faster the less life left - npc.localAI[1] += 1f; - - if (npc.localAI[1] > 12f) - { - npc.localAI[1] = 10f; - float projectile_velocity = 15f; - int projectile_dmg = 75; - npc_pos = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - npc_to_target_x = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - npc_pos.X; - npc_to_target_y = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - npc_pos.Y; - dist_to_target = (float)Math.Sqrt((double)(npc_to_target_x * npc_to_target_x + npc_to_target_y * npc_to_target_y)); - dist_to_target = projectile_velocity / dist_to_target; // prep to normalize by velocity - npc_to_target_x *= dist_to_target; // normalize by velocity - npc_to_target_y *= dist_to_target; // normalize by velocity - npc_to_target_y += npc.velocity.Y * 0.5f; // advance fwd half a tick - npc_to_target_x += npc.velocity.X * 0.5f; // advance fwd half a tick - npc_pos.X -= npc_to_target_x * 1f; - npc_pos.Y -= npc_to_target_y * 1f; - //Projectile.NewProjectile(npc_pos.X, npc_pos.Y, npc_to_target_x, npc_to_target_y, ProjDef.byName["Pumpking:TerraGuardLaser"].type, projectile_dmg, 0f, Main.myPlayer); - return; - } - } - } - } - else if (npc.ai[1] == 1f) - { - npc.rotation = npc_to_target_angle; - float speed = 14f; - npc_pos = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - npc_to_target_x = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - npc_pos.X; - npc_to_target_y = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - npc_pos.Y; - dist_to_target = (float)Math.Sqrt((double)(npc_to_target_x * npc_to_target_x + npc_to_target_y * npc_to_target_y)); - dist_to_target = speed / dist_to_target; - npc.velocity.X = npc_to_target_x * dist_to_target; - npc.velocity.Y = npc_to_target_y * dist_to_target; - npc.ai[1] = 2f; - return; - } - else if (npc.ai[1] == 2f) - { - npc.ai[2] += 1f; - if (npc.ai[2] >= 50f) - { - npc.velocity.X = npc.velocity.X * 0.93f; - npc.velocity.Y = npc.velocity.Y * 0.93f; - if ((double)npc.velocity.X > -0.1 && (double)npc.velocity.X < 0.1) - npc.velocity.X = 0f; - if ((double)npc.velocity.Y > -0.1 && (double)npc.velocity.Y < 0.1) - npc.velocity.Y = 0f; - } - else - npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X) - 1.57f; - - if (npc.ai[2] >= 80f) - { - npc.ai[3] += 1f; - npc.ai[2] = 0f; - npc.target = 255; - npc.rotation = npc_to_target_angle; - if (npc.ai[3] >= 6f) - { - npc.ai[1] = 0f; - npc.ai[3] = 0f; - return; - } - npc.ai[1] = 1f; - return; - } - } - } - } - } - } + float customAi1; + bool FirstState = false; + bool SecondState = false; + public override void AI() + { + //PlayAnimation(); + if (npc.life > npc.lifeMax / 2) + { + FirstState = true; + } + + if (npc.life < npc.lifeMax / 2) + { + FirstState = false; + SecondState = true; + } + + if (Main.rand.Next(150) == 0) + { + for (int num36 = 0; num36 < 25; num36++) + { + int dust = Dust.NewDust(new Vector2((float)npc.position.X, (float)npc.position.Y), npc.width, npc.height, mod.DustType("CyberDust"), npc.velocity.X + Main.rand.Next(-10, 10), npc.velocity.Y + Main.rand.Next(-10, 10), 1, npc.color, 1f); + Main.dust[dust].noGravity = true; + } + + npc.ai[3] = (float)(Main.rand.Next(360) * (Math.PI / 180)); + npc.ai[2] = 0; + npc.ai[1] = 0; + if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active) + { + npc.TargetClosest(true); + } + if (Main.player[npc.target].dead) + { + npc.position.X = 0; + npc.position.Y = 0; + if (npc.timeLeft > 10) + { + npc.timeLeft = 10; + return; + } + } + else + { + npc.position.X = Main.player[npc.target].position.X + (float)((250 * Math.Cos(npc.ai[3])) * -1); + npc.position.Y = Main.player[npc.target].position.Y + (float)((250 * Math.Sin(npc.ai[3])) * -1); + } + } + if (Main.rand.Next(2) == 0) + { + int num706 = Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), 0f, 0f, 200, npc.color, 0.5f); + Main.dust[num706].velocity *= 0.6f; + } + if (FirstState) + { + npc.TargetClosest(true); + Vector2 PTC = Main.player[npc.target].position + new Vector2(npc.width / 2, npc.height / 2); + Vector2 NPos = npc.position + new Vector2(npc.width / 2, npc.height / 2); + npc.netUpdate = true; + + if (npc.ai[1] == 0) + { + if (Main.player[npc.target].position.X < npc.position.X) + { + if (npc.velocity.X > -8) npc.velocity.X -= 0.10f; + } + + if (Main.player[npc.target].position.X > npc.position.X) + { + if (npc.velocity.X < 8) npc.velocity.X += 0.10f; + } + + if (Main.player[npc.target].position.Y < npc.position.Y + 200) + { + if (npc.velocity.Y < 0) + { + if (npc.velocity.Y > -4) npc.velocity.Y -= 0.4f; + } + else npc.velocity.Y -= 0.8f; + } + + if (Main.player[npc.target].position.Y > npc.position.Y + 200) + { + if (npc.velocity.Y > 0) + { + if (npc.velocity.Y < 4) npc.velocity.Y += 0.4f; + } + else npc.velocity.Y += 0.6f; + } + } + + customAi1 += (Main.rand.Next(2, 5) * 0.1f) * npc.scale; + if (customAi1 >= 4f) + if (Main.rand.Next(120) == 1) + { + Main.PlaySound(16, (int)npc.position.X, (int)npc.position.Y, 12); + float Angle = (float)Math.Atan2(NPos.Y - PTC.Y, NPos.X - PTC.X); + int SpitShot1 = Projectile.NewProjectile(NPos.X, NPos.Y, (float)((Math.Cos(Angle) * 22f) * -1), (float)((Math.Sin(Angle) * 22f) * -1), mod.ProjectileType("CyberLaserBat"), 30, 0f, 0); + //Main.projectile[SpitShot1].friendly = false; + Main.projectile[SpitShot1].timeLeft = 500; + customAi1 = 1f; + } + npc.netUpdate = true; + + if (Main.rand.Next(6) == 0) + { + int dust = Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), 0f, 0f, 200, npc.color, 0.4f); + Main.dust[dust].velocity *= 0.4f; + } + + if (npc.ai[1] == 1) + { + + } + + npc.ai[2] += 1; + if (npc.ai[2] >= 600) + { + if (npc.ai[1] == 0) npc.ai[1] = 1; + else npc.ai[1] = 0; + } + if (npc.life > 500) + { + Color color = new Color(); + int dust = Dust.NewDust(new Vector2((float)npc.position.X, (float)npc.position.Y), npc.width, npc.height, mod.DustType("CyberDust"), npc.velocity.X, npc.velocity.Y, 100, color, 0.6f); + Main.dust[dust].noGravity = true; + } + else if (npc.life <= 200) + { + Color color = new Color(); + int dust = Dust.NewDust(new Vector2((float)npc.position.X, (float)npc.position.Y), npc.width, npc.height, mod.DustType("CyberDust"), npc.velocity.X, npc.velocity.Y, 50, color, 0.8f); + Main.dust[dust].noGravity = true; + } + } + + if (SecondState && !FirstState) + { + Vector2 PTC = Main.player[npc.target].position + new Vector2(npc.width / 2, npc.height / 2); + Vector2 NPos = npc.position + new Vector2(npc.width / 2, npc.height / 2); + if (Main.rand.Next(70) == 1) + { + Main.PlaySound(16, (int)npc.position.X, (int)npc.position.Y, 12); + float Angle = (float)Math.Atan2(NPos.Y - PTC.Y, NPos.X - PTC.X); + int SpitShot1 = Projectile.NewProjectile(NPos.X, NPos.Y, (float)((Math.Cos(Angle) * 22f) * -1), (float)((Math.Sin(Angle) * 22f) * -1), mod.ProjectileType("CyberLaserBat"), 30, 0f, 0); + //Main.projectile[SpitShot1].friendly = false; + Main.projectile[SpitShot1].timeLeft = 500; + customAi1 = 1f; + } + float npc_to_target_x = npc.position.X + (float)(npc.width / 2) - Main.player[npc.target].position.X - (float)(Main.player[npc.target].width / 2); + float npc_to_target_y = npc.position.Y + (float)npc.height - 59f - Main.player[npc.target].position.Y - (float)(Main.player[npc.target].height / 2); // 59(3.7 blocks) above bottom(slightly above center; ht is 110) to target center + float npc_to_target_angle = (float)Math.Atan2((double)npc_to_target_y, (double)npc_to_target_x) + 1.57f; // angle+pi/2 + if (npc_to_target_angle < 0f) // modulus + npc_to_target_angle += 6.283f; + else if ((double)npc_to_target_angle > 6.283) + npc_to_target_angle -= 6.283f; + float rotation_rate = 0.15f; + float top_speed = 4f; + float accel = 0.1f; + int close_side_of_target = 1; + if (npc.position.X + (float)(npc.width / 2) < Main.player[npc.target].position.X + (float)Main.player[npc.target].width) + close_side_of_target = -1; + + Vector2 npc_pos = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + npc_to_target_x = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) + (float)(close_side_of_target * 360) - npc_pos.X; + npc_to_target_y = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) + (float)(close_side_of_target * 160) - npc_pos.Y; + float dist_to_target = (float)Math.Sqrt((double)(npc_to_target_x * npc_to_target_x + npc_to_target_y * npc_to_target_y)); + dist_to_target = top_speed / dist_to_target; + npc_to_target_x *= dist_to_target; + npc_to_target_y *= dist_to_target; + + if (npc.velocity.X < npc_to_target_x) + { + npc.velocity.X = npc.velocity.X + accel; + if (npc.velocity.X < 0f && npc_to_target_x > 0f) + npc.velocity.X = npc.velocity.X + accel; + } + else if (npc.velocity.X > npc_to_target_x) + { + npc.velocity.X = npc.velocity.X - accel; + if (npc.velocity.X > 0f && npc_to_target_x < 0f) + npc.velocity.X = npc.velocity.X - accel; + } + if (npc.velocity.Y < npc_to_target_y) + { + npc.velocity.Y = npc.velocity.Y + accel; + if (npc.velocity.Y < 0f && npc_to_target_y > 0f) + npc.velocity.Y = npc.velocity.Y + accel; + } + else if (npc.velocity.Y > npc_to_target_y) + { + npc.velocity.Y = npc.velocity.Y - accel; + if (npc.velocity.Y > 0f && npc_to_target_y < 0f) + npc.velocity.Y = npc.velocity.Y - accel; + } + + bool target_dead = Main.player[npc.target].dead; + if (target_dead) + { + npc.velocity.Y = npc.velocity.Y - 0.04f; + if (npc.timeLeft > 10) + { + npc.timeLeft = 10; + return; + } + } + else + { + if (npc.ai[1] == 0f) + { + top_speed = 4f; + accel = 0.1f; + close_side_of_target = 1; + if (npc.position.X + (float)(npc.width / 2) < Main.player[npc.target].position.X + (float)Main.player[npc.target].width) + close_side_of_target = -1; + + npc_pos = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + npc_to_target_x = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) + (float)(close_side_of_target * 360) - npc_pos.X; //360 pix in front of target + npc_to_target_y = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) + (float)(close_side_of_target * 160) - npc_pos.Y; //160 pix above target + dist_to_target = (float)Math.Sqrt((double)(npc_to_target_x * npc_to_target_x + npc_to_target_y * npc_to_target_y)); + dist_to_target = top_speed / dist_to_target; + npc_to_target_x *= dist_to_target; + npc_to_target_y *= dist_to_target; + + if (npc.velocity.X < npc_to_target_x) + { + npc.velocity.X = npc.velocity.X + accel; + if (npc.velocity.X < 0f && npc_to_target_x > 0f) + npc.velocity.X = npc.velocity.X + accel; + } + else if (npc.velocity.X > npc_to_target_x) + { + npc.velocity.X = npc.velocity.X - accel; + if (npc.velocity.X > 0f && npc_to_target_x < 0f) + npc.velocity.X = npc.velocity.X - accel; + } + if (npc.velocity.Y < npc_to_target_y) + { + npc.velocity.Y = npc.velocity.Y + accel; + if (npc.velocity.Y < 0f && npc_to_target_y > 0f) + npc.velocity.Y = npc.velocity.Y + accel; + } + else if (npc.velocity.Y > npc_to_target_y) + { + npc.velocity.Y = npc.velocity.Y - accel; + if (npc.velocity.Y > 0f && npc_to_target_y < 0f) + npc.velocity.Y = npc.velocity.Y - accel; + } + + npc.ai[2] += 1f; // inc count till charge + if (npc.ai[2] >= 400f) // charge after 400 ticks + { + npc.ai[1] = 1f; // transition state to 'start charge' + npc.ai[2] = 0f; + npc.ai[3] = 0f; + npc.target = 255; // retarget + npc.netUpdate = true; + } + if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + { + npc.localAI[2] += 1f; // ??? + if (Main.netMode != 1) // is server + { // localAI[1] grows faster the less life left + npc.localAI[1] += 1f; + + if (npc.localAI[1] > 12f) + { + npc.localAI[1] = 10f; + float projectile_velocity = 15f; + int projectile_dmg = 75; + npc_pos = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + npc_to_target_x = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - npc_pos.X; + npc_to_target_y = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - npc_pos.Y; + dist_to_target = (float)Math.Sqrt((double)(npc_to_target_x * npc_to_target_x + npc_to_target_y * npc_to_target_y)); + dist_to_target = projectile_velocity / dist_to_target; // prep to normalize by velocity + npc_to_target_x *= dist_to_target; // normalize by velocity + npc_to_target_y *= dist_to_target; // normalize by velocity + npc_to_target_y += npc.velocity.Y * 0.5f; // advance fwd half a tick + npc_to_target_x += npc.velocity.X * 0.5f; // advance fwd half a tick + npc_pos.X -= npc_to_target_x * 1f; + npc_pos.Y -= npc_to_target_y * 1f; + //Projectile.NewProjectile(npc_pos.X, npc_pos.Y, npc_to_target_x, npc_to_target_y, ProjDef.byName["Pumpking:TerraGuardLaser"].type, projectile_dmg, 0f, Main.myPlayer); + return; + } + } + } + } + else if (npc.ai[1] == 1f) + { + npc.rotation = npc_to_target_angle; + float speed = 14f; + npc_pos = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + npc_to_target_x = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - npc_pos.X; + npc_to_target_y = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - npc_pos.Y; + dist_to_target = (float)Math.Sqrt((double)(npc_to_target_x * npc_to_target_x + npc_to_target_y * npc_to_target_y)); + dist_to_target = speed / dist_to_target; + npc.velocity.X = npc_to_target_x * dist_to_target; + npc.velocity.Y = npc_to_target_y * dist_to_target; + npc.ai[1] = 2f; + return; + } + else if (npc.ai[1] == 2f) + { + npc.ai[2] += 1f; + if (npc.ai[2] >= 50f) + { + npc.velocity.X = npc.velocity.X * 0.93f; + npc.velocity.Y = npc.velocity.Y * 0.93f; + if ((double)npc.velocity.X > -0.1 && (double)npc.velocity.X < 0.1) + npc.velocity.X = 0f; + if ((double)npc.velocity.Y > -0.1 && (double)npc.velocity.Y < 0.1) + npc.velocity.Y = 0f; + } + else + npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X) - 1.57f; + + if (npc.ai[2] >= 80f) + { + npc.ai[3] += 1f; + npc.ai[2] = 0f; + npc.target = 255; + npc.rotation = npc_to_target_angle; + if (npc.ai[3] >= 6f) + { + npc.ai[1] = 0f; + npc.ai[3] = 0f; + return; + } + npc.ai[1] = 1f; + return; + } + } + } + } + } + } } \ No newline at end of file diff --git a/Invasion/ParadoxCohortMusicBox.cs b/Invasion/ParadoxCohortMusicBox.cs index c0d477af..6dcdf63d 100644 --- a/Invasion/ParadoxCohortMusicBox.cs +++ b/Invasion/ParadoxCohortMusicBox.cs @@ -24,11 +24,11 @@ public override void SetDefaults() item.accessory = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Music Box (Paradox Cohort)"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Music Box (Paradox Cohort)"); + Tooltip.SetDefault(""); + } } } diff --git a/Invasion/ParadoxDrill.cs b/Invasion/ParadoxDrill.cs index 605369d2..b374c0f5 100644 --- a/Invasion/ParadoxDrill.cs +++ b/Invasion/ParadoxDrill.cs @@ -3,68 +3,70 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Invasion { - -public class ParadoxDrill : ModItem +namespace Tremor.Invasion { - public override void SetDefaults() - { - item.damage = 9; - item.melee = true; - item.width = 40; - item.height = 22; - item.useTime = 4; - item.useAnimation = 12; - item.channel = true; + public class ParadoxDrill : ModItem + { + public override void SetDefaults() + { + + item.damage = 9; + item.melee = true; + item.width = 40; + item.height = 22; + item.useTime = 4; + item.useAnimation = 12; + item.channel = true; + + item.noUseGraphic = true; + item.noMelee = true; + item.useStyle = 5; + item.knockBack = 6; + item.value = Item.buyPrice(0, 10, 0, 0); + item.rare = 11; + item.UseSound = SoundID.Item23; + item.autoReuse = true; + item.shoot = mod.ProjectileType("ParadoxDrillPro"); + item.shootSpeed = 20f; + } - item.noUseGraphic = true; - item.noMelee = true; - item.useStyle = 5; - item.knockBack = 6; - item.value = Item.buyPrice(0, 10, 0, 0); - item.rare = 11; - item.UseSound = SoundID.Item23; - item.autoReuse = true; - item.shoot = mod.ProjectileType("ParadoxDrillPro"); - item.shootSpeed = 20f; - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Paradox Drill"); + Tooltip.SetDefault("Press LMB to use drill\nPress RMB to use axe and hammer"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Paradox Drill"); - Tooltip.SetDefault("Press LMB to use drill\nPress RMB to use axe and hammer"); - } - - public override bool AltFunctionUse(Player player) - { - return true; - } + public override bool AltFunctionUse(Player player) + { + return true; + } - public override bool CanUseItem(Player player) - { - if (player.altFunctionUse == 2) - { - item.useStyle = 5; + public override bool CanUseItem(Player player) + { + if (player.altFunctionUse == 2) + { + item.useStyle = 5; item.useTime = 15; item.useAnimation = 15; item.axe = 40; item.hammer = 200; item.pick = 0; item.shoot = mod.ProjectileType("ParadoxDrillPro"); - } - else - { - item.useStyle = 5; + } + else + { + item.useStyle = 5; item.useTime = 4; item.useAnimation = 12; item.axe = 0; item.hammer = 0; item.pick = 265; item.shoot = mod.ProjectileType("ParadoxDrillPro"); - } - return base.CanUseItem(player); - } -}} + } + return base.CanUseItem(player); + } + } +} diff --git a/Invasion/ParadoxDrillPro.cs b/Invasion/ParadoxDrillPro.cs index 1d48ac44..5badfc6b 100644 --- a/Invasion/ParadoxDrillPro.cs +++ b/Invasion/ParadoxDrillPro.cs @@ -4,27 +4,29 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Invasion { - -public class ParadoxDrillPro : ModProjectile +namespace Tremor.Invasion { - public override void SetDefaults() - { - projectile.width = 22; - projectile.height = 40; - projectile.aiStyle = 20; - projectile.friendly = true; - projectile.penetrate = -1; - projectile.tileCollide = false; - projectile.hide = true; - projectile.ownerHitCheck = true; - projectile.melee = true; - } - public override void AI() - { - int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, mod.DustType("CyberDust"), projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1f); - Main.dust[dust].noGravity = true; - } + public class ParadoxDrillPro : ModProjectile + { + public override void SetDefaults() + { + projectile.width = 22; + projectile.height = 40; + projectile.aiStyle = 20; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.hide = true; + projectile.ownerHitCheck = true; + projectile.melee = true; + } + + public override void AI() + { + int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, mod.DustType("CyberDust"), projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1f); + Main.dust[dust].noGravity = true; + } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/Invasion/ParadoxElement.cs b/Invasion/ParadoxElement.cs index ce8aac8b..6f9ea73d 100644 --- a/Invasion/ParadoxElement.cs +++ b/Invasion/ParadoxElement.cs @@ -5,24 +5,26 @@ using Terraria.ModLoader; -namespace Tremor.Invasion { -public class ParadoxElement : ModItem +namespace Tremor.Invasion { - public override void SetDefaults() - { + public class ParadoxElement : ModItem + { + public override void SetDefaults() + { - item.width = 46; - item.height = 46; - item.value = 600; - item.rare = 11; + item.width = 46; + item.height = 46; + item.value = 600; + item.rare = 11; - item.maxStack = 999; - } + item.maxStack = 999; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Paradox Element"); - Tooltip.SetDefault("'Element of paradox warriors'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Paradox Element"); + Tooltip.SetDefault("'Element of paradox warriors'"); + } -}} + } +} diff --git a/Invasion/ParadoxPotion.cs b/Invasion/ParadoxPotion.cs index eeec690a..371be2c9 100644 --- a/Invasion/ParadoxPotion.cs +++ b/Invasion/ParadoxPotion.cs @@ -3,60 +3,62 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Invasion { - -public class ParadoxPotion : ModItem +namespace Tremor.Invasion { - public override void SetDefaults() - { - item.width = 38; - item.height = 32; - item.maxStack = 20; + public class ParadoxPotion : ModItem + { + public override void SetDefaults() + { + + item.width = 38; + item.height = 32; + item.maxStack = 20; - item.rare = 11; - item.useAnimation = 15; - item.useTime = 15; - item.useStyle = 2; - item.UseSound = SoundID.Item3; - item.consumable = true; - } + item.rare = 11; + item.useAnimation = 15; + item.useTime = 15; + item.useStyle = 2; + item.UseSound = SoundID.Item3; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Paradox Potion"); - Tooltip.SetDefault("Restores 300 health"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Paradox Potion"); + Tooltip.SetDefault("Restores 300 health"); + } public override bool CanUseItem(Player player) - { - if (player.FindBuffIndex(BuffID.PotionSickness) == -1) - { - player.AddBuff(BuffID.PotionSickness, 3600, true); - } - else - { - return false; - } + { + if (player.FindBuffIndex(BuffID.PotionSickness) == -1) + { + player.AddBuff(BuffID.PotionSickness, 3600, true); + } + else + { + return false; + } return true; - } + } - public override bool UseItem(Player player) - { + public override bool UseItem(Player player) + { Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 3); Main.player[Main.myPlayer].HealEffect(300); player.statLife += 300; return true; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ParadoxElement", 2); - recipe.AddIngredient(ItemID.BottledWater); - recipe.SetResult(this); - recipe.AddTile(13); - recipe.AddRecipe(); - } -}} + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ParadoxElement", 2); + recipe.AddIngredient(ItemID.BottledWater); + recipe.SetResult(this); + recipe.AddTile(13); + recipe.AddRecipe(); + } + } +} diff --git a/Invasion/ParadoxSun.cs b/Invasion/ParadoxSun.cs index 72230b23..e452a6a8 100644 --- a/Invasion/ParadoxSun.cs +++ b/Invasion/ParadoxSun.cs @@ -6,331 +6,332 @@ using Terraria.ModLoader; -namespace Tremor.Invasion { - public class ParadoxSun : ModNPC - { +namespace Tremor.Invasion +{ + public class ParadoxSun : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Forgotten Creature"); Main.npcFrameCount[npc.type] = 3; } - - public override void SetDefaults() - { - npc.lifeMax = 5750; - npc.damage = 125; - npc.defense = 115; - npc.knockBackResist = 0f; - npc.width = 34; - npc.height = 40; - animationType = 3; - npc.aiStyle = -1; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.color = Color.White; - } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - Mod mod = ModLoader.GetMod("Tremor"); - CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer(mod); - float spawn = 20f; - if (InvasionWorld.CyberWrath) - return 10000f; - else - return 0f; + public override void SetDefaults() + { + npc.lifeMax = 5750; + npc.damage = 125; + npc.defense = 115; + npc.knockBackResist = 0f; + npc.width = 34; + npc.height = 40; + animationType = 3; + npc.aiStyle = -1; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.color = Color.White; + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + Mod mod = ModLoader.GetMod("Tremor"); + CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer(mod); + float spawn = 20f; + if (InvasionWorld.CyberWrath) + return 10000f; + else + return 0f; + + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return InvasionWorld.CyberWrath && y > Main.worldSurface ? 1f : 0f; + } - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return InvasionWorld.CyberWrath && y > Main.worldSurface ? 1f : 0f; - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 10; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } - public override void HitEffect(int hitDirection, double damage) - { - if (npc.life <= 0) - { - for (int k = 0; k < 10; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } + CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer(mod); + if (InvasionWorld.CyberWrath && Main.rand.Next(2) == 1) + { + InvasionWorld.CyberWrathPoints1 += 2; + //Main.NewText(("Wave 1: Complete " + TremorWorld.CyberWrathPoints + "%"), 39, 86, 134); + } + } - CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer(mod); - if (InvasionWorld.CyberWrath && Main.rand.Next(2) == 1) - { - InvasionWorld.CyberWrathPoints1 += 2; - //Main.NewText(("Wave 1: Complete " + TremorWorld.CyberWrathPoints + "%"), 39, 86, 134); - } - } + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), (float)hitDirection, -1f, 0, default(Color), 0.7f); + } + } - for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void OnHitPlayer(Player player, int damage, bool crit) + { + if (Main.rand.Next(6) == 0) + { + player.AddBuff(31, 1000, true); + } + } - public override void OnHitPlayer(Player player, int damage, bool crit) - { - if(Main.rand.Next(6) == 0) - { - player.AddBuff(31, 1000, true); - } - } + public override void AI() + { + if (Main.rand.Next(320) == 5) + { + do + { + npc.position.X = (Main.player[npc.target].position.X - 500) + Main.rand.Next(1000); + npc.position.Y = (Main.player[npc.target].position.Y - 500) + Main.rand.Next(1000); + } while (npc.Distance(Main.player[npc.target].position) < 40); + } - public override void AI() - { - if (Main.rand.Next(320) == 5) - { - do - { - npc.position.X = (Main.player[npc.target].position.X - 500) + Main.rand.Next(1000); - npc.position.Y = (Main.player[npc.target].position.Y - 500) + Main.rand.Next(1000); - } while (npc.Distance(Main.player[npc.target].position) < 40); - } + int num5 = 60; + bool flag2 = false; + bool flag3 = true; - int num5 = 60; - bool flag2 = false; - bool flag3 = true; + if (npc.velocity.Y == 0f && ((npc.velocity.X > 0f && npc.direction < 0) || (npc.velocity.X < 0f && npc.direction > 0))) + { + flag2 = true; + } + if (npc.position.X == npc.oldPosition.X || npc.ai[3] >= (float)num5 || flag2) + { + npc.ai[3] += 1f; + } + else + { + if ((double)Math.Abs(npc.velocity.X) > 0.9 && npc.ai[3] > 0f) + { + npc.ai[3] -= 1f; + } + } + if (npc.ai[3] > (float)(num5 * 10)) + { + npc.ai[3] = 0f; + } + if (npc.justHit) + { + npc.ai[3] = 0f; + } + if (npc.ai[3] == (float)num5) + { + npc.netUpdate = true; + } - if (npc.velocity.Y == 0f && ((npc.velocity.X > 0f && npc.direction < 0) || (npc.velocity.X < 0f && npc.direction > 0))) - { - flag2 = true; - } - if (npc.position.X == npc.oldPosition.X || npc.ai[3] >= (float)num5 || flag2) - { - npc.ai[3] += 1f; - } - else - { - if ((double)Math.Abs(npc.velocity.X) > 0.9 && npc.ai[3] > 0f) - { - npc.ai[3] -= 1f; - } - } - if (npc.ai[3] > (float)(num5 * 10)) - { - npc.ai[3] = 0f; - } - if (npc.justHit) - { - npc.ai[3] = 0f; - } - if (npc.ai[3] == (float)num5) - { - npc.netUpdate = true; - } + if (npc.ai[3] < (float)num5) + { + npc.TargetClosest(true); + } + else + { + if (npc.velocity.X == 0f) + { + if (npc.velocity.Y == 0f) + { + npc.ai[0] += 1f; + if (npc.ai[0] >= 2f) + { + npc.direction *= -1; + npc.spriteDirection = npc.direction; + npc.ai[0] = 0f; + } + } + } + else + { + npc.ai[0] = 0f; + } + if (npc.direction == 0) + { + npc.direction = 1; + } + } - if (npc.ai[3] < (float)num5) - { - npc.TargetClosest(true); - } - else - { - if (npc.velocity.X == 0f) - { - if (npc.velocity.Y == 0f) - { - npc.ai[0] += 1f; - if (npc.ai[0] >= 2f) - { - npc.direction *= -1; - npc.spriteDirection = npc.direction; - npc.ai[0] = 0f; - } - } - } - else - { - npc.ai[0] = 0f; - } - if (npc.direction == 0) - { - npc.direction = 1; - } - } + if (npc.velocity.X < -3f || npc.velocity.X > 3f) + { + if (npc.velocity.Y == 0f) + { + npc.velocity *= 0.8f; + } + } + else + { + if (npc.velocity.X < 3f && npc.direction == 1) + { + npc.velocity.X = npc.velocity.X + 0.1f; + if (npc.velocity.X > 3f) + { + npc.velocity.X = 3f; + } + } + else + { + if (npc.velocity.X > -3f && npc.direction == -1) + { + npc.velocity.X = npc.velocity.X - 0.1f; + if (npc.velocity.X < -3f) + { + npc.velocity.X = -3f; + } + } + } + } - if (npc.velocity.X < -3f || npc.velocity.X > 3f) - { - if (npc.velocity.Y == 0f) - { - npc.velocity *= 0.8f; - } - } - else - { - if (npc.velocity.X < 3f && npc.direction == 1) - { - npc.velocity.X = npc.velocity.X + 0.1f; - if (npc.velocity.X > 3f) - { - npc.velocity.X = 3f; - } - } - else - { - if (npc.velocity.X > -3f && npc.direction == -1) - { - npc.velocity.X = npc.velocity.X - 0.1f; - if (npc.velocity.X < -3f) - { - npc.velocity.X = -3f; - } - } - } - } + bool flag4 = false; + if (npc.velocity.Y == 0f) + { + int num29 = (int)(npc.position.Y + (float)npc.height + 8f) / 16; + int num30 = (int)npc.position.X / 16; + int num31 = (int)(npc.position.X + (float)npc.width) / 16; + for (int l = num30; l <= num31; l++) + { + if (Main.tile[l, num29] == null) + { + return; + } + if (Main.tile[l, num29].active() && Main.tileSolid[(int)Main.tile[l, num29].type]) + { + flag4 = true; + break; + } + } + } - bool flag4 = false; - if (npc.velocity.Y == 0f) - { - int num29 = (int)(npc.position.Y + (float)npc.height + 8f) / 16; - int num30 = (int)npc.position.X / 16; - int num31 = (int)(npc.position.X + (float)npc.width) / 16; - for (int l = num30; l <= num31; l++) - { - if (Main.tile[l, num29] == null) - { - return; - } - if (Main.tile[l, num29].active() && Main.tileSolid[(int)Main.tile[l, num29].type]) - { - flag4 = true; - break; - } - } - } + if (flag4) + { + int num32 = (int)((npc.position.X + (float)(npc.width / 2) + (float)((npc.width / 2 + 6) * npc.direction)) / 16f); + int num33 = (int)((npc.position.Y + (float)npc.height - 15f) / 16f); + if (Main.tile[num32, num33] == null) + { + Main.tile[num32, num33] = new Tile(); + } + if (Main.tile[num32, num33 - 1] == null) + { + Main.tile[num32, num33 - 1] = new Tile(); + } + if (Main.tile[num32, num33 - 2] == null) + { + Main.tile[num32, num33 - 2] = new Tile(); + } + if (Main.tile[num32, num33 - 3] == null) + { + Main.tile[num32, num33 - 3] = new Tile(); + } + if (Main.tile[num32, num33 + 1] == null) + { + Main.tile[num32, num33 + 1] = new Tile(); + } + if (Main.tile[num32 + npc.direction, num33 - 1] == null) + { + Main.tile[num32 + npc.direction, num33 - 1] = new Tile(); + } + if (Main.tile[num32 + npc.direction, num33 + 1] == null) + { + Main.tile[num32 + npc.direction, num33 + 1] = new Tile(); + } - if (flag4) - { - int num32 = (int)((npc.position.X + (float)(npc.width / 2) + (float)((npc.width / 2 + 6) * npc.direction)) / 16f); - int num33 = (int)((npc.position.Y + (float)npc.height - 15f) / 16f); - if (Main.tile[num32, num33] == null) - { - Main.tile[num32, num33] = new Tile(); - } - if (Main.tile[num32, num33 - 1] == null) - { - Main.tile[num32, num33 - 1] = new Tile(); - } - if (Main.tile[num32, num33 - 2] == null) - { - Main.tile[num32, num33 - 2] = new Tile(); - } - if (Main.tile[num32, num33 - 3] == null) - { - Main.tile[num32, num33 - 3] = new Tile(); - } - if (Main.tile[num32, num33 + 1] == null) - { - Main.tile[num32, num33 + 1] = new Tile(); - } - if (Main.tile[num32 + npc.direction, num33 - 1] == null) - { - Main.tile[num32 + npc.direction, num33 - 1] = new Tile(); - } - if (Main.tile[num32 + npc.direction, num33 + 1] == null) - { - Main.tile[num32 + npc.direction, num33 + 1] = new Tile(); - } + if (Main.tile[num32, num33 - 1].active() && Main.tile[num32, num33 - 1].type == 10 && flag3) + { + npc.ai[2] += 1f; + npc.ai[3] = 0f; + if (npc.ai[2] >= 60f) + { + npc.velocity.X = 0.5f * (float)(-(float)npc.direction); + npc.ai[1] += 1f; + npc.ai[2] = 0f; + bool flag5 = false; + if (npc.ai[1] >= 10f) + { + flag5 = true; + npc.ai[1] = 10f; + } + WorldGen.KillTile(num32, num33 - 1, true, false, false); + if ((Main.netMode != 1 || !flag5) && flag5 && Main.netMode != 1) + { + bool flag6 = WorldGen.OpenDoor(num32, num33, npc.direction); + if (!flag6) + { + npc.ai[3] = (float)num5; + npc.netUpdate = true; + } + //if (Main.netMode == 2 && flag6) + //{ + //NetMessage.SendData(19, -1, -1, "", 0, (float)num32, (float)num33, (float)npc.direction, 0); + //} + } + } + } - if (Main.tile[num32, num33 - 1].active() && Main.tile[num32, num33 - 1].type == 10 && flag3) - { - npc.ai[2] += 1f; - npc.ai[3] = 0f; - if (npc.ai[2] >= 60f) - { - npc.velocity.X = 0.5f * (float)(-(float)npc.direction); - npc.ai[1] += 1f; - npc.ai[2] = 0f; - bool flag5 = false; - if (npc.ai[1] >= 10f) - { - flag5 = true; - npc.ai[1] = 10f; - } - WorldGen.KillTile(num32, num33 - 1, true, false, false); - if ((Main.netMode != 1 || !flag5) && flag5 && Main.netMode != 1) - { - bool flag6 = WorldGen.OpenDoor(num32, num33, npc.direction); - if (!flag6) - { - npc.ai[3] = (float)num5; - npc.netUpdate = true; - } - //if (Main.netMode == 2 && flag6) - //{ - //NetMessage.SendData(19, -1, -1, "", 0, (float)num32, (float)num33, (float)npc.direction, 0); - //} - } - } - } + if ((npc.velocity.X < 0f && npc.spriteDirection == -1) || (npc.velocity.X > 0f && npc.spriteDirection == 1)) + { + if (Main.tile[num32, num33 - 2].active() && Main.tileSolid[(int)Main.tile[num32, num33 - 2].type]) + { + if ((Main.tile[num32, num33 - 3].active() && Main.tileSolid[(int)Main.tile[num32, num33 - 3].type])) + { + npc.velocity.Y = -8f; + npc.netUpdate = true; + } + else + { + npc.velocity.Y = -7f; + npc.netUpdate = true; + } + } + else + { + if (Main.tile[num32, num33 - 1].active() && Main.tileSolid[(int)Main.tile[num32, num33 - 1].type]) + { + npc.velocity.Y = -6f; + npc.netUpdate = true; + } + else + { + if (Main.tile[num32, num33].active() && Main.tileSolid[(int)Main.tile[num32, num33].type]) + { + npc.velocity.Y = -5f; + npc.netUpdate = true; + } + else + { + if (npc.directionY < 0 && (!Main.tile[num32, num33 + 1].active() || !Main.tileSolid[(int)Main.tile[num32, num33 + 1].type]) && (!Main.tile[num32 + npc.direction, num33 + 1].active() || !Main.tileSolid[(int)Main.tile[num32 + npc.direction, num33 + 1].type])) + { + npc.velocity.Y = -8f; + npc.velocity.X = npc.velocity.X * 1.5f; + npc.netUpdate = true; + } + else + { + if (flag3) + { + npc.ai[1] = 0f; + npc.ai[2] = 0f; + } + } + } + } + } + } + } + else + { + if (flag3) + { + npc.ai[1] = 0f; + npc.ai[2] = 0f; + } + } + } - if ((npc.velocity.X < 0f && npc.spriteDirection == -1) || (npc.velocity.X > 0f && npc.spriteDirection == 1)) - { - if (Main.tile[num32, num33 - 2].active() && Main.tileSolid[(int)Main.tile[num32, num33 - 2].type]) - { - if ((Main.tile[num32, num33 - 3].active() && Main.tileSolid[(int)Main.tile[num32, num33 - 3].type])) - { - npc.velocity.Y = -8f; - npc.netUpdate = true; - } - else - { - npc.velocity.Y = -7f; - npc.netUpdate = true; - } - } - else - { - if (Main.tile[num32, num33 - 1].active() && Main.tileSolid[(int)Main.tile[num32, num33 - 1].type]) - { - npc.velocity.Y = -6f; - npc.netUpdate = true; - } - else - { - if (Main.tile[num32, num33].active() && Main.tileSolid[(int)Main.tile[num32, num33].type]) - { - npc.velocity.Y = -5f; - npc.netUpdate = true; - } - else - { - if (npc.directionY < 0 && (!Main.tile[num32, num33 + 1].active() || !Main.tileSolid[(int)Main.tile[num32, num33 + 1].type]) && (!Main.tile[num32 + npc.direction, num33 + 1].active() || !Main.tileSolid[(int)Main.tile[num32 + npc.direction, num33 + 1].type])) - { - npc.velocity.Y = -8f; - npc.velocity.X = npc.velocity.X * 1.5f; - npc.netUpdate = true; - } - else - { - if (flag3) - { - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - } - } - } - } - } - } - else - { - if (flag3) - { - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - } - } - public override void NPCLoot() { if (Main.rand.Next(20) == 0) @@ -338,5 +339,5 @@ public override void NPCLoot() Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ClockofTime")); } } - } + } } \ No newline at end of file diff --git a/Invasion/ParadoxTitanBag.cs b/Invasion/ParadoxTitanBag.cs index c5030acf..e048486e 100644 --- a/Invasion/ParadoxTitanBag.cs +++ b/Invasion/ParadoxTitanBag.cs @@ -19,11 +19,11 @@ public override void SetDefaults() bossBagNPC = mod.NPCType("Titan"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Treasure Bag"); - Tooltip.SetDefault("Right click to open"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Treasure Bag"); + Tooltip.SetDefault("Right click to open"); + } public override bool CanRightClick() @@ -41,21 +41,21 @@ public override void OpenBossBag(Player player) if (Main.rand.Next(20) == 0) { player.QuickSpawnItem(mod.ItemType("VioleumWings")); - } - switch (Main.rand.Next(4)) - { - case 0: - player.QuickSpawnItem(mod.ItemType("TheEtherealm")); - break; - case 1: - player.QuickSpawnItem(mod.ItemType("RocketWand")); - break; - case 2: - player.QuickSpawnItem(mod.ItemType("SoulFlames")); - break; - } + } + switch (Main.rand.Next(4)) + { + case 0: + player.QuickSpawnItem(mod.ItemType("TheEtherealm")); + break; + case 1: + player.QuickSpawnItem(mod.ItemType("RocketWand")); + break; + case 2: + player.QuickSpawnItem(mod.ItemType("SoulFlames")); + break; + } player.QuickSpawnItem(mod.ItemType("HealingPotion"), Main.rand.Next(7, 20)); - player.QuickSpawnItem(mod.ItemType("TimeTissue"), Main.rand.Next(5, 15)); + player.QuickSpawnItem(mod.ItemType("TimeTissue"), Main.rand.Next(5, 15)); player.QuickSpawnItem(mod.ItemType("Relayx")); player.QuickSpawnItem(mod.ItemType("ClockofTime")); } diff --git a/Invasion/ParadoxTitanMask.cs b/Invasion/ParadoxTitanMask.cs index fe471544..6882d246 100644 --- a/Invasion/ParadoxTitanMask.cs +++ b/Invasion/ParadoxTitanMask.cs @@ -3,23 +3,25 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Invasion { -[AutoloadEquip(EquipType.Head)] -public class ParadoxTitanMask : ModItem +namespace Tremor.Invasion { - public override void SetDefaults() - { + [AutoloadEquip(EquipType.Head)] + public class ParadoxTitanMask : ModItem + { + public override void SetDefaults() + { - item.width = 20; - item.height = 24; - item.rare = 1; - item.vanity = true; - } + item.width = 20; + item.height = 24; + item.rare = 1; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Paradox Titan Mask"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Paradox Titan Mask"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Invasion/ParadoxTitanTrophy.cs b/Invasion/ParadoxTitanTrophy.cs index f30ab547..bce8416a 100644 --- a/Invasion/ParadoxTitanTrophy.cs +++ b/Invasion/ParadoxTitanTrophy.cs @@ -3,30 +3,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Invasion { -public class ParadoxTitanTrophy : ModItem +namespace Tremor.Invasion { - public override void SetDefaults() - { + public class ParadoxTitanTrophy : ModItem + { + public override void SetDefaults() + { - item.width = 32; - item.height = 32; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 50000; - item.createTile = mod.TileType("ParadoxTitanTrophyTile"); - item.placeStyle = 0; - } + item.width = 32; + item.height = 32; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 50000; + item.createTile = mod.TileType("ParadoxTitanTrophyTile"); + item.placeStyle = 0; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Paradox Titan Trophy"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Paradox Titan Trophy"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Invasion/ParadoxTitanTrophyTile.cs b/Invasion/ParadoxTitanTrophyTile.cs index 5bf479dc..a886fdb7 100644 --- a/Invasion/ParadoxTitanTrophyTile.cs +++ b/Invasion/ParadoxTitanTrophyTile.cs @@ -5,26 +5,28 @@ using Terraria.ModLoader; using Terraria.ObjectData; -namespace Tremor.Invasion { -public class ParadoxTitanTrophyTile : ModTile +namespace Tremor.Invasion { - public override void SetDefaults() - { - Main.tileFrameImportant[Type] = true; - Main.tileLavaDeath[Type] = true; - TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3Wall); - TileObjectData.newTile.StyleHorizontal = true; - TileObjectData.newTile.StyleWrapLimit = 36; - TileObjectData.addTile(Type); - dustType = 7; - AddMapEntry(new Color(120, 85, 60)); - } + public class ParadoxTitanTrophyTile : ModTile + { + public override void SetDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileLavaDeath[Type] = true; + TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3Wall); + TileObjectData.newTile.StyleHorizontal = true; + TileObjectData.newTile.StyleWrapLimit = 36; + TileObjectData.addTile(Type); + dustType = 7; + AddMapEntry(new Color(120, 85, 60)); + } - public override void KillMultiTile(int i, int j, int frameX, int frameY) - { - if(frameX == 0) - { - Item.NewItem(i * 16, j * 16, 48, 48, mod.ItemType("ParadoxTitanTrophy")); - } - } -}} \ No newline at end of file + public override void KillMultiTile(int i, int j, int frameX, int frameY) + { + if (frameX == 0) + { + Item.NewItem(i * 16, j * 16, 48, 48, mod.ItemType("ParadoxTitanTrophy")); + } + } + } +} \ No newline at end of file diff --git a/Invasion/Relayx.cs b/Invasion/Relayx.cs index 4cd45c3f..722ec2fb 100644 --- a/Invasion/Relayx.cs +++ b/Invasion/Relayx.cs @@ -6,71 +6,71 @@ namespace Tremor.Invasion { - public class Relayx : ModItem - { - public override void SetDefaults() - { + public class Relayx : ModItem + { + public override void SetDefaults() + { - item.damage = 95; - item.melee = true; - item.width = 50; - item.height = 50; - item.useTime = 15; - item.useAnimation = 15; - item.useStyle = 1; - item.shoot = mod.ProjectileType("RelayxProj"); - item.shootSpeed = 6f; - item.knockBack = 6; - item.value = 1000000; - item.rare = 11; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.useTurn = true; + item.damage = 95; + item.melee = true; + item.width = 50; + item.height = 50; + item.useTime = 15; + item.useAnimation = 15; + item.useStyle = 1; + item.shoot = mod.ProjectileType("RelayxProj"); + item.shootSpeed = 6f; + item.knockBack = 6; + item.value = 1000000; + item.rare = 11; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.useTurn = true; item.expert = true; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Relayx"); - Tooltip.SetDefault("Feel the power of the Titan"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Relayx"); + Tooltip.SetDefault("Feel the power of the Titan"); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if (Main.rand.Next(3) == 0) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 59); - } - } + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.Next(3) == 0) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 59); + } + } - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - if (Main.rand.Next(8) == 0) - { - if (Main.rand.Next(3) == 0) - { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("RelayxDragonBig"), item.damage + 200, 10, Main.myPlayer); - } - else - { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("RelayxDragon"), item.damage + 100, 10, Main.myPlayer); - } - } - else - { - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, item.damage - 20, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, item.damage - 20, knockBack, Main.myPlayer); - } - return false; - } + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + if (Main.rand.Next(8) == 0) + { + if (Main.rand.Next(3) == 0) + { + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("RelayxDragonBig"), item.damage + 200, 10, Main.myPlayer); + } + else + { + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("RelayxDragon"), item.damage + 100, 10, Main.myPlayer); + } + } + else + { + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, item.damage - 20, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, item.damage - 20, knockBack, Main.myPlayer); + } + return false; + } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) - { - TooltipLine tip = new TooltipLine(mod, "Tremor:Tooltip", "-Donator Items-"); - tip.overrideColor = new Color(119, 200, 203); - tooltips.Insert(3, tip); - } - } + public override void ModifyTooltips(System.Collections.Generic.List tooltips) + { + TooltipLine tip = new TooltipLine(mod, "Tremor:Tooltip", "-Donator Items-"); + tip.overrideColor = new Color(119, 200, 203); + tooltips.Insert(3, tip); + } + } } diff --git a/Invasion/RelayxDragon.cs b/Invasion/RelayxDragon.cs index 7cbce9c6..42278fc0 100644 --- a/Invasion/RelayxDragon.cs +++ b/Invasion/RelayxDragon.cs @@ -12,89 +12,89 @@ public class RelayxDragon : ModProjectile { public override void SetDefaults() { - projectile.width = 30; - projectile.height = 36; - projectile.aiStyle = 1; - projectile.friendly = true; - projectile.melee = true; - projectile.penetrate = -1; - projectile.timeLeft = 300; - projectile.extraUpdates = 1; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - aiType = ProjectileID.Bullet; - } + projectile.width = 30; + projectile.height = 36; + projectile.aiStyle = 1; + projectile.friendly = true; + projectile.melee = true; + projectile.penetrate = -1; + projectile.timeLeft = 300; + projectile.extraUpdates = 1; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + aiType = ProjectileID.Bullet; + } - public override void AI() - { - projectile.spriteDirection = projectile.direction; - if (Main.rand.Next(3) == 1) - { - int dust2 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 59, 0f, 0f, 100, default(Color), 1f); - Main.dust[dust2].noGravity = true; - Main.dust[dust2].velocity *= 0f; - } + public override void AI() + { + projectile.spriteDirection = projectile.direction; + if (Main.rand.Next(3) == 1) + { + int dust2 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 59, 0f, 0f, 100, default(Color), 1f); + Main.dust[dust2].noGravity = true; + Main.dust[dust2].velocity *= 0f; + } - float CenterX = projectile.Center.X; - float CenterY = projectile.Center.Y; - float Distanse = 400f; - bool CheckDistanse = false; - for (int MobCounts = 0; MobCounts < 200; MobCounts++) - { - if (Main.npc[MobCounts].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[MobCounts].Center, 1, 1)) - { - float Position1 = Main.npc[MobCounts].position.X + (float)(Main.npc[MobCounts].width / 2); - float Position2 = Main.npc[MobCounts].position.Y + (float)(Main.npc[MobCounts].height / 2); - float Position3 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - Position1) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - Position2); - if (Position3 < Distanse) - { - Distanse = Position3; - CenterX = Position1; - CenterY = Position2; - CheckDistanse = true; - } - } - } - if (CheckDistanse) - { - float Speed = 8f; - Vector2 FinalPos = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float NewPosX = CenterX - FinalPos.X; - float NewPosY = CenterY - FinalPos.Y; - float FinPos = (float)Math.Sqrt((double)(NewPosX * NewPosX + NewPosY * NewPosY)); - FinPos = Speed / FinPos; - NewPosX *= FinPos; - NewPosY *= FinPos; - projectile.velocity.X = (projectile.velocity.X * 20f + NewPosX) / 21f; - projectile.velocity.Y = (projectile.velocity.Y * 20f + NewPosY) / 21f; - return; - } - } + float CenterX = projectile.Center.X; + float CenterY = projectile.Center.Y; + float Distanse = 400f; + bool CheckDistanse = false; + for (int MobCounts = 0; MobCounts < 200; MobCounts++) + { + if (Main.npc[MobCounts].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[MobCounts].Center, 1, 1)) + { + float Position1 = Main.npc[MobCounts].position.X + (float)(Main.npc[MobCounts].width / 2); + float Position2 = Main.npc[MobCounts].position.Y + (float)(Main.npc[MobCounts].height / 2); + float Position3 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - Position1) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - Position2); + if (Position3 < Distanse) + { + Distanse = Position3; + CenterX = Position1; + CenterY = Position2; + CheckDistanse = true; + } + } + } + if (CheckDistanse) + { + float Speed = 8f; + Vector2 FinalPos = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float NewPosX = CenterX - FinalPos.X; + float NewPosY = CenterY - FinalPos.Y; + float FinPos = (float)Math.Sqrt((double)(NewPosX * NewPosX + NewPosY * NewPosY)); + FinPos = Speed / FinPos; + NewPosX *= FinPos; + NewPosY *= FinPos; + projectile.velocity.X = (projectile.velocity.X * 20f + NewPosX) / 21f; + projectile.velocity.Y = (projectile.velocity.Y * 20f + NewPosY) / 21f; + return; + } + } - public override void Kill(int timeLeft) - { - for (int k = 0; k < 5; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 59, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); - } - } + public override void Kill(int timeLeft) + { + for (int k = 0; k < 5; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 59, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); + } + } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - for (int k = 0; k < 5; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 59, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); - } - } + for (int k = 0; k < 5; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 59, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); + } + } - public override bool OnTileCollide(Vector2 oldVelocity) - { - for (int k = 0; k < 5; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 59, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); - projectile.Kill(); - } - return true; - } - } + public override bool OnTileCollide(Vector2 oldVelocity) + { + for (int k = 0; k < 5; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 59, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); + projectile.Kill(); + } + return true; + } + } } \ No newline at end of file diff --git a/Invasion/RelayxDragonBig.cs b/Invasion/RelayxDragonBig.cs index 4e3bd807..d83ed6ce 100644 --- a/Invasion/RelayxDragonBig.cs +++ b/Invasion/RelayxDragonBig.cs @@ -12,108 +12,108 @@ public class RelayxDragonBig : ModProjectile { public override void SetDefaults() { - projectile.width = 45; - projectile.height = 80; - projectile.aiStyle = 1; - projectile.friendly = true; - projectile.melee = true; - projectile.tileCollide = false; - projectile.penetrate = 1; - projectile.extraUpdates = 1; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - aiType = ProjectileID.Bullet; - Main.projFrames[projectile.type] = 4; - } + projectile.width = 45; + projectile.height = 80; + projectile.aiStyle = 1; + projectile.friendly = true; + projectile.melee = true; + projectile.tileCollide = false; + projectile.penetrate = 1; + projectile.extraUpdates = 1; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + aiType = ProjectileID.Bullet; + Main.projFrames[projectile.type] = 4; + } - public override bool PreAI() - { - projectile.spriteDirection = projectile.direction; - projectile.frameCounter++; - if (projectile.frameCounter >= 6) - { - projectile.frame++; - projectile.frameCounter = 0; - if (projectile.frame >= 4) - { - projectile.frame = 0; - } - } - return true; - } + public override bool PreAI() + { + projectile.spriteDirection = projectile.direction; + projectile.frameCounter++; + if (projectile.frameCounter >= 6) + { + projectile.frame++; + projectile.frameCounter = 0; + if (projectile.frame >= 4) + { + projectile.frame = 0; + } + } + return true; + } - public override void AI() - { - projectile.spriteDirection = projectile.direction; - if (Main.rand.Next(3) == 1) - { - int dust2 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 59, 0f, 0f, 100, default(Color), 1f); - Main.dust[dust2].noGravity = true; - Main.dust[dust2].velocity *= 0f; - } + public override void AI() + { + projectile.spriteDirection = projectile.direction; + if (Main.rand.Next(3) == 1) + { + int dust2 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 59, 0f, 0f, 100, default(Color), 1f); + Main.dust[dust2].noGravity = true; + Main.dust[dust2].velocity *= 0f; + } - float CenterX = projectile.Center.X; - float CenterY = projectile.Center.Y; - float Distanse = 400f; - bool CheckDistanse = false; - for (int MobCounts = 0; MobCounts < 200; MobCounts++) - { - if (Main.npc[MobCounts].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[MobCounts].Center, 1, 1)) - { - float Position1 = Main.npc[MobCounts].position.X + (float)(Main.npc[MobCounts].width / 2); - float Position2 = Main.npc[MobCounts].position.Y + (float)(Main.npc[MobCounts].height / 2); - float Position3 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - Position1) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - Position2); - if (Position3 < Distanse) - { - Distanse = Position3; - CenterX = Position1; - CenterY = Position2; - CheckDistanse = true; - } - } - } - if (CheckDistanse) - { - float Speed = 8f; - Vector2 FinalPos = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float NewPosX = CenterX - FinalPos.X; - float NewPosY = CenterY - FinalPos.Y; - float FinPos = (float)Math.Sqrt((double)(NewPosX * NewPosX + NewPosY * NewPosY)); - FinPos = Speed / FinPos; - NewPosX *= FinPos; - NewPosY *= FinPos; - projectile.velocity.X = (projectile.velocity.X * 20f + NewPosX) / 21f; - projectile.velocity.Y = (projectile.velocity.Y * 20f + NewPosY) / 21f; - return; - } - } + float CenterX = projectile.Center.X; + float CenterY = projectile.Center.Y; + float Distanse = 400f; + bool CheckDistanse = false; + for (int MobCounts = 0; MobCounts < 200; MobCounts++) + { + if (Main.npc[MobCounts].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[MobCounts].Center, 1, 1)) + { + float Position1 = Main.npc[MobCounts].position.X + (float)(Main.npc[MobCounts].width / 2); + float Position2 = Main.npc[MobCounts].position.Y + (float)(Main.npc[MobCounts].height / 2); + float Position3 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - Position1) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - Position2); + if (Position3 < Distanse) + { + Distanse = Position3; + CenterX = Position1; + CenterY = Position2; + CheckDistanse = true; + } + } + } + if (CheckDistanse) + { + float Speed = 8f; + Vector2 FinalPos = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float NewPosX = CenterX - FinalPos.X; + float NewPosY = CenterY - FinalPos.Y; + float FinPos = (float)Math.Sqrt((double)(NewPosX * NewPosX + NewPosY * NewPosY)); + FinPos = Speed / FinPos; + NewPosX *= FinPos; + NewPosY *= FinPos; + projectile.velocity.X = (projectile.velocity.X * 20f + NewPosX) / 21f; + projectile.velocity.Y = (projectile.velocity.Y * 20f + NewPosY) / 21f; + return; + } + } - public override void Kill(int timeLeft) - { - for (int k = 0; k < 5; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 59, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); - } - } + public override void Kill(int timeLeft) + { + for (int k = 0; k < 5; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 59, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); + } + } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - for (int k = 0; k < 5; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 59, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); - } - Main.player[projectile.owner].statLife += 10; - Main.player[projectile.owner].HealEffect(10); - } + for (int k = 0; k < 5; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 59, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); + } + Main.player[projectile.owner].statLife += 10; + Main.player[projectile.owner].HealEffect(10); + } - public override bool OnTileCollide(Vector2 oldVelocity) - { - for (int k = 0; k < 5; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 59, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); - projectile.Kill(); - } - return true; - } - } + public override bool OnTileCollide(Vector2 oldVelocity) + { + for (int k = 0; k < 5; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 59, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); + projectile.Kill(); + } + return true; + } + } } \ No newline at end of file diff --git a/Invasion/RelayxProj.cs b/Invasion/RelayxProj.cs index fd555440..bd836b79 100644 --- a/Invasion/RelayxProj.cs +++ b/Invasion/RelayxProj.cs @@ -7,91 +7,91 @@ namespace Tremor.Invasion { - public class RelayxProj : ModProjectile - { - public override void SetDefaults() - { - projectile.width = 28; - projectile.height = 28; - projectile.aiStyle = 27; - projectile.friendly = true; - projectile.melee = true; - projectile.penetrate = 1; - projectile.extraUpdates = 1; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - aiType = ProjectileID.Bullet; - } + public class RelayxProj : ModProjectile + { + public override void SetDefaults() + { + projectile.width = 28; + projectile.height = 28; + projectile.aiStyle = 27; + projectile.friendly = true; + projectile.melee = true; + projectile.penetrate = 1; + projectile.extraUpdates = 1; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + aiType = ProjectileID.Bullet; + } - public override void AI() - { - if (Main.rand.Next(3) == 1) - { - int dust2 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 59, 0f, 0f, 100, default(Color), 1f); - Main.dust[dust2].noGravity = true; - Main.dust[dust2].velocity *= 0f; - } + public override void AI() + { + if (Main.rand.Next(3) == 1) + { + int dust2 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 59, 0f, 0f, 100, default(Color), 1f); + Main.dust[dust2].noGravity = true; + Main.dust[dust2].velocity *= 0f; + } - float CenterX = projectile.Center.X; - float CenterY = projectile.Center.Y; - float Distanse = 400f; - bool CheckDistanse = false; - for (int MobCounts = 0; MobCounts < 200; MobCounts++) - { - if (Main.npc[MobCounts].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[MobCounts].Center, 1, 1)) - { - float Position1 = Main.npc[MobCounts].position.X + (float)(Main.npc[MobCounts].width / 2); - float Position2 = Main.npc[MobCounts].position.Y + (float)(Main.npc[MobCounts].height / 2); - float Position3 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - Position1) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - Position2); - if (Position3 < Distanse) - { - Distanse = Position3; - CenterX = Position1; - CenterY = Position2; - CheckDistanse = true; - } - } - } - if (CheckDistanse) - { - float Speed = 8f; - Vector2 FinalPos = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float NewPosX = CenterX - FinalPos.X; - float NewPosY = CenterY - FinalPos.Y; - float FinPos = (float)Math.Sqrt((double)(NewPosX * NewPosX + NewPosY * NewPosY)); - FinPos = Speed / FinPos; - NewPosX *= FinPos; - NewPosY *= FinPos; - projectile.velocity.X = (projectile.velocity.X * 20f + NewPosX) / 21f; - projectile.velocity.Y = (projectile.velocity.Y * 20f + NewPosY) / 21f; - return; - } - } + float CenterX = projectile.Center.X; + float CenterY = projectile.Center.Y; + float Distanse = 400f; + bool CheckDistanse = false; + for (int MobCounts = 0; MobCounts < 200; MobCounts++) + { + if (Main.npc[MobCounts].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[MobCounts].Center, 1, 1)) + { + float Position1 = Main.npc[MobCounts].position.X + (float)(Main.npc[MobCounts].width / 2); + float Position2 = Main.npc[MobCounts].position.Y + (float)(Main.npc[MobCounts].height / 2); + float Position3 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - Position1) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - Position2); + if (Position3 < Distanse) + { + Distanse = Position3; + CenterX = Position1; + CenterY = Position2; + CheckDistanse = true; + } + } + } + if (CheckDistanse) + { + float Speed = 8f; + Vector2 FinalPos = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float NewPosX = CenterX - FinalPos.X; + float NewPosY = CenterY - FinalPos.Y; + float FinPos = (float)Math.Sqrt((double)(NewPosX * NewPosX + NewPosY * NewPosY)); + FinPos = Speed / FinPos; + NewPosX *= FinPos; + NewPosY *= FinPos; + projectile.velocity.X = (projectile.velocity.X * 20f + NewPosX) / 21f; + projectile.velocity.Y = (projectile.velocity.Y * 20f + NewPosY) / 21f; + return; + } + } - public override void Kill(int timeLeft) - { - for (int k = 0; k < 5; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 59, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); - } - } + public override void Kill(int timeLeft) + { + for (int k = 0; k < 5; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 59, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); + } + } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - for (int k = 0; k < 5; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 59, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); - } - } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + for (int k = 0; k < 5; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 59, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); + } + } - public override bool OnTileCollide(Vector2 oldVelocity) - { - for (int k = 0; k < 5; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 59, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); - projectile.Kill(); - } - return true; - } - } + public override bool OnTileCollide(Vector2 oldVelocity) + { + for (int k = 0; k < 5; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 59, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); + projectile.Kill(); + } + return true; + } + } } \ No newline at end of file diff --git a/Invasion/RocketWand.cs b/Invasion/RocketWand.cs index 9f65bc32..64e7c4c2 100644 --- a/Invasion/RocketWand.cs +++ b/Invasion/RocketWand.cs @@ -4,37 +4,38 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Invasion { -public class RocketWand : ModItem +namespace Tremor.Invasion { - public override void SetDefaults() - { - item.CloneDefaults(ItemID.Starfury); + public class RocketWand : ModItem + { + public override void SetDefaults() + { + item.CloneDefaults(ItemID.Starfury); - item.damage = 300; - item.melee = false; - item.magic = true; - item.width = 50; - item.height = 55; - item.useTime = 20; - item.mana = 9; + item.damage = 300; + item.melee = false; + item.magic = true; + item.width = 50; + item.height = 55; + item.useTime = 20; + item.mana = 9; - item.useAnimation = 50; - item.useStyle = 5; - item.shootSpeed = 10f; - Item.staff[item.type] = true; - item.knockBack = 3; - item.value = 10000; - item.rare = 2; - item.UseSound = SoundID.Item9; - item.autoReuse = true; - } + item.useAnimation = 50; + item.useStyle = 5; + item.shootSpeed = 10f; + Item.staff[item.type] = true; + item.knockBack = 3; + item.value = 10000; + item.rare = 2; + item.UseSound = SoundID.Item9; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Rocket Wand"); - Tooltip.SetDefault("Causes missiles to fall from the sky"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Rocket Wand"); + Tooltip.SetDefault("Causes missiles to fall from the sky"); + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) @@ -43,5 +44,5 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX return base.Shoot(player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack); } -} + } } diff --git a/Invasion/SecondHand.cs b/Invasion/SecondHand.cs index 3b41cdc4..a3153752 100644 --- a/Invasion/SecondHand.cs +++ b/Invasion/SecondHand.cs @@ -5,34 +5,36 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Invasion { -public class SecondHand : ModItem +namespace Tremor.Invasion { + public class SecondHand : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 20; - item.alpha = 100; - item.value = 110000; - item.rare = 10; + item.width = 26; + item.height = 20; + item.alpha = 100; + item.value = 110000; + item.rare = 10; - item.accessory = true; - } + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Second Hand"); - Tooltip.SetDefault("Increases tile and wall placement range"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Second Hand"); + Tooltip.SetDefault("Increases tile and wall placement range"); + } - public override void UpdateAccessory(Player player, bool hideVisual) + public override void UpdateAccessory(Player player, bool hideVisual) - { - Player.tileRangeX+=10; - Player.tileRangeY+=10; - } + { + Player.tileRangeX += 10; + Player.tileRangeY += 10; + } -}} + } +} diff --git a/Invasion/SoulFlames.cs b/Invasion/SoulFlames.cs index be00d4e7..d84e6642 100644 --- a/Invasion/SoulFlames.cs +++ b/Invasion/SoulFlames.cs @@ -4,45 +4,47 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Invasion { -public class SoulFlames : ModItem +namespace Tremor.Invasion { - public override void SetDefaults() - { + public class SoulFlames : ModItem + { + public override void SetDefaults() + { - item.damage = 200; - item.magic = true; - item.width = 28; - item.height = 30; - item.useTime = 5; - item.useAnimation = 5; - item.shoot = 400; - item.shootSpeed = 31f; - item.mana = 6; - item.useStyle = 5; - item.knockBack = 3; - item.value = 150000; - item.rare = 11; - item.UseSound = SoundID.Item20; - item.autoReuse = true; - } + item.damage = 200; + item.magic = true; + item.width = 28; + item.height = 30; + item.useTime = 5; + item.useAnimation = 5; + item.shoot = 400; + item.shootSpeed = 31f; + item.mana = 6; + item.useStyle = 5; + item.knockBack = 3; + item.value = 150000; + item.rare = 11; + item.UseSound = SoundID.Item20; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Soul Flames"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Soul Flames"); + Tooltip.SetDefault(""); + } -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) -{ - for (int i = 0; i < 1; ++i) - { - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); - } - return false; -} + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + for (int i = 0; i < 1; ++i) + { + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); + } + return false; + } - -}} + + } +} diff --git a/Invasion/StrayStaff.cs b/Invasion/StrayStaff.cs index 56d0c60b..9eb3fbcf 100644 --- a/Invasion/StrayStaff.cs +++ b/Invasion/StrayStaff.cs @@ -7,9 +7,9 @@ namespace Tremor.Invasion { public class StrayStaff : ModItem - { + { - public override void SetDefaults() + public override void SetDefaults() { item.damage = 120; @@ -31,26 +31,26 @@ public override void SetDefaults() item.buffTime = 3600; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Stray Staff"); - Tooltip.SetDefault("Summons a cyber stray to fight for you"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Stray Staff"); + Tooltip.SetDefault("Summons a cyber stray to fight for you"); + } public override bool AltFunctionUse(Player player) { return true; } - + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { return player.altFunctionUse != 2; } - + public override bool UseItem(Player player) { - if(player.altFunctionUse == 2) + if (player.altFunctionUse == 2) { player.MinionNPCTargetAim(); } diff --git a/Invasion/SunBoots.cs b/Invasion/SunBoots.cs index 6a1dbb51..1817ee52 100644 --- a/Invasion/SunBoots.cs +++ b/Invasion/SunBoots.cs @@ -4,34 +4,36 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Invasion { -public class SunBoots : ModItem +namespace Tremor.Invasion { + public class SunBoots : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 28; - item.value = 00150000; - item.rare = 11; + item.width = 26; + item.height = 28; + item.value = 00150000; + item.rare = 11; - item.accessory = true; - } + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Paradox Boots"); - Tooltip.SetDefault("Allows you to control gravity\nIncreases speed and regeneration, increases maximum health by 50"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Paradox Boots"); + Tooltip.SetDefault("Allows you to control gravity\nIncreases speed and regeneration, increases maximum health by 50"); + } - public override void UpdateEquip(Player player) - { - player.moveSpeed += 0.5f; + public override void UpdateEquip(Player player) + { + player.moveSpeed += 0.5f; player.lifeRegen += 2; player.statLifeMax2 += 50; player.accRunSpeed = 10f; - player.gravControl = true; - } -}} + player.gravControl = true; + } + } +} diff --git a/Invasion/TheEtherealm.cs b/Invasion/TheEtherealm.cs index 8c3c8532..513ee6a8 100644 --- a/Invasion/TheEtherealm.cs +++ b/Invasion/TheEtherealm.cs @@ -4,51 +4,53 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Invasion { -public class TheEtherealm : ModItem +namespace Tremor.Invasion { - public override void SetDefaults() - { + public class TheEtherealm : ModItem + { + public override void SetDefaults() + { - item.damage = 100; - item.width = 18; - item.height = 56; - item.ranged = true; - item.useTime = 17; - item.shoot = 1; - item.shootSpeed = 52f; - item.noMelee = true; - item.useAnimation = 17; - item.useStyle = 5; - item.knockBack = 5; - item.value = 250000; - item.useAmmo = AmmoID.Arrow; - item.rare = 11; - item.UseSound = SoundID.Item5; - item.autoReuse = true; - } + item.damage = 100; + item.width = 18; + item.height = 56; + item.ranged = true; + item.useTime = 17; + item.shoot = 1; + item.shootSpeed = 52f; + item.noMelee = true; + item.useAnimation = 17; + item.useStyle = 5; + item.knockBack = 5; + item.value = 250000; + item.useAmmo = AmmoID.Arrow; + item.rare = 11; + item.UseSound = SoundID.Item5; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("The Etherealm"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("The Etherealm"); + Tooltip.SetDefault(""); + } -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) -{ - for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. - { - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, 440, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, 440, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, 440, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 440, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 2, speedY - 2, 440, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX + 3, speedY + 3, 440, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 3, speedY - 3, 440, damage, knockBack, Main.myPlayer); - } - return false; -} + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. + { + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, 440, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, 440, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, 440, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 440, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 2, speedY - 2, 440, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX + 3, speedY + 3, 440, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 3, speedY - 3, 440, damage, knockBack, Main.myPlayer); + } + return false; + } -}} + } +} diff --git a/Invasion/TimeTissue.cs b/Invasion/TimeTissue.cs index f3f34d9d..e6fbb620 100644 --- a/Invasion/TimeTissue.cs +++ b/Invasion/TimeTissue.cs @@ -3,24 +3,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Invasion { -public class TimeTissue : ModItem +namespace Tremor.Invasion { - public override void SetDefaults() - { + public class TimeTissue : ModItem + { + public override void SetDefaults() + { - item.width = 28; - item.height = 30; + item.width = 28; + item.height = 30; - item.maxStack = 99; - item.value = 10000; - item.rare = 11; - } + item.maxStack = 99; + item.value = 10000; + item.rare = 11; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Time Tissue"); - Tooltip.SetDefault("'It's about time'."); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Time Tissue"); + Tooltip.SetDefault("'It's about time'."); + } -}} + } +} diff --git a/Invasion/Titan.cs b/Invasion/Titan.cs index a71f0824..66d7407e 100644 --- a/Invasion/Titan.cs +++ b/Invasion/Titan.cs @@ -4,84 +4,85 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Invasion { - [AutoloadBossHead] -public class Titan : ModNPC +namespace Tremor.Invasion { -/* -Интеллект боÑÑа ÑоÑтоит из резких рывков. -Рывок определÑетÑÑ Ñ‚Ð°Ð¹Ð¼ÐµÑ€Ð¾Ð¼ npc.ai[1] -МакÑ. кол-во "тиков" в npc.ai[1] = 4500 -Чем меньше у боÑÑа здоровьÑ, тем быÑтрее и Ñильнее рывки -С небольшим шанÑом может Ñделать комбинацию из рывков (от 1 до 6 рывков подрÑд) -Иногда Ñоздает кольцо из быÑтро менÑющихÑÑ ÐºÐ°Ñ€Ñ‚Ð¸Ð½Ð¾Ðº (как у мозга Ктулху) -Выбирает Ñлучайную позицию и вÑтает на меÑто картинки -Со временем картинки иÑчезают -Ð’ завиÑимоÑти от выбранной картинки менÑетÑÑ ÑƒÑ€Ð¾Ð½ рывка -БоÑÑ Ð½Ðµ покидает поле ÑражениÑ, при Ñтом, ÑÐ´ÐµÐ»Ð°Ñ Ñ€Ñ‹Ð²Ð¾Ðº 6, может улететь -Рывки 1, 2 и 3 Ñамые безвредные -Иногда Ñпаунит криÑталлы -*/ + [AutoloadBossHead] + public class Titan : ModNPC + { + /* + Интеллект боÑÑа ÑоÑтоит из резких рывков. + Рывок определÑетÑÑ Ñ‚Ð°Ð¹Ð¼ÐµÑ€Ð¾Ð¼ npc.ai[1] + МакÑ. кол-во "тиков" в npc.ai[1] = 4500 + Чем меньше у боÑÑа здоровьÑ, тем быÑтрее и Ñильнее рывки + С небольшим шанÑом может Ñделать комбинацию из рывков (от 1 до 6 рывков подрÑд) + Иногда Ñоздает кольцо из быÑтро менÑющихÑÑ ÐºÐ°Ñ€Ñ‚Ð¸Ð½Ð¾Ðº (как у мозга Ктулху) + Выбирает Ñлучайную позицию и вÑтает на меÑто картинки + Со временем картинки иÑчезают + Ð’ завиÑимоÑти от выбранной картинки менÑетÑÑ ÑƒÑ€Ð¾Ð½ рывка + БоÑÑ Ð½Ðµ покидает поле ÑражениÑ, при Ñтом, ÑÐ´ÐµÐ»Ð°Ñ Ñ€Ñ‹Ð²Ð¾Ðº 6, может улететь + Рывки 1, 2 и 3 Ñамые безвредные + Иногда Ñпаунит криÑталлы + */ public override void SetStaticDefaults() { DisplayName.SetDefault("Paradox Titan"); Main.npcFrameCount[npc.type] = 4; } - - Vector2 Hands = new Vector2(-1, -1); - public static readonly int arenaWidth = (int)(1.3f * NPC.sWidth); - public override void SetDefaults() - { - npc.lifeMax = 90000; - npc.damage = 145; - npc.defense = 50; - npc.knockBackResist = 0f; - npc.noTileCollide = true; - npc.width = 180; - npc.height = 200; - animationType = 82; - npc.aiStyle = 14; - npc.npcSlots = 50f; - npc.HitSound = SoundID.NPCHit31; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 25, 0); - npc.boss = true; - bossBag = mod.ItemType("ParadoxTitanBag"); - } + + Vector2 Hands = new Vector2(-1, -1); + public static readonly int arenaWidth = (int)(1.3f * NPC.sWidth); + public override void SetDefaults() + { + npc.lifeMax = 90000; + npc.damage = 145; + npc.defense = 50; + npc.knockBackResist = 0f; + npc.noTileCollide = true; + npc.width = 180; + npc.height = 200; + animationType = 82; + npc.aiStyle = 14; + npc.npcSlots = 50f; + npc.HitSound = SoundID.NPCHit31; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 0, 25, 0); + npc.boss = true; + bossBag = mod.ItemType("ParadoxTitanBag"); + } int draw = -25; int draw_ = 75; public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) - { - //spriteBatch.Draw(mod.GetTexture("NPCs/CogLordBody"), npc.Center - Main.screenPosition, null, Color.White, 0f, new Vector2(74, -18), 1f, SpriteEffects.None, 0f); - spriteBatch.Draw(mod.GetTexture("Invasion/Hand_"), npc.Center - Main.screenPosition, null, Color.White, 0.0f, new Vector2(draw, -10), 1f, SpriteEffects.None, 1); - spriteBatch.Draw(mod.GetTexture("Invasion/Hand"), npc.Center - Main.screenPosition, null, Color.White, 0.0f, new Vector2(draw_, -10), 1f, SpriteEffects.None, 1); + { + //spriteBatch.Draw(mod.GetTexture("NPCs/CogLordBody"), npc.Center - Main.screenPosition, null, Color.White, 0f, new Vector2(74, -18), 1f, SpriteEffects.None, 0f); + spriteBatch.Draw(mod.GetTexture("Invasion/Hand_"), npc.Center - Main.screenPosition, null, Color.White, 0.0f, new Vector2(draw, -10), 1f, SpriteEffects.None, 1); + spriteBatch.Draw(mod.GetTexture("Invasion/Hand"), npc.Center - Main.screenPosition, null, Color.White, 0.0f, new Vector2(draw_, -10), 1f, SpriteEffects.None, 1); //spriteBatch.Draw(mod.GetTexture("Invasion/Titan"), new Vector2(npc.Center.X, npc.Center.Y), null, Color.White, 0.0f, new Vector2(-10, -25), 1f, SpriteEffects.None, 1); - } - - int CurrentFrame = 0; - int TimeToAnimation = 6; - const int AnimationRate = 6; - bool FirstState_ = true; - void Animation() - { - if (--TimeToAnimation <= 0) - { + } - if (++CurrentFrame > 4) - CurrentFrame = 1; - TimeToAnimation = AnimationRate; - npc.frame = GetFrame(CurrentFrame + ((FirstState_) ? 0 : 4)); - } - } + int CurrentFrame = 0; + int TimeToAnimation = 6; + const int AnimationRate = 6; + bool FirstState_ = true; + void Animation() + { + if (--TimeToAnimation <= 0) + { - Rectangle GetFrame(int Number) - { - return new Rectangle(0, npc.frame.Height * (Number - 1), npc.frame.Width, npc.frame.Height); - } - -private void SetupCrystals(int radius, bool clockwise) + if (++CurrentFrame > 4) + CurrentFrame = 1; + TimeToAnimation = AnimationRate; + npc.frame = GetFrame(CurrentFrame + ((FirstState_) ? 0 : 4)); + } + } + + Rectangle GetFrame(int Number) + { + return new Rectangle(0, npc.frame.Height * (Number - 1), npc.frame.Width, npc.frame.Height); + } + + private void SetupCrystals(int radius, bool clockwise) { if (Main.netMode == 1) { @@ -103,45 +104,45 @@ private void SetupCrystals(int radius, bool clockwise) //NetMessage.SendData(27, -1, -1, "", proj); } } - - public override void AI() - { + + public override void AI() + { Animation(); Vector2 PTC = Main.player[npc.target].position + new Vector2(npc.width / 2, npc.height / 2); - Vector2 NPos = npc.position + new Vector2(npc.width / 2, npc.height / 2); + Vector2 NPos = npc.position + new Vector2(npc.width / 2, npc.height / 2); if (Main.rand.Next(150) == 0) - { - NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("TitanCrystal")); - } - - if (Main.rand.Next(150) == 1) - { - Vector2 vector8 = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height / 2)); - float rotation = (float)Math.Atan2(vector8.Y - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), vector8.X - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); - npc.velocity.X = (float)(Math.Cos(rotation) * 14) * -1; - npc.velocity.Y = (float)(Math.Sin(rotation) * 14) * -1; - npc.netUpdate = true; - } - - if (Main.rand.Next(250) == 1) - { - Vector2 vector8 = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height / 2)); - float rotation = (float)Math.Atan2(vector8.Y - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), vector8.X - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); - npc.velocity.X = (float)(Math.Cos(rotation) * 28) * -1; - npc.velocity.Y = (float)(Math.Sin(rotation) * 28) * -1; - npc.netUpdate = true; - } - + { + NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("TitanCrystal")); + } + + if (Main.rand.Next(150) == 1) + { + Vector2 vector8 = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height / 2)); + float rotation = (float)Math.Atan2(vector8.Y - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), vector8.X - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); + npc.velocity.X = (float)(Math.Cos(rotation) * 14) * -1; + npc.velocity.Y = (float)(Math.Sin(rotation) * 14) * -1; + npc.netUpdate = true; + } + + if (Main.rand.Next(250) == 1) + { + Vector2 vector8 = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height / 2)); + float rotation = (float)Math.Atan2(vector8.Y - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), vector8.X - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); + npc.velocity.X = (float)(Math.Cos(rotation) * 28) * -1; + npc.velocity.Y = (float)(Math.Sin(rotation) * 28) * -1; + npc.netUpdate = true; + } + if (Main.rand.Next(350) == 1) //6 комбо - { - Vector2 vector8 = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height / 2)); - float rotation = (float)Math.Atan2(vector8.Y - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), vector8.X - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); - npc.velocity.X = (float)(Math.Cos(rotation) * 46) * -1; - npc.velocity.Y = (float)(Math.Sin(rotation) * 46) * -1; - npc.netUpdate = true; - } - - + { + Vector2 vector8 = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height / 2)); + float rotation = (float)Math.Atan2(vector8.Y - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), vector8.X - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); + npc.velocity.X = (float)(Math.Cos(rotation) * 46) * -1; + npc.velocity.Y = (float)(Math.Sin(rotation) * 46) * -1; + npc.netUpdate = true; + } + + npc.netUpdate = false; npc.ai[0]++; npc.ai[1]++; //Ñтарт таймера @@ -149,8 +150,8 @@ public override void AI() { npc.velocity.X *= 0.97f; npc.velocity.Y *= 0.97f; - } - + } + if (npc.ai[1] >= 4500) //макÑ. таймера { npc.ai[0]++; @@ -184,7 +185,7 @@ public override void AI() npc.velocity.Y = (float)(Math.Sin(rotation) * 14) * -1; } } - + if ((npc.ai[1] >= 200 && npc.life > 45000 && npc.ai[1] < 500) || (npc.ai[1] >= 120 && npc.life <= 45000 && npc.ai[1] < 500) && !Main.expertMode) //рывки { Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 8); @@ -202,7 +203,7 @@ public override void AI() { npc.TargetClosest(true); } - + if (!Main.player[npc.target].dead && Main.rand.Next(2) == 1) { npc.position.X = Main.player[npc.target].position.X + (float)((600 * Math.Cos(npc.ai[3])) * -1); @@ -213,9 +214,9 @@ public override void AI() npc.velocity.Y = (float)(Math.Sin(rotation) * 14) * -1; } } - + if (npc.ai[1] >= 3000) //комбо 2 - { + { if (npc.ai[0] == 0) { npc.velocity.Y = Main.rand.Next(-10, -2); @@ -243,87 +244,88 @@ public override void AI() else npc.velocity.Y += 0.015f; } } - + if (npc.ai[1] >= 3200) //комбо 3 { - Vector2 vector8 = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height / 2)); - float rotation = (float)Math.Atan2(vector8.Y - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), vector8.X - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); - npc.velocity.X = (float)(Math.Cos(rotation) * 28) * -1; - npc.velocity.Y = (float)(Math.Sin(rotation) * 28) * -1; - npc.netUpdate = true; - float Angle = (float)Math.Atan2(NPos.Y - PTC.Y, NPos.X - PTC.X); - int SpitShot1 = Projectile.NewProjectile(NPos.X, NPos.Y, (float)((Math.Cos(Angle) * 22f) * -1), (float)((Math.Sin(Angle) * 22f) * -1), mod.ProjectileType("CyberLaserBat"), 30, 0f, 0); - Main.projectile[SpitShot1].friendly = false; - Main.projectile[SpitShot1].timeLeft = 500; - } - + Vector2 vector8 = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height / 2)); + float rotation = (float)Math.Atan2(vector8.Y - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), vector8.X - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); + npc.velocity.X = (float)(Math.Cos(rotation) * 28) * -1; + npc.velocity.Y = (float)(Math.Sin(rotation) * 28) * -1; + npc.netUpdate = true; + float Angle = (float)Math.Atan2(NPos.Y - PTC.Y, NPos.X - PTC.X); + int SpitShot1 = Projectile.NewProjectile(NPos.X, NPos.Y, (float)((Math.Cos(Angle) * 22f) * -1), (float)((Math.Sin(Angle) * 22f) * -1), mod.ProjectileType("CyberLaserBat"), 30, 0f, 0); + Main.projectile[SpitShot1].friendly = false; + Main.projectile[SpitShot1].timeLeft = 500; + } + if (npc.ai[1] >= 3500) //комбо 4 - { - npc.velocity.X *= 2.00f; - npc.velocity.Y *= 2.00f; - Vector2 vector8 = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height * 0.5f)); - { - float rotation = (float)Math.Atan2((vector8.Y) - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), (vector8.X) - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); - npc.velocity.X = (float)(Math.Cos(rotation) * 28) * -1; - npc.velocity.Y = (float)(Math.Sin(rotation) * 28) * -1; + { + npc.velocity.X *= 2.00f; + npc.velocity.Y *= 2.00f; + Vector2 vector8 = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height * 0.5f)); + { + float rotation = (float)Math.Atan2((vector8.Y) - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), (vector8.X) - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); + npc.velocity.X = (float)(Math.Cos(rotation) * 28) * -1; + npc.velocity.Y = (float)(Math.Sin(rotation) * 28) * -1; float Angle = (float)Math.Atan2(NPos.Y - PTC.Y, NPos.X - PTC.X); int SpitShot1 = Projectile.NewProjectile(NPos.X, NPos.Y, (float)((Math.Cos(Angle) * 22f) * -1), (float)((Math.Sin(Angle) * 22f) * -1), mod.ProjectileType("CyberLaserBat"), 50, 0f, 0); Main.projectile[SpitShot1].friendly = false; Main.projectile[SpitShot1].timeLeft = 500; - } - return; - } - + } + return; + } + if (npc.ai[1] >= 4000) //комбо 5-6 - { - npc.velocity.X *= 5.00f; - npc.velocity.Y *= 5.00f; - Vector2 vector8 = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height * 0.5f)); - { + { + npc.velocity.X *= 5.00f; + npc.velocity.Y *= 5.00f; + Vector2 vector8 = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height * 0.5f)); + { float Angle = (float)Math.Atan2(NPos.Y - PTC.Y, NPos.X - PTC.X); int SpitShot1 = Projectile.NewProjectile(NPos.X, NPos.Y, (float)((Math.Cos(Angle) * 22f) * -1), (float)((Math.Sin(Angle) * 22f) * -1), mod.ProjectileType("CyberLaserBat"), 90, 0f, 0); Main.projectile[SpitShot1].friendly = false; Main.projectile[SpitShot1].timeLeft = 500; - float rotation = (float)Math.Atan2((vector8.Y) - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), (vector8.X) - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); - npc.velocity.X = (float)(Math.Cos(rotation) * 28) * -1; - npc.velocity.Y = (float)(Math.Sin(rotation) * 28) * -1; - } - return; - } - } + float rotation = (float)Math.Atan2((vector8.Y) - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), (vector8.X) - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); + npc.velocity.X = (float)(Math.Cos(rotation) * 28) * -1; + npc.velocity.Y = (float)(Math.Sin(rotation) * 28) * -1; + } + return; + } + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; - if(Main.expertMode) - { - npc.DropBossBags(); - } - if(!Main.expertMode && Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ParadoxTitanMask")); - } - if(!Main.expertMode && Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TimeTissue"), Main.rand.Next(20,32)); - } - if(!Main.expertMode && Main.rand.Next(1) == 0) - { - Helper.DropItem(new Rectangle((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height), new Drop(mod.ItemType("RocketWand"), 1, 1), new Drop(mod.ItemType("TheEtherealm"), 1, 1), new Drop(mod.ItemType("SoulFlames"), 1, 1)); - } - if(Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ParadoxTitanTrophy")); - } - if(Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("VioleumWings")); - } - } - } -}} \ No newline at end of file + if (Main.expertMode) + { + npc.DropBossBags(); + } + if (!Main.expertMode && Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ParadoxTitanMask")); + } + if (!Main.expertMode && Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TimeTissue"), Main.rand.Next(20, 32)); + } + if (!Main.expertMode && Main.rand.Next(1) == 0) + { + Helper.DropItem(new Rectangle((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height), new Drop(mod.ItemType("RocketWand"), 1, 1), new Drop(mod.ItemType("TheEtherealm"), 1, 1), new Drop(mod.ItemType("SoulFlames"), 1, 1)); + } + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ParadoxTitanTrophy")); + } + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("VioleumWings")); + } + } + } + } +} \ No newline at end of file diff --git a/Invasion/TitanCrystal.cs b/Invasion/TitanCrystal.cs index 27f47800..86000899 100644 --- a/Invasion/TitanCrystal.cs +++ b/Invasion/TitanCrystal.cs @@ -16,10 +16,10 @@ public override void SetStaticDefaults() DisplayName.SetDefault("Paradox Crystal"); Main.npcFrameCount[npc.type] = 5; } - + public override void SetDefaults() { - animationType = 523; + animationType = 523; npc.npcSlots = 0.3f; npc.damage = 150; npc.width = 36; @@ -35,31 +35,31 @@ public override void SetDefaults() npc.DeathSound = SoundID.NPCDeath1; } - public override bool PreAI() - { - bool expertMode = Main.expertMode; - npc.TargetClosest(true); - Vector2 direction = Main.player[npc.target].Center - npc.Center; - direction.Normalize(); - direction *= 9f; - npc.rotation = 0f; - Player player = Main.player[npc.target]; - NPC parent = Main.npc[NPC.FindFirstNPC(mod.NPCType("Titan"))]; - double deg = (double)npc.ai[1] / 2; - double rad = deg * (Math.PI / 180); - double dist = 250; - npc.position.X = parent.Center.X - (int)(Math.Cos(rad) * dist) - npc.width / 2; - npc.position.Y = parent.Center.Y - (int)(Math.Sin(rad) * dist) - npc.height / 2; - npc.ai[1] += 2f; - return false; - } + public override bool PreAI() + { + bool expertMode = Main.expertMode; + npc.TargetClosest(true); + Vector2 direction = Main.player[npc.target].Center - npc.Center; + direction.Normalize(); + direction *= 9f; + npc.rotation = 0f; + Player player = Main.player[npc.target]; + NPC parent = Main.npc[NPC.FindFirstNPC(mod.NPCType("Titan"))]; + double deg = (double)npc.ai[1] / 2; + double rad = deg * (Math.PI / 180); + double dist = 250; + npc.position.X = parent.Center.X - (int)(Math.Cos(rad) * dist) - npc.width / 2; + npc.position.Y = parent.Center.Y - (int)(Math.Sin(rad) * dist) - npc.height / 2; + npc.ai[1] += 2f; + return false; + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { npc.lifeMax = (int)(npc.lifeMax * 0.55f * bossLifeScale); npc.damage = (int)(npc.damage * 0.75f); } - + public override void HitEffect(int hitDirection, double damage) { for (int k = 0; k < 5; k++) @@ -68,9 +68,9 @@ public override void HitEffect(int hitDirection, double damage) } } - public override bool CheckActive() - { - return false; - } - } + public override bool CheckActive() + { + return false; + } + } } \ No newline at end of file diff --git a/Invasion/Titan_.cs b/Invasion/Titan_.cs index f2d2c6a0..da4214d0 100644 --- a/Invasion/Titan_.cs +++ b/Invasion/Titan_.cs @@ -6,129 +6,130 @@ using Terraria.ModLoader; using Tremor.Invasion; -namespace Tremor.Invasion { - [AutoloadBossHead] - public class Titan_ : ModNPC - { +namespace Tremor.Invasion +{ + [AutoloadBossHead] + public class Titan_ : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Titan Soul"); Main.npcFrameCount[npc.type] = 4; } - - public static readonly int arenaWidth = (int)(1.3f * NPC.sWidth); - public override void SetDefaults() - { - npc.aiStyle = 94; - npc.lifeMax = 1; - npc.dontTakeDamage = true; - npc.defense = 15; - npc.knockBackResist = 0f; - npc.width = 108; - npc.height = 98; - npc.value = Item.buyPrice(0, 20, 0, 0); - npc.npcSlots = 15f; - npc.lavaImmune = true; - npc.noGravity = true; - npc.noTileCollide = true; - } - - int CurrentFrame = 0; - int TimeToAnimation = 6; - const int AnimationRate = 6; - bool FirstState_ = true; - void Animation() - { - if (--TimeToAnimation <= 0) - { - - if (++CurrentFrame > 4) - CurrentFrame = 1; - TimeToAnimation = AnimationRate; - npc.frame = GetFrame(CurrentFrame + ((FirstState_) ? 0 : 4)); - } - } - - Rectangle GetFrame(int Number) - { - return new Rectangle(0, npc.frame.Height * (Number - 1), npc.frame.Width, npc.frame.Height); - } - - - - - - - - public override void HitEffect(int hitDirection, double damage) - { - - } - - public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) - { - return false; - } - - public override void AI() - { - Player player = Main.player[Main.myPlayer]; - if (npc.Distance(Main.player[npc.target].position) > 5000) - { - player.position = npc.Center; - } - Animation(); - CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer(mod); - if (InvasionWorld.CyberWrath && InvasionWorld.CyberWrathPoints1 == 97) - { - npc.dontTakeDamage = false; - npc.life = 0; - NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("Titan")); - InvasionWorld.CyberWrathPoints1 = 98; - } - - if (InvasionWorld.CyberWrath && InvasionWorld.CyberWrathPoints1 < 98) - npc.dontTakeDamage = true; - bool FirstAttack = true; - if (FirstAttack) - { - SetupCrystals(arenaWidth / 2, false); - FirstAttack = false; - } - - - if (player.dead) - { - npc.active = true; - } - - if (player.statLife == 0) - { - player.position = npc.Center; - } - } - - private void SetupCrystals(int radius, bool clockwise) - { - if (Main.netMode == 1) - { - return; - } - Vector2 center = npc.Center; - for (int k = 0; k < 15; k++) - { - float angle = 2f * (float)Math.PI / 10f * k; - Vector2 pos = center + radius * new Vector2((float)Math.Cos(angle), (float)Math.Sin(angle)); - int damage = 80; - if (Main.expertMode) - { - damage = (int)(100 / Main.expertDamage); - } - int proj = Projectile.NewProjectile(pos.X, pos.Y, 0f, 0f, mod.ProjectileType("TitanCrystal_"), damage, 0f, Main.myPlayer, npc.whoAmI, angle); - Main.projectile[proj].localAI[0] = radius; - Main.projectile[proj].localAI[1] = clockwise ? 1 : -1; - //NetMessage.SendData(27, -1, -1, "", proj); - } - } - } + + public static readonly int arenaWidth = (int)(1.3f * NPC.sWidth); + public override void SetDefaults() + { + npc.aiStyle = 94; + npc.lifeMax = 1; + npc.dontTakeDamage = true; + npc.defense = 15; + npc.knockBackResist = 0f; + npc.width = 108; + npc.height = 98; + npc.value = Item.buyPrice(0, 20, 0, 0); + npc.npcSlots = 15f; + npc.lavaImmune = true; + npc.noGravity = true; + npc.noTileCollide = true; + } + + int CurrentFrame = 0; + int TimeToAnimation = 6; + const int AnimationRate = 6; + bool FirstState_ = true; + void Animation() + { + if (--TimeToAnimation <= 0) + { + + if (++CurrentFrame > 4) + CurrentFrame = 1; + TimeToAnimation = AnimationRate; + npc.frame = GetFrame(CurrentFrame + ((FirstState_) ? 0 : 4)); + } + } + + Rectangle GetFrame(int Number) + { + return new Rectangle(0, npc.frame.Height * (Number - 1), npc.frame.Width, npc.frame.Height); + } + + + + + + + + public override void HitEffect(int hitDirection, double damage) + { + + } + + public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) + { + return false; + } + + public override void AI() + { + Player player = Main.player[Main.myPlayer]; + if (npc.Distance(Main.player[npc.target].position) > 5000) + { + player.position = npc.Center; + } + Animation(); + CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer(mod); + if (InvasionWorld.CyberWrath && InvasionWorld.CyberWrathPoints1 == 97) + { + npc.dontTakeDamage = false; + npc.life = 0; + NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("Titan")); + InvasionWorld.CyberWrathPoints1 = 98; + } + + if (InvasionWorld.CyberWrath && InvasionWorld.CyberWrathPoints1 < 98) + npc.dontTakeDamage = true; + bool FirstAttack = true; + if (FirstAttack) + { + SetupCrystals(arenaWidth / 2, false); + FirstAttack = false; + } + + + if (player.dead) + { + npc.active = true; + } + + if (player.statLife == 0) + { + player.position = npc.Center; + } + } + + private void SetupCrystals(int radius, bool clockwise) + { + if (Main.netMode == 1) + { + return; + } + Vector2 center = npc.Center; + for (int k = 0; k < 15; k++) + { + float angle = 2f * (float)Math.PI / 10f * k; + Vector2 pos = center + radius * new Vector2((float)Math.Cos(angle), (float)Math.Sin(angle)); + int damage = 80; + if (Main.expertMode) + { + damage = (int)(100 / Main.expertDamage); + } + int proj = Projectile.NewProjectile(pos.X, pos.Y, 0f, 0f, mod.ProjectileType("TitanCrystal_"), damage, 0f, Main.myPlayer, npc.whoAmI, angle); + Main.projectile[proj].localAI[0] = radius; + Main.projectile[proj].localAI[1] = clockwise ? 1 : -1; + //NetMessage.SendData(27, -1, -1, "", proj); + } + } + } } \ No newline at end of file diff --git a/Invasion/Violeum.cs b/Invasion/Violeum.cs index 42077e47..16856938 100644 --- a/Invasion/Violeum.cs +++ b/Invasion/Violeum.cs @@ -6,312 +6,313 @@ using Terraria.ModLoader; -namespace Tremor.Invasion { - public class Violeum : ModNPC - { +namespace Tremor.Invasion +{ + public class Violeum : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Violeum"); Main.npcFrameCount[npc.type] = 4; } - - Vector2 Hands = new Vector2(-1, -1); - public override void SetDefaults() - { - npc.lifeMax = 18000; - npc.width = 78; - npc.height = 88; - animationType = 82; - npc.damage = 250; - npc.defense = 70; - npc.knockBackResist = 0f; - npc.width = 70; - npc.height = 86; - npc.aiStyle = 14; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit35; - npc.noGravity = true; - npc.DeathSound = SoundID.NPCDeath57; - npc.color = Color.White; - } - + + Vector2 Hands = new Vector2(-1, -1); + public override void SetDefaults() + { + npc.lifeMax = 18000; + npc.width = 78; + npc.height = 88; + animationType = 82; + npc.damage = 250; + npc.defense = 70; + npc.knockBackResist = 0f; + npc.width = 70; + npc.height = 86; + npc.aiStyle = 14; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit35; + npc.noGravity = true; + npc.DeathSound = SoundID.NPCDeath57; + npc.color = Color.White; + } + public override void NPCLoot() { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; - if(Main.expertMode) - { - npc.DropBossBags(); - } - if(!Main.expertMode && Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("VioleumMask")); - } - if(!Main.expertMode && Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Crystyle")); - } - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HealingPotion"), Main.rand.Next(7, 20)); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TimeTissue"), Main.rand.Next(5, 15)); - Main.NewText("Violeum has been defeated!", 39, 86, 134); + if (Main.expertMode) + { + npc.DropBossBags(); + } + if (!Main.expertMode && Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("VioleumMask")); + } + if (!Main.expertMode && Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Crystyle")); + } + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HealingPotion"), Main.rand.Next(7, 20)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TimeTissue"), Main.rand.Next(5, 15)); + Main.NewText("Violeum has been defeated!", 39, 86, 134); + } } - } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer(mod); - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return InvasionWorld.CyberWrath && y > Main.worldSurface ? 0.5f : 0f; - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer(mod); + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return InvasionWorld.CyberWrath && y > Main.worldSurface ? 0.5f : 0f; + } - public override void HitEffect(int hitDirection, double damage) - { - if (npc.life <= 0) - { - for (int k = 0; k < 10; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 10; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } - CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer(mod); - if (InvasionWorld.CyberWrath && InvasionWorld.CyberWrathPoints1 < 85) - { - InvasionWorld.CyberWrathPoints1 += 15; - //Main.NewText(("Wave 1: Complete " + TremorWorld.CyberWrathPoints + "%"), 39, 86, 134); - } - } + CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer(mod); + if (InvasionWorld.CyberWrath && InvasionWorld.CyberWrathPoints1 < 85) + { + InvasionWorld.CyberWrathPoints1 += 15; + //Main.NewText(("Wave 1: Complete " + TremorWorld.CyberWrathPoints + "%"), 39, 86, 134); + } + } - for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), (float)hitDirection, -1f, 0, default(Color), 0.7f); + } + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - const string Boss_Left_Hand_Type = "Violeum_LeftArm"; - const string Boss_Right_Hand_Type = "Violeum_RightArm"; - const string Boss_Up_Hand_Type = "Violeum_LeftArm"; - const string Boss_Down_Hand_Type = "Violeum_RightArm"; + const string Boss_Left_Hand_Type = "Violeum_LeftArm"; + const string Boss_Right_Hand_Type = "Violeum_RightArm"; + const string Boss_Up_Hand_Type = "Violeum_LeftArm"; + const string Boss_Down_Hand_Type = "Violeum_RightArm"; - void MakeHands() - { - Hands.X = NPC.NewNPC((int)npc.Center.X - 50, (int)npc.Center.Y, mod.NPCType(Boss_Left_Hand_Type), 0, 1, npc.whoAmI); - Hands.Y = NPC.NewNPC((int)npc.Center.X + 50, (int)npc.Center.Y, mod.NPCType(Boss_Right_Hand_Type), 0, -1, npc.whoAmI); - Hands.Y = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y - 1000, mod.NPCType(Boss_Down_Hand_Type), 0, -1, npc.whoAmI); - Hands.Y = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y + 1000, mod.NPCType(Boss_Up_Hand_Type), 0, -1, npc.whoAmI); - } + void MakeHands() + { + Hands.X = NPC.NewNPC((int)npc.Center.X - 50, (int)npc.Center.Y, mod.NPCType(Boss_Left_Hand_Type), 0, 1, npc.whoAmI); + Hands.Y = NPC.NewNPC((int)npc.Center.X + 50, (int)npc.Center.Y, mod.NPCType(Boss_Right_Hand_Type), 0, -1, npc.whoAmI); + Hands.Y = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y - 1000, mod.NPCType(Boss_Down_Hand_Type), 0, -1, npc.whoAmI); + Hands.Y = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y + 1000, mod.NPCType(Boss_Up_Hand_Type), 0, -1, npc.whoAmI); + } - void CheckHands() - { - if (Hands.X != -1) - if (!((Main.npc[(int)Hands.X].type == mod.NPCType(Boss_Left_Hand_Type) && Main.npc[(int)Hands.X].ai[1] == npc.whoAmI) && Main.npc[(int)Hands.X].active)) - Hands.X = -1; - if (Hands.Y != -1) - if (!((Main.npc[(int)Hands.Y].type == mod.NPCType(Boss_Right_Hand_Type) && Main.npc[(int)Hands.Y].ai[1] == npc.whoAmI) && Main.npc[(int)Hands.Y].active)) - Hands.Y = -1; - if (Hands.X != -1) - if (!((Main.npc[(int)Hands.X].type == mod.NPCType(Boss_Up_Hand_Type) && Main.npc[(int)Hands.X].ai[1] == npc.whoAmI) && Main.npc[(int)Hands.X].active)) - Hands.X = -1; - if (Hands.Y != -1) - if (!((Main.npc[(int)Hands.Y].type == mod.NPCType(Boss_Down_Hand_Type) && Main.npc[(int)Hands.Y].ai[1] == npc.whoAmI) && Main.npc[(int)Hands.Y].active)) - Hands.Y = -1; - } + void CheckHands() + { + if (Hands.X != -1) + if (!((Main.npc[(int)Hands.X].type == mod.NPCType(Boss_Left_Hand_Type) && Main.npc[(int)Hands.X].ai[1] == npc.whoAmI) && Main.npc[(int)Hands.X].active)) + Hands.X = -1; + if (Hands.Y != -1) + if (!((Main.npc[(int)Hands.Y].type == mod.NPCType(Boss_Right_Hand_Type) && Main.npc[(int)Hands.Y].ai[1] == npc.whoAmI) && Main.npc[(int)Hands.Y].active)) + Hands.Y = -1; + if (Hands.X != -1) + if (!((Main.npc[(int)Hands.X].type == mod.NPCType(Boss_Up_Hand_Type) && Main.npc[(int)Hands.X].ai[1] == npc.whoAmI) && Main.npc[(int)Hands.X].active)) + Hands.X = -1; + if (Hands.Y != -1) + if (!((Main.npc[(int)Hands.Y].type == mod.NPCType(Boss_Down_Hand_Type) && Main.npc[(int)Hands.Y].ai[1] == npc.whoAmI) && Main.npc[(int)Hands.Y].active)) + Hands.Y = -1; + } - public override void ModifyHitByProjectile(Projectile projectile, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) - { - CheckHands(); - if (Hands.Y != -1) - damage /= 10; - } + public override void ModifyHitByProjectile(Projectile projectile, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) + { + CheckHands(); + if (Hands.Y != -1) + damage /= 10; + } - public override void ModifyHitByItem(Player player, Item item, ref int damage, ref float knockback, ref bool crit) - { - CheckHands(); - if (Hands.Y != -1) - damage /= 10; - } + public override void ModifyHitByItem(Player player, Item item, ref int damage, ref float knockback, ref bool crit) + { + CheckHands(); + if (Hands.Y != -1) + damage /= 10; + } - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - CheckHands(); - if (Hands.Y != -1) - damage /= 10; - } + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + CheckHands(); + if (Hands.Y != -1) + damage /= 10; + } - public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit) - { - CheckHands(); - if (Hands.Y != -1) - damage /= 10; - } + public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit) + { + CheckHands(); + if (Hands.Y != -1) + damage /= 10; + } - float customAi1; - bool FirstState = false; - bool SecondState = false; - public override void AI() - { - if (npc.life > npc.lifeMax / 2) - { - FirstState = true; - } + float customAi1; + bool FirstState = false; + bool SecondState = false; + public override void AI() + { + if (npc.life > npc.lifeMax / 2) + { + FirstState = true; + } - if (npc.life < npc.lifeMax / 2) - { - SecondState = true; - } + if (npc.life < npc.lifeMax / 2) + { + SecondState = true; + } - if (Main.rand.Next(2) == 0) - { - int num706 = Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), 0f, 0f, 200, npc.color, 0.5f); - Main.dust[num706].velocity *= 0.6f; - } - if (FirstState) - { - npc.TargetClosest(); - npc.netUpdate = false; - npc.ai[1]++; + if (Main.rand.Next(2) == 0) + { + int num706 = Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("CyberDust"), 0f, 0f, 200, npc.color, 0.5f); + Main.dust[num706].velocity *= 0.6f; + } + if (FirstState) + { + npc.TargetClosest(); + npc.netUpdate = false; + npc.ai[1]++; - npc.TargetClosest(true); - Vector2 PTC = Main.player[npc.target].position + new Vector2(npc.width / 2, npc.height / 2); - Vector2 NPos = npc.position + new Vector2(npc.width / 2, npc.height / 2); - npc.netUpdate = true; + npc.TargetClosest(true); + Vector2 PTC = Main.player[npc.target].position + new Vector2(npc.width / 2, npc.height / 2); + Vector2 NPos = npc.position + new Vector2(npc.width / 2, npc.height / 2); + npc.netUpdate = true; - customAi1 += (Main.rand.Next(2, 5) * 0.1f) * npc.scale; - if (customAi1 >= 4f) - if (Main.rand.Next(300) == 1) - { - Main.PlaySound(27, (int)npc.position.X, (int)npc.position.Y, 12); - float Angle = (float)Math.Atan2(NPos.Y - PTC.Y, NPos.X - PTC.X); - int SpitShot1 = Projectile.NewProjectile(NPos.X, NPos.Y, (float)((Math.Cos(Angle) * 22f) * -1), (float)((Math.Sin(Angle) * 22f) * -1), mod.ProjectileType("CyberLaserBat"), 70, 0f, 0); - Main.projectile[SpitShot1].timeLeft = 120; - customAi1 = 1f; - } - npc.netUpdate = true; + customAi1 += (Main.rand.Next(2, 5) * 0.1f) * npc.scale; + if (customAi1 >= 4f) + if (Main.rand.Next(300) == 1) + { + Main.PlaySound(27, (int)npc.position.X, (int)npc.position.Y, 12); + float Angle = (float)Math.Atan2(NPos.Y - PTC.Y, NPos.X - PTC.X); + int SpitShot1 = Projectile.NewProjectile(NPos.X, NPos.Y, (float)((Math.Cos(Angle) * 22f) * -1), (float)((Math.Sin(Angle) * 22f) * -1), mod.ProjectileType("CyberLaserBat"), 70, 0f, 0); + Main.projectile[SpitShot1].timeLeft = 120; + customAi1 = 1f; + } + npc.netUpdate = true; - npc.ai[1] += (Main.rand.Next(2, 5) * 0.1f) * npc.scale; - if (npc.ai[1] >= 10f) - { - npc.TargetClosest(true); - if (Main.rand.Next(60) == 0) - { - Vector2 vector8 = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height / 2)); - float rotation = (float)Math.Atan2(vector8.Y - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), vector8.X - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); - npc.velocity.X = (float)(Math.Cos(rotation) * 14) * -1; - npc.velocity.Y = (float)(Math.Sin(rotation) * 14) * -1; - npc.ai[1] = 1f; - npc.netUpdate = true; - } - } + npc.ai[1] += (Main.rand.Next(2, 5) * 0.1f) * npc.scale; + if (npc.ai[1] >= 10f) + { + npc.TargetClosest(true); + if (Main.rand.Next(60) == 0) + { + Vector2 vector8 = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height / 2)); + float rotation = (float)Math.Atan2(vector8.Y - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), vector8.X - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); + npc.velocity.X = (float)(Math.Cos(rotation) * 14) * -1; + npc.velocity.Y = (float)(Math.Sin(rotation) * 14) * -1; + npc.ai[1] = 1f; + npc.netUpdate = true; + } + } - int num60; - this.npc.TargetClosest(true); + int num60; + this.npc.TargetClosest(true); - if (Main.player[this.npc.target].position.Y - 150 > this.npc.position.Y) - { - this.npc.directionY = 1; - } - else - { - this.npc.directionY = -1; - } + if (Main.player[this.npc.target].position.Y - 150 > this.npc.position.Y) + { + this.npc.directionY = 1; + } + else + { + this.npc.directionY = -1; + } - if (this.npc.direction == -1 && this.npc.velocity.X > -2f) - { - this.npc.velocity.X = this.npc.velocity.X - 0.4f; - if (this.npc.velocity.X > 2f) - { - this.npc.velocity.X = this.npc.velocity.X - 0.4f; - } - else - { - if (this.npc.velocity.X > 0f) - { - this.npc.velocity.X = this.npc.velocity.X + 0.08f; - } - } - if (this.npc.velocity.X < -2f) - { - this.npc.velocity.X = -2f; - } - } - else - { - if (this.npc.direction == 1 && this.npc.velocity.X < 4f) - { - this.npc.velocity.X = this.npc.velocity.X + 0.1f; - if (this.npc.velocity.X < -2f) - { - this.npc.velocity.X = this.npc.velocity.X + 0.1f; - } - else - { - if (this.npc.velocity.X < 0f) - { - this.npc.velocity.X = this.npc.velocity.X - 0.08f; - } - } - if (this.npc.velocity.X > 2f) - { - this.npc.velocity.X = 2f; - } - } - } - if (this.npc.directionY == -1 && (double)this.npc.velocity.Y > -1.5) - { - this.npc.velocity.Y = this.npc.velocity.Y - 0.08f; + if (this.npc.direction == -1 && this.npc.velocity.X > -2f) + { + this.npc.velocity.X = this.npc.velocity.X - 0.4f; + if (this.npc.velocity.X > 2f) + { + this.npc.velocity.X = this.npc.velocity.X - 0.4f; + } + else + { + if (this.npc.velocity.X > 0f) + { + this.npc.velocity.X = this.npc.velocity.X + 0.08f; + } + } + if (this.npc.velocity.X < -2f) + { + this.npc.velocity.X = -2f; + } + } + else + { + if (this.npc.direction == 1 && this.npc.velocity.X < 4f) + { + this.npc.velocity.X = this.npc.velocity.X + 0.1f; + if (this.npc.velocity.X < -2f) + { + this.npc.velocity.X = this.npc.velocity.X + 0.1f; + } + else + { + if (this.npc.velocity.X < 0f) + { + this.npc.velocity.X = this.npc.velocity.X - 0.08f; + } + } + if (this.npc.velocity.X > 2f) + { + this.npc.velocity.X = 2f; + } + } + } + if (this.npc.directionY == -1 && (double)this.npc.velocity.Y > -1.5) + { + this.npc.velocity.Y = this.npc.velocity.Y - 0.08f; - if ((double)this.npc.velocity.Y < -1.5) - { - this.npc.velocity.Y = -1.5f; - } - } - else - { - if (this.npc.directionY == 1 && (double)this.npc.velocity.Y < 1.5) - { - this.npc.velocity.Y = this.npc.velocity.Y + 0.08f; - if ((double)this.npc.velocity.Y > 1.5) - { - this.npc.velocity.Y = 1.5f; - } - } - } + if ((double)this.npc.velocity.Y < -1.5) + { + this.npc.velocity.Y = -1.5f; + } + } + else + { + if (this.npc.directionY == 1 && (double)this.npc.velocity.Y < 1.5) + { + this.npc.velocity.Y = this.npc.velocity.Y + 0.08f; + if ((double)this.npc.velocity.Y > 1.5) + { + this.npc.velocity.Y = 1.5f; + } + } + } - if (Main.rand.Next(2) == 0) - { + if (Main.rand.Next(2) == 0) + { - float j = 0; - float m = 0; - float n = 0; - FirstState = true; - if ((int)Main.time % 140 > 50) - { - if ((int)Main.time % 40 < 1) - for (int i = 0; i < 3; i++) - { - j += (float)2; - m = (float)Math.Sin(j) * 25f; - n = (float)Math.Cos(j) * 25f; - Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 8); - int damage = 70, - type = mod.ProjectileType("CyberLaserBat"); - int num56 = Projectile.NewProjectile(this.npc.position.X + 20, this.npc.position.Y + 50, m, n, type, damage, 0f, Main.myPlayer); - Main.projectile[num56].timeLeft = 600; - } - } - } - } - } - } + float j = 0; + float m = 0; + float n = 0; + FirstState = true; + if ((int)Main.time % 140 > 50) + { + if ((int)Main.time % 40 < 1) + for (int i = 0; i < 3; i++) + { + j += (float)2; + m = (float)Math.Sin(j) * 25f; + n = (float)Math.Cos(j) * 25f; + Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 8); + int damage = 70, + type = mod.ProjectileType("CyberLaserBat"); + int num56 = Projectile.NewProjectile(this.npc.position.X + 20, this.npc.position.Y + 50, m, n, type, damage, 0f, Main.myPlayer); + Main.projectile[num56].timeLeft = 600; + } + } + } + } + } + } } \ No newline at end of file diff --git a/Invasion/VioleumMask.cs b/Invasion/VioleumMask.cs index 678186f9..1b0cc9ba 100644 --- a/Invasion/VioleumMask.cs +++ b/Invasion/VioleumMask.cs @@ -1,8 +1,9 @@ using System.Collections.Generic; using Terraria.ModLoader; -namespace Tremor.Invasion { -[AutoloadEquip(EquipType.Head)] +namespace Tremor.Invasion +{ + [AutoloadEquip(EquipType.Head)] public class VioleumMask : ModItem { @@ -15,11 +16,11 @@ public override void SetDefaults() item.vanity = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Violeum Mask"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Violeum Mask"); + Tooltip.SetDefault(""); + } public override bool DrawHead() diff --git a/Invasion/VioleumWings.cs b/Invasion/VioleumWings.cs index f645b5ef..34fcab3b 100644 --- a/Invasion/VioleumWings.cs +++ b/Invasion/VioleumWings.cs @@ -6,46 +6,48 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Invasion { -[AutoloadEquip(EquipType.Wings)] -public class VioleumWings : ModItem +namespace Tremor.Invasion { - public override void SetDefaults() - { + [AutoloadEquip(EquipType.Wings)] + public class VioleumWings : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 20; - item.value = 500000; - item.rare = 11; - item.accessory = true; - } + item.width = 22; + item.height = 20; + item.value = 500000; + item.rare = 11; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Paradox Wings"); - Tooltip.SetDefault("Allows flight and slow fall"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Paradox Wings"); + Tooltip.SetDefault("Allows flight and slow fall"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.wingTimeMax = 180; - } + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.wingTimeMax = 180; + } public override void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend) - { - ascentWhenFalling = 0.85f; - ascentWhenRising = 0.15f; - maxCanAscendMultiplier = 1f; - maxAscentMultiplier = 3f; - constantAscend = 0.135f; - } + { + ascentWhenFalling = 0.85f; + ascentWhenRising = 0.15f; + maxCanAscendMultiplier = 1f; + maxAscentMultiplier = 3f; + constantAscend = 0.135f; + } public override void HorizontalWingSpeeds(Player player, ref float speed, ref float acceleration) - { - speed = 10f; - acceleration *= 2.5f; - } -}} + { + speed = 10f; + acceleration *= 2.5f; + } + } +} diff --git a/InvasionData.cs b/InvasionData.cs index 34d3312c..c21e60af 100644 --- a/InvasionData.cs +++ b/InvasionData.cs @@ -8,7 +8,7 @@ namespace Tremor { public class InvasionData : ScreenShaderData { - private int invasionI; + private int invasionI; public InvasionData(string passName) : base(passName) @@ -17,14 +17,14 @@ public InvasionData(string passName) private void UpdatePuritySpiritIndex() { - Mod mod = ModLoader.GetMod("Tremor"); - CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer(mod); - if (InvasionWorld.CyberWrath) + Mod mod = ModLoader.GetMod("Tremor"); + CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer(mod); + if (InvasionWorld.CyberWrath) { return; } - invasionI = -1; - } + invasionI = -1; + } public override void Apply() { diff --git a/InvasionSky.cs b/InvasionSky.cs index cd60e433..3ee425ec 100644 --- a/InvasionSky.cs +++ b/InvasionSky.cs @@ -10,7 +10,7 @@ namespace Tremor { public class InvasionSky : CustomSky { - private bool isActive = false; + private bool isActive = false; private float intensity = 0f; private int invasionI; @@ -28,14 +28,14 @@ public override void Update(GameTime gameTime) private bool UpdatePuritySpiritIndex() { - Mod mod = ModLoader.GetMod("Tremor"); - CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer(mod); - if (InvasionWorld.CyberWrath) - { - return true; - } - invasionI = -1; - return invasionI >= 0; + Mod mod = ModLoader.GetMod("Tremor"); + CyberWrathInvasion modPlayer = Main.player[Main.myPlayer].GetModPlayer(mod); + if (InvasionWorld.CyberWrath) + { + return true; + } + invasionI = -1; + return invasionI >= 0; } public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth) diff --git a/Items/AbominationBanner.cs b/Items/AbominationBanner.cs index fee93e0d..c74a5079 100644 --- a/Items/AbominationBanner.cs +++ b/Items/AbominationBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class AbominationBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class AbominationBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 24; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 24; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Abomination Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Abomination Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/AbyssBreastplate.cs b/Items/AbyssBreastplate.cs index 61ba1ddb..ba4c6195 100644 --- a/Items/AbyssBreastplate.cs +++ b/Items/AbyssBreastplate.cs @@ -5,45 +5,47 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class AbyssBreastplate : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.width = 38; - item.height = 22; - - - item.value = 18000; - item.rare = 7; - item.defense = 22; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Abyss Breastplate"); - Tooltip.SetDefault("14% increased minion damage\nIncreases your max number of minions"); - } - - - public override void UpdateEquip(Player player) - { - player.maxMinions += 2; - player.minionDamage += 0.14f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "DarknessCloth", 13); - recipe.AddIngredient(ItemID.SoulofNight, 10); - recipe.AddIngredient(ItemID.Amethyst, 8); - recipe.AddIngredient(null, "PhantomSoul", 5); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } - -}} + [AutoloadEquip(EquipType.Body)] + public class AbyssBreastplate : ModItem + { + public override void SetDefaults() + { + + item.width = 38; + item.height = 22; + + + item.value = 18000; + item.rare = 7; + item.defense = 22; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Abyss Breastplate"); + Tooltip.SetDefault("14% increased minion damage\nIncreases your max number of minions"); + } + + + public override void UpdateEquip(Player player) + { + player.maxMinions += 2; + player.minionDamage += 0.14f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "DarknessCloth", 13); + recipe.AddIngredient(ItemID.SoulofNight, 10); + recipe.AddIngredient(ItemID.Amethyst, 8); + recipe.AddIngredient(null, "PhantomSoul", 5); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + + } +} diff --git a/Items/AbyssGreaves.cs b/Items/AbyssGreaves.cs index 4d0fc277..0f63f092 100644 --- a/Items/AbyssGreaves.cs +++ b/Items/AbyssGreaves.cs @@ -5,46 +5,49 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class AbyssGreaves : ModItem +namespace Tremor.Items { - - - public override void SetDefaults() - { - - item.width = 38; - item.height = 22; - - - item.value = 18000; - item.rare = 7; - item.defense = 15; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Abyss Greaves"); - Tooltip.SetDefault("14% increased minion damage\nIncreases your max number of minions"); - } - - - public override void UpdateEquip(Player player) - { - player.maxMinions += 2; - player.minionDamage += 0.14f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "DarknessCloth", 9); - recipe.AddIngredient(ItemID.SoulofNight, 8); - recipe.AddIngredient(ItemID.Amethyst, 6); - recipe.AddIngredient(null, "PhantomSoul", 3); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } - -}} + [AutoloadEquip(EquipType.Legs)] + public class AbyssGreaves : ModItem + { + + + public override void SetDefaults() + { + + item.width = 38; + item.height = 22; + + + item.value = 18000; + item.rare = 7; + item.defense = 15; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Abyss Greaves"); + Tooltip.SetDefault("14% increased minion damage\nIncreases your max number of minions"); + } + + + public override void UpdateEquip(Player player) + { + player.maxMinions += 2; + player.minionDamage += 0.14f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "DarknessCloth", 9); + recipe.AddIngredient(ItemID.SoulofNight, 8); + recipe.AddIngredient(ItemID.Amethyst, 6); + recipe.AddIngredient(null, "PhantomSoul", 3); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + + } +} diff --git a/Items/AbyssHeadgear.cs b/Items/AbyssHeadgear.cs index 69f45da9..9a5020ae 100644 --- a/Items/AbyssHeadgear.cs +++ b/Items/AbyssHeadgear.cs @@ -7,126 +7,129 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class AbyssHeadgear : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class AbyssHeadgear : ModItem + { - const int ShootType = 496; // ��� ����५� - const float ShootRange = 100.0f; // ���쭮��� ����५� - const float ShootKN = 1.0f; // ����뢠��� - const int ShootRate = 60; // ����� ����५� (60 - 1 ᥪ㭤�) - const int ShootCount = 3; // ����஢ �� ����५ - const float ShootSpeed = 15f; // ������� ����५� (��� ����� - ���쭮���) - const int spread = 45; // ������ - const float spreadMult = 0.045f; // ����䨪��� ࠧ��� - - int TimeToShoot = ShootRate; - - public override void SetDefaults() - { - - item.width = 38; - item.height = 22; - - - item.value = 18000; - item.rare = 7; - item.defense = 11; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Abyss Headgear"); - Tooltip.SetDefault("14% increased minion damage\nIncreases maximum health by 40"); - } - - - public override void UpdateEquip(Player player) - { - player.minionDamage += 0.14f; - player.statLifeMax2 += 40; - - } - - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("AbyssBreastplate") && legs.type == mod.ItemType("AbyssGreaves"); - } - - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Allows to see hazards\nSummons abyss magic to attack nearby enemies\nYour Shadow Arms has 33% chance to inflict Shadowflame on enemies"; - TremorPlayer modPlayer = player.GetModPlayer(mod); - modPlayer.shadowArmSF = true; - player.dangerSense = false; - - if (--TimeToShoot <= 0) - { - TimeToShoot = ShootRate; - int Target = GetTarget(); - if (Target != -1) Shoot(Target, GetDamage()); - } - - if(Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y) > 1f && !player.rocketFrame) // Makes sure the player is actually moving - { - for (int k = 0; k < 2; k++) - { - int index= Dust.NewDust(new Vector2(player.position.X - player.velocity.X * 2f, player.position.Y - 2f - player.velocity.Y * 2f), player.width, player.height, 65, 0f, 0f, 100, default(Color), 2f); - Main.dust[index].noGravity = true; - Main.dust[index].noLight = true; - Dust dust = Main.dust[index]; - dust.velocity.X = dust.velocity.X - player.velocity.X * 0.5f; - dust.velocity.Y = dust.velocity.Y - player.velocity.Y * 0.5f; - } - } - } + const int ShootType = 496; // ��� ����५� + const float ShootRange = 100.0f; // ���쭮��� ����५� + const float ShootKN = 1.0f; // ����뢠��� + const int ShootRate = 60; // ����� ����५� (60 - 1 ᥪ㭤�) + const int ShootCount = 3; // ����஢ �� ����५ + const float ShootSpeed = 15f; // ������� ����५� (��� ����� - ���쭮���) + const int spread = 45; // ������ + const float spreadMult = 0.045f; // ����䨪��� ࠧ��� + + int TimeToShoot = ShootRate; + + public override void SetDefaults() + { + + item.width = 38; + item.height = 22; + + + item.value = 18000; + item.rare = 7; + item.defense = 11; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Abyss Headgear"); + Tooltip.SetDefault("14% increased minion damage\nIncreases maximum health by 40"); + } + + + public override void UpdateEquip(Player player) + { + player.minionDamage += 0.14f; + player.statLifeMax2 += 40; + + } + + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("AbyssBreastplate") && legs.type == mod.ItemType("AbyssGreaves"); + } + + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Allows to see hazards\nSummons abyss magic to attack nearby enemies\nYour Shadow Arms has 33% chance to inflict Shadowflame on enemies"; + TremorPlayer modPlayer = player.GetModPlayer(mod); + modPlayer.shadowArmSF = true; + player.dangerSense = false; + + if (--TimeToShoot <= 0) + { + TimeToShoot = ShootRate; + int Target = GetTarget(); + if (Target != -1) Shoot(Target, GetDamage()); + } + + if (Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y) > 1f && !player.rocketFrame) // Makes sure the player is actually moving + { + for (int k = 0; k < 2; k++) + { + int index = Dust.NewDust(new Vector2(player.position.X - player.velocity.X * 2f, player.position.Y - 2f - player.velocity.Y * 2f), player.width, player.height, 65, 0f, 0f, 100, default(Color), 2f); + Main.dust[index].noGravity = true; + Main.dust[index].noLight = true; + Dust dust = Main.dust[index]; + dust.velocity.X = dust.velocity.X - player.velocity.X * 0.5f; + dust.velocity.Y = dust.velocity.Y - player.velocity.Y * 0.5f; + } + } + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawShadow=true; + player.armorEffectDrawShadow = true; + } + + int GetTarget() + { + int Target = -1; + for (int k = 0; k < Main.npc.Length; k++) + { + if (Main.npc[k].active && Main.npc[k].lifeMax > 5 && !Main.npc[k].dontTakeDamage && !Main.npc[k].friendly && Main.npc[k].Distance(Main.player[item.owner].Center) <= ShootRange && Collision.CanHitLine(Main.player[item.owner].Center, 4, 4, Main.npc[k].Center, 4, 4)) + { + Target = k; + break; + } + } + return Target; + } + + int GetDamage() + { + return (10 * ((int)Main.player[item.owner].magicDamage + (int)Main.player[item.owner].meleeDamage + (int)Main.player[item.owner].minionDamage + (int)Main.player[item.owner].rangedDamage + (int)Main.player[item.owner].thrownDamage)) + 15; + } + + void Shoot(int Target, int Damage) + { + Vector2 velocity = Helper.VelocityToPoint(Main.player[item.owner].Center, Main.npc[Target].Center, ShootSpeed); + for (int l = 0; l < ShootCount; l++) + { + velocity.X = velocity.X + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.Y = velocity.Y + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + int i = Projectile.NewProjectile(Main.player[item.owner].Center.X, Main.player[item.owner].Center.Y, velocity.X, velocity.Y, ShootType, Damage, ShootKN, item.owner); + } + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "DarknessCloth", 11); + recipe.AddIngredient(ItemID.SoulofNight, 9); + recipe.AddIngredient(ItemID.Amethyst, 7); + recipe.AddIngredient(null, "PhantomSoul", 4); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); } - int GetTarget() - { - int Target = -1; - for(int k = 0; k < Main.npc.Length; k++) - { - if (Main.npc[k].active && Main.npc[k].lifeMax > 5 && !Main.npc[k].dontTakeDamage && !Main.npc[k].friendly && Main.npc[k].Distance(Main.player[item.owner].Center) <= ShootRange && Collision.CanHitLine(Main.player[item.owner].Center, 4, 4, Main.npc[k].Center, 4, 4)) - { - Target = k; - break; - } - } - return Target; - } - - int GetDamage() - { - return (10 * ((int)Main.player[item.owner].magicDamage + (int)Main.player[item.owner].meleeDamage + (int)Main.player[item.owner].minionDamage + (int)Main.player[item.owner].rangedDamage + (int)Main.player[item.owner].thrownDamage)) + 15; - } - - void Shoot(int Target, int Damage) - { - Vector2 velocity = Helper.VelocityToPoint(Main.player[item.owner].Center, Main.npc[Target].Center, ShootSpeed); - for (int l = 0; l < ShootCount; l++) - { - velocity.X = velocity.X + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - velocity.Y = velocity.Y + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - int i = Projectile.NewProjectile(Main.player[item.owner].Center.X, Main.player[item.owner].Center.Y, velocity.X, velocity.Y, ShootType, Damage, ShootKN, item.owner); - } - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "DarknessCloth", 11); - recipe.AddIngredient(ItemID.SoulofNight, 9); - recipe.AddIngredient(ItemID.Amethyst, 7); - recipe.AddIngredient(null, "PhantomSoul", 4); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } - -}} + } +} diff --git a/Items/AdamantiteDisc.cs b/Items/AdamantiteDisc.cs index a9b3356c..ceef95e0 100644 --- a/Items/AdamantiteDisc.cs +++ b/Items/AdamantiteDisc.cs @@ -4,54 +4,56 @@ using Terraria.ModLoader; using Terraria.ID; -namespace Tremor.Items { -public class AdamantiteDisc : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class AdamantiteDisc : ModItem + { + public override void SetDefaults() + { - item.damage = 44; - item.thrown = true; - item.width = 48; - item.height = 48; - item.useTime = 20; - item.shootSpeed = 12f; - item.useAnimation = 20; - item.useStyle = 1; - item.knockBack = 3f; - item.shoot = mod.ProjectileType("AdamantiteDiscPro"); - item.value = 27600; - item.rare = 4; - item.noUseGraphic = true; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 44; + item.thrown = true; + item.width = 48; + item.height = 48; + item.useTime = 20; + item.shootSpeed = 12f; + item.useAnimation = 20; + item.useStyle = 1; + item.knockBack = 3f; + item.shoot = mod.ProjectileType("AdamantiteDiscPro"); + item.value = 27600; + item.rare = 4; + item.noUseGraphic = true; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Adamantite Disc"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Adamantite Disc"); + Tooltip.SetDefault(""); + } -public override bool CanUseItem(Player player) -{ - for (int i = 0; i < 1000; ++i) - { - if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) - { - return false; - } - } - return true; -} + public override bool CanUseItem(Player player) + { + for (int i = 0; i < 1000; ++i) + { + if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) + { + return false; + } + } + return true; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.AdamantiteBar, 12); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.AdamantiteBar, 12); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/AdamantiteHat.cs b/Items/AdamantiteHat.cs index c85c8d7c..ec0ad5b5 100644 --- a/Items/AdamantiteHat.cs +++ b/Items/AdamantiteHat.cs @@ -5,55 +5,57 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Head)] -public class AdamantiteHat : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + [AutoloadEquip(EquipType.Head)] + public class AdamantiteHat : ModItem + { + public override void SetDefaults() + { - item.width = 20; - item.height = 26; + item.width = 20; + item.height = 26; - item.value = 400; - item.rare = 4; - item.defense = 7; - } + item.value = 400; + item.rare = 4; + item.defense = 7; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Adamantite Hat"); - Tooltip.SetDefault("Increases minion damage by 24%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Adamantite Hat"); + Tooltip.SetDefault("Increases minion damage by 24%"); + } - public override void UpdateEquip(Player player) - { - player.minionDamage += 0.24f; - } + public override void UpdateEquip(Player player) + { + player.minionDamage += 0.24f; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == 403 && legs.type == 404; - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == 403 && legs.type == 404; + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increases your max number of minions"; - player.maxMinions += 3; - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increases your max number of minions"; + player.maxMinions += 3; + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawOutlines=true; + player.armorEffectDrawOutlines = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.AdamantiteBar, 12); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.AdamantiteBar, 12); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/AdamantiteHeader.cs b/Items/AdamantiteHeader.cs index 68753994..291600e8 100644 --- a/Items/AdamantiteHeader.cs +++ b/Items/AdamantiteHeader.cs @@ -5,55 +5,57 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Head)] -public class AdamantiteHeader : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + [AutoloadEquip(EquipType.Head)] + public class AdamantiteHeader : ModItem + { + public override void SetDefaults() + { - item.width = 20; - item.height = 26; + item.width = 20; + item.height = 26; - item.value = 400; - item.rare = 4; - item.defense = 7; - } + item.value = 400; + item.rare = 4; + item.defense = 7; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Adamantite Header"); - Tooltip.SetDefault("Increases thrown damage by 24%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Adamantite Header"); + Tooltip.SetDefault("Increases thrown damage by 24%"); + } - public override void UpdateEquip(Player player) - { - player.minionDamage += 0.24f; - } + public override void UpdateEquip(Player player) + { + player.minionDamage += 0.24f; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == 403 && legs.type == 404; - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == 403 && legs.type == 404; + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increases thrown weapon velocity"; - player.thrownVelocity +=0.25f; - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increases thrown weapon velocity"; + player.thrownVelocity += 0.25f; + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawOutlines=true; + player.armorEffectDrawOutlines = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.AdamantiteBar, 12); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.AdamantiteBar, 12); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/AdamantiteRifle.cs b/Items/AdamantiteRifle.cs index 6e00fb48..d0760082 100644 --- a/Items/AdamantiteRifle.cs +++ b/Items/AdamantiteRifle.cs @@ -5,48 +5,50 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class AdamantiteRifle : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class AdamantiteRifle : ModItem + { + public override void SetDefaults() + { - item.damage = 40; - item.ranged = true; - item.width = 40; - item.height = 20; - item.useTime = 15; - item.useAnimation = 15; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 6; - item.value = 10000; - item.rare = 5; - item.UseSound = SoundID.Item11; - item.autoReuse = true; - item.shoot = 10; - item.shootSpeed = 12f; - item.useAmmo = AmmoID.Bullet; - } + item.damage = 40; + item.ranged = true; + item.width = 40; + item.height = 20; + item.useTime = 15; + item.useAnimation = 15; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 6; + item.value = 10000; + item.rare = 5; + item.UseSound = SoundID.Item11; + item.autoReuse = true; + item.shoot = 10; + item.shootSpeed = 12f; + item.useAmmo = AmmoID.Bullet; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Adamantite Rifle"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Adamantite Rifle"); + Tooltip.SetDefault(""); + } - public override Vector2? HoldoutOffset() - { - return new Vector2(-15, 0); - } + public override Vector2? HoldoutOffset() + { + return new Vector2(-15, 0); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.AdamantiteBar, 15); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.AdamantiteBar, 15); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/AdamantiteStaff.cs b/Items/AdamantiteStaff.cs index 40646e5f..2b1c4216 100644 --- a/Items/AdamantiteStaff.cs +++ b/Items/AdamantiteStaff.cs @@ -5,44 +5,46 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class AdamantiteStaff : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class AdamantiteStaff : ModItem + { + public override void SetDefaults() + { - item.damage = 43; - item.magic = true; - item.mana = 9; - item.width = 40; - item.height = 40; - item.useTime = 28; - item.useAnimation = 28; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 3; - item.value = 13800; - item.rare = 4; - item.UseSound = SoundID.Item43; - item.autoReuse = false; - Item.staff[item.type] = true; //this makes the useStyle animate as a staff instead of as a gun - item.shoot = mod.ProjectileType("AdamantiteBolt"); - item.shootSpeed = 15f; - } + item.damage = 43; + item.magic = true; + item.mana = 9; + item.width = 40; + item.height = 40; + item.useTime = 28; + item.useAnimation = 28; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 3; + item.value = 13800; + item.rare = 4; + item.UseSound = SoundID.Item43; + item.autoReuse = false; + Item.staff[item.type] = true; //this makes the useStyle animate as a staff instead of as a gun + item.shoot = mod.ProjectileType("AdamantiteBolt"); + item.shootSpeed = 15f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Adamantite Staff"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Adamantite Staff"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.AdamantiteBar, 12); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.AdamantiteBar, 12); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/AdamantiteVisage.cs b/Items/AdamantiteVisage.cs index 88c19921..bb50b3ab 100644 --- a/Items/AdamantiteVisage.cs +++ b/Items/AdamantiteVisage.cs @@ -6,51 +6,51 @@ using Terraria.ModLoader; namespace Tremor.Items -{ -[AutoloadEquip(EquipType.Head)] - public class AdamantiteVisage : ModItem - { - public override void SetDefaults() - { - - item.width = 22; - item.height = 24; - - item.value = 400; - item.rare = 4; - item.defense = 8; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Adamantite Visage"); - Tooltip.SetDefault("Increases alchemic damage by 24%"); - } - - - public override void UpdateEquip(Player player) - { - player.GetModPlayer(mod).alchemistDamage += 0.24f; - } - - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == 403 && legs.type == 404; - } - - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increases alchemic critical strike chance by 20%"; - player.GetModPlayer(mod).alchemistCrit += 20; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.AdamantiteBar, 10); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } - } +{ + [AutoloadEquip(EquipType.Head)] + public class AdamantiteVisage : ModItem + { + public override void SetDefaults() + { + + item.width = 22; + item.height = 24; + + item.value = 400; + item.rare = 4; + item.defense = 8; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Adamantite Visage"); + Tooltip.SetDefault("Increases alchemic damage by 24%"); + } + + + public override void UpdateEquip(Player player) + { + player.GetModPlayer(mod).alchemistDamage += 0.24f; + } + + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == 403 && legs.type == 404; + } + + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increases alchemic critical strike chance by 20%"; + player.GetModPlayer(mod).alchemistCrit += 20; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.AdamantiteBar, 10); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } } diff --git a/Items/AdamantiteWarhammer.cs b/Items/AdamantiteWarhammer.cs index 0a08179a..55873a0a 100644 --- a/Items/AdamantiteWarhammer.cs +++ b/Items/AdamantiteWarhammer.cs @@ -4,40 +4,42 @@ using Terraria.ModLoader; using Terraria.ID; -namespace Tremor.Items { -public class AdamantiteWarhammer : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class AdamantiteWarhammer : ModItem + { + public override void SetDefaults() + { - item.damage = 49; - item.melee = true; - item.width = 48; - item.height = 48; - item.useTime = 35; - item.useAnimation = 35; - item.hammer = 86; - item.useStyle = 1; - item.knockBack = 7; - item.value = 27600; - item.rare = 4; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 49; + item.melee = true; + item.width = 48; + item.height = 48; + item.useTime = 35; + item.useAnimation = 35; + item.hammer = 86; + item.useStyle = 1; + item.knockBack = 7; + item.value = 27600; + item.rare = 4; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Adamantite Warhammer"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Adamantite Warhammer"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.AdamantiteBar, 12); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.AdamantiteBar, 12); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/AdvancedCircuit.cs b/Items/AdvancedCircuit.cs index 3e7575a5..31fc1edc 100644 --- a/Items/AdvancedCircuit.cs +++ b/Items/AdvancedCircuit.cs @@ -12,29 +12,29 @@ public class AdvancedCircuit : ModItem public override void SetDefaults() { - item.width = 38; - item.height = 38; - item.maxStack = 20; + item.width = 38; + item.height = 38; + item.maxStack = 20; - item.rare = 7; - item.value = 30000; - item.useAnimation = 45; - item.useTime = 45; - item.useStyle = 4; - item.consumable = true; - } + item.rare = 7; + item.value = 30000; + item.useAnimation = 45; + item.useTime = 45; + item.useStyle = 4; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Advanced Circuit"); - Tooltip.SetDefault("Summons the Mothership"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Advanced Circuit"); + Tooltip.SetDefault("Summons the Mothership"); + } - public override bool CanUseItem(Player player) - { - return !NPC.AnyNPCs(mod.NPCType("Mothership")) && NPC.downedPlantBoss && !Main.dayTime && Main.netMode != 1; - } + public override bool CanUseItem(Player player) + { + return !NPC.AnyNPCs(mod.NPCType("Mothership")) && NPC.downedPlantBoss && !Main.dayTime && Main.netMode != 1; + } public override bool UseItem(Player player) { @@ -43,29 +43,29 @@ public override bool UseItem(Player player) return true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GolemCore", 1); - recipe.AddIngredient(ItemID.HallowedBar, 25); - recipe.AddIngredient(ItemID.SoulofSight, 12); - recipe.AddIngredient(ItemID.SoulofMight, 12); - recipe.AddIngredient(ItemID.SoulofFright, 12); - recipe.AddIngredient(ItemID.Wire, 30); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GolemCore", 1); + recipe.AddIngredient(ItemID.HallowedBar, 25); + recipe.AddIngredient(ItemID.SoulofSight, 12); + recipe.AddIngredient(ItemID.SoulofMight, 12); + recipe.AddIngredient(ItemID.SoulofFright, 12); + recipe.AddIngredient(ItemID.Wire, 30); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GolemCore", 1); - recipe.AddIngredient(ItemID.HallowedBar, 25); - recipe.AddIngredient(ItemID.SoulofSight, 12); - recipe.AddIngredient(null, "SoulofMind", 12); - recipe.AddIngredient(ItemID.SoulofFright, 12); - recipe.AddIngredient(ItemID.Wire, 30); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } - } + recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GolemCore", 1); + recipe.AddIngredient(ItemID.HallowedBar, 25); + recipe.AddIngredient(ItemID.SoulofSight, 12); + recipe.AddIngredient(null, "SoulofMind", 12); + recipe.AddIngredient(ItemID.SoulofFright, 12); + recipe.AddIngredient(ItemID.Wire, 30); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } } diff --git a/Items/AdventurerSpark.cs b/Items/AdventurerSpark.cs index e515c29a..7137ce03 100644 --- a/Items/AdventurerSpark.cs +++ b/Items/AdventurerSpark.cs @@ -6,23 +6,25 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class AdventurerSpark : ModItem +namespace Tremor.Items { + public class AdventurerSpark : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 22; + item.width = 22; + item.height = 22; - item.rare = 1; - } + item.rare = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Adventurer Spark"); - Tooltip.SetDefault("Can be enchanted only once!"); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(5, 4)); - } -}} + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Adventurer Spark"); + Tooltip.SetDefault("Can be enchanted only once!"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(5, 4)); + } + } +} diff --git a/Items/AegisofDarkness.cs b/Items/AegisofDarkness.cs index c3ba9ce1..e7061271 100644 --- a/Items/AegisofDarkness.cs +++ b/Items/AegisofDarkness.cs @@ -5,43 +5,45 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Shield)] -public class AegisofDarkness : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + [AutoloadEquip(EquipType.Shield)] + public class AegisofDarkness : ModItem + { + public override void SetDefaults() + { - item.width = 26; - item.height = 30; - item.value = 110; - item.rare = 0; + item.width = 26; + item.height = 30; + item.value = 110; + item.rare = 0; - item.accessory = true; - item.defense = 1; - } + item.accessory = true; + item.defense = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Aegis of Darkness"); - Tooltip.SetDefault("Increases minion damage by 10%\nIncreases magic critical strike chance by 10\n8% decreased magic damage\nIncreases maximum mana by 40"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Aegis of Darkness"); + Tooltip.SetDefault("Increases minion damage by 10%\nIncreases magic critical strike chance by 10\n8% decreased magic damage\nIncreases maximum mana by 40"); + } - public override void UpdateEquip(Player player) - { - player.magicCrit += 10; - player.minionDamage += 0.1f; - player.statManaMax2 += 40; - player.magicDamage -= 0.08f; - } + public override void UpdateEquip(Player player) + { + player.magicCrit += 10; + player.minionDamage += 0.1f; + player.statManaMax2 += 40; + player.magicDamage -= 0.08f; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "EnchantedShield", 1); - recipe.AddIngredient(null, "NecroShield", 1); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "EnchantedShield", 1); + recipe.AddIngredient(null, "NecroShield", 1); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/AfterlifeBreastplate.cs b/Items/AfterlifeBreastplate.cs index 3b7dc766..52ba9f0c 100644 --- a/Items/AfterlifeBreastplate.cs +++ b/Items/AfterlifeBreastplate.cs @@ -6,8 +6,8 @@ using Terraria.ModLoader; namespace Tremor.Items -{ -[AutoloadEquip(EquipType.Body)] +{ + [AutoloadEquip(EquipType.Body)] public class AfterlifeBreastplate : ModItem { @@ -23,31 +23,31 @@ public override void SetDefaults() item.defense = 11; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Afterlife Breastplate"); - Tooltip.SetDefault("9% increased all damage\nIncreases your max number of minions"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Afterlife Breastplate"); + Tooltip.SetDefault("9% increased all damage\nIncreases your max number of minions"); + } public override void UpdateEquip(Player player) { - player.maxMinions += 2; - player.minionDamage += 0.09f; - player.thrownDamage += 0.09f; - player.magicDamage += 0.09f; - player.meleeDamage += 0.09f; - player.rangedDamage += 0.09f; + player.maxMinions += 2; + player.minionDamage += 0.09f; + player.thrownDamage += 0.09f; + player.magicDamage += 0.09f; + player.meleeDamage += 0.09f; + player.rangedDamage += 0.09f; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "SkullTeeth", 3); - recipe.AddIngredient(null, "SteelBar", 20); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "SkullTeeth", 3); + recipe.AddIngredient(null, "SteelBar", 20); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } } } diff --git a/Items/AfterlifeHood.cs b/Items/AfterlifeHood.cs index 25c72e86..0d572193 100644 --- a/Items/AfterlifeHood.cs +++ b/Items/AfterlifeHood.cs @@ -5,62 +5,64 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Head)] -public class AfterlifeHood : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class AfterlifeHood : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 38; - item.height = 22; + item.width = 38; + item.height = 22; - item.value = 10000; - item.rare = 6; - item.defense = 7; - } + item.value = 10000; + item.rare = 6; + item.defense = 7; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Afterlife Hood"); - Tooltip.SetDefault("Increases life regeneration"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Afterlife Hood"); + Tooltip.SetDefault("Increases life regeneration"); + } - public override void UpdateEquip(Player player) - { - player.crimsonRegen = true; - } + public override void UpdateEquip(Player player) + { + player.crimsonRegen = true; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("AfterlifeBreastplate") && legs.type == mod.ItemType("AfterlifeLeggings"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("AfterlifeBreastplate") && legs.type == mod.ItemType("AfterlifeLeggings"); + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Quickly recovers you if you have low health. But at what cost..."; - if (player.statLife < 25) - { - player.lifeRegen += 40; - player.statDefense = 0; - } - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Quickly recovers you if you have low health. But at what cost..."; + if (player.statLife < 25) + { + player.lifeRegen += 40; + player.statDefense = 0; + } + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawShadowLokis = true; + player.armorEffectDrawShadowLokis = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "SkullTeeth", 2); - recipe.AddIngredient(null, "SteelBar", 12); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "SkullTeeth", 2); + recipe.AddIngredient(null, "SteelBar", 12); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } -}} + } +} diff --git a/Items/AfterlifeLeggings.cs b/Items/AfterlifeLeggings.cs index 6d6207f6..75e97359 100644 --- a/Items/AfterlifeLeggings.cs +++ b/Items/AfterlifeLeggings.cs @@ -5,44 +5,46 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Legs)] -public class AfterlifeLeggings : ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 38; - item.height = 22; - - - item.value = 10000; - item.rare = 6; - item.defense = 9; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Afterlife Leggings"); - Tooltip.SetDefault("Higher jump height\nIncreases movement speed"); - } - - - public override void UpdateEquip(Player player) - { - player.moveSpeed += 0.25f; - player.jumpBoost = true; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "SkullTeeth", 2); - recipe.AddIngredient(null, "SteelBar", 16); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } - -}} + [AutoloadEquip(EquipType.Legs)] + public class AfterlifeLeggings : ModItem + { + + public override void SetDefaults() + { + + item.width = 38; + item.height = 22; + + + item.value = 10000; + item.rare = 6; + item.defense = 9; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Afterlife Leggings"); + Tooltip.SetDefault("Higher jump height\nIncreases movement speed"); + } + + + public override void UpdateEquip(Player player) + { + player.moveSpeed += 0.25f; + player.jumpBoost = true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "SkullTeeth", 2); + recipe.AddIngredient(null, "SteelBar", 16); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + + } +} diff --git a/Items/AgloominationBanner.cs b/Items/AgloominationBanner.cs index d8d26f30..d668ea7e 100644 --- a/Items/AgloominationBanner.cs +++ b/Items/AgloominationBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class AgloominationBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class AgloominationBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 44; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 44; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Agloomination Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Agloomination Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/AirFragment.cs b/Items/AirFragment.cs index 29375259..4488db1f 100644 --- a/Items/AirFragment.cs +++ b/Items/AirFragment.cs @@ -6,23 +6,25 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class AirFragment : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class AirFragment : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 100; - item.rare = 1; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 100; + item.rare = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Air Fragment"); - Tooltip.SetDefault(""); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(8, 4)); - } -}} + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Air Fragment"); + Tooltip.SetDefault(""); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(8, 4)); + } + } +} diff --git a/Items/AlchemasterMask.cs b/Items/AlchemasterMask.cs index 7197091c..5239b24f 100644 --- a/Items/AlchemasterMask.cs +++ b/Items/AlchemasterMask.cs @@ -5,24 +5,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Head)] -public class AlchemasterMask : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + [AutoloadEquip(EquipType.Head)] + public class AlchemasterMask : ModItem + { + public override void SetDefaults() + { - item.width = 26; - item.height = 24; - item.rare = 1; - item.vanity = true; - } + item.width = 26; + item.height = 24; + item.rare = 1; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Alchemaster Mask"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Alchemaster Mask"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/AlchemasterTreasureBag.cs b/Items/AlchemasterTreasureBag.cs index bf96844b..108db7d0 100644 --- a/Items/AlchemasterTreasureBag.cs +++ b/Items/AlchemasterTreasureBag.cs @@ -4,63 +4,65 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class AlchemasterTreasureBag : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class AlchemasterTreasureBag : ModItem + { + public override void SetDefaults() + { - item.maxStack = 999; - item.consumable = true; - item.width = 24; - item.height = 24; + item.maxStack = 999; + item.consumable = true; + item.width = 24; + item.height = 24; - item.rare = 9; - item.expert = true; - bossBagNPC = mod.NPCType("Alchemaster"); - } + item.rare = 9; + item.expert = true; + bossBagNPC = mod.NPCType("Alchemaster"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Treasure Bag"); - Tooltip.SetDefault("Right click to open"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Treasure Bag"); + Tooltip.SetDefault("Right click to open"); + } - public override bool CanRightClick() - { - return true; - } + public override bool CanRightClick() + { + return true; + } - public override void OpenBossBag(Player player) - { - if(Main.rand.Next(7) == 0) - { - player.QuickSpawnItem(mod.ItemType("AlchemasterMask")); - } - if(Main.rand.Next(10) == 0) - { - player.QuickSpawnItem(mod.ItemType("AlchemasterTrophy")); - } - if(Main.rand.Next(1) == 0) - { - player.QuickSpawnItem(mod.ItemType("PlagueFlask"), Main.rand.Next(30, 78)); - } - if(Main.rand.Next(1) == 0) - { - player.QuickSpawnItem(mod.ItemType("SparkingFlask"), Main.rand.Next(30, 78)); - } - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("TheGlorch")); - } - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("BadApple")); - } - player.TryGettingDevArmor(); - player.QuickSpawnItem(mod.ItemType("GoldenStar")); - player.QuickSpawnItem(mod.ItemType("LongFuse")); - } + public override void OpenBossBag(Player player) + { + if (Main.rand.Next(7) == 0) + { + player.QuickSpawnItem(mod.ItemType("AlchemasterMask")); + } + if (Main.rand.Next(10) == 0) + { + player.QuickSpawnItem(mod.ItemType("AlchemasterTrophy")); + } + if (Main.rand.Next(1) == 0) + { + player.QuickSpawnItem(mod.ItemType("PlagueFlask"), Main.rand.Next(30, 78)); + } + if (Main.rand.Next(1) == 0) + { + player.QuickSpawnItem(mod.ItemType("SparkingFlask"), Main.rand.Next(30, 78)); + } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("TheGlorch")); + } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("BadApple")); + } + player.TryGettingDevArmor(); + player.QuickSpawnItem(mod.ItemType("GoldenStar")); + player.QuickSpawnItem(mod.ItemType("LongFuse")); + } -}} + } +} diff --git a/Items/AlchemasterTrophy.cs b/Items/AlchemasterTrophy.cs index 85422885..f9047c1e 100644 --- a/Items/AlchemasterTrophy.cs +++ b/Items/AlchemasterTrophy.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class AlchemasterTrophy : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class AlchemasterTrophy : ModItem + { + public override void SetDefaults() + { - item.width = 32; - item.height = 32; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 50000; - item.createTile = mod.TileType("AlchemasterTrophyTile"); - item.placeStyle = 0; - } + item.width = 32; + item.height = 32; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 50000; + item.createTile = mod.TileType("AlchemasterTrophyTile"); + item.placeStyle = 0; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Alchemaster Trophy"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Alchemaster Trophy"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/Alchemator.cs b/Items/Alchemator.cs index 01ba9943..24548ddb 100644 --- a/Items/Alchemator.cs +++ b/Items/Alchemator.cs @@ -4,46 +4,48 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Alchemator : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Alchemator : ModItem + { + public override void SetDefaults() + { - item.width = 50; - item.height = 26; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; + item.width = 50; + item.height = 26; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.rare = 7; - item.useStyle = 1; - item.consumable = true; - item.value = 300000; - item.createTile = mod.TileType("AlchematorTile"); - } + item.useAnimation = 15; + item.useTime = 10; + item.rare = 7; + item.useStyle = 1; + item.consumable = true; + item.value = 300000; + item.createTile = mod.TileType("AlchematorTile"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Alchemator"); - Tooltip.SetDefault("Allows you to create and use Jellyxir"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Alchemator"); + Tooltip.SetDefault("Allows you to create and use Jellyxir"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.HallowedBar, 1); - recipe.AddIngredient(ItemID.ChlorophyteBar, 1); - recipe.AddIngredient(null, "DarkBulb", 10); - recipe.AddIngredient(null, "LightBulb", 10); - recipe.AddIngredient(null, "EssenseofJungle", 1); - recipe.AddIngredient(null, "Opal", 1); - recipe.AddIngredient(ItemID.Glass, 25); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.HallowedBar, 1); + recipe.AddIngredient(ItemID.ChlorophyteBar, 1); + recipe.AddIngredient(null, "DarkBulb", 10); + recipe.AddIngredient(null, "LightBulb", 10); + recipe.AddIngredient(null, "EssenseofJungle", 1); + recipe.AddIngredient(null, "Opal", 1); + recipe.AddIngredient(ItemID.Glass, 25); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/AlchemistEmblem.cs b/Items/AlchemistEmblem.cs index 38d7ceb3..dad396a9 100644 --- a/Items/AlchemistEmblem.cs +++ b/Items/AlchemistEmblem.cs @@ -17,18 +17,18 @@ public override void SetDefaults() item.accessory = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Alchemist Emblem"); - Tooltip.SetDefault("15% increased alchemic damage"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Alchemist Emblem"); + Tooltip.SetDefault("15% increased alchemic damage"); + } + - public override void UpdateAccessory(Player player, bool hideVisual) { - player.GetModPlayer(mod).alchemistDamage += 0.15f; - } - + player.GetModPlayer(mod).alchemistDamage += 0.15f; + } + public override void AddRecipes() { var recipe = new ModRecipe(mod); diff --git a/Items/AlchemistFocus.cs b/Items/AlchemistFocus.cs index b75e4a73..dfb3ba4b 100644 --- a/Items/AlchemistFocus.cs +++ b/Items/AlchemistFocus.cs @@ -6,43 +6,45 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class AlchemistFocus : ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 22; - item.height = 22; - - - item.rare = 2; - item.accessory = true; - item.value = 50000; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Alchemist Focus"); - Tooltip.SetDefault("6% increased alchemic damage\nIncreases alchemic critical strike chance by 12"); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 4)); - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.GetModPlayer(mod).alchemistDamage += 0.06f; - player.GetModPlayer(mod).alchemistCrit += 12; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "AlchemistSpark"); - recipe.AddIngredient(null, "GelCube", 25); - recipe.AddIngredient(ItemID.Amethyst, 16); - recipe.SetResult(this); - recipe.AddTile(null, "AltarofEnchantmentsTile"); - recipe.AddRecipe(); - } -}} + public class AlchemistFocus : ModItem + { + + public override void SetDefaults() + { + + item.width = 22; + item.height = 22; + + + item.rare = 2; + item.accessory = true; + item.value = 50000; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Alchemist Focus"); + Tooltip.SetDefault("6% increased alchemic damage\nIncreases alchemic critical strike chance by 12"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 4)); + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.GetModPlayer(mod).alchemistDamage += 0.06f; + player.GetModPlayer(mod).alchemistCrit += 12; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "AlchemistSpark"); + recipe.AddIngredient(null, "GelCube", 25); + recipe.AddIngredient(ItemID.Amethyst, 16); + recipe.SetResult(this); + recipe.AddTile(null, "AltarofEnchantmentsTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/AlchemistGlove.cs b/Items/AlchemistGlove.cs index 172453fb..7db5c79f 100644 --- a/Items/AlchemistGlove.cs +++ b/Items/AlchemistGlove.cs @@ -6,44 +6,44 @@ namespace Tremor.Items { - public class AlchemistGlove : ModItem - { - public override bool CanEquipAccessory(Player player, int slot) - { - for (int i = 0; i < player.armor.Length; i++) - { - MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - if (modPlayer.glove == true) - { - return false; - } - } - return true; - } + public class AlchemistGlove : ModItem + { + public override bool CanEquipAccessory(Player player, int slot) + { + for (int i = 0; i < player.armor.Length; i++) + { + MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); + if (modPlayer.glove == true) + { + return false; + } + } + return true; + } - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 30; - item.height = 38; + item.width = 30; + item.height = 38; - item.value = 1500000; - item.rare = 7; - item.accessory = true; - } + item.value = 1500000; + item.rare = 7; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Master Alchemist Glove"); - Tooltip.SetDefault("Alchemic weapons throw two flasks instead of one"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Master Alchemist Glove"); + Tooltip.SetDefault("Alchemic weapons throw two flasks instead of one"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - player.AddBuff(mod.BuffType("AlchemistGloveBuff"), 2); - modPlayer.glove = true; - } - } + public override void UpdateAccessory(Player player, bool hideVisual) + { + MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); + player.AddBuff(mod.BuffType("AlchemistGloveBuff"), 2); + modPlayer.glove = true; + } + } } diff --git a/Items/AlchemistSoul.cs b/Items/AlchemistSoul.cs index 01a265db..da73bc28 100644 --- a/Items/AlchemistSoul.cs +++ b/Items/AlchemistSoul.cs @@ -6,43 +6,45 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class AlchemistSoul : ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 22; - item.height = 22; - - - item.rare = 3; - item.accessory = true; - item.value = 100000; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Alchemist Soul"); - Tooltip.SetDefault("12% increased alchemic damage\nIncreases alchemic critical strike chance by 15"); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 6)); - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.GetModPlayer(mod).alchemistDamage += 0.12f; - player.GetModPlayer(mod).alchemistCrit += 15; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "AlchemistFocus"); - recipe.AddIngredient(null, "Opal", 3); - recipe.AddIngredient(null, "AlchemistEmblem", 1); - recipe.SetResult(this); - recipe.AddTile(null, "AltarofEnchantmentsTile"); - recipe.AddRecipe(); - } -}} + public class AlchemistSoul : ModItem + { + + public override void SetDefaults() + { + + item.width = 22; + item.height = 22; + + + item.rare = 3; + item.accessory = true; + item.value = 100000; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Alchemist Soul"); + Tooltip.SetDefault("12% increased alchemic damage\nIncreases alchemic critical strike chance by 15"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 6)); + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.GetModPlayer(mod).alchemistDamage += 0.12f; + player.GetModPlayer(mod).alchemistCrit += 15; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "AlchemistFocus"); + recipe.AddIngredient(null, "Opal", 3); + recipe.AddIngredient(null, "AlchemistEmblem", 1); + recipe.SetResult(this); + recipe.AddTile(null, "AltarofEnchantmentsTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/AlchemistSpark.cs b/Items/AlchemistSpark.cs index 28e4ca54..bf5ed47e 100644 --- a/Items/AlchemistSpark.cs +++ b/Items/AlchemistSpark.cs @@ -6,40 +6,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class AlchemistSpark : ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 22; - item.height = 22; - - - item.rare = 1; - item.accessory = true; - item.value = 20000; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Alchemist Spark"); - Tooltip.SetDefault("3% increased alchemic damage\nIncreases alchemic critical strike chance by 8"); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 4)); - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.GetModPlayer(mod).alchemistDamage += 0.03f; - player.GetModPlayer(mod).alchemistCrit += 8; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "AdventurerSpark"); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public class AlchemistSpark : ModItem + { + + public override void SetDefaults() + { + + item.width = 22; + item.height = 22; + + + item.rare = 1; + item.accessory = true; + item.value = 20000; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Alchemist Spark"); + Tooltip.SetDefault("3% increased alchemic damage\nIncreases alchemic critical strike chance by 8"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 4)); + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.GetModPlayer(mod).alchemistDamage += 0.03f; + player.GetModPlayer(mod).alchemistCrit += 8; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "AdventurerSpark"); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/AlchemyStation.cs b/Items/AlchemyStation.cs index 3058eb40..7df165b7 100644 --- a/Items/AlchemyStation.cs +++ b/Items/AlchemyStation.cs @@ -4,43 +4,45 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class AlchemyStation : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class AlchemyStation : ModItem + { + public override void SetDefaults() + { - item.width = 50; - item.height = 26; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; + item.width = 50; + item.height = 26; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 150; - item.createTile = mod.TileType("AlchemyStationTile"); - } + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 150; + item.createTile = mod.TileType("AlchemyStationTile"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Alchemy Station"); - Tooltip.SetDefault("Allows you to create unusual potions and transformation of different materials"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Alchemy Station"); + Tooltip.SetDefault("Allows you to create unusual potions and transformation of different materials"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Wood, 12); - recipe.AddIngredient(null, "CarbonSteel", 12); - recipe.AddIngredient(ItemID.SoulofLight, 12); - recipe.AddIngredient(ItemID.SoulofNight, 12); - recipe.AddIngredient(ItemID.Glass, 12); - recipe.AddIngredient(ItemID.Bottle, 3); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Wood, 12); + recipe.AddIngredient(null, "CarbonSteel", 12); + recipe.AddIngredient(ItemID.SoulofLight, 12); + recipe.AddIngredient(ItemID.SoulofNight, 12); + recipe.AddIngredient(ItemID.Glass, 12); + recipe.AddIngredient(ItemID.Bottle, 3); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/AlienBlaster.cs b/Items/AlienBlaster.cs index 0b2cde16..224f1fff 100644 --- a/Items/AlienBlaster.cs +++ b/Items/AlienBlaster.cs @@ -5,77 +5,79 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class AlienBlaster : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class AlienBlaster : ModItem + { + public override void SetDefaults() + { - item.damage = 136; - item.magic = true; - item.mana = 4; - item.width = 40; - item.height = 40; - item.useTime = 9; - item.useAnimation = 9; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 3; - item.value = 28440; - item.rare = 8; - item.UseSound = SoundID.Item11; - item.autoReuse = true; - item.shoot = 440; - item.shootSpeed = 5f; - } + item.damage = 136; + item.magic = true; + item.mana = 4; + item.width = 40; + item.height = 40; + item.useTime = 9; + item.useAnimation = 9; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 3; + item.value = 28440; + item.rare = 8; + item.UseSound = SoundID.Item11; + item.autoReuse = true; + item.shoot = 440; + item.shootSpeed = 5f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Alien Blaster"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Alien Blaster"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.SpaceGun, 1); - recipe.AddIngredient(null, "NightmareBar", 15); - recipe.AddIngredient(ItemID.MeteoriteBar, 25); - recipe.AddIngredient(null, "ConcentratedEther", 22); - recipe.AddIngredient(null, "StarBar", 5); - recipe.AddIngredient(null, "Phantaplasm", 10); - recipe.SetResult(this); - recipe.AddTile(null, "StarvilTile"); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.SpaceGun, 1); + recipe.AddIngredient(null, "NightmareBar", 15); + recipe.AddIngredient(ItemID.MeteoriteBar, 25); + recipe.AddIngredient(null, "ConcentratedEther", 22); + recipe.AddIngredient(null, "StarBar", 5); + recipe.AddIngredient(null, "Phantaplasm", 10); + recipe.SetResult(this); + recipe.AddTile(null, "StarvilTile"); + recipe.AddRecipe(); + } -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - int ShotAmt = 2; - int spread = 5; - float spreadMult = 0.3f; + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + int ShotAmt = 2; + int spread = 5; + float spreadMult = 0.3f; Vector2 vector2 = new Vector2(); - - for(int i = 0; i < ShotAmt; i++) - { - float vX = 8*speedX+(float)Main.rand.Next(-spread,spread+1) * spreadMult; - float vY = 8*speedY+(float)Main.rand.Next(-spread,spread+1) * spreadMult; - - float angle = (float)Math.Atan(vY/vX); - vector2 = new Vector2(position.X+75f*(float)Math.Cos(angle), position.Y+75f*(float)Math.Sin(angle)); + + for (int i = 0; i < ShotAmt; i++) + { + float vX = 8 * speedX + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + float vY = 8 * speedY + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + + float angle = (float)Math.Atan(vY / vX); + vector2 = new Vector2(position.X + 75f * (float)Math.Cos(angle), position.Y + 75f * (float)Math.Sin(angle)); float mouseX = (float)Main.mouseX + Main.screenPosition.X; - if(mouseX < player.position.X) + if (mouseX < player.position.X) { - vector2 = new Vector2(position.X-75f*(float)Math.Cos(angle), position.Y-75f*(float)Math.Sin(angle)); + vector2 = new Vector2(position.X - 75f * (float)Math.Cos(angle), position.Y - 75f * (float)Math.Sin(angle)); } - Projectile.NewProjectile(vector2.X,vector2.Y,vX,vY, 440,damage,knockBack,Main.myPlayer); + Projectile.NewProjectile(vector2.X, vector2.Y, vX, vY, 440, damage, knockBack, Main.myPlayer); + + - - - } - return false; - } -}} + } + return false; + } + } +} diff --git a/Items/AlienFish.cs b/Items/AlienFish.cs index 585f7a5a..8626da23 100644 --- a/Items/AlienFish.cs +++ b/Items/AlienFish.cs @@ -21,11 +21,11 @@ public override void SetDefaults() item.rare = -11; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Alien Fish"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Alien Fish"); + Tooltip.SetDefault(""); + } public override bool IsQuestFish() diff --git a/Items/AlienTongue.cs b/Items/AlienTongue.cs index 8575b70a..c6532c47 100644 --- a/Items/AlienTongue.cs +++ b/Items/AlienTongue.cs @@ -3,24 +3,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class AlienTongue : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class AlienTongue : ModItem + { + public override void SetDefaults() + { - item.width = 14; - item.height = 22; - item.maxStack = 999; - item.rare = 11; + item.width = 14; + item.height = 22; + item.maxStack = 999; + item.rare = 11; - item.value = Item.buyPrice(0, 10, 0, 0); - } + item.value = Item.buyPrice(0, 10, 0, 0); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Alien Tongue"); - Tooltip.SetDefault("'Extraterrestrial abomination'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Alien Tongue"); + Tooltip.SetDefault("'Extraterrestrial abomination'"); + } -}} + } +} diff --git a/Items/AlphaClaw.cs b/Items/AlphaClaw.cs index 81fb90f8..8caa64d4 100644 --- a/Items/AlphaClaw.cs +++ b/Items/AlphaClaw.cs @@ -4,24 +4,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class AlphaClaw : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class AlphaClaw : ModItem + { + public override void SetDefaults() + { - item.width = 28; - item.height = 30; + item.width = 28; + item.height = 30; - item.maxStack = 99; - item.value = 10; - item.rare = 1; - } + item.maxStack = 99; + item.value = 10; + item.rare = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Alpha Claw"); - Tooltip.SetDefault("A claw of a powerful wolf"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Alpha Claw"); + Tooltip.SetDefault("A claw of a powerful wolf"); + } -}} + } +} diff --git a/Items/AlphaKnife.cs b/Items/AlphaKnife.cs index 44a8f5ca..41a47192 100644 --- a/Items/AlphaKnife.cs +++ b/Items/AlphaKnife.cs @@ -5,44 +5,46 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class AlphaKnife : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class AlphaKnife : ModItem + { + public override void SetDefaults() + { - item.damage = 12; - item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("AlphaKnifePro"); - item.shootSpeed = 22f; - item.useStyle = 1; - item.knockBack = 4; - item.value = 7; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 12; + item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("AlphaKnifePro"); + item.shootSpeed = 22f; + item.useStyle = 1; + item.knockBack = 4; + item.value = 7; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Alpha Knife"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Alpha Knife"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "AlphaClaw", 1); - recipe.SetResult(this, 75); - recipe.AddTile(14); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "AlphaClaw", 1); + recipe.SetResult(this, 75); + recipe.AddTile(14); + recipe.AddRecipe(); + } + } +} diff --git a/Items/AlphaWolfBanner.cs b/Items/AlphaWolfBanner.cs index e7e40bfc..42e78eac 100644 --- a/Items/AlphaWolfBanner.cs +++ b/Items/AlphaWolfBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class AlphaWolfBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class AlphaWolfBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 23; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 23; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Alpha Wolf Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Alpha Wolf Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/AltarofEnchantments.cs b/Items/AltarofEnchantments.cs index 9c8a6bb0..d3be0b28 100644 --- a/Items/AltarofEnchantments.cs +++ b/Items/AltarofEnchantments.cs @@ -4,41 +4,43 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class AltarofEnchantments : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class AltarofEnchantments : ModItem + { + public override void SetDefaults() + { - item.width = 50; - item.height = 26; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; + item.width = 50; + item.height = 26; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 150; - item.createTile = mod.TileType("AltarofEnchantmentsTile"); - } + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 150; + item.createTile = mod.TileType("AltarofEnchantmentsTile"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Altar of Enchantments"); - Tooltip.SetDefault("Allows you to improve some items"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Altar of Enchantments"); + Tooltip.SetDefault("Allows you to improve some items"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.StoneBlock, 30); - recipe.AddIngredient(null, "StoneofLife", 2); - recipe.AddIngredient(null, "Gloomstone", 30); - recipe.AddIngredient(ItemID.Book, 1); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.StoneBlock, 30); + recipe.AddIngredient(null, "StoneofLife", 2); + recipe.AddIngredient(null, "Gloomstone", 30); + recipe.AddIngredient(ItemID.Book, 1); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/AmethystBlade.cs b/Items/AmethystBlade.cs index 1c76fb08..379262e8 100644 --- a/Items/AmethystBlade.cs +++ b/Items/AmethystBlade.cs @@ -5,46 +5,48 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class AmethystBlade : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class AmethystBlade : ModItem + { + public override void SetDefaults() + { - item.damage = 13; - item.melee = true; - item.width = 46; - item.height = 48; - item.useTime = 25; - item.useAnimation = 25; - item.useStyle = 1; - item.knockBack = 3; - item.value = 6400; - item.rare = 2; - item.UseSound = SoundID.Item15; - item.autoReuse = true; - item.useTurn = true; - } + item.damage = 13; + item.melee = true; + item.width = 46; + item.height = 48; + item.useTime = 25; + item.useAnimation = 25; + item.useStyle = 1; + item.knockBack = 3; + item.value = 6400; + item.rare = 2; + item.UseSound = SoundID.Item15; + item.autoReuse = true; + item.useTurn = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Amethyst Blade"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Amethyst Blade"); + Tooltip.SetDefault(""); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 62); - } + public override void MeleeEffects(Player player, Rectangle hitbox) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 62); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Amethyst, 12); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Amethyst, 12); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/AmethystDrill.cs b/Items/AmethystDrill.cs index 0b64eeb9..a84f5c35 100644 --- a/Items/AmethystDrill.cs +++ b/Items/AmethystDrill.cs @@ -4,47 +4,49 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class AmethystDrill : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.damage = 9; - item.melee = true; - item.width = 20; - item.height = 12; - item.useTime = 8; - item.useAnimation = 25; - item.channel = true; - item.noUseGraphic = true; - item.noMelee = true; - item.pick = 85; - item.useStyle = 5; - item.knockBack = 6; - item.value = Item.buyPrice(0, 0, 50, 0); - item.rare = 2; - item.UseSound = SoundID.Item23; - item.autoReuse = true; - item.shoot = mod.ProjectileType("AmethystDrillPro"); - item.shootSpeed = 40f; - } + public class AmethystDrill : ModItem + { + public override void SetDefaults() + { + + item.damage = 9; + item.melee = true; + item.width = 20; + item.height = 12; + item.useTime = 8; + item.useAnimation = 25; + item.channel = true; + item.noUseGraphic = true; + item.noMelee = true; + item.pick = 85; + item.useStyle = 5; + item.knockBack = 6; + item.value = Item.buyPrice(0, 0, 50, 0); + item.rare = 2; + item.UseSound = SoundID.Item23; + item.autoReuse = true; + item.shoot = mod.ProjectileType("AmethystDrillPro"); + item.shootSpeed = 40f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Amethyst Drill"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Amethyst Drill"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Obsidian, 25); - recipe.AddIngredient(ItemID.MeteoriteBar, 16); - recipe.AddIngredient(ItemID.Amethyst, 12); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Obsidian, 25); + recipe.AddIngredient(ItemID.MeteoriteBar, 16); + recipe.AddIngredient(ItemID.Amethyst, 12); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/AmplifiedEnchantmentSolution.cs b/Items/AmplifiedEnchantmentSolution.cs index 87e79b61..3cb1f1eb 100644 --- a/Items/AmplifiedEnchantmentSolution.cs +++ b/Items/AmplifiedEnchantmentSolution.cs @@ -6,61 +6,61 @@ namespace Tremor.Items { - public class AmplifiedEnchantmentSolution : ModItem - { - public override bool CanEquipAccessory(Player player, int slot) - { - for (int i = 0; i < player.armor.Length; i++) - { - MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - if (modPlayer.enchanted == true) - { - return false; - } - } - return true; - } + public class AmplifiedEnchantmentSolution : ModItem + { + public override bool CanEquipAccessory(Player player, int slot) + { + for (int i = 0; i < player.armor.Length; i++) + { + MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); + if (modPlayer.enchanted == true) + { + return false; + } + } + return true; + } - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 30; + item.width = 26; + item.height = 30; - item.value = 350000; - item.rare = 7; - item.accessory = true; - } + item.value = 350000; + item.rare = 7; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Amplified Enchantment Solution"); - Tooltip.SetDefault("45% chance not to consume flask"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Amplified Enchantment Solution"); + Tooltip.SetDefault("45% chance not to consume flask"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "EnchantmentSolution", 2); - recipe.AddIngredient(ItemID.Bottle, 10); - recipe.AddIngredient(ItemID.SoulofLight, 14); - recipe.AddIngredient(ItemID.SoulofNight, 14); - recipe.AddIngredient(ItemID.ChlorophyteBar, 10); - recipe.AddIngredient(ItemID.HallowedBar, 6); - recipe.AddIngredient(ItemID.ManaCrystal, 3); - recipe.AddIngredient(ItemID.LifeCrystal, 3); - recipe.AddIngredient(null, "BasicFlask", 15); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "EnchantmentSolution", 2); + recipe.AddIngredient(ItemID.Bottle, 10); + recipe.AddIngredient(ItemID.SoulofLight, 14); + recipe.AddIngredient(ItemID.SoulofNight, 14); + recipe.AddIngredient(ItemID.ChlorophyteBar, 10); + recipe.AddIngredient(ItemID.HallowedBar, 6); + recipe.AddIngredient(ItemID.ManaCrystal, 3); + recipe.AddIngredient(ItemID.LifeCrystal, 3); + recipe.AddIngredient(null, "BasicFlask", 15); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - player.AddBuff(mod.BuffType("AmplifiedEnchantmentSolution"), 2); - modPlayer.enchanted = true; - } - } + public override void UpdateAccessory(Player player, bool hideVisual) + { + MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); + player.AddBuff(mod.BuffType("AmplifiedEnchantmentSolution"), 2); + modPlayer.enchanted = true; + } + } } diff --git a/Items/AncientArmorPlate.cs b/Items/AncientArmorPlate.cs index 0e15368b..847a9850 100644 --- a/Items/AncientArmorPlate.cs +++ b/Items/AncientArmorPlate.cs @@ -4,24 +4,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class AncientArmorPlate : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class AncientArmorPlate : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 12000; - item.rare = 8; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 12000; + item.rare = 8; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ancient Armor Plate"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ancient Armor Plate"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/AncientBanner.cs b/Items/AncientBanner.cs index 0859cc7f..d29a8062 100644 --- a/Items/AncientBanner.cs +++ b/Items/AncientBanner.cs @@ -4,42 +4,44 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class AncientBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class AncientBanner : ModItem + { + public override void SetDefaults() + { - item.width = 48; - item.height = 64; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; + item.width = 48; + item.height = 64; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 50000; - item.rare = 11; - item.createTile = mod.TileType("AncientBanner"); - } + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 50000; + item.rare = 11; + item.createTile = mod.TileType("AncientBanner"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ancient Banner"); - Tooltip.SetDefault("Increases life regeneration if placed"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ancient Banner"); + Tooltip.SetDefault("Increases life regeneration if placed"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Gloomstone", 10); - recipe.AddIngredient(null, "UnstableCrystal", 2); - recipe.AddIngredient(ItemID.AncientCloth, 25); - recipe.SetResult(this); - recipe.AddTile(106); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Gloomstone", 10); + recipe.AddIngredient(null, "UnstableCrystal", 2); + recipe.AddIngredient(ItemID.AncientCloth, 25); + recipe.SetResult(this); + recipe.AddTile(106); + recipe.AddRecipe(); + } + } +} diff --git a/Items/AncientClaymore.cs b/Items/AncientClaymore.cs index 15951c2b..92349d56 100644 --- a/Items/AncientClaymore.cs +++ b/Items/AncientClaymore.cs @@ -5,53 +5,54 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class AncientClaymore : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class AncientClaymore : ModItem + { + public override void SetDefaults() + { - item.damage = 110; - item.melee = true; - item.width = 88; - item.height = 88; - item.useTime = 45; - item.useAnimation = 45; - item.useStyle = 1; - item.shoot = mod.ProjectileType("AncientClaymorePro"); - item.shootSpeed = 10f; - item.knockBack = 4; - item.value = 250000; - item.rare = 10; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.useTurn = false; + item.damage = 110; + item.melee = true; + item.width = 88; + item.height = 88; + item.useTime = 45; + item.useAnimation = 45; + item.useStyle = 1; + item.shoot = mod.ProjectileType("AncientClaymorePro"); + item.shootSpeed = 10f; + item.knockBack = 4; + item.value = 250000; + item.rare = 10; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.useTurn = false; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ancient Claymore"); - Tooltip.SetDefault("Shoots out a ghostly sword that inflicts Ichor on enemies"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ancient Claymore"); + Tooltip.SetDefault("Shoots out a ghostly sword that inflicts Ichor on enemies"); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if(Main.rand.Next(3) == 0) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 64); - } - } + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.Next(3) == 0) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 64); + } + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "AncientTablet", 14); - recipe.AddIngredient(ItemID.BrokenHeroSword); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } -} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "AncientTablet", 14); + recipe.AddIngredient(ItemID.BrokenHeroSword); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } } diff --git a/Items/AncientCursedSkullBanner.cs b/Items/AncientCursedSkullBanner.cs index 4d2ce057..940a2df5 100644 --- a/Items/AncientCursedSkullBanner.cs +++ b/Items/AncientCursedSkullBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class AncientCursedSkullBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class AncientCursedSkullBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 45; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 45; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ancient CursedSkull Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ancient CursedSkull Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/AncientDagger.cs b/Items/AncientDagger.cs index 477d96c2..c9b85374 100644 --- a/Items/AncientDagger.cs +++ b/Items/AncientDagger.cs @@ -5,46 +5,48 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class AncientDagger : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class AncientDagger : ModItem + { + public override void SetDefaults() + { - item.damage = 96; - item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 42; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("AncientDaggerPro"); - item.shootSpeed = 22f; - item.useStyle = 1; - item.knockBack = 4; - item.value = 7; - item.rare = 10; - item.UseSound = SoundID.Item1; - item.autoReuse = false; + item.damage = 96; + item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 42; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("AncientDaggerPro"); + item.shootSpeed = 22f; + item.useStyle = 1; + item.knockBack = 4; + item.value = 7; + item.rare = 10; + item.UseSound = SoundID.Item1; + item.autoReuse = false; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ancient Dagger"); - Tooltip.SetDefault("Throws an exploding dagger"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ancient Dagger"); + Tooltip.SetDefault("Throws an exploding dagger"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "AncientTablet"); - recipe.AddIngredient(ItemID.ThrowingKnife, 25); - recipe.SetResult(this, 25); - recipe.AddTile(412); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "AncientTablet"); + recipe.AddIngredient(ItemID.ThrowingKnife, 25); + recipe.SetResult(this, 25); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } +} diff --git a/Items/AncientDragonBag.cs b/Items/AncientDragonBag.cs index dfc16ef1..d5406550 100644 --- a/Items/AncientDragonBag.cs +++ b/Items/AncientDragonBag.cs @@ -4,57 +4,59 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class AncientDragonBag : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.maxStack = 999; - item.consumable = true; - item.width = 24; - item.height = 24; - - item.rare = 9; - item.expert = true; - bossBagNPC = mod.NPCType("Dragon_HeadB"); - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Treasure Bag"); - Tooltip.SetDefault("Right click to open"); - } - - - public override bool CanRightClick() - { - return true; - } - - public override void OpenBossBag(Player player) - { - switch (Main.rand.Next(4)) - { - case 0: - player.QuickSpawnItem(mod.ItemType("DragonHead")); - break; - case 1: - player.QuickSpawnItem(mod.ItemType("Swordstorm")); - break; - case 2: - player.QuickSpawnItem(mod.ItemType("AncientTimesEdge")); - break; - } - - if(Main.rand.Next(7) == 0) - { - player.QuickSpawnItem(mod.ItemType("AncientDragonMask")); - } - - player.TryGettingDevArmor(); - player.QuickSpawnItem(mod.ItemType("AncientSoul")); - player.QuickSpawnItem(188, Main.rand.Next(5,15)); - } - -}} + public class AncientDragonBag : ModItem + { + public override void SetDefaults() + { + + item.maxStack = 999; + item.consumable = true; + item.width = 24; + item.height = 24; + + item.rare = 9; + item.expert = true; + bossBagNPC = mod.NPCType("Dragon_HeadB"); + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Treasure Bag"); + Tooltip.SetDefault("Right click to open"); + } + + + public override bool CanRightClick() + { + return true; + } + + public override void OpenBossBag(Player player) + { + switch (Main.rand.Next(4)) + { + case 0: + player.QuickSpawnItem(mod.ItemType("DragonHead")); + break; + case 1: + player.QuickSpawnItem(mod.ItemType("Swordstorm")); + break; + case 2: + player.QuickSpawnItem(mod.ItemType("AncientTimesEdge")); + break; + } + + if (Main.rand.Next(7) == 0) + { + player.QuickSpawnItem(mod.ItemType("AncientDragonMask")); + } + + player.TryGettingDevArmor(); + player.QuickSpawnItem(mod.ItemType("AncientSoul")); + player.QuickSpawnItem(188, Main.rand.Next(5, 15)); + } + + } +} diff --git a/Items/AncientDragonMask.cs b/Items/AncientDragonMask.cs index 3265e8f8..2dd1066a 100644 --- a/Items/AncientDragonMask.cs +++ b/Items/AncientDragonMask.cs @@ -4,25 +4,28 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class AncientDragonMask : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class AncientDragonMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 20; - item.height = 24; - item.rare = 1; - item.vanity = true; - } + item.width = 20; + item.height = 24; + item.rare = 1; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ancient Dragon Mask"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ancient Dragon Mask"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/AncientDragonTrophy.cs b/Items/AncientDragonTrophy.cs index eb9b2d6d..f1347d74 100644 --- a/Items/AncientDragonTrophy.cs +++ b/Items/AncientDragonTrophy.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class AncientDragonTrophy : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class AncientDragonTrophy : ModItem + { + public override void SetDefaults() + { - item.width = 32; - item.height = 32; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 50000; - item.createTile = mod.TileType("AncientDragonTrophy"); - item.placeStyle = 0; - } + item.width = 32; + item.height = 32; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 50000; + item.createTile = mod.TileType("AncientDragonTrophy"); + item.placeStyle = 0; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ancient Dragon Trophy"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ancient Dragon Trophy"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/AncientFlail.cs b/Items/AncientFlail.cs index 62169e9e..27eae486 100644 --- a/Items/AncientFlail.cs +++ b/Items/AncientFlail.cs @@ -7,44 +7,44 @@ namespace Tremor.Items { - public class AncientFlail : ModItem - { - public override void SetDefaults() - { + public class AncientFlail : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 10; - item.rare = 10; - item.noMelee = true; - item.useStyle = 5; - item.useAnimation = 40; - item.useTime = 40; - item.knockBack = 7.5F; - item.damage = 106; - item.scale = 1.1F; - item.noUseGraphic = true; - item.shoot = mod.ProjectileType("AncientFlailPro"); - item.shootSpeed = 13f; - item.UseSound = SoundID.Item1; - item.melee = true; - item.channel = true; - } + item.width = 30; + item.height = 10; + item.rare = 10; + item.noMelee = true; + item.useStyle = 5; + item.useAnimation = 40; + item.useTime = 40; + item.knockBack = 7.5F; + item.damage = 106; + item.scale = 1.1F; + item.noUseGraphic = true; + item.shoot = mod.ProjectileType("AncientFlailPro"); + item.shootSpeed = 13f; + item.UseSound = SoundID.Item1; + item.melee = true; + item.channel = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ancient Flail"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ancient Flail"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "AncientTablet", 9); - recipe.AddIngredient(ItemID.Chain, 8); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "AncientTablet", 9); + recipe.AddIngredient(ItemID.Chain, 8); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } } diff --git a/Items/AncientMeteorHelmet.cs b/Items/AncientMeteorHelmet.cs index 0d3dcfc4..4eb5ccba 100644 --- a/Items/AncientMeteorHelmet.cs +++ b/Items/AncientMeteorHelmet.cs @@ -5,43 +5,46 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class AncientMeteorHelmet : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class AncientMeteorHelmet : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 20; - item.height = 26; + item.width = 20; + item.height = 26; - item.value = 9000; - item.rare = 1; - item.defense = 5; - } + item.value = 9000; + item.rare = 1; + item.defense = 5; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ancient Meteor Helmet"); - Tooltip.SetDefault("7% increased magic damage"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ancient Meteor Helmet"); + Tooltip.SetDefault("7% increased magic damage"); + } - public override void UpdateEquip(Player player) - { - player.magicDamage += 0.07f; - } + public override void UpdateEquip(Player player) + { + player.magicDamage += 0.07f; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == 124 && legs.type == 125; - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == 124 && legs.type == 125; + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Reduces the mana cost of the Space Gun to zero"; - player.spaceGun = true; - } -}} + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Reduces the mana cost of the Space Gun to zero"; + player.spaceGun = true; + } + } +} diff --git a/Items/AncientMosaic.cs b/Items/AncientMosaic.cs index 2eb391ff..09020248 100644 --- a/Items/AncientMosaic.cs +++ b/Items/AncientMosaic.cs @@ -5,37 +5,37 @@ namespace Tremor.Items { - public class AncientMosaic : ModItem - { - public override void SetDefaults() - { - - item.width = 30; - item.height = 30; - item.maxStack = 1; - - item.rare = 4; - item.maxStack = 20; - item.useAnimation = 45; - item.useTime = 45; - item.useStyle = 4; - item.UseSound = SoundID.Item44; - item.consumable = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ancient Mosaic"); - Tooltip.SetDefault("Summons the Alchemaster"); - } - - - public override bool CanUseItem(Player player) - { - return !Main.dayTime && Main.hardMode && !NPC.AnyNPCs(mod.NPCType("Alchemaster")); - } - - + public class AncientMosaic : ModItem + { + public override void SetDefaults() + { + + item.width = 30; + item.height = 30; + item.maxStack = 1; + + item.rare = 4; + item.maxStack = 20; + item.useAnimation = 45; + item.useTime = 45; + item.useStyle = 4; + item.UseSound = SoundID.Item44; + item.consumable = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ancient Mosaic"); + Tooltip.SetDefault("Summons the Alchemaster"); + } + + + public override bool CanUseItem(Player player) + { + return !Main.dayTime && Main.hardMode && !NPC.AnyNPCs(mod.NPCType("Alchemaster")); + } + + public override bool UseItem(Player player) { NPC.SpawnOnPlayer(player.whoAmI, mod.NPCType("Alchemaster")); @@ -43,18 +43,18 @@ public override bool UseItem(Player player) return true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "RedPuzzleFragment", 1); - recipe.AddIngredient(null, "GreenPuzzleFragment", 1); - recipe.AddIngredient(null, "YellowPuzzleFragment", 1); - recipe.AddIngredient(null, "PurplePuzzleFragment", 1); - recipe.AddIngredient(null, "BottledGlue", 1); - recipe.SetResult(this); - recipe.AddTile(26); - recipe.AddRecipe(); - } - - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "RedPuzzleFragment", 1); + recipe.AddIngredient(null, "GreenPuzzleFragment", 1); + recipe.AddIngredient(null, "YellowPuzzleFragment", 1); + recipe.AddIngredient(null, "PurplePuzzleFragment", 1); + recipe.AddIngredient(null, "BottledGlue", 1); + recipe.SetResult(this); + recipe.AddTile(26); + recipe.AddRecipe(); + } + + } } diff --git a/Items/AncientSmasher.cs b/Items/AncientSmasher.cs index ea36407e..83ee797f 100644 --- a/Items/AncientSmasher.cs +++ b/Items/AncientSmasher.cs @@ -5,52 +5,53 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class AncientSmasher : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class AncientSmasher : ModItem + { + public override void SetDefaults() + { - item.damage = 100; - item.melee = true; - item.width = 88; - item.height = 88; - item.useTime = 30; - item.useAnimation = 30; - item.useStyle = 1; - item.knockBack = 10; - item.value = 10000; - item.rare = 10; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.useTurn = false; - item.axe = 25; - item.hammer = 100; - item.tileBoost+=5; - } + item.damage = 100; + item.melee = true; + item.width = 88; + item.height = 88; + item.useTime = 30; + item.useAnimation = 30; + item.useStyle = 1; + item.knockBack = 10; + item.value = 10000; + item.rare = 10; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.useTurn = false; + item.axe = 25; + item.hammer = 100; + item.tileBoost += 5; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ancient Smasher"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ancient Smasher"); + Tooltip.SetDefault(""); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if(Main.rand.Next(3) == 0) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 64); - } - } + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.Next(3) == 0) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 64); + } + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "AncientTablet", 16); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } -} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "AncientTablet", 16); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } } diff --git a/Items/AncientSolarWind.cs b/Items/AncientSolarWind.cs index d05c7da2..25829fb4 100644 --- a/Items/AncientSolarWind.cs +++ b/Items/AncientSolarWind.cs @@ -5,51 +5,53 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class AncientSolarWind : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class AncientSolarWind : ModItem + { + public override void SetDefaults() + { - item.damage = 120; - item.width = 72; - item.height = 72; - item.noUseGraphic = true; - item.melee = true; - item.useTime = 30; - item.shoot = mod.ProjectileType("AncientSolarWindPro"); - item.shootSpeed = 3f; - item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 4; - item.value = 210000; - item.rare = 10; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 120; + item.width = 72; + item.height = 72; + item.noUseGraphic = true; + item.melee = true; + item.useTime = 30; + item.shoot = mod.ProjectileType("AncientSolarWindPro"); + item.shootSpeed = 3f; + item.useAnimation = 30; + item.useStyle = 5; + item.knockBack = 4; + item.value = 210000; + item.rare = 10; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ancient Solar Wind"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ancient Solar Wind"); + Tooltip.SetDefault(""); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if(Main.rand.Next(3) == 0) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 64); - } - } + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.Next(3) == 0) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 64); + } + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "AncientTablet", 10); - recipe.AddIngredient(null, "FireFragment", 6); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "AncientTablet", 10); + recipe.AddIngredient(null, "FireFragment", 6); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } +} diff --git a/Items/AncientSoul.cs b/Items/AncientSoul.cs index cb18015a..fef4f538 100644 --- a/Items/AncientSoul.cs +++ b/Items/AncientSoul.cs @@ -8,37 +8,37 @@ namespace Tremor.Items { - public class AncientSoul : ModItem - { - public override void SetDefaults() - { + public class AncientSoul : ModItem + { + public override void SetDefaults() + { - item.width = 28; - item.height = 36; + item.width = 28; + item.height = 36; - item.rare = 9; - item.accessory = true; - item.value = 30000; - item.expert = true; - } + item.rare = 9; + item.accessory = true; + item.value = 30000; + item.expert = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ancient Soul"); - Tooltip.SetDefault("Creates a shield of souls to protect you\nMore souls appear after some time and each soul disappear after second hit of enemy"); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 3)); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ancient Soul"); + Tooltip.SetDefault("Creates a shield of souls to protect you\nMore souls appear after some time and each soul disappear after second hit of enemy"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 3)); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - if (Main.rand.Next(250) == 0) - { - if (player.ownedProjectileCounts[mod.ProjectileType("AncientShield")] <= 4) - { - Projectile.NewProjectile(player.position, Vector2.Zero, mod.ProjectileType("AncientShield"), 20, 0, player.whoAmI); - } - } - } - } + public override void UpdateAccessory(Player player, bool hideVisual) + { + if (Main.rand.Next(250) == 0) + { + if (player.ownedProjectileCounts[mod.ProjectileType("AncientShield")] <= 4) + { + Projectile.NewProjectile(player.position, Vector2.Zero, mod.ProjectileType("AncientShield"), 20, 0, player.whoAmI); + } + } + } + } } diff --git a/Items/AncientSunStaff.cs b/Items/AncientSunStaff.cs index 5e8422fa..8f03d3d2 100644 --- a/Items/AncientSunStaff.cs +++ b/Items/AncientSunStaff.cs @@ -5,54 +5,55 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class AncientSunStaff : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class AncientSunStaff : ModItem + { + public override void SetDefaults() + { - item.damage = 80; - item.magic = true; - item.mana = 16; - item.width = 88; - item.height = 88; - item.useTime = 45; - item.useAnimation = 45; - item.useStyle = 5; - item.shoot = mod.ProjectileType("AncientSunPro"); - item.shootSpeed = 10f; - item.knockBack = 4; - item.value = 10000; - item.rare = 10; - item.UseSound = SoundID.Item75; - item.autoReuse = true; - item.useTurn = false; - Item.staff[item.type] = true; + item.damage = 80; + item.magic = true; + item.mana = 16; + item.width = 88; + item.height = 88; + item.useTime = 45; + item.useAnimation = 45; + item.useStyle = 5; + item.shoot = mod.ProjectileType("AncientSunPro"); + item.shootSpeed = 10f; + item.knockBack = 4; + item.value = 10000; + item.rare = 10; + item.UseSound = SoundID.Item75; + item.autoReuse = true; + item.useTurn = false; + Item.staff[item.type] = true; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ancient Sun Staff"); - Tooltip.SetDefault("Summons an fiery exploding bolt"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ancient Sun Staff"); + Tooltip.SetDefault("Summons an fiery exploding bolt"); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if(Main.rand.Next(3) == 0) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 64); - } - } + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.Next(3) == 0) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 64); + } + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "AncientTablet", 12); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } -} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "AncientTablet", 12); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } } diff --git a/Items/AncientTablet.cs b/Items/AncientTablet.cs index b9570b44..0f1c2d14 100644 --- a/Items/AncientTablet.cs +++ b/Items/AncientTablet.cs @@ -6,23 +6,25 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class AncientTablet : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class AncientTablet : ModItem + { + public override void SetDefaults() + { - item.width = 34; - item.height = 40; - item.maxStack = 99; - item.value = 10000; - item.rare = 10; - } + item.width = 34; + item.height = 40; + item.maxStack = 99; + item.value = 10000; + item.rare = 10; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ancient Tablet"); - Tooltip.SetDefault(""); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(8, 4)); - } -}} + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ancient Tablet"); + Tooltip.SetDefault(""); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(8, 4)); + } + } +} diff --git a/Items/AncientTechnology.cs b/Items/AncientTechnology.cs index 553eba85..6d7ac909 100644 --- a/Items/AncientTechnology.cs +++ b/Items/AncientTechnology.cs @@ -4,23 +4,25 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class AncientTechnology : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class AncientTechnology : ModItem + { + public override void SetDefaults() + { - item.height = 16; - item.maxStack = 20; - item.value = 1000000; - item.rare = 8; - } + item.height = 16; + item.maxStack = 20; + item.value = 1000000; + item.rare = 8; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ancient Technology"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ancient Technology"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/AncientTimesEdge.cs b/Items/AncientTimesEdge.cs index 14f0683d..c3506aec 100644 --- a/Items/AncientTimesEdge.cs +++ b/Items/AncientTimesEdge.cs @@ -4,34 +4,36 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class AncientTimesEdge : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class AncientTimesEdge : ModItem + { + public override void SetDefaults() + { - item.damage = 18; - item.melee = true; - item.width = 36; - item.height = 44; - item.useTime = 35; + item.damage = 18; + item.melee = true; + item.width = 36; + item.height = 44; + item.useTime = 35; - item.useAnimation = 35; - item.useStyle = 1; - item.useTurn = true; - item.knockBack = 6f; - item.value = 30000; - item.rare = 2; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.shootSpeed = 15f; - item.shoot = 270; - } + item.useAnimation = 35; + item.useStyle = 1; + item.useTurn = true; + item.knockBack = 6f; + item.value = 30000; + item.rare = 2; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.shootSpeed = 15f; + item.shoot = 270; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ancient Times Edge"); - Tooltip.SetDefault("Summons ancient skulls on swing"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ancient Times Edge"); + Tooltip.SetDefault("Summons ancient skulls on swing"); + } -}} + } +} diff --git a/Items/AncientVisionStaff.cs b/Items/AncientVisionStaff.cs index fcaa2719..89bae4aa 100644 --- a/Items/AncientVisionStaff.cs +++ b/Items/AncientVisionStaff.cs @@ -31,26 +31,26 @@ public override void SetDefaults() item.buffTime = 3600; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ancient Vision Staff"); - Tooltip.SetDefault("Summons an ancient vision to fight for you."); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ancient Vision Staff"); + Tooltip.SetDefault("Summons an ancient vision to fight for you."); + } public override bool AltFunctionUse(Player player) { return true; } - + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { return player.altFunctionUse != 2; } - + public override bool UseItem(Player player) { - if(player.altFunctionUse == 2) + if (player.altFunctionUse == 2) { player.MinionNPCTargetAim(); } diff --git a/Items/AndasBag.cs b/Items/AndasBag.cs index 39151df0..2d6c3df9 100644 --- a/Items/AndasBag.cs +++ b/Items/AndasBag.cs @@ -4,65 +4,67 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class AndasBag : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class AndasBag : ModItem + { + public override void SetDefaults() + { - item.maxStack = 999; - item.consumable = true; - item.width = 24; - item.height = 24; + item.maxStack = 999; + item.consumable = true; + item.width = 24; + item.height = 24; - item.rare = 9; - item.expert = true; - bossBagNPC = mod.NPCType("TrueAndas"); - } + item.rare = 9; + item.expert = true; + bossBagNPC = mod.NPCType("TrueAndas"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Treasure Bag"); - Tooltip.SetDefault("Right click to open"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Treasure Bag"); + Tooltip.SetDefault("Right click to open"); + } - public override bool CanRightClick() - { - return true; - } + public override bool CanRightClick() + { + return true; + } - public override void OpenBossBag(Player player) - { - switch (Main.rand.Next(4)) - { - case 0: - player.QuickSpawnItem(mod.ItemType("GehennaStaff")); - break; - case 1: - player.QuickSpawnItem(mod.ItemType("VulcanBlade")); - break; - case 2: - player.QuickSpawnItem(mod.ItemType("Pandemonium")); - break; - case 3: - player.QuickSpawnItem(mod.ItemType("HellStorm")); - break; - case 4: - player.QuickSpawnItem(mod.ItemType("Inferno")); - break; - } + public override void OpenBossBag(Player player) + { + switch (Main.rand.Next(4)) + { + case 0: + player.QuickSpawnItem(mod.ItemType("GehennaStaff")); + break; + case 1: + player.QuickSpawnItem(mod.ItemType("VulcanBlade")); + break; + case 2: + player.QuickSpawnItem(mod.ItemType("Pandemonium")); + break; + case 3: + player.QuickSpawnItem(mod.ItemType("HellStorm")); + break; + case 4: + player.QuickSpawnItem(mod.ItemType("Inferno")); + break; + } - if(Main.rand.Next(7) == 0) - { - player.QuickSpawnItem(mod.ItemType("AndasMask")); - } + if (Main.rand.Next(7) == 0) + { + player.QuickSpawnItem(mod.ItemType("AndasMask")); + } - player.TryGettingDevArmor(); - player.QuickSpawnItem(mod.ItemType("AndasCore")); - player.QuickSpawnItem(3544, Main.rand.Next(10,25)); - player.QuickSpawnItem(mod.ItemType("InfernoSoul"), Main.rand.Next(8,15)); + player.TryGettingDevArmor(); + player.QuickSpawnItem(mod.ItemType("AndasCore")); + player.QuickSpawnItem(3544, Main.rand.Next(10, 25)); + player.QuickSpawnItem(mod.ItemType("InfernoSoul"), Main.rand.Next(8, 15)); - } + } -}} + } +} diff --git a/Items/AndasCore.cs b/Items/AndasCore.cs index 5a5de9a8..7fba5a9a 100644 --- a/Items/AndasCore.cs +++ b/Items/AndasCore.cs @@ -6,54 +6,56 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Wings)] -public class AndasCore : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + [AutoloadEquip(EquipType.Wings)] + public class AndasCore : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 20; + item.width = 22; + item.height = 20; - item.value = 500000; - item.rare = 10; - item.expert = true; - item.accessory = true; - } + item.value = 500000; + item.rare = 10; + item.expert = true; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Andas Core"); - Tooltip.SetDefault("Allows flight\nHas infinite flight time\nHas big flight speed"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Andas Core"); + Tooltip.SetDefault("Allows flight\nHas infinite flight time\nHas big flight speed"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.wingTimeMax = 9999999; - } + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.wingTimeMax = 9999999; + } - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawOutlines = true; //á।­¥¥ ¯ã«ìá¨à®¢ ­¨¥ - player.armorEffectDrawShadowLokis = true; //¬ «¥­ìª¨¥ ⥭¨ - } + public override void ArmorSetShadows(Player player) + { + player.armorEffectDrawOutlines = true; //á।­¥¥ ¯ã«ìá¨à®¢ ­¨¥ + player.armorEffectDrawShadowLokis = true; //¬ «¥­ìª¨¥ ⥭¨ + } - public override void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, + public override void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend) - { - ascentWhenFalling = 3f; - ascentWhenRising = 2f; - maxCanAscendMultiplier = 3f; - maxAscentMultiplier = 3f; - constantAscend = 0.135f; - } + { + ascentWhenFalling = 3f; + ascentWhenRising = 2f; + maxCanAscendMultiplier = 3f; + maxAscentMultiplier = 3f; + constantAscend = 0.135f; + } public override void HorizontalWingSpeeds(Player player, ref float speed, ref float acceleration) - { - speed = 40f; - acceleration *= 4f; - } -}} + { + speed = 40f; + acceleration *= 4f; + } + } +} diff --git a/Items/AndasMask.cs b/Items/AndasMask.cs index 4a91f6e2..ea464438 100644 --- a/Items/AndasMask.cs +++ b/Items/AndasMask.cs @@ -4,25 +4,28 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class AndasMask : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class AndasMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 20; - item.height = 24; - item.rare = 1; - item.vanity = true; - } + item.width = 20; + item.height = 24; + item.rare = 1; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Andas Mask"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Andas Mask"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/AndasTrophy.cs b/Items/AndasTrophy.cs index 9007fc52..b297399a 100644 --- a/Items/AndasTrophy.cs +++ b/Items/AndasTrophy.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class AndasTrophy : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class AndasTrophy : ModItem + { + public override void SetDefaults() + { - item.width = 32; - item.height = 32; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 50000; - item.createTile = mod.TileType("AndasTrophy"); - item.placeStyle = 0; - } + item.width = 32; + item.height = 32; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 50000; + item.createTile = mod.TileType("AndasTrophy"); + item.placeStyle = 0; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Andas Trophy"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Andas Trophy"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/AngelFlameSword.cs b/Items/AngelFlameSword.cs index 4406822f..44d1b23f 100644 --- a/Items/AngelFlameSword.cs +++ b/Items/AngelFlameSword.cs @@ -7,47 +7,47 @@ namespace Tremor.Items { - public class AngelFlameSword : ModItem - { - public override void SetDefaults() - { - - item.damage = 59; - item.melee = true; - item.width = 35; - item.height = 20; - - item.useTime = 20; - item.useAnimation = 30; - item.useStyle = 1; - item.knockBack = 10; - item.value = 1002; - item.rare = 5; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Angel Flame Sword"); - Tooltip.SetDefault("Ignites your enemies"); - } - - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Excalibur, 1); - recipe.AddIngredient(ItemID.FieryGreatsword, 1); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this); - recipe.AddRecipe(); - - } - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(BuffID.OnFire, 140); - } - } - } - + public class AngelFlameSword : ModItem + { + public override void SetDefaults() + { + + item.damage = 59; + item.melee = true; + item.width = 35; + item.height = 20; + + item.useTime = 20; + item.useAnimation = 30; + item.useStyle = 1; + item.knockBack = 10; + item.value = 1002; + item.rare = 5; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Angel Flame Sword"); + Tooltip.SetDefault("Ignites your enemies"); + } + + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Excalibur, 1); + recipe.AddIngredient(ItemID.FieryGreatsword, 1); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); + + } + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(BuffID.OnFire, 140); + } + } +} + diff --git a/Items/AngelicTears.cs b/Items/AngelicTears.cs index aab28fc0..27d1853e 100644 --- a/Items/AngelicTears.cs +++ b/Items/AngelicTears.cs @@ -5,50 +5,52 @@ using Terraria.ID; using Microsoft.Xna.Framework; -namespace Tremor.Items { -public class AngelicTears : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class AngelicTears : ModItem + { + public override void SetDefaults() + { - item.damage = 256; - item.magic = true; - item.width = 28; - item.height = 30; - item.useTime = 14; - item.useAnimation = 14; - item.shoot = mod.ProjectileType("AngelTearsPro"); - item.shootSpeed = 16f; - item.mana = 6; - item.useStyle = 5; - item.knockBack = 3; - item.value = 90000; - item.rare = 0; - item.UseSound = SoundID.Item21; - item.autoReuse = true; - } + item.damage = 256; + item.magic = true; + item.width = 28; + item.height = 30; + item.useTime = 14; + item.useAnimation = 14; + item.shoot = mod.ProjectileType("AngelTearsPro"); + item.shootSpeed = 16f; + item.mana = 6; + item.useStyle = 5; + item.knockBack = 3; + item.value = 90000; + item.rare = 0; + item.UseSound = SoundID.Item21; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Angelic Tears"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Angelic Tears"); + Tooltip.SetDefault(""); + } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) - { - tooltips[0].overrideColor = new Color(238, 194, 73); - } + public override void ModifyTooltips(System.Collections.Generic.List tooltips) + { + tooltips[0].overrideColor = new Color(238, 194, 73); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "AngeliteBar", 12); - recipe.AddIngredient(null, "LapisLazuli", 7); - recipe.AddIngredient(ItemID.FallenStar, 10); - recipe.AddIngredient(null, "HuskofDusk", 8); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "AngeliteBar", 12); + recipe.AddIngredient(null, "LapisLazuli", 7); + recipe.AddIngredient(ItemID.FallenStar, 10); + recipe.AddIngredient(null, "HuskofDusk", 8); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } +} diff --git a/Items/AngeliteBar.cs b/Items/AngeliteBar.cs index 4155449b..9a88369d 100644 --- a/Items/AngeliteBar.cs +++ b/Items/AngeliteBar.cs @@ -5,44 +5,46 @@ using Terraria.ID; using Microsoft.Xna.Framework; -namespace Tremor.Items { -public class AngeliteBar : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class AngeliteBar : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 17500; - item.rare = 0; - item.createTile = mod.TileType("AngeliteBarTile"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 17500; + item.rare = 0; + item.createTile = mod.TileType("AngeliteBarTile"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Angelite Bar"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Angelite Bar"); + Tooltip.SetDefault(""); + } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) - { - tooltips[0].overrideColor = new Color(238, 194, 73); - } + public override void ModifyTooltips(System.Collections.Generic.List tooltips) + { + tooltips[0].overrideColor = new Color(238, 194, 73); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "AngeliteOre", 6); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "AngeliteOre", 6); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } +} diff --git a/Items/AngeliteOre.cs b/Items/AngeliteOre.cs index 6a75d3e6..31c13c39 100644 --- a/Items/AngeliteOre.cs +++ b/Items/AngeliteOre.cs @@ -5,35 +5,37 @@ using Terraria.ID; using Microsoft.Xna.Framework; -namespace Tremor.Items { -public class AngeliteOre : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class AngeliteOre : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 999; - item.value = 12500; - item.rare = 0; - item.createTile = mod.TileType("AngeliteOreTile"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - } + item.width = 30; + item.height = 24; + item.maxStack = 999; + item.value = 12500; + item.rare = 0; + item.createTile = mod.TileType("AngeliteOreTile"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Angelite Ore"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Angelite Ore"); + Tooltip.SetDefault(""); + } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) - { - tooltips[0].overrideColor = new Color(238, 194, 73); - } -}} + public override void ModifyTooltips(System.Collections.Generic.List tooltips) + { + tooltips[0].overrideColor = new Color(238, 194, 73); + } + } +} diff --git a/Items/AngryShard.cs b/Items/AngryShard.cs index f7ba76d6..266c4749 100644 --- a/Items/AngryShard.cs +++ b/Items/AngryShard.cs @@ -4,23 +4,25 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class AngryShard : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class AngryShard : ModItem + { + public override void SetDefaults() + { - item.width = 14; - item.height = 22; - item.maxStack = 999; - item.rare = 10; - item.value = Item.buyPrice(0, 10, 0, 0); - } + item.width = 14; + item.height = 22; + item.maxStack = 999; + item.rare = 10; + item.value = Item.buyPrice(0, 10, 0, 0); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Angry Shard"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Angry Shard"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/AngryTotemMask.cs b/Items/AngryTotemMask.cs index 5bc09a25..ab1e4479 100644 --- a/Items/AngryTotemMask.cs +++ b/Items/AngryTotemMask.cs @@ -4,25 +4,28 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class AngryTotemMask : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class AngryTotemMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.rare = 1; - item.vanity = true; - } + item.width = 30; + item.height = 24; + item.rare = 1; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Angry Totem Mask"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Angry Totem Mask"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/AntiqueStave.cs b/Items/AntiqueStave.cs index cab9bc59..8fd8eee9 100644 --- a/Items/AntiqueStave.cs +++ b/Items/AntiqueStave.cs @@ -2,48 +2,48 @@ using Terraria.ID; using Microsoft.Xna.Framework; using Terraria.ModLoader; - -namespace Tremor.Items + +namespace Tremor.Items { - public class AntiqueStave : ModItem - { - - public override void SetDefaults() - { + public class AntiqueStave : ModItem + { + + public override void SetDefaults() + { - item.damage = 21; - item.mana = 10; - item.width = 44; - item.height = 44; - item.useTime = 25; - item.useAnimation = 25; - item.useStyle = 1; - item.noMelee = true; - item.knockBack = 2.5f; - item.value = Item.buyPrice(0, 1, 0, 0); - item.rare = 2; - item.UseSound = SoundID.Item44; - item.autoReuse = true; - item.shoot = mod.ProjectileType("AntiqueStavePro"); - item.summon = true; - item.sentry = true; - } + item.damage = 21; + item.mana = 10; + item.width = 44; + item.height = 44; + item.useTime = 25; + item.useAnimation = 25; + item.useStyle = 1; + item.noMelee = true; + item.knockBack = 2.5f; + item.value = Item.buyPrice(0, 1, 0, 0); + item.rare = 2; + item.UseSound = SoundID.Item44; + item.autoReuse = true; + item.shoot = mod.ProjectileType("AntiqueStavePro"); + item.summon = true; + item.sentry = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Antique Stave"); - Tooltip.SetDefault("Summons a antique spirit to shoot bolts at your enemies"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Antique Stave"); + Tooltip.SetDefault("Summons a antique spirit to shoot bolts at your enemies"); + } public override bool AltFunctionUse(Player player) { return true; } - + public override bool UseItem(Player player) { - if(player.altFunctionUse == 2) + if (player.altFunctionUse == 2) { player.MinionNPCTargetAim(); } @@ -51,19 +51,19 @@ public override bool UseItem(Player player) } - public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - Vector2 SPos = Main.screenPosition + new Vector2((float)Main.mouseX, (float)Main.mouseY); - position = SPos; - for (int l = 0; l < Main.projectile.Length; l++) - { - Projectile proj = Main.projectile[l]; - if (proj.active && proj.type == item.shoot && proj.owner == player.whoAmI) - { - proj.active = false; - } - } - return player.altFunctionUse != 2; - } - } + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + Vector2 SPos = Main.screenPosition + new Vector2((float)Main.mouseX, (float)Main.mouseY); + position = SPos; + for (int l = 0; l < Main.projectile.Length; l++) + { + Projectile proj = Main.projectile[l]; + if (proj.active && proj.type == item.shoot && proj.owner == player.whoAmI) + { + proj.active = false; + } + } + return player.altFunctionUse != 2; + } + } } diff --git a/Items/AntlionFury.cs b/Items/AntlionFury.cs index 99e08ddc..f749da6d 100644 --- a/Items/AntlionFury.cs +++ b/Items/AntlionFury.cs @@ -5,41 +5,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class AntlionFury : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class AntlionFury : ModItem + { + public override void SetDefaults() + { - item.damage = 28; - item.ranged = true; - item.width = 48; - item.height = 24; - item.useTime = 15; - item.useAnimation = 15; - item.useStyle = 5; - item.shoot = mod.ProjectileType("Sand"); - item.shootSpeed = 17f; - item.knockBack = 4; - item.value = 10000; - item.rare = 5; - item.UseSound = SoundID.Item11; - item.autoReuse = true; + item.damage = 28; + item.ranged = true; + item.width = 48; + item.height = 24; + item.useTime = 15; + item.useAnimation = 15; + item.useStyle = 5; + item.shoot = mod.ProjectileType("Sand"); + item.shootSpeed = 17f; + item.knockBack = 4; + item.value = 10000; + item.rare = 5; + item.UseSound = SoundID.Item11; + item.autoReuse = true; - item.useAmmo = AmmoID.Sand; - } + item.useAmmo = AmmoID.Sand; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Antlion Fury"); - Tooltip.SetDefault("Quickly shoots sand blocks\nUses sand blocks as ammo"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Antlion Fury"); + Tooltip.SetDefault("Quickly shoots sand blocks\nUses sand blocks as ammo"); + } - public override Vector2? HoldoutOffset() - { - return new Vector2(-4, 0); - } -} + public override Vector2? HoldoutOffset() + { + return new Vector2(-4, 0); + } + } } diff --git a/Items/AntlionShell.cs b/Items/AntlionShell.cs index d3f015fa..7581cfb6 100644 --- a/Items/AntlionShell.cs +++ b/Items/AntlionShell.cs @@ -4,23 +4,25 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class AntlionShell : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class AntlionShell : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 100; - item.rare = 2; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 100; + item.rare = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Antlion Shell"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Antlion Shell"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/Aquamarine.cs b/Items/Aquamarine.cs index 19c9fa3a..1b041302 100644 --- a/Items/Aquamarine.cs +++ b/Items/Aquamarine.cs @@ -4,24 +4,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Aquamarine : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Aquamarine : ModItem + { + public override void SetDefaults() + { - item.width = 14; - item.height = 22; + item.width = 14; + item.height = 22; - item.maxStack = 999; - item.rare = 11; - item.value = Item.buyPrice(0, 10, 0, 0); - } + item.maxStack = 999; + item.rare = 11; + item.value = Item.buyPrice(0, 10, 0, 0); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Aquamarine"); - Tooltip.SetDefault("'A jewel from a snake tail"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Aquamarine"); + Tooltip.SetDefault("'A jewel from a snake tail"); + } -}} + } +} diff --git a/Items/Arachnophobia.cs b/Items/Arachnophobia.cs index dab1fda1..f34da456 100644 --- a/Items/Arachnophobia.cs +++ b/Items/Arachnophobia.cs @@ -4,32 +4,34 @@ using Terraria.ModLoader; using Terraria.ID; -namespace Tremor.Items { -public class Arachnophobia : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Arachnophobia : ModItem + { + public override void SetDefaults() + { - item.damage = 18; - item.melee = true; - item.width = 48; - item.height = 48; - item.useTime = 35; - item.useAnimation = 35; - item.useStyle = 1; - item.knockBack = 7; - item.shoot = 378; - item.shootSpeed = 14f; - item.value = 12500; - item.rare = 3; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 18; + item.melee = true; + item.width = 48; + item.height = 48; + item.useTime = 35; + item.useAnimation = 35; + item.useStyle = 1; + item.knockBack = 7; + item.shoot = 378; + item.shootSpeed = 14f; + item.value = 12500; + item.rare = 3; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Arachnophobia"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Arachnophobia"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/ArchDemonBanner.cs b/Items/ArchDemonBanner.cs index c012c2df..e0cf2b2a 100644 --- a/Items/ArchDemonBanner.cs +++ b/Items/ArchDemonBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ArchDemonBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ArchDemonBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 20; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 20; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Arch Demon Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Arch Demon Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/ArcherChainmail.cs b/Items/ArcherChainmail.cs index 2f89bee4..25a70af3 100644 --- a/Items/ArcherChainmail.cs +++ b/Items/ArcherChainmail.cs @@ -5,25 +5,27 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class ArcherChainmail : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Body)] + public class ArcherChainmail : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 18; - item.value = 1000; - item.rare = 2; - item.vanity = true; - } + item.width = 26; + item.height = 18; + item.value = 1000; + item.rare = 2; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Archer Chainmail"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Archer Chainmail"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/ArcherGlove.cs b/Items/ArcherGlove.cs index 36784e34..9119a795 100644 --- a/Items/ArcherGlove.cs +++ b/Items/ArcherGlove.cs @@ -4,32 +4,34 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ArcherGlove : ModItem +namespace Tremor.Items { + public class ArcherGlove : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 24; - item.height = 28; - item.value = 6000; + item.width = 24; + item.height = 28; + item.value = 6000; - item.rare = 1; - item.accessory = true; - item.defense = 1; - } + item.rare = 1; + item.accessory = true; + item.defense = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Archer Glove"); - Tooltip.SetDefault("5% increased ranged damage"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Archer Glove"); + Tooltip.SetDefault("5% increased ranged damage"); + } - public override void UpdateAccessory(Player player, bool hideVisual) + public override void UpdateAccessory(Player player, bool hideVisual) - { - player.rangedDamage += 0.05f; - } -}} + { + player.rangedDamage += 0.05f; + } + } +} diff --git a/Items/ArcherGreaves.cs b/Items/ArcherGreaves.cs index 67d4086a..92891d50 100644 --- a/Items/ArcherGreaves.cs +++ b/Items/ArcherGreaves.cs @@ -5,25 +5,28 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class ArcherGreaves : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Legs)] + public class ArcherGreaves : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 18; - item.value = 1000; - item.rare = 2; - item.vanity = true; - } + item.width = 22; + item.height = 18; + item.value = 1000; + item.rare = 2; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Archer Greaves"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Archer Greaves"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/ArcherHelmet.cs b/Items/ArcherHelmet.cs index 104807a9..e8bb3b10 100644 --- a/Items/ArcherHelmet.cs +++ b/Items/ArcherHelmet.cs @@ -5,35 +5,38 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class ArcherHelmet : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class ArcherHelmet : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 22; - item.value = 1000; - item.rare = 2; - item.vanity = true; - } + item.width = 26; + item.height = 22; + item.value = 1000; + item.rare = 2; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Archer Helmet"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Archer Helmet"); + Tooltip.SetDefault(""); + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("ArcherChainmail") && legs.type == mod.ItemType("ArcherGreaves"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("ArcherChainmail") && legs.type == mod.ItemType("ArcherGreaves"); + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawShadow=true; + player.armorEffectDrawShadow = true; } -}} + } +} diff --git a/Items/ArgiteBar.cs b/Items/ArgiteBar.cs index 613099f4..30b402c5 100644 --- a/Items/ArgiteBar.cs +++ b/Items/ArgiteBar.cs @@ -4,38 +4,40 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ArgiteBar : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ArgiteBar : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 100; - item.rare = 3; - item.createTile = mod.TileType("ArgiteBar"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 100; + item.rare = 3; + item.createTile = mod.TileType("ArgiteBar"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Argite Bar"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Argite Bar"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ArgiteOre", 4); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ArgiteOre", 4); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } + } +} diff --git a/Items/ArgiteBreastplate.cs b/Items/ArgiteBreastplate.cs index 390bf7d3..27e4d4f3 100644 --- a/Items/ArgiteBreastplate.cs +++ b/Items/ArgiteBreastplate.cs @@ -6,8 +6,8 @@ using Terraria.ModLoader; namespace Tremor.Items -{ -[AutoloadEquip(EquipType.Body)] +{ + [AutoloadEquip(EquipType.Body)] public class ArgiteBreastplate : ModItem { public override void SetDefaults() @@ -21,25 +21,25 @@ public override void SetDefaults() item.defense = 9; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Argite Breastplate"); - Tooltip.SetDefault("12% increased melee damage"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Argite Breastplate"); + Tooltip.SetDefault("12% increased melee damage"); + } - public override void UpdateEquip(Player player) - { - player.meleeDamage += 0.12f; - } + public override void UpdateEquip(Player player) + { + player.meleeDamage += 0.12f; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ArgiteBar", 22); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ArgiteBar", 22); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } } } diff --git a/Items/ArgiteBroadsword.cs b/Items/ArgiteBroadsword.cs index 6b62858b..8ce46dc2 100644 --- a/Items/ArgiteBroadsword.cs +++ b/Items/ArgiteBroadsword.cs @@ -5,47 +5,49 @@ using Terraria.ID; using Microsoft.Xna.Framework; -namespace Tremor.Items { -public class ArgiteBroadsword : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ArgiteBroadsword : ModItem + { + public override void SetDefaults() + { - item.damage = 22; - item.melee = true; - item.width = 48; - item.height = 48; - item.useTime = 30; - item.useAnimation = 30; - item.useStyle = 1; - item.knockBack = 12; - item.value = 20000; - item.rare = 3; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 22; + item.melee = true; + item.width = 48; + item.height = 48; + item.useTime = 30; + item.useAnimation = 30; + item.useStyle = 1; + item.knockBack = 12; + item.value = 20000; + item.rare = 3; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Argite Broadsword"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Argite Broadsword"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ArgiteBar", 25); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ArgiteBar", 25); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if(Main.rand.Next(3) == 0) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 61); - } - } -}} + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.Next(3) == 0) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 61); + } + } + } +} diff --git a/Items/ArgiteGreaves.cs b/Items/ArgiteGreaves.cs index 4e69b89d..5aedcf05 100644 --- a/Items/ArgiteGreaves.cs +++ b/Items/ArgiteGreaves.cs @@ -5,41 +5,44 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class ArgiteGreaves : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Legs)] + public class ArgiteGreaves : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 18; - item.value = 15000; - item.rare = 3; + item.width = 22; + item.height = 18; + item.value = 15000; + item.rare = 3; - item.defense = 6; - } + item.defense = 6; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Argite Greaves"); - Tooltip.SetDefault("10% increased movement speed"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Argite Greaves"); + Tooltip.SetDefault("10% increased movement speed"); + } - public override void UpdateEquip(Player player) - { - player.moveSpeed += 0.1f; - } + public override void UpdateEquip(Player player) + { + player.moveSpeed += 0.1f; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ArgiteBar", 18); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ArgiteBar", 18); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } -}} + } +} diff --git a/Items/ArgiteHamaxe.cs b/Items/ArgiteHamaxe.cs index c25d7fb1..71ddd748 100644 --- a/Items/ArgiteHamaxe.cs +++ b/Items/ArgiteHamaxe.cs @@ -5,49 +5,51 @@ using Terraria.ID; using Microsoft.Xna.Framework; -namespace Tremor.Items { -public class ArgiteHamaxe : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ArgiteHamaxe : ModItem + { + public override void SetDefaults() + { - item.damage = 20; - item.melee = true; - item.width = 54; - item.height = 48; - item.useTime = 18; - item.useAnimation = 18; - item.useStyle = 1; - item.knockBack = 5; - item.value = 20000; - item.rare = 3; - item.axe = 6; - item.hammer = 66; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 20; + item.melee = true; + item.width = 54; + item.height = 48; + item.useTime = 18; + item.useAnimation = 18; + item.useStyle = 1; + item.knockBack = 5; + item.value = 20000; + item.rare = 3; + item.axe = 6; + item.hammer = 66; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Argite Hamaxe"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Argite Hamaxe"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ArgiteBar", 12); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ArgiteBar", 12); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if(Main.rand.Next(3) == 0) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 61); - } - } -}} + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.Next(3) == 0) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 61); + } + } + } +} diff --git a/Items/ArgiteHelmet.cs b/Items/ArgiteHelmet.cs index a86333b3..d1f00ab6 100644 --- a/Items/ArgiteHelmet.cs +++ b/Items/ArgiteHelmet.cs @@ -7,67 +7,70 @@ using Terraria.DataStructures; using Microsoft.Xna.Framework; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class ArgiteHelmet : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class ArgiteHelmet : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 38; - item.height = 22; - item.value = 15000; + item.width = 38; + item.height = 22; + item.value = 15000; - item.rare = 3; - item.defense = 6; - } + item.rare = 3; + item.defense = 6; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Argite Helmet"); - Tooltip.SetDefault("10% increased melee speed"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Argite Helmet"); + Tooltip.SetDefault("10% increased melee speed"); + } - public override void UpdateEquip(Player player) - { - player.meleeSpeed += 0.1f; - } + public override void UpdateEquip(Player player) + { + player.meleeSpeed += 0.1f; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("ArgiteBreastplate") && legs.type == mod.ItemType("ArgiteGreaves"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("ArgiteBreastplate") && legs.type == mod.ItemType("ArgiteGreaves"); + } - public override void UpdateArmorSet(Player player) - { + public override void UpdateArmorSet(Player player) + { - player.setBonus = "Your body become spiky"; - player.thorns = 1; + player.setBonus = "Your body become spiky"; + player.thorns = 1; - if(Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y) > 1f && !player.rocketFrame) // Makes sure the player is actually moving - { - for (int k = 0; k < 2; k++) - { - int index= Dust.NewDust(new Vector2(player.position.X - player.velocity.X * 2f, player.position.Y - 2f - player.velocity.Y * 2f), player.width, player.height, 44, 0f, 0f, 100, default(Color), 2f); - Main.dust[index].noGravity = true; - Main.dust[index].noLight = true; - Dust dust = Main.dust[index]; - dust.velocity.X = dust.velocity.X - player.velocity.X * 0.5f; - dust.velocity.Y = dust.velocity.Y - player.velocity.Y * 0.5f; - } - } - } + if (Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y) > 1f && !player.rocketFrame) // Makes sure the player is actually moving + { + for (int k = 0; k < 2; k++) + { + int index = Dust.NewDust(new Vector2(player.position.X - player.velocity.X * 2f, player.position.Y - 2f - player.velocity.Y * 2f), player.width, player.height, 44, 0f, 0f, 100, default(Color), 2f); + Main.dust[index].noGravity = true; + Main.dust[index].noLight = true; + Dust dust = Main.dust[index]; + dust.velocity.X = dust.velocity.X - player.velocity.X * 0.5f; + dust.velocity.Y = dust.velocity.Y - player.velocity.Y * 0.5f; + } + } + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ArgiteBar", 15); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ArgiteBar", 15); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } -}} + } +} diff --git a/Items/ArgiteOre.cs b/Items/ArgiteOre.cs index 6ce19979..c706240b 100644 --- a/Items/ArgiteOre.cs +++ b/Items/ArgiteOre.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ArgiteOre : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ArgiteOre : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 999; - item.value = 100; - item.rare = 3; - item.createTile = mod.TileType("ArgiteOre"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - } + item.width = 30; + item.height = 24; + item.maxStack = 999; + item.value = 100; + item.rare = 3; + item.createTile = mod.TileType("ArgiteOre"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Argite Ore"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Argite Ore"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/ArgitePickaxe.cs b/Items/ArgitePickaxe.cs index df23ebb3..27798ea3 100644 --- a/Items/ArgitePickaxe.cs +++ b/Items/ArgitePickaxe.cs @@ -5,48 +5,50 @@ using Terraria.ID; using Microsoft.Xna.Framework; -namespace Tremor.Items { -public class ArgitePickaxe : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ArgitePickaxe : ModItem + { + public override void SetDefaults() + { - item.damage = 9; - item.melee = true; - item.width = 54; - item.height = 48; - item.useTime = 15; - item.useAnimation = 15; - item.useStyle = 1; - item.knockBack = 5; - item.value = 20000; - item.rare = 3; - item.pick = 80; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 9; + item.melee = true; + item.width = 54; + item.height = 48; + item.useTime = 15; + item.useAnimation = 15; + item.useStyle = 1; + item.knockBack = 5; + item.value = 20000; + item.rare = 3; + item.pick = 80; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Argite Pickaxe"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Argite Pickaxe"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ArgiteBar", 15); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ArgiteBar", 15); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if(Main.rand.Next(3) == 0) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 61); - } - } -}} + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.Next(3) == 0) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 61); + } + } + } +} diff --git a/Items/ArgiteTome.cs b/Items/ArgiteTome.cs index 3115f866..699becde 100644 --- a/Items/ArgiteTome.cs +++ b/Items/ArgiteTome.cs @@ -5,45 +5,46 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ArgiteTome : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ArgiteTome : ModItem + { + public override void SetDefaults() + { - item.damage = 18; - item.melee = false; - item.magic = true; - item.width = 50; - item.height = 55; - item.useTime = 30; - item.mana = 8; - item.useAnimation = 30; - item.useStyle = 5; - item.shoot = mod.ProjectileType("ArgiteSpherePro"); - item.shootSpeed = 12f; - item.knockBack = 4; - item.value = 32000; - item.rare = 3; - item.UseSound = SoundID.Item9; - item.autoReuse = true; - } + item.damage = 18; + item.melee = false; + item.magic = true; + item.width = 50; + item.height = 55; + item.useTime = 30; + item.mana = 8; + item.useAnimation = 30; + item.useStyle = 5; + item.shoot = mod.ProjectileType("ArgiteSpherePro"); + item.shootSpeed = 12f; + item.knockBack = 4; + item.value = 32000; + item.rare = 3; + item.UseSound = SoundID.Item9; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Argite Tome"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Argite Tome"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Book, 1); - recipe.AddIngredient(null, "ArgiteBar", 20); - recipe.SetResult(this); - recipe.AddTile(null, "MagicWorkbenchTile"); - recipe.AddRecipe(); - } -} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Book, 1); + recipe.AddIngredient(null, "ArgiteBar", 20); + recipe.SetResult(this); + recipe.AddTile(null, "MagicWorkbenchTile"); + recipe.AddRecipe(); + } + } } diff --git a/Items/Armchair.cs b/Items/Armchair.cs index 637b1313..847a9796 100644 --- a/Items/Armchair.cs +++ b/Items/Armchair.cs @@ -4,40 +4,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Armchair : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Armchair : ModItem + { + public override void SetDefaults() + { - item.width = 42; - item.height = 32; - item.maxStack = 999; - item.value = 100; - item.rare = 1; - item.createTile = mod.TileType("Armchair"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - } + item.width = 42; + item.height = 32; + item.maxStack = 999; + item.value = 100; + item.rare = 1; + item.createTile = mod.TileType("Armchair"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Armchair"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Armchair"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Wood, 15); - recipe.AddIngredient(ItemID.Silk, 6); - recipe.SetResult(this); - recipe.AddTile(106); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Wood, 15); + recipe.AddIngredient(ItemID.Silk, 6); + recipe.SetResult(this); + recipe.AddTile(106); + recipe.AddRecipe(); + } + } +} diff --git a/Items/ArmoredJellyfishBanner.cs b/Items/ArmoredJellyfishBanner.cs index 311242dc..766bfdc5 100644 --- a/Items/ArmoredJellyfishBanner.cs +++ b/Items/ArmoredJellyfishBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ArmoredJellyfishBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ArmoredJellyfishBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 19; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 19; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Armored Jellyfish Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Armored Jellyfish Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/ArtifactEngine.cs b/Items/ArtifactEngine.cs index 5f1f1256..a700a209 100644 --- a/Items/ArtifactEngine.cs +++ b/Items/ArtifactEngine.cs @@ -8,60 +8,60 @@ namespace Tremor.Items { - public class ArtifactEngine : ModItem - { - const int XOffset = -400; - const int YOffset = -400; + public class ArtifactEngine : ModItem + { + const int XOffset = -400; + const int YOffset = -400; - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 40; - item.height = 28; - item.maxStack = 20; - item.value = 100; - item.rare = 5; - item.useAnimation = 15; - item.useTime = 15; - item.useStyle = 4; - item.consumable = true; + item.width = 40; + item.height = 28; + item.maxStack = 20; + item.value = 100; + item.rare = 5; + item.useAnimation = 15; + item.useTime = 15; + item.useStyle = 4; + item.consumable = true; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Artifact Engine"); - Tooltip.SetDefault("Summons Cog Lord"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Artifact Engine"); + Tooltip.SetDefault("Summons Cog Lord"); + } - public override bool CanUseItem(Player player) - { - return !Main.dayTime && Main.hardMode && NPC.downedMechBossAny && !NPC.AnyNPCs(mod.NPCType("CogLord")); - } + public override bool CanUseItem(Player player) + { + return !Main.dayTime && Main.hardMode && NPC.downedMechBossAny && !NPC.AnyNPCs(mod.NPCType("CogLord")); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(575, 30); - recipe.AddIngredient(ItemID.HallowedBar, 6); - recipe.AddIngredient(ItemID.Cog, 25); - recipe.AddIngredient(ItemID.Wire, 20); - recipe.AddIngredient(null,"GolemCore", 1); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(575, 30); + recipe.AddIngredient(ItemID.HallowedBar, 6); + recipe.AddIngredient(ItemID.Cog, 25); + recipe.AddIngredient(ItemID.Wire, 20); + recipe.AddIngredient(null, "GolemCore", 1); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } - public override bool UseItem(Player player) - { - Main.NewText("Cog Lord has awoken!", 175, 75, 255); - Main.PlaySound(15, (int)player.position.X, (int)player.position.Y, 0); - if(Main.netMode !=1) - { - NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y + YOffset, mod.NPCType("CogLord")); - } - return true; - } - } + public override bool UseItem(Player player) + { + Main.NewText("Cog Lord has awoken!", 175, 75, 255); + Main.PlaySound(15, (int)player.position.X, (int)player.position.Y, 0); + if (Main.netMode != 1) + { + NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y + YOffset, mod.NPCType("CogLord")); + } + return true; + } + } } diff --git a/Items/AtisBanner.cs b/Items/AtisBanner.cs index f95db0b9..588eb471 100644 --- a/Items/AtisBanner.cs +++ b/Items/AtisBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class AtisBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class AtisBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 7; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 7; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Atis Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Atis Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/AtisBlood.cs b/Items/AtisBlood.cs index 7d3b3fad..cfb79663 100644 --- a/Items/AtisBlood.cs +++ b/Items/AtisBlood.cs @@ -4,23 +4,25 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class AtisBlood : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class AtisBlood : ModItem + { + public override void SetDefaults() + { - item.width = 16; - item.height = 16; - item.maxStack = 99; - item.rare = 3; - } + item.width = 16; + item.height = 16; + item.maxStack = 99; + item.rare = 3; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Atis Blood"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Atis Blood"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/Avenger.cs b/Items/Avenger.cs index 7a7f8c40..893cba9d 100644 --- a/Items/Avenger.cs +++ b/Items/Avenger.cs @@ -5,34 +5,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Avenger : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.CloneDefaults(3279); - item.damage = 17; - item.width = 30; - item.height = 26; - item.shoot = mod.ProjectileType("AvengerPro"); - item.knockBack = 4; - item.value = 10000; - item.rare = 2; - } + public class Avenger : ModItem + { + public override void SetDefaults() + { + item.CloneDefaults(3279); + item.damage = 17; + item.width = 30; + item.height = 26; + item.shoot = mod.ProjectileType("AvengerPro"); + item.knockBack = 4; + item.value = 10000; + item.rare = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Avenger"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Avenger"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "SteelBar", 18); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "SteelBar", 18); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } } diff --git a/Items/Awakening.cs b/Items/Awakening.cs index dcab5aab..417e0420 100644 --- a/Items/Awakening.cs +++ b/Items/Awakening.cs @@ -5,46 +5,48 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Awakening: ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.damage = 300; - item.melee = true; - item.width = 70; - item.height = 70; - item.useTime = 23; - item.useAnimation = 23; - item.useStyle = 1; - item.knockBack = 10; - item.value = 1000000; - item.rare = 11; - - item.UseSound = SoundID.Item71; - item.autoReuse = true; - item.useTurn = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Awakening"); - Tooltip.SetDefault("Hitting enemies temporarily increases maximum health"); - } - - - - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if(Main.rand.Next(3) == 0) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 13); - } - } - - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) - { - player.AddBuff(113, 120); - } -}} + public class Awakening : ModItem + { + public override void SetDefaults() + { + + item.damage = 300; + item.melee = true; + item.width = 70; + item.height = 70; + item.useTime = 23; + item.useAnimation = 23; + item.useStyle = 1; + item.knockBack = 10; + item.value = 1000000; + item.rare = 11; + + item.UseSound = SoundID.Item71; + item.autoReuse = true; + item.useTurn = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Awakening"); + Tooltip.SetDefault("Hitting enemies temporarily increases maximum health"); + } + + + + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.Next(3) == 0) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 13); + } + } + + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + { + player.AddBuff(113, 120); + } + } +} diff --git a/Items/AxeofExecutioner.cs b/Items/AxeofExecutioner.cs index e658e7e8..5ba54391 100644 --- a/Items/AxeofExecutioner.cs +++ b/Items/AxeofExecutioner.cs @@ -5,35 +5,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class AxeofExecutioner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.autoReuse = true; - item.useStyle = 1; + public class AxeofExecutioner : ModItem + { + public override void SetDefaults() + { + item.autoReuse = true; + item.useStyle = 1; - item.shootSpeed = 8f; - item.shoot = mod.ProjectileType("AxeofExecutionerPro"); - item.damage = 175; - item.width = 18; - item.height = 20; - item.UseSound = SoundID.Item1; - item.useAnimation = 14; - item.useTime = 17; - item.noUseGraphic = true; - item.noMelee = true; - item.value = 500000; - item.knockBack = 5f; - item.melee = true; - item.rare = 10; - } + item.shootSpeed = 8f; + item.shoot = mod.ProjectileType("AxeofExecutionerPro"); + item.damage = 175; + item.width = 18; + item.height = 20; + item.UseSound = SoundID.Item1; + item.useAnimation = 14; + item.useTime = 17; + item.noUseGraphic = true; + item.noMelee = true; + item.value = 500000; + item.knockBack = 5f; + item.melee = true; + item.rare = 10; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Axe of Executioner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Axe of Executioner"); + Tooltip.SetDefault(""); + } - -}} + + } +} diff --git a/Items/BadApple.cs b/Items/BadApple.cs index 0ecebfc6..3c45e74f 100644 --- a/Items/BadApple.cs +++ b/Items/BadApple.cs @@ -13,18 +13,18 @@ public override void SetDefaults() { item.CloneDefaults(ItemID.Carrot); - item.useTime = 25; - item.useAnimation = 25; + item.useTime = 25; + item.useAnimation = 25; item.shoot = mod.ProjectileType("GurdPet"); item.buffType = mod.BuffType("GurdPetBuff"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bad Apple"); - Tooltip.SetDefault("Summons a gurd pet"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bad Apple"); + Tooltip.SetDefault("Summons a gurd pet"); + } public override void UseStyle(Player player) diff --git a/Items/BagofDust.cs b/Items/BagofDust.cs index ffc1f320..fa11f6cb 100644 --- a/Items/BagofDust.cs +++ b/Items/BagofDust.cs @@ -6,24 +6,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BagofDust : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BagofDust : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 36; - item.value = 10000; - item.rare = 4; - } + item.width = 22; + item.height = 36; + item.value = 10000; + item.rare = 4; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bag of Dust"); - Tooltip.SetDefault("Used for crafting bags with a variety of dust"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bag of Dust"); + Tooltip.SetDefault("Used for crafting bags with a variety of dust"); + } -}} + } +} diff --git a/Items/BallnChain.cs b/Items/BallnChain.cs index 959b53e5..04107ef8 100644 --- a/Items/BallnChain.cs +++ b/Items/BallnChain.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BallnChain : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BallnChain : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 44; + item.width = 22; + item.height = 44; - item.value = 75000; - item.rare = 3; - item.accessory = true; - item.defense = 3; - } + item.value = 75000; + item.rare = 3; + item.accessory = true; + item.defense = 3; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ball n' Chain"); - Tooltip.SetDefault("Grants a spinning ball around the player"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ball n' Chain"); + Tooltip.SetDefault("Grants a spinning ball around the player"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.AddBuff(mod.BuffType("BallnChainBuff"), 2); - } -}} + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.AddBuff(mod.BuffType("BallnChainBuff"), 2); + } + } +} diff --git a/Items/Band.cs b/Items/Band.cs index 634f4ea7..3f497666 100644 --- a/Items/Band.cs +++ b/Items/Band.cs @@ -4,37 +4,39 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Band : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Band : ModItem + { + public override void SetDefaults() + { - item.width = 28; - item.height = 20; - item.maxStack = 99; - item.value = 100; - item.rare = 1; - } + item.width = 28; + item.height = 20; + item.maxStack = 99; + item.value = 100; + item.rare = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Band"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Band"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.SilverBar, 15); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.SilverBar, 15); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.TungstenBar, 15); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.TungstenBar, 15); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Banhammer.cs b/Items/Banhammer.cs index 1fc87116..6d908fa1 100644 --- a/Items/Banhammer.cs +++ b/Items/Banhammer.cs @@ -7,47 +7,49 @@ using Microsoft.Xna.Framework; using Terraria.DataStructures; -namespace Tremor.Items { -public class Banhammer : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Banhammer : ModItem + { + public override void SetDefaults() + { - item.autoReuse = true; - item.useStyle = 1; - item.useTurn = true; - item.useAnimation = 37; - item.useTime = 25; - item.hammer = 100; - item.width = 24; - item.height = 28; - item.damage = 485; - item.rare = 0; - item.knockBack = 5.5f; - item.scale = 1.2f; - item.UseSound = SoundID.Item1; - item.tileBoost =+3; - item.value = 520000; - item.melee = true; - } + item.autoReuse = true; + item.useStyle = 1; + item.useTurn = true; + item.useAnimation = 37; + item.useTime = 25; + item.hammer = 100; + item.width = 24; + item.height = 28; + item.damage = 485; + item.rare = 0; + item.knockBack = 5.5f; + item.scale = 1.2f; + item.UseSound = SoundID.Item1; + item.tileBoost = +3; + item.value = 520000; + item.melee = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Banhammer"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Banhammer"); + Tooltip.SetDefault(""); + } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) - { - tooltips[0].overrideColor = new Color(238, 194, 73); - } + public override void ModifyTooltips(System.Collections.Generic.List tooltips) + { + tooltips[0].overrideColor = new Color(238, 194, 73); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if(Main.rand.Next(2) == 0) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 226); - } - } -}} + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.Next(2) == 0) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 226); + } + } + } +} diff --git a/Items/BansheeBanner.cs b/Items/BansheeBanner.cs index 89a6153d..b60dfcc4 100644 --- a/Items/BansheeBanner.cs +++ b/Items/BansheeBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BansheeBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BansheeBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 46; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 46; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Banshee Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Banshee Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/BasicFlask.cs b/Items/BasicFlask.cs index fbb90859..eef0218c 100644 --- a/Items/BasicFlask.cs +++ b/Items/BasicFlask.cs @@ -8,83 +8,83 @@ namespace Tremor.Items { - public class BasicFlask : AlchemistItem - { + public class BasicFlask : AlchemistItem + { - public override void SetDefaults() - { - item.crit = 4; - item.damage = 9; - //item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("BasicFlaskPro"); - item.shootSpeed = 8f; - item.useStyle = 1; - item.knockBack = 1; - item.UseSound = SoundID.Item106; - item.value = 30; - item.rare = 1; - item.autoReuse = false; - item.crit = 4; + public override void SetDefaults() + { + item.crit = 4; + item.damage = 9; + //item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("BasicFlaskPro"); + item.shootSpeed = 8f; + item.useStyle = 1; + item.knockBack = 1; + item.UseSound = SoundID.Item106; + item.value = 30; + item.rare = 1; + item.autoReuse = false; + item.crit = 4; - item.ammo = mod.ItemType("BoomFlask"); - } + item.ammo = mod.ItemType("BoomFlask"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Basic Flask"); - Tooltip.SetDefault("Throws a flask that explodes into clouds"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Basic Flask"); + Tooltip.SetDefault("Throws a flask that explodes into clouds"); + } - public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) - { - type = mod.ProjectileType("CloudPro"); - } + public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) + { + type = mod.ProjectileType("CloudPro"); + } - public override void UpdateInventory(Player player) - { - MPlayer modPlayer = player.GetModPlayer(mod); - if (modPlayer.novaHelmet) - { - item.autoReuse = true; - } - if (!modPlayer.novaHelmet) - { - item.autoReuse = false; - } - - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) - { - item.shootSpeed = 11f; - } - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) - { - item.shootSpeed = 8f; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) - { - item.autoReuse = true; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) - { - item.autoReuse = false; - } - } + public override void UpdateInventory(Player player) + { + MPlayer modPlayer = player.GetModPlayer(mod); + if (modPlayer.novaHelmet) + { + item.autoReuse = true; + } + if (!modPlayer.novaHelmet) + { + item.autoReuse = false; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.BottledWater, 1); - recipe.AddIngredient(null, "GelCube", 2); - recipe.SetResult(this, 50); - recipe.AddRecipe(); - } - } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) + { + item.shootSpeed = 11f; + } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) + { + item.shootSpeed = 8f; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) + { + item.autoReuse = true; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) + { + item.autoReuse = false; + } + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.BottledWater, 1); + recipe.AddIngredient(null, "GelCube", 2); + recipe.SetResult(this, 50); + recipe.AddRecipe(); + } + } } diff --git a/Items/BasicSprayer.cs b/Items/BasicSprayer.cs index bbd9a486..f0e8807b 100644 --- a/Items/BasicSprayer.cs +++ b/Items/BasicSprayer.cs @@ -7,163 +7,163 @@ namespace Tremor.Items { - public class BasicSprayer : AlchemistItem - { + public class BasicSprayer : AlchemistItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.damage = 16; - item.width = 68; - item.height = 30; - item.useTime = 18; - item.useAnimation = 18; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 4; - item.value = 10000; - item.rare = 2; - item.UseSound = SoundID.Item20; - item.autoReuse = false; - item.shoot = 10; - item.shootSpeed = 6f; - item.crit = 4; - item.useAmmo = mod.ItemType("BoomFlask"); + item.damage = 16; + item.width = 68; + item.height = 30; + item.useTime = 18; + item.useAnimation = 18; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 4; + item.value = 10000; + item.rare = 2; + item.UseSound = SoundID.Item20; + item.autoReuse = false; + item.shoot = 10; + item.shootSpeed = 6f; + item.crit = 4; + item.useAmmo = mod.ItemType("BoomFlask"); - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Basic Sprayer"); - Tooltip.SetDefault("Uses flasks as ammo\nSprays alchemical clouds"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Basic Sprayer"); + Tooltip.SetDefault("Uses flasks as ammo\nSprays alchemical clouds"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Wood, 45); - recipe.AddIngredient(null, "BasicFlask", 8); - recipe.AddIngredient(ItemID.ShadowScale, 15); - recipe.AddIngredient(ItemID.IronBar, 18); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Wood, 45); + recipe.AddIngredient(null, "BasicFlask", 8); + recipe.AddIngredient(ItemID.ShadowScale, 15); + recipe.AddIngredient(ItemID.IronBar, 18); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Wood, 45); - recipe.AddIngredient(null, "BasicFlask", 8); - recipe.AddIngredient(ItemID.TissueSample, 15); - recipe.AddIngredient(ItemID.IronBar, 18); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Wood, 45); + recipe.AddIngredient(null, "BasicFlask", 8); + recipe.AddIngredient(ItemID.TissueSample, 15); + recipe.AddIngredient(ItemID.IronBar, 18); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Wood, 45); - recipe.AddIngredient(null, "BasicFlask", 8); - recipe.AddIngredient(ItemID.ShadowScale, 15); - recipe.AddIngredient(ItemID.LeadBar, 18); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Wood, 45); + recipe.AddIngredient(null, "BasicFlask", 8); + recipe.AddIngredient(ItemID.ShadowScale, 15); + recipe.AddIngredient(ItemID.LeadBar, 18); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Wood, 45); - recipe.AddIngredient(null, "BasicFlask", 8); - recipe.AddIngredient(ItemID.TissueSample, 15); - recipe.AddIngredient(ItemID.LeadBar, 18); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Wood, 45); + recipe.AddIngredient(null, "BasicFlask", 8); + recipe.AddIngredient(ItemID.TissueSample, 15); + recipe.AddIngredient(ItemID.LeadBar, 18); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } - public override bool ConsumeAmmo(Player player) - { - if (player.FindBuffIndex(mod.BuffType("EnchantmentSolution")) != -1) - { - if (Main.rand.Next(0, 100) <= 50) - return false; - } - if (player.FindBuffIndex(mod.BuffType("AmplifiedEnchantmentSolution")) != -1) - { - if (Main.rand.Next(0, 100) <= 70) - return false; - } - return true; - } + public override bool ConsumeAmmo(Player player) + { + if (player.FindBuffIndex(mod.BuffType("EnchantmentSolution")) != -1) + { + if (Main.rand.Next(0, 100) <= 50) + return false; + } + if (player.FindBuffIndex(mod.BuffType("AmplifiedEnchantmentSolution")) != -1) + { + if (Main.rand.Next(0, 100) <= 70) + return false; + } + return true; + } - public override Vector2? HoldoutOffset() - { - return new Vector2(-18, -4); - } + public override Vector2? HoldoutOffset() + { + return new Vector2(-18, -4); + } - public override void UpdateInventory(Player player) - { - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) - { - item.autoReuse = true; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) - { - item.autoReuse = false; - } - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) - { - item.shootSpeed = 14f; - } - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) - { - item.shootSpeed = 6f; - } - } + public override void UpdateInventory(Player player) + { + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) + { + item.autoReuse = true; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) + { + item.autoReuse = false; + } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) + { + item.shootSpeed = 14f; + } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) + { + item.shootSpeed = 6f; + } + } - public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - MPlayer modPlayer = player.GetModPlayer(mod); - if (modPlayer.glove) - { - for (int i = 0; i < 1; ++i) - { - if (player.FindBuffIndex(mod.BuffType("BottledSpirit")) != -1) - { - Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 297, damage, knockBack, Main.myPlayer); - } - if (player.FindBuffIndex(mod.BuffType("BigBottledSpirit")) != -1) - { - Projectile.NewProjectile(position.X, position.Y, speedX + 3, speedY + 3, 297, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 297, damage, knockBack, Main.myPlayer); - } - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - int k = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Main.projectile[k].friendly = true; - } - return false; - } - if (player.FindBuffIndex(mod.BuffType("BottledSpirit")) != -1 && !modPlayer.glove) - { - for (int i = 0; i < 1; ++i) - { - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, 297, damage, knockBack, Main.myPlayer); - int k = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Main.projectile[k].friendly = true; - } - return false; - } - if (player.FindBuffIndex(mod.BuffType("BigBottledSpirit")) != -1 && !modPlayer.glove) - { - for (int i = 0; i < 1; ++i) - { - Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 297, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, 297, damage, knockBack, Main.myPlayer); - int k = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Main.projectile[k].friendly = true; - } - return false; - } - return true; - } - } + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + MPlayer modPlayer = player.GetModPlayer(mod); + if (modPlayer.glove) + { + for (int i = 0; i < 1; ++i) + { + if (player.FindBuffIndex(mod.BuffType("BottledSpirit")) != -1) + { + Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 297, damage, knockBack, Main.myPlayer); + } + if (player.FindBuffIndex(mod.BuffType("BigBottledSpirit")) != -1) + { + Projectile.NewProjectile(position.X, position.Y, speedX + 3, speedY + 3, 297, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 297, damage, knockBack, Main.myPlayer); + } + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + int k = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Main.projectile[k].friendly = true; + } + return false; + } + if (player.FindBuffIndex(mod.BuffType("BottledSpirit")) != -1 && !modPlayer.glove) + { + for (int i = 0; i < 1; ++i) + { + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, 297, damage, knockBack, Main.myPlayer); + int k = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Main.projectile[k].friendly = true; + } + return false; + } + if (player.FindBuffIndex(mod.BuffType("BigBottledSpirit")) != -1 && !modPlayer.glove) + { + for (int i = 0; i < 1; ++i) + { + Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 297, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, 297, damage, knockBack, Main.myPlayer); + int k = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Main.projectile[k].friendly = true; + } + return false; + } + return true; + } + } } diff --git a/Items/Basilisk.cs b/Items/Basilisk.cs index 0b35077b..8047c2a6 100644 --- a/Items/Basilisk.cs +++ b/Items/Basilisk.cs @@ -4,43 +4,45 @@ using Terraria.ModLoader; using Terraria.ID; -namespace Tremor.Items { -public class Basilisk : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Basilisk : ModItem + { + public override void SetDefaults() + { - item.damage = 68; - item.melee = true; - item.width = 48; - item.height = 48; - item.useTime = 35; - item.useAnimation = 35; - item.useStyle = 1; - item.knockBack = 7; - item.value = 32740; - item.rare = 6; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.shoot = 606; - item.shootSpeed = 30f; - } + item.damage = 68; + item.melee = true; + item.width = 48; + item.height = 48; + item.useTime = 35; + item.useAnimation = 35; + item.useStyle = 1; + item.knockBack = 7; + item.value = 32740; + item.rare = 6; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.shoot = 606; + item.shootSpeed = 30f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Basilisk"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Basilisk"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "SkullTeeth", 5); - recipe.AddIngredient(null, "SteelBar", 10); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "SkullTeeth", 5); + recipe.AddIngredient(null, "SteelBar", 10); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } -}} + } +} diff --git a/Items/BeetleShield.cs b/Items/BeetleShield.cs index 4db02382..91c7d3ac 100644 --- a/Items/BeetleShield.cs +++ b/Items/BeetleShield.cs @@ -5,60 +5,62 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Shield)] -public class BeetleShield : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Shield)] + public class BeetleShield : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 24; - item.height = 24; - item.value = 123110; - item.rare = 8; + item.width = 24; + item.height = 24; + item.value = 123110; + item.rare = 8; - item.accessory = true; - } + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Beetle Shield"); - Tooltip.SetDefault("The less health, the more defense\nMaximum life increased by 50"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Beetle Shield"); + Tooltip.SetDefault("The less health, the more defense\nMaximum life increased by 50"); + } - public override void UpdateAccessory(Player player, bool hideVisual) + public override void UpdateAccessory(Player player, bool hideVisual) - { - player.statLifeMax2 += 50; - if (player.statLife < 25) - { - player.statDefense += 10; - } - if (player.statLife < 100) - { - player.statDefense += 8; - } - if (player.statLife < 200) - { - player.statDefense += 6; - } - if (player.statLife < 300) - { - player.statDefense += 3; - } - } + { + player.statLifeMax2 += 50; + if (player.statLife < 25) + { + player.statDefense += 10; + } + if (player.statLife < 100) + { + player.statDefense += 8; + } + if (player.statLife < 200) + { + player.statDefense += 6; + } + if (player.statLife < 300) + { + player.statDefense += 3; + } + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "TurtleShield", 1); - recipe.AddIngredient(null, "LeechingSeed", 1); - recipe.AddIngredient(ItemID.BeetleHusk, 10); - recipe.SetResult(this); - recipe.AddTile(114); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "TurtleShield", 1); + recipe.AddIngredient(null, "LeechingSeed", 1); + recipe.AddIngredient(ItemID.BeetleHusk, 10); + recipe.SetResult(this); + recipe.AddTile(114); + recipe.AddRecipe(); + } + } +} diff --git a/Items/BenderBody.cs b/Items/BenderBody.cs index 5f46ee9e..a8ed5275 100644 --- a/Items/BenderBody.cs +++ b/Items/BenderBody.cs @@ -5,24 +5,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class BenderBody : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + [AutoloadEquip(EquipType.Body)] + public class BenderBody : ModItem + { + public override void SetDefaults() + { - item.width = 26; - item.height = 18; - item.value = 10000; - item.rare = 5; - item.vanity = true; - } + item.width = 26; + item.height = 18; + item.value = 10000; + item.rare = 5; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bender Body"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bender Body"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/BenderHead.cs b/Items/BenderHead.cs index 6ce8165b..07bc59f7 100644 --- a/Items/BenderHead.cs +++ b/Items/BenderHead.cs @@ -4,36 +4,39 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class BenderHead : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class BenderHead : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 32; - item.height = 26; - item.value = 10000; - item.rare = 5; - item.vanity = true; - } + item.width = 32; + item.height = 26; + item.value = 10000; + item.rare = 5; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bender Head"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bender Head"); + Tooltip.SetDefault(""); + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == mod.ItemType("BenderBody") && legs.type == mod.ItemType("BenderLegs"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("BenderBody") && legs.type == mod.ItemType("BenderLegs"); + } - public override void UpdateArmorSet(Player player) - { + public override void UpdateArmorSet(Player player) + { player.setBonus = "'Bite my shiny metal ass!'"; - } -}} + } + } +} diff --git a/Items/BenderLegs.cs b/Items/BenderLegs.cs index 85d73fb9..21091506 100644 --- a/Items/BenderLegs.cs +++ b/Items/BenderLegs.cs @@ -4,25 +4,28 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class BenderLegs : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Legs)] + public class BenderLegs : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 18; - item.value = 10000; - item.rare = 5; - item.vanity = true; - } + item.width = 22; + item.height = 18; + item.value = 10000; + item.rare = 5; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bender Legs"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bender Legs"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/BerserkerChestplate.cs b/Items/BerserkerChestplate.cs index 6445fee7..acaf2fde 100644 --- a/Items/BerserkerChestplate.cs +++ b/Items/BerserkerChestplate.cs @@ -6,43 +6,43 @@ using Terraria.ModLoader; namespace Tremor.Items -{ -[AutoloadEquip(EquipType.Body)] - public class BerserkerChestplate : ModItem - { - - public override void SetDefaults() - { - - item.width = 26; - item.height = 18; - - item.value = 600; - item.rare = 2; - item.defense = 6; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Berserker Chestplate"); - Tooltip.SetDefault("7% increased melee critical strike chance"); - } - - - public override void UpdateEquip(Player player) - { - player.meleeCrit += 7; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "SteelBar", 20); - recipe.AddIngredient(null, "MinotaurHorn", 1); - recipe.AddIngredient(null, "EarthFragment", 10); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } - } +{ + [AutoloadEquip(EquipType.Body)] + public class BerserkerChestplate : ModItem + { + + public override void SetDefaults() + { + + item.width = 26; + item.height = 18; + + item.value = 600; + item.rare = 2; + item.defense = 6; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Berserker Chestplate"); + Tooltip.SetDefault("7% increased melee critical strike chance"); + } + + + public override void UpdateEquip(Player player) + { + player.meleeCrit += 7; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "SteelBar", 20); + recipe.AddIngredient(null, "MinotaurHorn", 1); + recipe.AddIngredient(null, "EarthFragment", 10); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } } diff --git a/Items/BerserkerGreaves.cs b/Items/BerserkerGreaves.cs index be798ea9..75ab1e93 100644 --- a/Items/BerserkerGreaves.cs +++ b/Items/BerserkerGreaves.cs @@ -6,44 +6,44 @@ namespace Tremor.Items { -[AutoloadEquip(EquipType.Legs)] - public class BerserkerGreaves : ModItem - { - - - public override void SetDefaults() - { - - item.width = 22; - item.height = 18; - item.value = 500; - - item.rare = 2; - item.defense = 5; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Berserker Greaves"); - Tooltip.SetDefault("4% increased melee damage"); - } - - - public override void UpdateEquip(Player player) - { - player.meleeDamage += 0.04f; - } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "SteelBar", 16); - recipe.AddIngredient(null, "MinotaurHorn", 1); - recipe.AddIngredient(null, "EarthFragment", 8); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } - } + [AutoloadEquip(EquipType.Legs)] + public class BerserkerGreaves : ModItem + { + + + public override void SetDefaults() + { + + item.width = 22; + item.height = 18; + item.value = 500; + + item.rare = 2; + item.defense = 5; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Berserker Greaves"); + Tooltip.SetDefault("4% increased melee damage"); + } + + + public override void UpdateEquip(Player player) + { + player.meleeDamage += 0.04f; + } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "SteelBar", 16); + recipe.AddIngredient(null, "MinotaurHorn", 1); + recipe.AddIngredient(null, "EarthFragment", 8); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } } diff --git a/Items/BerserkerHelmet.cs b/Items/BerserkerHelmet.cs index 2c8dcc72..c76bfc5b 100644 --- a/Items/BerserkerHelmet.cs +++ b/Items/BerserkerHelmet.cs @@ -6,58 +6,58 @@ namespace Tremor.Items { -[AutoloadEquip(EquipType.Head)] - public class BerserkerHelmet : ModItem - { + [AutoloadEquip(EquipType.Head)] + public class BerserkerHelmet : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 32; - item.height = 26; + item.width = 32; + item.height = 26; - item.value = 400; - item.rare = 2; - item.defense = 5; - } + item.value = 400; + item.rare = 2; + item.defense = 5; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Berserker Helmet"); - Tooltip.SetDefault("15% increased melee speed"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Berserker Helmet"); + Tooltip.SetDefault("15% increased melee speed"); + } - public override void UpdateEquip(Player player) - { - player.meleeSpeed += 0.15f; - } + public override void UpdateEquip(Player player) + { + player.meleeSpeed += 0.15f; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == mod.ItemType("BerserkerChestplate") && legs.type == mod.ItemType("BerserkerGreaves"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("BerserkerChestplate") && legs.type == mod.ItemType("BerserkerGreaves"); + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Summons a protective rotating sword!"; - player.AddBuff(mod.BuffType("BerserkerBuff"), 2); - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Summons a protective rotating sword!"; + player.AddBuff(mod.BuffType("BerserkerBuff"), 2); + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawOutlines=true; + player.armorEffectDrawOutlines = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "SteelBar", 16); - recipe.AddIngredient(null, "MinotaurHorn", 1); - recipe.AddIngredient(null, "EarthFragment", 8); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "SteelBar", 16); + recipe.AddIngredient(null, "MinotaurHorn", 1); + recipe.AddIngredient(null, "EarthFragment", 8); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } } diff --git a/Items/BestNightmare.cs b/Items/BestNightmare.cs index 1a0d85d1..e1b700ab 100644 --- a/Items/BestNightmare.cs +++ b/Items/BestNightmare.cs @@ -6,39 +6,41 @@ using Microsoft.Xna.Framework; using Terraria.DataStructures; -namespace Tremor.Items { -public class BestNightmare : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BestNightmare : ModItem + { + public override void SetDefaults() + { - item.damage = 260; - item.thrown = true; - item.width = 48; - item.height = 48; - item.useTime = 50; - item.shootSpeed = 30f; - item.useAnimation = 50; - item.useStyle = 1; - item.knockBack = 9f; - item.shoot = mod.ProjectileType("BestNightmarePro"); - item.value = 27600; - item.rare = 0; - item.noUseGraphic = true; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 260; + item.thrown = true; + item.width = 48; + item.height = 48; + item.useTime = 50; + item.shootSpeed = 30f; + item.useAnimation = 50; + item.useStyle = 1; + item.knockBack = 9f; + item.shoot = mod.ProjectileType("BestNightmarePro"); + item.value = 27600; + item.rare = 0; + item.noUseGraphic = true; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Best Nightmare"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Best Nightmare"); + Tooltip.SetDefault(""); + } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) - { - tooltips[0].overrideColor = new Color(238, 194, 73); - } + public override void ModifyTooltips(System.Collections.Generic.List tooltips) + { + tooltips[0].overrideColor = new Color(238, 194, 73); + } -}} + } +} diff --git a/Items/BetaWolfBanner.cs b/Items/BetaWolfBanner.cs index 7d29c2c9..e6c08cf8 100644 --- a/Items/BetaWolfBanner.cs +++ b/Items/BetaWolfBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BetaWolfBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BetaWolfBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 22; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 22; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Beta Wolf Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Beta Wolf Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/BicholmereBanner.cs b/Items/BicholmereBanner.cs index 19ab606a..f816136d 100644 --- a/Items/BicholmereBanner.cs +++ b/Items/BicholmereBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BicholmereBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BicholmereBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 14; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 14; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bicholmere Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bicholmere Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/BicholmereSpear.cs b/Items/BicholmereSpear.cs index 498ae99b..d802b7e5 100644 --- a/Items/BicholmereSpear.cs +++ b/Items/BicholmereSpear.cs @@ -4,33 +4,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BicholmereSpear : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BicholmereSpear : ModItem + { + public override void SetDefaults() + { - item.damage = 20; - item.width = 14; - item.height = 84; - item.noUseGraphic = true; - item.thrown = true; - item.useTime = 30; - item.shoot = mod.ProjectileType("BicholmereSpearPro"); - item.shootSpeed = 15f; - item.useAnimation = 30; - item.useStyle = 1; - item.knockBack = 4; - item.value = 1000; - item.rare = 2; - item.UseSound = SoundID.Item5; - item.autoReuse = true; - } + item.damage = 20; + item.width = 14; + item.height = 84; + item.noUseGraphic = true; + item.thrown = true; + item.useTime = 30; + item.shoot = mod.ProjectileType("BicholmereSpearPro"); + item.shootSpeed = 15f; + item.useAnimation = 30; + item.useStyle = 1; + item.knockBack = 4; + item.value = 1000; + item.rare = 2; + item.UseSound = SoundID.Item5; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bicholmere Spear"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bicholmere Spear"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/BigBottledSpirit.cs b/Items/BigBottledSpirit.cs index 1d54062e..b87dc85c 100644 --- a/Items/BigBottledSpirit.cs +++ b/Items/BigBottledSpirit.cs @@ -6,59 +6,59 @@ namespace Tremor.Items { - public class BigBottledSpirit : ModItem - { - public override bool CanEquipAccessory(Player player, int slot) - { - for (int i = 0; i < player.armor.Length; i++) - { - MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - if (modPlayer.spirit == true) - { - return false; - } - } - return true; - } + public class BigBottledSpirit : ModItem + { + public override bool CanEquipAccessory(Player player, int slot) + { + for (int i = 0; i < player.armor.Length; i++) + { + MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); + if (modPlayer.spirit == true) + { + return false; + } + } + return true; + } - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 44; + item.width = 22; + item.height = 44; - item.value = 80000; - item.rare = 7; - item.accessory = true; - item.defense = 4; - } + item.value = 80000; + item.rare = 7; + item.accessory = true; + item.defense = 4; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Big Bottled Spirit"); - Tooltip.SetDefault("Using flask also spawns four homing souls\nDamage of the souls scales on flask damage"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Big Bottled Spirit"); + Tooltip.SetDefault("Using flask also spawns four homing souls\nDamage of the souls scales on flask damage"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - player.AddBuff(mod.BuffType("BigBottledSpirit"), 2); - modPlayer.spirit = true; - } + public override void UpdateAccessory(Player player, bool hideVisual) + { + MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); + player.AddBuff(mod.BuffType("BigBottledSpirit"), 2); + modPlayer.spirit = true; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Bottle, 3); - recipe.AddIngredient(ItemID.HallowedBar, 12); - recipe.AddIngredient(ItemID.Ectoplasm, 15); - recipe.AddIngredient(ItemID.Sapphire, 8); - recipe.AddIngredient(null, "BottledSpirit", 1); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Bottle, 3); + recipe.AddIngredient(ItemID.HallowedBar, 12); + recipe.AddIngredient(ItemID.Ectoplasm, 15); + recipe.AddIngredient(ItemID.Sapphire, 8); + recipe.AddIngredient(null, "BottledSpirit", 1); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } } diff --git a/Items/BigHealingFlack.cs b/Items/BigHealingFlack.cs index 2613c1fc..93e91061 100644 --- a/Items/BigHealingFlack.cs +++ b/Items/BigHealingFlack.cs @@ -6,84 +6,86 @@ using System.Linq; using Terraria.ModLoader; -namespace Tremor.Items { -public class BigHealingFlack : AlchemistItem +namespace Tremor.Items { + public class BigHealingFlack : AlchemistItem + { - public override void SetDefaults() - { - item.crit = 4; - item.damage = 22; - //item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("BigHealingFlackPro"); - item.shootSpeed = 8f; - item.useStyle = 1; - item.knockBack = 1; - item.UseSound = SoundID.Item106; - item.value = 200; - item.rare = 4; - item.autoReuse = false; + public override void SetDefaults() + { + item.crit = 4; + item.damage = 22; + //item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("BigHealingFlackPro"); + item.shootSpeed = 8f; + item.useStyle = 1; + item.knockBack = 1; + item.UseSound = SoundID.Item106; + item.value = 200; + item.rare = 4; + item.autoReuse = false; - item.ammo = mod.ItemType("BoomFlask"); - } + item.ammo = mod.ItemType("BoomFlask"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Big Healing Flask"); - Tooltip.SetDefault("Throws a flask that explodes into clouds\nClouds deal damage to enemies and heal player if hit enemy"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Big Healing Flask"); + Tooltip.SetDefault("Throws a flask that explodes into clouds\nClouds deal damage to enemies and heal player if hit enemy"); + } - public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) - { - type = mod.ProjectileType("HealingCloudPro"); - } + public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) + { + type = mod.ProjectileType("HealingCloudPro"); + } + + public override void UpdateInventory(Player player) + { + MPlayer modPlayer = player.GetModPlayer(mod); + if (modPlayer.novaHelmet) + { + item.autoReuse = true; + } + if (!modPlayer.novaHelmet) + { + item.autoReuse = false; + } - public override void UpdateInventory(Player player) - { - MPlayer modPlayer = player.GetModPlayer(mod); - if (modPlayer.novaHelmet) - { - item.autoReuse = true; - } - if (!modPlayer.novaHelmet) - { - item.autoReuse = false; - } - - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) - { - item.shootSpeed = 11f; - } - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) - { - item.shootSpeed = 8f; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) - { - item.autoReuse = true; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) - { - item.autoReuse = false; - } - } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) + { + item.shootSpeed = 11f; + } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) + { + item.shootSpeed = 8f; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) + { + item.autoReuse = true; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) + { + item.autoReuse = false; + } + } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "LesserHealingFlack", 25); - recipe.AddIngredient(null, "StoneofLife", 1); + recipe.AddIngredient(null, "LesserHealingFlack", 25); + recipe.AddIngredient(null, "StoneofLife", 1); recipe.AddIngredient(ItemID.PixieDust, 3); recipe.SetResult(this, 20); recipe.AddRecipe(); } -}} + } +} diff --git a/Items/BigManaFlask.cs b/Items/BigManaFlask.cs index df43d142..11e7e975 100644 --- a/Items/BigManaFlask.cs +++ b/Items/BigManaFlask.cs @@ -6,82 +6,84 @@ using System.Linq; using Terraria.ModLoader; -namespace Tremor.Items { -public class BigManaFlask : AlchemistItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.crit = 4; - item.damage = 22; - //item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("BigManaFlaskPro"); - item.shootSpeed = 8f; - item.useStyle = 1; - item.knockBack = 1; - item.UseSound = SoundID.Item106; - item.value = 200; - item.rare = 4; - item.autoReuse = false; + public class BigManaFlask : AlchemistItem + { + public override void SetDefaults() + { + item.crit = 4; + item.damage = 22; + //item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("BigManaFlaskPro"); + item.shootSpeed = 8f; + item.useStyle = 1; + item.knockBack = 1; + item.UseSound = SoundID.Item106; + item.value = 200; + item.rare = 4; + item.autoReuse = false; - item.ammo = mod.ItemType("BoomFlask"); - } + item.ammo = mod.ItemType("BoomFlask"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Big Mana Flask"); - Tooltip.SetDefault("Throws a flask that explodes into clouds\nClouds deal damage to enemies and restore mana"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Big Mana Flask"); + Tooltip.SetDefault("Throws a flask that explodes into clouds\nClouds deal damage to enemies and restore mana"); + } - public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) - { - type = mod.ProjectileType("ManaCloudPro"); - } - public override void UpdateInventory(Player player) - { - MPlayer modPlayer = player.GetModPlayer(mod); - if (modPlayer.novaHelmet) - { - item.autoReuse = true; - } - if (!modPlayer.novaHelmet) - { - item.autoReuse = false; - } - - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) - { - item.shootSpeed = 11f; - } - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) - { - item.shootSpeed = 8f; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) - { - item.autoReuse = true; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) - { - item.autoReuse = false; - } - } + public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) + { + type = mod.ProjectileType("ManaCloudPro"); + } + public override void UpdateInventory(Player player) + { + MPlayer modPlayer = player.GetModPlayer(mod); + if (modPlayer.novaHelmet) + { + item.autoReuse = true; + } + if (!modPlayer.novaHelmet) + { + item.autoReuse = false; + } + + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) + { + item.shootSpeed = 11f; + } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) + { + item.shootSpeed = 8f; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) + { + item.autoReuse = true; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) + { + item.autoReuse = false; + } + } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "LesserManaFlask", 25); - recipe.AddIngredient(ItemID.FallenStar, 3); + recipe.AddIngredient(null, "LesserManaFlask", 25); + recipe.AddIngredient(ItemID.FallenStar, 3); recipe.AddIngredient(ItemID.SoulofLight, 1); recipe.SetResult(this, 20); recipe.AddRecipe(); } -}} + } +} diff --git a/Items/BigPoisonFlask.cs b/Items/BigPoisonFlask.cs index ec38e066..986f7812 100644 --- a/Items/BigPoisonFlask.cs +++ b/Items/BigPoisonFlask.cs @@ -9,82 +9,83 @@ namespace Tremor.Items { public class BigPoisonFlask : AlchemistItem - { + { - public override void SetDefaults() - { - item.crit = 4; - item.damage = 40; - //item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("BigPoisonFlaskPro"); - item.shootSpeed = 8f; - item.useStyle = 1; - item.knockBack = 1; - item.UseSound = SoundID.Item106; - item.value = 200; - item.rare = 4; - item.autoReuse = false; + public override void SetDefaults() + { + item.crit = 4; + item.damage = 40; + //item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("BigPoisonFlaskPro"); + item.shootSpeed = 8f; + item.useStyle = 1; + item.knockBack = 1; + item.UseSound = SoundID.Item106; + item.value = 200; + item.rare = 4; + item.autoReuse = false; - item.ammo = mod.ItemType("BoomFlask"); - } + item.ammo = mod.ItemType("BoomFlask"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Big Poison Flask"); - Tooltip.SetDefault("Throws a flask that explodes into poison clouds\nClouds deal damage to enemies and poisons them"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Big Poison Flask"); + Tooltip.SetDefault("Throws a flask that explodes into poison clouds\nClouds deal damage to enemies and poisons them"); + } - public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) - { - type = mod.ProjectileType("PoisonCloudPro"); - } + public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) + { + type = mod.ProjectileType("PoisonCloudPro"); + } + + public override void UpdateInventory(Player player) + { + MPlayer modPlayer = player.GetModPlayer(mod); + if (modPlayer.novaHelmet) + { + item.autoReuse = true; + } + if (!modPlayer.novaHelmet) + { + item.autoReuse = false; + } - public override void UpdateInventory(Player player) - { - MPlayer modPlayer = player.GetModPlayer(mod); - if (modPlayer.novaHelmet) - { - item.autoReuse = true; - } - if (!modPlayer.novaHelmet) - { - item.autoReuse = false; - } - - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) - { - item.shootSpeed = 11f; - } - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) - { - item.shootSpeed = 8f; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) - { - item.autoReuse = true; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) - { - item.autoReuse = false; - } - } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) + { + item.shootSpeed = 11f; + } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) + { + item.shootSpeed = 8f; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) + { + item.autoReuse = true; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) + { + item.autoReuse = false; + } + } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "LesserPoisonFlask", 45); - recipe.AddIngredient(ItemID.Vine, 2); - recipe.AddIngredient(ItemID.SoulofLight, 3); + recipe.AddIngredient(null, "LesserPoisonFlask", 45); + recipe.AddIngredient(ItemID.Vine, 2); + recipe.AddIngredient(ItemID.SoulofLight, 3); recipe.SetResult(this, 30); recipe.AddRecipe(); } -}} + } +} diff --git a/Items/BigVenomFlask.cs b/Items/BigVenomFlask.cs index a603262e..484c94dd 100644 --- a/Items/BigVenomFlask.cs +++ b/Items/BigVenomFlask.cs @@ -9,82 +9,83 @@ namespace Tremor.Items { public class BigVenomFlask : AlchemistItem - { + { - public override void SetDefaults() - { - item.crit = 4; - item.damage = 60; - //item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("BigVenomFlaskPro"); - item.shootSpeed = 8f; - item.useStyle = 1; - item.knockBack = 1; - item.UseSound = SoundID.Item106; - item.value = 200; - item.rare = 4; - item.autoReuse = false; + public override void SetDefaults() + { + item.crit = 4; + item.damage = 60; + //item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("BigVenomFlaskPro"); + item.shootSpeed = 8f; + item.useStyle = 1; + item.knockBack = 1; + item.UseSound = SoundID.Item106; + item.value = 200; + item.rare = 4; + item.autoReuse = false; - item.ammo = mod.ItemType("BoomFlask"); - } + item.ammo = mod.ItemType("BoomFlask"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Big Venom Flask"); - Tooltip.SetDefault("Throws a flask that explodes into venom clouds\nClouds deal damage to enemies and poison them"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Big Venom Flask"); + Tooltip.SetDefault("Throws a flask that explodes into venom clouds\nClouds deal damage to enemies and poison them"); + } - public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) - { - type = mod.ProjectileType("PurpleCloudPro"); - } + public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) + { + type = mod.ProjectileType("PurpleCloudPro"); + } - public override void UpdateInventory(Player player) - { + public override void UpdateInventory(Player player) + { MPlayer modPlayer = player.GetModPlayer(mod); - if (modPlayer.novaHelmet) - { - item.autoReuse = true; - } - if (!modPlayer.novaHelmet) - { - item.autoReuse = false; - } - - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) - { - item.shootSpeed = 11f; - } - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) - { - item.shootSpeed = 8f; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) - { - item.autoReuse = true; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) - { - item.autoReuse = false; - } - } + if (modPlayer.novaHelmet) + { + item.autoReuse = true; + } + if (!modPlayer.novaHelmet) + { + item.autoReuse = false; + } + + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) + { + item.shootSpeed = 11f; + } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) + { + item.shootSpeed = 8f; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) + { + item.autoReuse = true; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) + { + item.autoReuse = false; + } + } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "LesserVenomFlask", 40); - recipe.AddIngredient(ItemID.Vine, 2); - recipe.AddIngredient(ItemID.SoulofNight, 3); + recipe.AddIngredient(null, "LesserVenomFlask", 40); + recipe.AddIngredient(ItemID.Vine, 2); + recipe.AddIngredient(ItemID.SoulofNight, 3); recipe.SetResult(this, 25); recipe.AddRecipe(); } -}} + } +} diff --git a/Items/BirbStaff.cs b/Items/BirbStaff.cs index 9e33a896..51f015d0 100644 --- a/Items/BirbStaff.cs +++ b/Items/BirbStaff.cs @@ -29,28 +29,28 @@ public override void SetDefaults() item.shootSpeed = 1f; item.buffType = mod.BuffType("BirbStaffBuff"); item.buffTime = 3600; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Birb Staff"); - Tooltip.SetDefault("Summons a birb to fight for you."); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Birb Staff"); + Tooltip.SetDefault("Summons a birb to fight for you."); + } public override bool AltFunctionUse(Player player) { return true; } - + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { return player.altFunctionUse != 2; } - + public override bool UseItem(Player player) { - if(player.altFunctionUse == 2) + if (player.altFunctionUse == 2) { player.MinionNPCTargetAim(); } diff --git a/Items/BlackCauldron.cs b/Items/BlackCauldron.cs index 5a13e0cd..30abcd98 100644 --- a/Items/BlackCauldron.cs +++ b/Items/BlackCauldron.cs @@ -7,32 +7,34 @@ using Terraria.ModLoader; -namespace Tremor.Items { -public class BlackCauldron : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.width = 22; - item.height = 44; - - - item.value = 100000; - item.rare = 4; - item.accessory = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Black Cauldron"); - Tooltip.SetDefault("Increased alchemic damage by 12%\nAlchemical weapons confuse your enemies"); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(8, 4)); - } - - - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.GetModPlayer(mod).alchemistDamage += 0.12f; - player.AddBuff(mod.BuffType("CursedCloudBuff"), 2); - } -}} + public class BlackCauldron : ModItem + { + public override void SetDefaults() + { + + item.width = 22; + item.height = 44; + + + item.value = 100000; + item.rare = 4; + item.accessory = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Black Cauldron"); + Tooltip.SetDefault("Increased alchemic damage by 12%\nAlchemical weapons confuse your enemies"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(8, 4)); + } + + + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.GetModPlayer(mod).alchemistDamage += 0.12f; + player.AddBuff(mod.BuffType("CursedCloudBuff"), 2); + } + } +} diff --git a/Items/BlackHoleCannon.cs b/Items/BlackHoleCannon.cs index f0c0fd52..39379933 100644 --- a/Items/BlackHoleCannon.cs +++ b/Items/BlackHoleCannon.cs @@ -5,34 +5,36 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BlackHoleCannon : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BlackHoleCannon : ModItem + { + public override void SetDefaults() + { - item.damage = 250; - item.magic = true; - item.mana = 15; - item.width = 68; - item.height = 28; - item.useTime = 60; - item.useAnimation = 60; - item.shoot = 617; - item.shootSpeed = 15f; - item.useStyle = 5; - item.knockBack = 4; - item.value = 20000; + item.damage = 250; + item.magic = true; + item.mana = 15; + item.width = 68; + item.height = 28; + item.useTime = 60; + item.useAnimation = 60; + item.shoot = 617; + item.shootSpeed = 15f; + item.useStyle = 5; + item.knockBack = 4; + item.value = 20000; - item.rare = 11; - item.UseSound = SoundID.Item12; - item.autoReuse = true; - } + item.rare = 11; + item.UseSound = SoundID.Item12; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Blackhole Cannon"); - Tooltip.SetDefault("Shoots deadly black holes"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Blackhole Cannon"); + Tooltip.SetDefault("Shoots deadly black holes"); + } -}} + } +} diff --git a/Items/BlackRose.cs b/Items/BlackRose.cs index af5afc29..15d6188b 100644 --- a/Items/BlackRose.cs +++ b/Items/BlackRose.cs @@ -3,34 +3,36 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { -//ported from my tAPI mod because I don't want to make more artwork -public class BlackRose : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + //ported from my tAPI mod because I don't want to make more artwork + public class BlackRose : ModItem + { + public override void SetDefaults() + { - item.damage = 16; - item.magic = true; - item.width = 20; - item.height = 12; - item.useTime = 7; - item.useAnimation = 28; - item.useStyle = 5; - item.knockBack = 6; - item.value = Item.buyPrice(0, 5, 0, 0); - item.rare = 3; - item.mana = 5; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.shoot = mod.ProjectileType("BlackRosePro"); - item.shootSpeed = 30f; - } + item.damage = 16; + item.magic = true; + item.width = 20; + item.height = 12; + item.useTime = 7; + item.useAnimation = 28; + item.useStyle = 5; + item.knockBack = 6; + item.value = Item.buyPrice(0, 5, 0, 0); + item.rare = 3; + item.mana = 5; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.shoot = mod.ProjectileType("BlackRosePro"); + item.shootSpeed = 30f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Black Rose"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Black Rose"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/BlacksmithHammer.cs b/Items/BlacksmithHammer.cs index 9a11daa6..5fa21159 100644 --- a/Items/BlacksmithHammer.cs +++ b/Items/BlacksmithHammer.cs @@ -4,31 +4,33 @@ using Terraria.ModLoader; using Terraria.ID; -namespace Tremor.Items { -public class BlacksmithHammer : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BlacksmithHammer : ModItem + { + public override void SetDefaults() + { - item.damage = 27; - item.melee = true; - item.width = 56; - item.height = 56; - item.useTime = 22; - item.useAnimation = 45; - item.useStyle = 1; - item.knockBack = 3; - item.value = 15000; - item.rare = 3; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 27; + item.melee = true; + item.width = 56; + item.height = 56; + item.useTime = 22; + item.useAnimation = 45; + item.useStyle = 1; + item.knockBack = 3; + item.value = 15000; + item.rare = 3; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Blacksmith Hammer"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Blacksmith Hammer"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/BladeofDarkness.cs b/Items/BladeofDarkness.cs index f2236d56..a92d9c34 100644 --- a/Items/BladeofDarkness.cs +++ b/Items/BladeofDarkness.cs @@ -5,50 +5,51 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BladeofDarkness : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BladeofDarkness : ModItem + { + public override void SetDefaults() + { - item.damage = 75; - item.melee = true; - item.width = 50; - item.height = 52; - item.useTime = 25; - item.useAnimation = 25; - item.useStyle = 1; - item.shoot = mod.ProjectileType("GloomSphere"); - item.shootSpeed = 10f; - item.knockBack = 4; - item.value = 10000; - item.rare = 8; - item.UseSound = SoundID.Item71; - item.autoReuse = false; - } + item.damage = 75; + item.melee = true; + item.width = 50; + item.height = 52; + item.useTime = 25; + item.useAnimation = 25; + item.useStyle = 1; + item.shoot = mod.ProjectileType("GloomSphere"); + item.shootSpeed = 10f; + item.knockBack = 4; + item.value = 10000; + item.rare = 8; + item.UseSound = SoundID.Item71; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Blade of Darkness"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Blade of Darkness"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.SoulofNight, 12); - recipe.AddIngredient(ItemID.Amethyst, 10); - recipe.AddIngredient(ItemID.BoneSword); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.SoulofNight, 12); + recipe.AddIngredient(ItemID.Amethyst, 10); + recipe.AddIngredient(ItemID.BoneSword); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 27); - } -} + public override void MeleeEffects(Player player, Rectangle hitbox) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 27); + } + } } diff --git a/Items/BlastFurnace.cs b/Items/BlastFurnace.cs index 45ed2d7c..90423698 100644 --- a/Items/BlastFurnace.cs +++ b/Items/BlastFurnace.cs @@ -4,39 +4,41 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BlastFurnace : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BlastFurnace : ModItem + { + public override void SetDefaults() + { - item.width = 28; - item.height = 14; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 150; - item.createTile = mod.TileType("BlastFurnace"); - } + item.width = 28; + item.height = 14; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 150; + item.createTile = mod.TileType("BlastFurnace"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Blast Furnace"); - Tooltip.SetDefault("Used to craft alloys"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Blast Furnace"); + Tooltip.SetDefault("Used to craft alloys"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.GrayBrick, 25); - recipe.AddIngredient(null, "Charcoal", 15); - recipe.AddIngredient(ItemID.LavaBucket, 1); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.GrayBrick, 25); + recipe.AddIngredient(null, "Charcoal", 15); + recipe.AddIngredient(ItemID.LavaBucket, 1); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Blasticyde.cs b/Items/Blasticyde.cs index 2191d222..1a74dcc1 100644 --- a/Items/Blasticyde.cs +++ b/Items/Blasticyde.cs @@ -4,23 +4,25 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Blasticyde : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Blasticyde : ModItem + { + public override void SetDefaults() + { - item.width = 14; - item.height = 22; - item.maxStack = 999; - item.rare = 11; - item.value = Item.buyPrice(0, 1, 0, 0); - } + item.width = 14; + item.height = 22; + item.maxStack = 999; + item.rare = 11; + item.value = Item.buyPrice(0, 1, 0, 0); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Blasticyde"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Blasticyde"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/BlazerBanner.cs b/Items/BlazerBanner.cs index 0394d9e1..5398ffe6 100644 --- a/Items/BlazerBanner.cs +++ b/Items/BlazerBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BlazerBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BlazerBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 25; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 25; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Blazer Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Blazer Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/Blizzard.cs b/Items/Blizzard.cs index 9688d901..938ba549 100644 --- a/Items/Blizzard.cs +++ b/Items/Blizzard.cs @@ -5,35 +5,36 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Blizzard : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Blizzard : ModItem + { + public override void SetDefaults() + { - item.damage = 35; - item.melee = false; - item.magic = true; - item.width = 50; - item.height = 55; - item.useTime = 12; - item.useAnimation = 12; - item.mana = 8; - item.useStyle = 5; -item.shoot = 337; - item.shootSpeed = 26f; - item.knockBack = 4; - item.value = 100000; - item.rare = 5; - item.UseSound = SoundID.Item20; - item.autoReuse = true; - } + item.damage = 35; + item.melee = false; + item.magic = true; + item.width = 50; + item.height = 55; + item.useTime = 12; + item.useAnimation = 12; + item.mana = 8; + item.useStyle = 5; + item.shoot = 337; + item.shootSpeed = 26f; + item.knockBack = 4; + item.value = 100000; + item.rare = 5; + item.UseSound = SoundID.Item20; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Blizzard"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Blizzard"); + Tooltip.SetDefault(""); + } -} + } } diff --git a/Items/BlizzardMusicBox.cs b/Items/BlizzardMusicBox.cs index ec68f249..12305f9d 100644 --- a/Items/BlizzardMusicBox.cs +++ b/Items/BlizzardMusicBox.cs @@ -25,11 +25,11 @@ public override void SetDefaults() item.accessory = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Music Box (Blizzard)"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Music Box (Blizzard)"); + Tooltip.SetDefault(""); + } } } diff --git a/Items/BloodCarnage.cs b/Items/BloodCarnage.cs index d4d27164..15be7b2e 100644 --- a/Items/BloodCarnage.cs +++ b/Items/BloodCarnage.cs @@ -5,47 +5,49 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BloodCarnage : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BloodCarnage : ModItem + { + public override void SetDefaults() + { - item.damage = 44; - item.melee = true; - item.width = 44; - item.height = 44; - item.useTime = 26; - item.useAnimation = 26; - item.useStyle = 1; - item.knockBack = 4; - item.value = 60000; - item.rare = 3; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 44; + item.melee = true; + item.width = 44; + item.height = 44; + item.useTime = 26; + item.useAnimation = 26; + item.useStyle = 1; + item.knockBack = 4; + item.value = 60000; + item.rare = 3; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Blood Carnage"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Blood Carnage"); + Tooltip.SetDefault(""); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 60); - } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(795, 1); - recipe.AddIngredient(155, 1); - recipe.AddIngredient(190, 1); - recipe.AddIngredient(121, 1); - recipe.SetResult(this); - recipe.AddTile(26); - recipe.AddRecipe(); - } -}} + public override void MeleeEffects(Player player, Rectangle hitbox) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 60); + } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(795, 1); + recipe.AddIngredient(155, 1); + recipe.AddIngredient(190, 1); + recipe.AddIngredient(121, 1); + recipe.SetResult(this); + recipe.AddTile(26); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Bloodbath.cs b/Items/Bloodbath.cs index 2e5aa211..28332431 100644 --- a/Items/Bloodbath.cs +++ b/Items/Bloodbath.cs @@ -5,34 +5,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Bloodbath : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Bloodbath : ModItem + { + public override void SetDefaults() + { - item.damage = 98; - item.magic = true; - item.width = 28; - item.height = 30; - item.useTime = 14; - item.useAnimation = 14; - item.shoot = 524; - item.shootSpeed = 6f; - item.mana = 6; - item.useStyle = 5; - item.knockBack = 3; - item.value = 122355; - item.rare = 5; - item.UseSound = SoundID.Item21; - item.autoReuse = true; - } + item.damage = 98; + item.magic = true; + item.width = 28; + item.height = 30; + item.useTime = 14; + item.useAnimation = 14; + item.shoot = 524; + item.shootSpeed = 6f; + item.mana = 6; + item.useStyle = 5; + item.knockBack = 3; + item.value = 122355; + item.rare = 5; + item.UseSound = SoundID.Item21; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bloodbath"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bloodbath"); + Tooltip.SetDefault(""); + } public override void AddRecipes() @@ -44,5 +45,6 @@ public override void AddRecipes() recipe.AddTile(412); recipe.SetResult(this); recipe.AddRecipe(); - } -}} + } + } +} diff --git a/Items/BloodmoonPotion.cs b/Items/BloodmoonPotion.cs index 5f6c467b..3b40e97d 100644 --- a/Items/BloodmoonPotion.cs +++ b/Items/BloodmoonPotion.cs @@ -4,54 +4,56 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class BloodmoonPotion : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.width = 38; - item.height = 32; - item.maxStack = 20; - - item.rare = 6; - item.useAnimation = 15; - item.useTime = 15; - item.useStyle = 2; - item.UseSound = SoundID.Item3; - item.consumable = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bloodmoon Potion"); - Tooltip.SetDefault("Summons Blood Moon"); - } - - - public override bool CanUseItem(Player player) - { - if (!Main.dayTime && !Main.bloodMoon) - return true; - return false; - } - - public override bool UseItem(Player player) - { - Main.bloodMoon = true; - return true; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Bottle, 1); - recipe.AddIngredient(520, 1); - recipe.AddIngredient(521, 1); - recipe.AddIngredient(null, "SkullTeeth", 1); - recipe.AddTile(13); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + + public class BloodmoonPotion : ModItem + { + public override void SetDefaults() + { + + item.width = 38; + item.height = 32; + item.maxStack = 20; + + item.rare = 6; + item.useAnimation = 15; + item.useTime = 15; + item.useStyle = 2; + item.UseSound = SoundID.Item3; + item.consumable = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bloodmoon Potion"); + Tooltip.SetDefault("Summons Blood Moon"); + } + + + public override bool CanUseItem(Player player) + { + if (!Main.dayTime && !Main.bloodMoon) + return true; + return false; + } + + public override bool UseItem(Player player) + { + Main.bloodMoon = true; + return true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Bottle, 1); + recipe.AddIngredient(520, 1); + recipe.AddIngredient(521, 1); + recipe.AddIngredient(null, "SkullTeeth", 1); + recipe.AddTile(13); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/BloodmoonWarriorBanner.cs b/Items/BloodmoonWarriorBanner.cs index 89060c28..83c8de98 100644 --- a/Items/BloodmoonWarriorBanner.cs +++ b/Items/BloodmoonWarriorBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BloodmoonWarriorBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BloodmoonWarriorBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 6; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 6; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bloodmoon Warrior Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bloodmoon Warrior Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/Bloodshed.cs b/Items/Bloodshed.cs index 18bbb3ff..120fcf3c 100644 --- a/Items/Bloodshed.cs +++ b/Items/Bloodshed.cs @@ -4,50 +4,52 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Bloodshed : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.width = 22; - item.height = 44; - - - - item.value = 10000; - item.rare = 3; - item.defense = 6; - item.accessory = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bloodshed"); - Tooltip.SetDefault("8% increased melee, magic and minion damage\nIncreases maximum mana and health by 60\nIncreases melee and magic critical strike chance by 10%"); - } - - - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.magicDamage += 0.08f; - player.minionDamage += 0.08f; - player.meleeDamage += 0.08f; - player.statManaMax2 += 60; - player.statLifeMax2 += 60; - player.meleeCrit += 10; - player.magicCrit += 10; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "JungleWrath", 1); - recipe.AddIngredient(null, "CrimtaneProtector", 1); - recipe.AddIngredient(null, "WaterStorm", 1); - recipe.AddIngredient(null, "Candent", 1); - recipe.SetResult(this); - recipe.AddTile(null, "GreatAnvilTile"); - recipe.AddRecipe(); - } -}} + public class Bloodshed : ModItem + { + public override void SetDefaults() + { + + item.width = 22; + item.height = 44; + + + + item.value = 10000; + item.rare = 3; + item.defense = 6; + item.accessory = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bloodshed"); + Tooltip.SetDefault("8% increased melee, magic and minion damage\nIncreases maximum mana and health by 60\nIncreases melee and magic critical strike chance by 10%"); + } + + + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.magicDamage += 0.08f; + player.minionDamage += 0.08f; + player.meleeDamage += 0.08f; + player.statManaMax2 += 60; + player.statLifeMax2 += 60; + player.meleeCrit += 10; + player.magicCrit += 10; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "JungleWrath", 1); + recipe.AddIngredient(null, "CrimtaneProtector", 1); + recipe.AddIngredient(null, "WaterStorm", 1); + recipe.AddIngredient(null, "Candent", 1); + recipe.SetResult(this); + recipe.AddTile(null, "GreatAnvilTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/BloodyBow.cs b/Items/BloodyBow.cs index f66e265b..170219b4 100644 --- a/Items/BloodyBow.cs +++ b/Items/BloodyBow.cs @@ -5,49 +5,51 @@ using Terraria.ModLoader; using Microsoft.Xna.Framework; -namespace Tremor.Items { -public class BloodyBow : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BloodyBow : ModItem + { + public override void SetDefaults() + { - item.damage = 59; - item.width = 16; - item.height = 32; - item.ranged = true; - item.useTime = 30; - item.shoot = 1; + item.damage = 59; + item.width = 16; + item.height = 32; + item.ranged = true; + item.useTime = 30; + item.shoot = 1; - item.shootSpeed = 60f; - item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 5; - item.value = 1040; - item.useAmmo = AmmoID.Arrow; - item.rare = 6; - item.crit = 7; - item.UseSound = SoundID.Item5; - item.autoReuse = true; - } + item.shootSpeed = 60f; + item.useAnimation = 30; + item.useStyle = 5; + item.knockBack = 5; + item.value = 1040; + item.useAmmo = AmmoID.Arrow; + item.rare = 6; + item.crit = 7; + item.UseSound = SoundID.Item5; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bloody Bow"); - Tooltip.SetDefault("Launches arrows at lightning speed!"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bloody Bow"); + Tooltip.SetDefault("Launches arrows at lightning speed!"); + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { type = mod.ProjectileType("BloodyArrow"); return base.Shoot(player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "SkullTeeth", 4); - recipe.AddIngredient(null, "SteelBar", 15); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "SkullTeeth", 4); + recipe.AddIngredient(null, "SteelBar", 15); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Bloomstone.cs b/Items/Bloomstone.cs index d7594bd8..646356e4 100644 --- a/Items/Bloomstone.cs +++ b/Items/Bloomstone.cs @@ -4,35 +4,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Bloomstone : ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 24; - item.height = 28; - item.value = 50000; - - item.rare = 1; - item.accessory = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bloomstone"); - Tooltip.SetDefault("You are glowing during night"); - } - - - public override void UpdateAccessory(Player player, bool hideVisual) - - { - if (!Main.dayTime) - { - player.AddBuff(11, 10); - player.AddBuff(12, 10); - } - } -}} + public class Bloomstone : ModItem + { + + public override void SetDefaults() + { + + item.width = 24; + item.height = 28; + item.value = 50000; + + item.rare = 1; + item.accessory = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bloomstone"); + Tooltip.SetDefault("You are glowing during night"); + } + + + public override void UpdateAccessory(Player player, bool hideVisual) + + { + if (!Main.dayTime) + { + player.AddBuff(11, 10); + player.AddBuff(12, 10); + } + } + } +} diff --git a/Items/BlueChristmasStocking.cs b/Items/BlueChristmasStocking.cs index 7e83fccc..0d105219 100644 --- a/Items/BlueChristmasStocking.cs +++ b/Items/BlueChristmasStocking.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BlueChristmasStocking : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BlueChristmasStocking : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 26; - item.maxStack = 99; - item.rare = 1; - item.createTile = mod.TileType("BlueChristmasStocking"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.value = 100; - item.consumable = true; - } + item.width = 22; + item.height = 26; + item.maxStack = 99; + item.rare = 1; + item.createTile = mod.TileType("BlueChristmasStocking"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.value = 100; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Blue Christmas Stocking"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Blue Christmas Stocking"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/BlueCrossguardPhasesaber.cs b/Items/BlueCrossguardPhasesaber.cs index 957ebc2c..844229cf 100644 --- a/Items/BlueCrossguardPhasesaber.cs +++ b/Items/BlueCrossguardPhasesaber.cs @@ -5,48 +5,50 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BlueCrossguardPhasesaber : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BlueCrossguardPhasesaber : ModItem + { + public override void SetDefaults() + { - item.damage = 71; - item.melee = true; - item.width = 46; - item.height = 48; - item.useTime = 25; - item.useAnimation = 25; - item.useStyle = 1; - item.knockBack = 3; - item.value = 54000; - item.rare = 5; - item.UseSound = SoundID.Item15; - item.autoReuse = true; - item.useTurn = true; - } + item.damage = 71; + item.melee = true; + item.width = 46; + item.height = 48; + item.useTime = 25; + item.useAnimation = 25; + item.useStyle = 1; + item.knockBack = 3; + item.value = 54000; + item.rare = 5; + item.UseSound = SoundID.Item15; + item.autoReuse = true; + item.useTurn = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Blue Crossguard Phasesaber"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Blue Crossguard Phasesaber"); + Tooltip.SetDefault(""); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 59); - } + public override void MeleeEffects(Player player, Rectangle hitbox) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 59); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(3764); - recipe.AddIngredient(ItemID.SoulofMight, 8); - recipe.AddIngredient(null, "SoulofMind", 8); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(3764); + recipe.AddIngredient(ItemID.SoulofMight, 8); + recipe.AddIngredient(null, "SoulofMind", 8); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/BlueKnightBreastplate.cs b/Items/BlueKnightBreastplate.cs index fc12a0d9..01a36dac 100644 --- a/Items/BlueKnightBreastplate.cs +++ b/Items/BlueKnightBreastplate.cs @@ -6,8 +6,8 @@ using Terraria.ModLoader; namespace Tremor.Items -{ -[AutoloadEquip(EquipType.Body)] +{ + [AutoloadEquip(EquipType.Body)] public class BlueKnightBreastplate : ModItem { @@ -21,21 +21,21 @@ public override void SetDefaults() item.vanity = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Blue Knight Breastplate"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Blue Knight Breastplate"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GrayKnightBreastplate", 3); - recipe.AddIngredient(ItemID.Sapphire, 1); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GrayKnightBreastplate", 3); + recipe.AddIngredient(ItemID.Sapphire, 1); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } } } diff --git a/Items/BlueKnightHelmet.cs b/Items/BlueKnightHelmet.cs index 50fbe84a..dcd0fa94 100644 --- a/Items/BlueKnightHelmet.cs +++ b/Items/BlueKnightHelmet.cs @@ -7,7 +7,7 @@ namespace Tremor.Items { -[AutoloadEquip(EquipType.Head)] + [AutoloadEquip(EquipType.Head)] public class BlueKnightHelmet : ModItem { @@ -21,21 +21,21 @@ public override void SetDefaults() item.vanity = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Blue Knight Helmet"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Blue Knight Helmet"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GrayKnightHelmet", 3); - recipe.AddIngredient(ItemID.Sapphire, 1); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GrayKnightHelmet", 3); + recipe.AddIngredient(ItemID.Sapphire, 1); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } } } diff --git a/Items/BlueSakura.cs b/Items/BlueSakura.cs index 04127c95..39205b65 100644 --- a/Items/BlueSakura.cs +++ b/Items/BlueSakura.cs @@ -32,39 +32,39 @@ public override void SetDefaults() item.buffTime = 3600; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Blue Sakura"); - Tooltip.SetDefault("Summons a blue wind to fight for you."); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Blue Sakura"); + Tooltip.SetDefault("Summons a blue wind to fight for you."); + } public override bool AltFunctionUse(Player player) { return true; } - + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { return player.altFunctionUse != 2; } - + public override bool UseItem(Player player) { - if(player.altFunctionUse == 2) + if (player.altFunctionUse == 2) { player.MinionNPCTargetAim(); } return base.UseItem(player); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Wood, 15); - recipe.AddIngredient(null, "SeaFragment", 5); - recipe.SetResult(this); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Wood, 15); + recipe.AddIngredient(null, "SeaFragment", 5); + recipe.SetResult(this); + recipe.AddRecipe(); + } } } diff --git a/Items/Blunderbuss.cs b/Items/Blunderbuss.cs index 113771a0..bf47a450 100644 --- a/Items/Blunderbuss.cs +++ b/Items/Blunderbuss.cs @@ -5,33 +5,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Blunderbuss : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Blunderbuss : ModItem + { + public override void SetDefaults() + { - item.damage = 32; - item.ranged = true; - item.width = 40; - item.height = 40; - item.useTime = 40; - item.useAnimation = 40; - item.shoot = 14; - item.shootSpeed = 8f; - item.useAmmo = AmmoID.Bullet; - item.useStyle = 5; - item.knockBack = 4; - item.value = 60000; - item.rare = 5; - item.UseSound = SoundID.Item11; - item.autoReuse = true; - } + item.damage = 32; + item.ranged = true; + item.width = 40; + item.height = 40; + item.useTime = 40; + item.useAnimation = 40; + item.shoot = 14; + item.shootSpeed = 8f; + item.useAmmo = AmmoID.Bullet; + item.useStyle = 5; + item.knockBack = 4; + item.value = 60000; + item.rare = 5; + item.UseSound = SoundID.Item11; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Blunderbuss"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Blunderbuss"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/BoltTome.cs b/Items/BoltTome.cs index 658be006..28e36511 100644 --- a/Items/BoltTome.cs +++ b/Items/BoltTome.cs @@ -5,35 +5,36 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BoltTome : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BoltTome : ModItem + { + public override void SetDefaults() + { - item.damage = 26; - item.melee = false; - item.magic = true; - item.width = 50; - item.height = 55; - item.useTime = 30; - item.mana = 7; - item.useAnimation = 30; - item.useStyle = 5; - item.shoot = 645; - item.shootSpeed = 20f; - item.knockBack = 3; - item.value = 30000; - item.rare = 3; - item.UseSound = SoundID.Item4; - item.autoReuse = false; - } + item.damage = 26; + item.melee = false; + item.magic = true; + item.width = 50; + item.height = 55; + item.useTime = 30; + item.mana = 7; + item.useAnimation = 30; + item.useStyle = 5; + item.shoot = 645; + item.shootSpeed = 20f; + item.knockBack = 3; + item.value = 30000; + item.rare = 3; + item.UseSound = SoundID.Item4; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bolt Tome"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bolt Tome"); + Tooltip.SetDefault(""); + } -} + } } diff --git a/Items/Bolter.cs b/Items/Bolter.cs index 7fc1c270..db037b81 100644 --- a/Items/Bolter.cs +++ b/Items/Bolter.cs @@ -5,45 +5,47 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Bolter : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.damage = 43; - item.ranged = true; - item.width = 46; - item.height = 32; - - - item.useTime = 9; - item.useAnimation = 9; - item.shoot = 1; - item.useAmmo = AmmoID.Arrow; - item.shootSpeed = 30f; - item.useStyle = 5; - item.knockBack = 4; - item.value = 90000; - item.rare = 7; - item.UseSound = SoundID.Item5; - item.autoReuse = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bolter"); - Tooltip.SetDefault("Quickly launches arrows\nHas 50% chance to shoot a Hellfire arrow"); - } + public class Bolter : ModItem + { + public override void SetDefaults() + { + + item.damage = 43; + item.ranged = true; + item.width = 46; + item.height = 32; + + + item.useTime = 9; + item.useAnimation = 9; + item.shoot = 1; + item.useAmmo = AmmoID.Arrow; + item.shootSpeed = 30f; + item.useStyle = 5; + item.knockBack = 4; + item.value = 90000; + item.rare = 7; + item.UseSound = SoundID.Item5; + item.autoReuse = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bolter"); + Tooltip.SetDefault("Quickly launches arrows\nHas 50% chance to shoot a Hellfire arrow"); + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - if(Main.rand.Next(2) == 0) - { - type = 41; - } + if (Main.rand.Next(2) == 0) + { + type = 41; + } return base.Shoot(player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack); } -}} + } +} diff --git a/Items/BoneArcherBanner.cs b/Items/BoneArcherBanner.cs index e9f6bbf4..0df5bb13 100644 --- a/Items/BoneArcherBanner.cs +++ b/Items/BoneArcherBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BoneArcherBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BoneArcherBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 47; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 47; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bone Archer Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bone Archer Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/BoneFlyerBanner.cs b/Items/BoneFlyerBanner.cs index e73d83b8..bc99cf8f 100644 --- a/Items/BoneFlyerBanner.cs +++ b/Items/BoneFlyerBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BoneFlyerBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BoneFlyerBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 26; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 26; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bone Flyer Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bone Flyer Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/BoneGreaves.cs b/Items/BoneGreaves.cs index ad9533d6..7067c12c 100644 --- a/Items/BoneGreaves.cs +++ b/Items/BoneGreaves.cs @@ -7,48 +7,50 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class BoneGreaves : ModItem +namespace Tremor.Items { - - - public override void SetDefaults() - { - - - - item.defense = 8; - item.width = 22; - item.height = 18; - item.value = 25000; - item.rare = 4; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bone Greaves"); - Tooltip.SetDefault("20% increased throwing critical strike chance\n6% increased ranged damage"); - } - - - public override void UpdateEquip(Player p) - { - p.thrownCrit += 20; - p.rangedDamage += 0.06f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(153, 1); - recipe.AddIngredient(3376, 1); - recipe.AddIngredient(null, "CursedSoul", 1); - recipe.AddIngredient(ItemID.SoulofNight, 3); - recipe.AddIngredient(null, "SharpenedTooth", 3); - recipe.AddIngredient(null, "TheRib", 3); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } - } + [AutoloadEquip(EquipType.Legs)] + public class BoneGreaves : ModItem + { + + + public override void SetDefaults() + { + + + + item.defense = 8; + item.width = 22; + item.height = 18; + item.value = 25000; + item.rare = 4; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bone Greaves"); + Tooltip.SetDefault("20% increased throwing critical strike chance\n6% increased ranged damage"); + } + + + public override void UpdateEquip(Player p) + { + p.thrownCrit += 20; + p.rangedDamage += 0.06f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(153, 1); + recipe.AddIngredient(3376, 1); + recipe.AddIngredient(null, "CursedSoul", 1); + recipe.AddIngredient(ItemID.SoulofNight, 3); + recipe.AddIngredient(null, "SharpenedTooth", 3); + recipe.AddIngredient(null, "TheRib", 3); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } } diff --git a/Items/BoneHelmet.cs b/Items/BoneHelmet.cs index 6aad43f5..17816edd 100644 --- a/Items/BoneHelmet.cs +++ b/Items/BoneHelmet.cs @@ -7,71 +7,73 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class BoneHelmet : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class BoneHelmet : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.defense = 5; - item.width = 26; - item.height = 22; - item.value = 2500; - item.rare = 4; - } + item.defense = 5; + item.width = 26; + item.height = 22; + item.value = 2500; + item.rare = 4; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bone Helmet"); - Tooltip.SetDefault("25% increased throwing velocity"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bone Helmet"); + Tooltip.SetDefault("25% increased throwing velocity"); + } - public override void UpdateEquip(Player p) - { - p.thrownVelocity += 0.25f; - } + public override void UpdateEquip(Player p) + { + p.thrownVelocity += 0.25f; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == mod.ItemType("BoneShell") && legs.type == mod.ItemType("BoneGreaves"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("BoneShell") && legs.type == mod.ItemType("BoneGreaves"); + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increases defense by 6"; - player.boneArmor = true; - player.statDefense += 6; + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increases defense by 6"; + player.boneArmor = true; + player.statDefense += 6; - if(Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y) > 1f && !player.rocketFrame) // Makes sure the player is actually moving - { - for (int k = 0; k < 2; k++) - { - int index= Dust.NewDust(new Vector2(player.position.X - player.velocity.X * 2f, player.position.Y - 2f - player.velocity.Y * 2f), player.width, player.height, 26, 0f, 0f, 100, default(Color), 2f); - Main.dust[index].noGravity = true; - Main.dust[index].noLight = true; - Dust dust = Main.dust[index]; - dust.velocity.X = dust.velocity.X - player.velocity.X * 0.5f; - dust.velocity.Y = dust.velocity.Y - player.velocity.Y * 0.5f; - } - } - } + if (Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y) > 1f && !player.rocketFrame) // Makes sure the player is actually moving + { + for (int k = 0; k < 2; k++) + { + int index = Dust.NewDust(new Vector2(player.position.X - player.velocity.X * 2f, player.position.Y - 2f - player.velocity.Y * 2f), player.width, player.height, 26, 0f, 0f, 100, default(Color), 2f); + Main.dust[index].noGravity = true; + Main.dust[index].noLight = true; + Dust dust = Main.dust[index]; + dust.velocity.X = dust.velocity.X - player.velocity.X * 0.5f; + dust.velocity.Y = dust.velocity.Y - player.velocity.Y * 0.5f; + } + } + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(151, 1); - recipe.AddIngredient(3374, 1); - recipe.AddIngredient(null, "CursedSoul", 1); - recipe.AddIngredient(ItemID.SoulofNight, 3); - recipe.AddIngredient(null, "SharpenedTooth", 3); - recipe.AddIngredient(null, "TheRib", 3); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(151, 1); + recipe.AddIngredient(3374, 1); + recipe.AddIngredient(null, "CursedSoul", 1); + recipe.AddIngredient(ItemID.SoulofNight, 3); + recipe.AddIngredient(null, "SharpenedTooth", 3); + recipe.AddIngredient(null, "TheRib", 3); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } } diff --git a/Items/BoneKnife.cs b/Items/BoneKnife.cs index 4b4ed01f..4957dc11 100644 --- a/Items/BoneKnife.cs +++ b/Items/BoneKnife.cs @@ -5,35 +5,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BoneKnife : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BoneKnife : ModItem + { + public override void SetDefaults() + { - item.damage = 83; - item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("BoneKnifePro"); - item.shootSpeed = 18f; - item.useStyle = 1; - item.knockBack = 4; - item.value = 7; - item.rare = 6; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 83; + item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("BoneKnifePro"); + item.shootSpeed = 18f; + item.useStyle = 1; + item.knockBack = 4; + item.value = 7; + item.rare = 6; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bone Knife"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bone Knife"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/BoneMask.cs b/Items/BoneMask.cs index 5266c354..5dfa05c3 100644 --- a/Items/BoneMask.cs +++ b/Items/BoneMask.cs @@ -5,24 +5,27 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class BoneMask : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class BoneMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 24; - item.rare = 2; - item.vanity = true; - } + item.width = 26; + item.height = 24; + item.rare = 2; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bone Mask"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bone Mask"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/BoneRepeater.cs b/Items/BoneRepeater.cs index 7f2b0c78..3bde648e 100644 --- a/Items/BoneRepeater.cs +++ b/Items/BoneRepeater.cs @@ -5,35 +5,36 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BoneRepeater : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BoneRepeater : ModItem + { + public override void SetDefaults() + { - item.damage = 28; + item.damage = 28; - item.width = 18; - item.height = 56; - item.ranged = true; - item.useTime = 30; - item.shoot = 1; - item.shootSpeed = 12f; - item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 1.8f; - item.value = 2500; - item.useAmmo = 154; - item.rare = 3; - item.UseSound = SoundID.Item5; - item.autoReuse = true; - } + item.width = 18; + item.height = 56; + item.ranged = true; + item.useTime = 30; + item.shoot = 1; + item.shootSpeed = 12f; + item.useAnimation = 30; + item.useStyle = 5; + item.knockBack = 1.8f; + item.value = 2500; + item.useAmmo = 154; + item.rare = 3; + item.UseSound = SoundID.Item5; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bone Repeater"); - Tooltip.SetDefault("Uses bones as ammo"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bone Repeater"); + Tooltip.SetDefault("Uses bones as ammo"); + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) @@ -42,14 +43,15 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX return base.Shoot(player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.HellstoneBar, 8); - recipe.AddIngredient(null, "PetrifiedSpike", 15); - recipe.AddIngredient(null, "SharpenedTooth", 9); - recipe.AddTile(18); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.HellstoneBar, 8); + recipe.AddIngredient(null, "PetrifiedSpike", 15); + recipe.AddIngredient(null, "SharpenedTooth", 9); + recipe.AddTile(18); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/BoneShell.cs b/Items/BoneShell.cs index ef94c554..b4b816ae 100644 --- a/Items/BoneShell.cs +++ b/Items/BoneShell.cs @@ -5,47 +5,49 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class BoneShell : ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 22; - item.height = 18; - - - item.value = 25000; - item.rare = 4; - item.defense = 9; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bone Shell"); - Tooltip.SetDefault("25% increased thrown damage\n6% increased ranged damage"); - } - - - public override void UpdateEquip(Player p) - { - p.thrownDamage += 0.25f; - p.rangedDamage += 0.06f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(152, 1); - recipe.AddIngredient(3375, 1); - recipe.AddIngredient(null, "CursedSoul", 1); - recipe.AddIngredient(ItemID.SoulofNight, 3); - recipe.AddIngredient(null, "SharpenedTooth", 3); - recipe.AddIngredient(null, "TheRib", 3); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + [AutoloadEquip(EquipType.Body)] + public class BoneShell : ModItem + { + + public override void SetDefaults() + { + + item.width = 22; + item.height = 18; + + + item.value = 25000; + item.rare = 4; + item.defense = 9; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bone Shell"); + Tooltip.SetDefault("25% increased thrown damage\n6% increased ranged damage"); + } + + + public override void UpdateEquip(Player p) + { + p.thrownDamage += 0.25f; + p.rangedDamage += 0.06f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(152, 1); + recipe.AddIngredient(3375, 1); + recipe.AddIngredient(null, "CursedSoul", 1); + recipe.AddIngredient(ItemID.SoulofNight, 3); + recipe.AddIngredient(null, "SharpenedTooth", 3); + recipe.AddIngredient(null, "TheRib", 3); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/BoneThrone.cs b/Items/BoneThrone.cs index 21e9affc..66bfb17f 100644 --- a/Items/BoneThrone.cs +++ b/Items/BoneThrone.cs @@ -4,40 +4,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BoneThrone : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BoneThrone : ModItem + { + public override void SetDefaults() + { - item.width = 48; - item.height = 64; - item.maxStack = 999; - item.value = 100; - item.rare = 1; - item.createTile = mod.TileType("BoneThrone"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - } + item.width = 48; + item.height = 64; + item.maxStack = 999; + item.value = 100; + item.rare = 1; + item.createTile = mod.TileType("BoneThrone"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bone Throne"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bone Throne"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Bone, 75); - recipe.AddIngredient(ItemID.Silk, 15); - recipe.SetResult(this); - recipe.AddTile(106); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Bone, 75); + recipe.AddIngredient(ItemID.Silk, 15); + recipe.SetResult(this); + recipe.AddTile(106); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Bonecrusher.cs b/Items/Bonecrusher.cs index a421006a..aab84b6a 100644 --- a/Items/Bonecrusher.cs +++ b/Items/Bonecrusher.cs @@ -5,46 +5,48 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Bonecrusher : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.autoReuse = true; - item.useStyle = 1; + public class Bonecrusher : ModItem + { + public override void SetDefaults() + { + item.autoReuse = true; + item.useStyle = 1; - item.shootSpeed = 8f; - item.shoot = mod.ProjectileType("BonecrusherPro"); - item.damage = 24; - item.width = 18; - item.height = 20; - item.UseSound = SoundID.Item1; - item.useAnimation = 14; - item.useTime = 17; - item.noUseGraphic = true; - item.noMelee = true; - item.value = 6000; - item.knockBack = 4f; - item.rare = 3; - item.thrown = true; - } + item.shootSpeed = 8f; + item.shoot = mod.ProjectileType("BonecrusherPro"); + item.damage = 24; + item.width = 18; + item.height = 20; + item.UseSound = SoundID.Item1; + item.useAnimation = 14; + item.useTime = 17; + item.noUseGraphic = true; + item.noMelee = true; + item.value = 6000; + item.knockBack = 4f; + item.rare = 3; + item.thrown = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bonecrusher"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bonecrusher"); + Tooltip.SetDefault(""); + } - -public override bool CanUseItem(Player player) -{ - for (int i = 0; i < 1000; ++i) - { - if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) - { - return false; - } - } - return true; -} -}} + + public override bool CanUseItem(Player player) + { + for (int i = 0; i < 1000; ++i) + { + if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) + { + return false; + } + } + return true; + } + } +} diff --git a/Items/BoomFlask.cs b/Items/BoomFlask.cs index 0e897a42..2532734b 100644 --- a/Items/BoomFlask.cs +++ b/Items/BoomFlask.cs @@ -9,55 +9,56 @@ namespace Tremor.Items { public class BoomFlask : AlchemistItem - { + { - public override void SetDefaults() - { - item.crit = 4; - item.damage = 18; - //item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 40; - item.useAnimation = 40; - item.shoot = mod.ProjectileType("BoomFlaskPro"); - item.shootSpeed = 10f; - item.useStyle = 1; - item.knockBack = 1; - item.UseSound = SoundID.Item106; - item.value = 145; - item.rare = 2; - item.autoReuse = false; + public override void SetDefaults() + { + item.crit = 4; + item.damage = 18; + //item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 40; + item.useAnimation = 40; + item.shoot = mod.ProjectileType("BoomFlaskPro"); + item.shootSpeed = 10f; + item.useStyle = 1; + item.knockBack = 1; + item.UseSound = SoundID.Item106; + item.value = 145; + item.rare = 2; + item.autoReuse = false; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Boom Flask"); - Tooltip.SetDefault("A vial of exploding chemicals"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Boom Flask"); + Tooltip.SetDefault("A vial of exploding chemicals"); + } - public override void UpdateInventory(Player player) - { - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) - { - item.shootSpeed = 11f; - } - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) - { - item.shootSpeed = 8f; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) - { - item.autoReuse = true; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) - { - item.autoReuse = false; - } - } -}} + public override void UpdateInventory(Player player) + { + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) + { + item.shootSpeed = 11f; + } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) + { + item.shootSpeed = 8f; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) + { + item.autoReuse = true; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) + { + item.autoReuse = false; + } + } + } +} diff --git a/Items/BoomSpear.cs b/Items/BoomSpear.cs index 8fe3b2de..7498e0bc 100644 --- a/Items/BoomSpear.cs +++ b/Items/BoomSpear.cs @@ -5,35 +5,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BoomSpear : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BoomSpear : ModItem + { + public override void SetDefaults() + { - item.damage = 18; - item.thrown = true; - item.width = 18; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 38; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = 246; - item.shootSpeed = 8f; - item.useStyle = 1; - item.knockBack = 4; - item.value = 80; - item.rare = 2; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 18; + item.thrown = true; + item.width = 18; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 38; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = 246; + item.shootSpeed = 8f; + item.useStyle = 1; + item.knockBack = 4; + item.value = 80; + item.rare = 2; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Boom Javelin"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Boom Javelin"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/Boonerang.cs b/Items/Boonerang.cs index 50577cd1..2bc55e77 100644 --- a/Items/Boonerang.cs +++ b/Items/Boonerang.cs @@ -4,56 +4,58 @@ using Terraria.ModLoader; using Terraria.ID; -namespace Tremor.Items { -public class Boonerang : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Boonerang : ModItem + { + public override void SetDefaults() + { - item.damage = 24; - item.thrown = true; - item.width = 48; - item.height = 48; - item.useTime = 14; - item.shootSpeed = 12f; - item.useAnimation = 14; - item.useStyle = 1; - item.knockBack = 3f; - item.shoot = mod.ProjectileType("BoonerangPro"); - item.value = 27600; - item.rare = 4; - item.noUseGraphic = true; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 24; + item.thrown = true; + item.width = 48; + item.height = 48; + item.useTime = 14; + item.shootSpeed = 12f; + item.useAnimation = 14; + item.useStyle = 1; + item.knockBack = 3f; + item.shoot = mod.ProjectileType("BoonerangPro"); + item.value = 27600; + item.rare = 4; + item.noUseGraphic = true; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Boonerang"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Boonerang"); + Tooltip.SetDefault(""); + } -public override bool CanUseItem(Player player) -{ - for (int i = 0; i < 1000; ++i) - { - if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) - { - return false; - } - } - return true; -} + public override bool CanUseItem(Player player) + { + for (int i = 0; i < 1000; ++i) + { + if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) + { + return false; + } + } + return true; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Bone, 45); - recipe.AddIngredient(null, "CursedSoul", 1); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Bone, 45); + recipe.AddIngredient(null, "CursedSoul", 1); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } -}} + } +} diff --git a/Items/BorealWoodArmchair.cs b/Items/BorealWoodArmchair.cs index 832c6764..d616296e 100644 --- a/Items/BorealWoodArmchair.cs +++ b/Items/BorealWoodArmchair.cs @@ -4,40 +4,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BorealWoodArmchair : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BorealWoodArmchair : ModItem + { + public override void SetDefaults() + { - item.width = 42; - item.height = 32; - item.maxStack = 99; - item.value = 100; - item.rare = 1; - item.createTile = mod.TileType("BorealWoodArmchair"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - } + item.width = 42; + item.height = 32; + item.maxStack = 99; + item.value = 100; + item.rare = 1; + item.createTile = mod.TileType("BorealWoodArmchair"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Boreal Wood Armchair"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Boreal Wood Armchair"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.BorealWood, 15); - recipe.AddIngredient(ItemID.Silk, 6); - recipe.SetResult(this); - recipe.AddTile(106); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.BorealWood, 15); + recipe.AddIngredient(ItemID.Silk, 6); + recipe.SetResult(this); + recipe.AddTile(106); + recipe.AddRecipe(); + } + } +} diff --git a/Items/BorealwoodShield.cs b/Items/BorealwoodShield.cs index 14f42ed4..5e42d85b 100644 --- a/Items/BorealwoodShield.cs +++ b/Items/BorealwoodShield.cs @@ -5,34 +5,36 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Shield)] -public class BorealwoodShield : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Shield)] + public class BorealwoodShield : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 24; - item.height = 24; - item.value = 110; - item.rare = 0; - item.accessory = true; - item.defense = 1; - } + item.width = 24; + item.height = 24; + item.value = 110; + item.rare = 0; + item.accessory = true; + item.defense = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Boreal Wood Shield"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Boreal Wood Shield"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.BorealWood, 15); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.BorealWood, 15); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Boss6MusicBox.cs b/Items/Boss6MusicBox.cs index 4c5446e4..11f0e10d 100644 --- a/Items/Boss6MusicBox.cs +++ b/Items/Boss6MusicBox.cs @@ -25,11 +25,11 @@ public override void SetDefaults() item.accessory = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Music Box (Boss 6)"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Music Box (Boss 6)"); + Tooltip.SetDefault(""); + } } } diff --git a/Items/BottledGlue.cs b/Items/BottledGlue.cs index 34c68948..af662b3f 100644 --- a/Items/BottledGlue.cs +++ b/Items/BottledGlue.cs @@ -4,32 +4,34 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BottledGlue : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BottledGlue : ModItem + { + public override void SetDefaults() + { - item.width = 14; - item.height = 22; - item.maxStack = 999; - item.rare = 3; - item.value = Item.buyPrice(0, 0, 5, 0); - } + item.width = 14; + item.height = 22; + item.maxStack = 999; + item.rare = 3; + item.value = Item.buyPrice(0, 0, 5, 0); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bottled Glue"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bottled Glue"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.BottledWater, 1); - recipe.AddIngredient(null, "LightBulb", 1); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.BottledWater, 1); + recipe.AddIngredient(null, "LightBulb", 1); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/BottledSoulOfFlight.cs b/Items/BottledSoulOfFlight.cs index 42b70a74..6bd3f8cc 100644 --- a/Items/BottledSoulOfFlight.cs +++ b/Items/BottledSoulOfFlight.cs @@ -4,49 +4,51 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BottledSoulOfFlight : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.width = 20; - item.height = 36; - item.maxStack = 1; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - - - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 150; - item.rare = 5; - item.createTile = mod.TileType("BottledSoulOfFlight"); - item.accessory = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bottled Soul of Flight"); - Tooltip.SetDefault("Grants Shiny Red Baloon effect if worn\n20% increased jump height if placed"); - } - - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(575, 5); - recipe.AddIngredient(ItemID.Bottle, 1); - recipe.SetResult(this); - recipe.AddTile(114); - recipe.AddRecipe(); - } - - public override void UpdateAccessory(Player player, bool hideVisual) - - { - player.jumpBoost = true; - } -}} + public class BottledSoulOfFlight : ModItem + { + public override void SetDefaults() + { + + item.width = 20; + item.height = 36; + item.maxStack = 1; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + + + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 150; + item.rare = 5; + item.createTile = mod.TileType("BottledSoulOfFlight"); + item.accessory = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bottled Soul of Flight"); + Tooltip.SetDefault("Grants Shiny Red Baloon effect if worn\n20% increased jump height if placed"); + } + + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(575, 5); + recipe.AddIngredient(ItemID.Bottle, 1); + recipe.SetResult(this); + recipe.AddTile(114); + recipe.AddRecipe(); + } + + public override void UpdateAccessory(Player player, bool hideVisual) + + { + player.jumpBoost = true; + } + } +} diff --git a/Items/BottledSoulOfFright.cs b/Items/BottledSoulOfFright.cs index 589c2f23..0d305afb 100644 --- a/Items/BottledSoulOfFright.cs +++ b/Items/BottledSoulOfFright.cs @@ -4,52 +4,54 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BottledSoulOfFright : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.width = 20; - item.height = 28; - item.maxStack = 1; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - - - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 150; - item.rare = 5; - item.createTile = mod.TileType("BottledSoulOfFright"); - item.accessory = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bottled Soul of Fright"); - Tooltip.SetDefault("Increases critical strike chance by 6 if worn\nIncreased critical strike chance by 2 if placed"); - } - - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(547, 5); - recipe.AddIngredient(ItemID.Bottle, 1); - recipe.SetResult(this); - recipe.AddTile(114); - recipe.AddRecipe(); - } - - public override void UpdateAccessory(Player player, bool hideVisual) - - { - player.rangedCrit += 6; - player.meleeCrit += 6; - player.magicCrit += 6; - player.thrownCrit += 6; - } -}} + public class BottledSoulOfFright : ModItem + { + public override void SetDefaults() + { + + item.width = 20; + item.height = 28; + item.maxStack = 1; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + + + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 150; + item.rare = 5; + item.createTile = mod.TileType("BottledSoulOfFright"); + item.accessory = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bottled Soul of Fright"); + Tooltip.SetDefault("Increases critical strike chance by 6 if worn\nIncreased critical strike chance by 2 if placed"); + } + + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(547, 5); + recipe.AddIngredient(ItemID.Bottle, 1); + recipe.SetResult(this); + recipe.AddTile(114); + recipe.AddRecipe(); + } + + public override void UpdateAccessory(Player player, bool hideVisual) + + { + player.rangedCrit += 6; + player.meleeCrit += 6; + player.magicCrit += 6; + player.thrownCrit += 6; + } + } +} diff --git a/Items/BottledSoulOfLight.cs b/Items/BottledSoulOfLight.cs index b13d611b..4dc9aa35 100644 --- a/Items/BottledSoulOfLight.cs +++ b/Items/BottledSoulOfLight.cs @@ -4,48 +4,50 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BottledSoulOfLight : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.width = 24; - item.height = 30; - item.maxStack = 1; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - - - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 150; - item.rare = 5; - item.createTile = mod.TileType("BottledSoulOfLight"); - item.accessory = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bottled Soul of Light"); - Tooltip.SetDefault("50% increased movement speed if worn\n20% increased movement speed if placed"); - } - - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(520, 5); - recipe.AddIngredient(ItemID.Bottle, 1); - recipe.SetResult(this); - recipe.AddTile(114); - recipe.AddRecipe(); - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.moveSpeed += 0.5f; - } -}} + public class BottledSoulOfLight : ModItem + { + public override void SetDefaults() + { + + item.width = 24; + item.height = 30; + item.maxStack = 1; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + + + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 150; + item.rare = 5; + item.createTile = mod.TileType("BottledSoulOfLight"); + item.accessory = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bottled Soul of Light"); + Tooltip.SetDefault("50% increased movement speed if worn\n20% increased movement speed if placed"); + } + + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(520, 5); + recipe.AddIngredient(ItemID.Bottle, 1); + recipe.SetResult(this); + recipe.AddTile(114); + recipe.AddRecipe(); + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.moveSpeed += 0.5f; + } + } +} diff --git a/Items/BottledSoulOfMight.cs b/Items/BottledSoulOfMight.cs index d53dda81..0e1ab049 100644 --- a/Items/BottledSoulOfMight.cs +++ b/Items/BottledSoulOfMight.cs @@ -4,52 +4,54 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BottledSoulOfMight : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.width = 24; - item.height = 24; - item.maxStack = 1; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - - - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 150; - item.rare = 5; - item.createTile = mod.TileType("BottledSoulOfMight"); - item.accessory = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bottled Soul of Might"); - Tooltip.SetDefault("12% increased damage if worn\n5% increased damage if placed"); - } - - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(548, 5); - recipe.AddIngredient(ItemID.Bottle, 1); - recipe.SetResult(this); - recipe.AddTile(114); - recipe.AddRecipe(); - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.meleeDamage += 0.12f; - player.rangedDamage += 0.12f; - player.thrownDamage += 0.12f; - player.minionDamage += 0.12f; - player.magicDamage += 0.12f; - } -}} + public class BottledSoulOfMight : ModItem + { + public override void SetDefaults() + { + + item.width = 24; + item.height = 24; + item.maxStack = 1; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + + + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 150; + item.rare = 5; + item.createTile = mod.TileType("BottledSoulOfMight"); + item.accessory = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bottled Soul of Might"); + Tooltip.SetDefault("12% increased damage if worn\n5% increased damage if placed"); + } + + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(548, 5); + recipe.AddIngredient(ItemID.Bottle, 1); + recipe.SetResult(this); + recipe.AddTile(114); + recipe.AddRecipe(); + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.meleeDamage += 0.12f; + player.rangedDamage += 0.12f; + player.thrownDamage += 0.12f; + player.minionDamage += 0.12f; + player.magicDamage += 0.12f; + } + } +} diff --git a/Items/BottledSoulOfMind.cs b/Items/BottledSoulOfMind.cs index 34d61cc0..f9004ed5 100644 --- a/Items/BottledSoulOfMind.cs +++ b/Items/BottledSoulOfMind.cs @@ -4,49 +4,51 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BottledSoulOfMind : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.width = 20; - item.height = 28; - item.maxStack = 1; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - - - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 150; - item.rare = 5; - item.createTile = mod.TileType("BottledSoulOfMind"); - item.accessory = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bottled Soul of Mind"); - Tooltip.SetDefault("Shows the location of enemies if worn\nShows the location of treasure and ore if placed"); - } - - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "SoulofMind", 5); - recipe.AddIngredient(ItemID.Bottle, 1); - recipe.SetResult(this); - recipe.AddTile(114); - recipe.AddRecipe(); - } - - public override void UpdateAccessory(Player player, bool hideVisual) - - { - player.detectCreature = true; - } -}} + public class BottledSoulOfMind : ModItem + { + public override void SetDefaults() + { + + item.width = 20; + item.height = 28; + item.maxStack = 1; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + + + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 150; + item.rare = 5; + item.createTile = mod.TileType("BottledSoulOfMind"); + item.accessory = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bottled Soul of Mind"); + Tooltip.SetDefault("Shows the location of enemies if worn\nShows the location of treasure and ore if placed"); + } + + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "SoulofMind", 5); + recipe.AddIngredient(ItemID.Bottle, 1); + recipe.SetResult(this); + recipe.AddTile(114); + recipe.AddRecipe(); + } + + public override void UpdateAccessory(Player player, bool hideVisual) + + { + player.detectCreature = true; + } + } +} diff --git a/Items/BottledSoulOfNight.cs b/Items/BottledSoulOfNight.cs index f2858731..b510543c 100644 --- a/Items/BottledSoulOfNight.cs +++ b/Items/BottledSoulOfNight.cs @@ -4,49 +4,51 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BottledSoulOfNight : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.width = 24; - item.height = 28; - item.maxStack = 1; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - - - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 150; - item.rare = 5; - item.createTile = mod.TileType("BottledSoulOfNight"); - item.accessory = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bottled Soul of Night"); - Tooltip.SetDefault("15% increased melee speed if worn\n8% increased melee speed if placed"); - } - - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(521, 5); - recipe.AddIngredient(ItemID.Bottle, 1); - recipe.SetResult(this); - recipe.AddTile(114); - recipe.AddRecipe(); - } - - public override void UpdateAccessory(Player player, bool hideVisual) - - { - player.meleeSpeed += 0.15f; - } -}} + public class BottledSoulOfNight : ModItem + { + public override void SetDefaults() + { + + item.width = 24; + item.height = 28; + item.maxStack = 1; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + + + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 150; + item.rare = 5; + item.createTile = mod.TileType("BottledSoulOfNight"); + item.accessory = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bottled Soul of Night"); + Tooltip.SetDefault("15% increased melee speed if worn\n8% increased melee speed if placed"); + } + + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(521, 5); + recipe.AddIngredient(ItemID.Bottle, 1); + recipe.SetResult(this); + recipe.AddTile(114); + recipe.AddRecipe(); + } + + public override void UpdateAccessory(Player player, bool hideVisual) + + { + player.meleeSpeed += 0.15f; + } + } +} diff --git a/Items/BottledSoulOfSight.cs b/Items/BottledSoulOfSight.cs index 280b9ac2..d2de422f 100644 --- a/Items/BottledSoulOfSight.cs +++ b/Items/BottledSoulOfSight.cs @@ -4,52 +4,54 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BottledSoulOfSight : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.width = 22; - item.height = 26; - item.maxStack = 1; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - - - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 150; - item.rare = 5; - item.createTile = mod.TileType("BottledSoulOfSight"); - item.accessory = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bottled Soul of Sight"); - Tooltip.SetDefault("Makes you shine if worn\nShows the location of enemies if placed"); - } - - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(549, 5); - recipe.AddIngredient(ItemID.Bottle, 1); - recipe.SetResult(this); - recipe.AddTile(114); - recipe.AddRecipe(); - } - - public override void UpdateAccessory(Player player, bool hideVisual) - - { - player.rangedCrit += 6; - player.meleeCrit += 6; - player.magicCrit += 6; - player.thrownCrit += 6; - } -}} + public class BottledSoulOfSight : ModItem + { + public override void SetDefaults() + { + + item.width = 22; + item.height = 26; + item.maxStack = 1; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + + + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 150; + item.rare = 5; + item.createTile = mod.TileType("BottledSoulOfSight"); + item.accessory = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bottled Soul of Sight"); + Tooltip.SetDefault("Makes you shine if worn\nShows the location of enemies if placed"); + } + + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(549, 5); + recipe.AddIngredient(ItemID.Bottle, 1); + recipe.SetResult(this); + recipe.AddTile(114); + recipe.AddRecipe(); + } + + public override void UpdateAccessory(Player player, bool hideVisual) + + { + player.rangedCrit += 6; + player.meleeCrit += 6; + player.magicCrit += 6; + player.thrownCrit += 6; + } + } +} diff --git a/Items/BottledSpirit.cs b/Items/BottledSpirit.cs index 9bdb5072..8a352099 100644 --- a/Items/BottledSpirit.cs +++ b/Items/BottledSpirit.cs @@ -6,47 +6,47 @@ namespace Tremor.Items { - public class BottledSpirit : ModItem - { - - public override bool CanEquipAccessory(Player player, int slot) - { - for (int i = 0; i < player.armor.Length; i++) - { - MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - if (modPlayer.spirit == true) - { - return false; - } - } - return true; - } - - public override void SetDefaults() - { - - item.width = 22; - item.height = 44; - - - item.value = 60000; - item.rare = 7; - item.accessory = true; - item.defense = 3; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bottled Spirit"); - Tooltip.SetDefault("Using flask also spawns two homing souls\nDamage of the souls scales on flask damage"); - } - - - public override void UpdateAccessory(Player player, bool hideVisual) - { - MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - player.AddBuff(mod.BuffType("BottledSpirit"), 2); - modPlayer.spirit = true; - } - } + public class BottledSpirit : ModItem + { + + public override bool CanEquipAccessory(Player player, int slot) + { + for (int i = 0; i < player.armor.Length; i++) + { + MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); + if (modPlayer.spirit == true) + { + return false; + } + } + return true; + } + + public override void SetDefaults() + { + + item.width = 22; + item.height = 44; + + + item.value = 60000; + item.rare = 7; + item.accessory = true; + item.defense = 3; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bottled Spirit"); + Tooltip.SetDefault("Using flask also spawns two homing souls\nDamage of the souls scales on flask damage"); + } + + + public override void UpdateAccessory(Player player, bool hideVisual) + { + MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); + player.AddBuff(mod.BuffType("BottledSpirit"), 2); + modPlayer.spirit = true; + } + } } diff --git a/Items/BounceTome.cs b/Items/BounceTome.cs index b5d57804..ebbd0e48 100644 --- a/Items/BounceTome.cs +++ b/Items/BounceTome.cs @@ -7,35 +7,35 @@ namespace Tremor.Items { - public class BounceTome : ModItem - { - public override void SetDefaults() - { - item.CloneDefaults(165); + public class BounceTome : ModItem + { + public override void SetDefaults() + { + item.CloneDefaults(165); - item.damage = 20; - item.magic = true; - item.width = 26; - item.maxStack = 1; + item.damage = 20; + item.magic = true; + item.width = 26; + item.maxStack = 1; - item.height = 30; - item.useTime = 15; - item.useAnimation = 15; - item.shoot = mod.ProjectileType("Bounce"); - item.shootSpeed = 19f; - item.useStyle = 5; - item.knockBack = 4; - item.rare = 2; - item.UseSound = SoundID.Item1; - item.autoReuse = true; + item.height = 30; + item.useTime = 15; + item.useAnimation = 15; + item.shoot = mod.ProjectileType("Bounce"); + item.shootSpeed = 19f; + item.useStyle = 5; + item.knockBack = 4; + item.rare = 2; + item.UseSound = SoundID.Item1; + item.autoReuse = true; item.mana = 5; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bounce Tome"); - Tooltip.SetDefault("Summons bouncy ball of gel"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bounce Tome"); + Tooltip.SetDefault("Summons bouncy ball of gel"); + } } } diff --git a/Items/BouncingCasing.cs b/Items/BouncingCasing.cs index 3113ab7d..659e7e9d 100644 --- a/Items/BouncingCasing.cs +++ b/Items/BouncingCasing.cs @@ -4,42 +4,44 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BouncingCasing : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BouncingCasing : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 44; + item.width = 22; + item.height = 44; - item.value = 25000; - item.rare = 5; - item.accessory = true; - item.defense = 1; - } + item.value = 25000; + item.rare = 5; + item.accessory = true; + item.defense = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bouncing Casing"); - Tooltip.SetDefault("Alchemical flasks bounce off blocks"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bouncing Casing"); + Tooltip.SetDefault("Alchemical flasks bounce off blocks"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.AddBuff(mod.BuffType("BouncingCasingBuff"), 2); - } + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.AddBuff(mod.BuffType("BouncingCasingBuff"), 2); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Bottle, 1); - recipe.AddIngredient(null, "PinkGelCube", 5); - recipe.AddIngredient(ItemID.SoulofLight, 9); - recipe.AddIngredient(ItemID.SoulofNight, 9); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Bottle, 1); + recipe.AddIngredient(null, "PinkGelCube", 5); + recipe.AddIngredient(ItemID.SoulofLight, 9); + recipe.AddIngredient(ItemID.SoulofNight, 9); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/BrainSmasher.cs b/Items/BrainSmasher.cs index 89df570c..376afabf 100644 --- a/Items/BrainSmasher.cs +++ b/Items/BrainSmasher.cs @@ -4,41 +4,43 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BrainSmasher : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BrainSmasher : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 44; + item.width = 22; + item.height = 44; - item.value = 250000; - item.rare = 7; - item.accessory = true; - item.defense = 4; - } + item.value = 250000; + item.rare = 7; + item.accessory = true; + item.defense = 4; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Brain Smasher"); - Tooltip.SetDefault("Grants a spinning ball around the player"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Brain Smasher"); + Tooltip.SetDefault("Grants a spinning ball around the player"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.AddBuff(mod.BuffType("BrainSmasherBuff"), 2); - } + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.AddBuff(mod.BuffType("BrainSmasherBuff"), 2); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BallnChain", 1); - recipe.AddIngredient(null, "GolemCore", 1); - recipe.AddIngredient(2766, 25); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "BallnChain", 1); + recipe.AddIngredient(null, "GolemCore", 1); + recipe.AddIngredient(2766, 25); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Brainiac.cs b/Items/Brainiac.cs index 9d36e7b4..43df479f 100644 --- a/Items/Brainiac.cs +++ b/Items/Brainiac.cs @@ -5,51 +5,53 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Brainiac : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.damage = 17; - item.magic = true; - item.width = 68; - item.height = 28; - item.useTime = 30; - item.useAnimation = 30; - item.mana=8; - item.shoot = mod.ProjectileType("BrainiacWavePro"); - item.shootSpeed = 5f; - item.useStyle = 5; - item.knockBack = 4; - item.value = 325000; - - item.rare = 4; - item.UseSound = SoundID.Item114; - item.autoReuse = false; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Brainiac"); - Tooltip.SetDefault("'Shoots mind waves'"); - } - - - public override Vector2? HoldoutOffset() - { - return new Vector2(-10, 0); - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "TheBrain", 1); - recipe.AddIngredient(null, "AtisBlood", 15); - recipe.AddIngredient(null, "DrippingRoot", 20); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } - -}} + public class Brainiac : ModItem + { + public override void SetDefaults() + { + + item.damage = 17; + item.magic = true; + item.width = 68; + item.height = 28; + item.useTime = 30; + item.useAnimation = 30; + item.mana = 8; + item.shoot = mod.ProjectileType("BrainiacWavePro"); + item.shootSpeed = 5f; + item.useStyle = 5; + item.knockBack = 4; + item.value = 325000; + + item.rare = 4; + item.UseSound = SoundID.Item114; + item.autoReuse = false; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Brainiac"); + Tooltip.SetDefault("'Shoots mind waves'"); + } + + + public override Vector2? HoldoutOffset() + { + return new Vector2(-10, 0); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "TheBrain", 1); + recipe.AddIngredient(null, "AtisBlood", 15); + recipe.AddIngredient(null, "DrippingRoot", 20); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + + } +} diff --git a/Items/BrambleStaff.cs b/Items/BrambleStaff.cs index 93a57e0f..76c05601 100644 --- a/Items/BrambleStaff.cs +++ b/Items/BrambleStaff.cs @@ -2,78 +2,78 @@ using Terraria.ID; using Microsoft.Xna.Framework; using Terraria.ModLoader; - -namespace Tremor.Items + +namespace Tremor.Items { - public class BrambleStaff : ModItem - { - - public override void SetDefaults() - { + public class BrambleStaff : ModItem + { - item.damage = 19; - item.mana = 10; - item.width = 44; - item.height = 44; - item.useTime = 25; - item.useAnimation = 25; - item.useStyle = 1; - item.noMelee = true; - item.knockBack = 2.5f; - item.value = Item.buyPrice(0, 1, 0, 0); - item.rare = 2; - item.UseSound = SoundID.Item44; - item.autoReuse = true; - item.shoot = mod.ProjectileType("Bramble"); - item.summon = true; - item.sentry = true; - } + public override void SetDefaults() + { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bramble Staff"); - Tooltip.SetDefault("Summons a bramble bush to spit spikes at your enemies"); - } + item.damage = 19; + item.mana = 10; + item.width = 44; + item.height = 44; + item.useTime = 25; + item.useAnimation = 25; + item.useStyle = 1; + item.noMelee = true; + item.knockBack = 2.5f; + item.value = Item.buyPrice(0, 1, 0, 0); + item.rare = 2; + item.UseSound = SoundID.Item44; + item.autoReuse = true; + item.shoot = mod.ProjectileType("Bramble"); + item.summon = true; + item.sentry = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bramble Staff"); + Tooltip.SetDefault("Summons a bramble bush to spit spikes at your enemies"); + } public override bool AltFunctionUse(Player player) { return true; } - + public override bool UseItem(Player player) { - if(player.altFunctionUse == 2) + if (player.altFunctionUse == 2) { player.MinionNPCTargetAim(); } return base.UseItem(player); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.JungleSpores, 10); - recipe.AddIngredient(ItemID.Stinger, 16); - recipe.AddIngredient(ItemID.Vine, 2); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } - - public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - Vector2 SPos = Main.screenPosition + new Vector2((float)Main.mouseX, (float)Main.mouseY); - position = SPos; - for (int l = 0; l < Main.projectile.Length; l++) - { - Projectile proj = Main.projectile[l]; - if (proj.active && proj.type == item.shoot && proj.owner == player.whoAmI) - { - proj.active = false; - } - } - return player.altFunctionUse != 2; - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.JungleSpores, 10); + recipe.AddIngredient(ItemID.Stinger, 16); + recipe.AddIngredient(ItemID.Vine, 2); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + Vector2 SPos = Main.screenPosition + new Vector2((float)Main.mouseX, (float)Main.mouseY); + position = SPos; + for (int l = 0; l < Main.projectile.Length; l++) + { + Projectile proj = Main.projectile[l]; + if (proj.active && proj.type == item.shoot && proj.owner == player.whoAmI) + { + proj.active = false; + } + } + return player.altFunctionUse != 2; + } + } } diff --git a/Items/BrassBar.cs b/Items/BrassBar.cs index 1bec9792..e38f3ddd 100644 --- a/Items/BrassBar.cs +++ b/Items/BrassBar.cs @@ -4,40 +4,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BrassBar : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BrassBar : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 300; - item.rare = 5; - item.createTile = mod.TileType("BrassBar"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 300; + item.rare = 5; + item.createTile = mod.TileType("BrassBar"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Brass Bar"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Brass Bar"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BrassNugget", 2); - recipe.AddIngredient(null, "Charcoal", 1); - recipe.SetResult(this); - recipe.AddTile(null, "BlastFurnace"); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "BrassNugget", 2); + recipe.AddIngredient(null, "Charcoal", 1); + recipe.SetResult(this); + recipe.AddTile(null, "BlastFurnace"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/BrassChainRepeater.cs b/Items/BrassChainRepeater.cs index 0f6f202b..2fedf471 100644 --- a/Items/BrassChainRepeater.cs +++ b/Items/BrassChainRepeater.cs @@ -6,57 +6,59 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BrassChainRepeater : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.ranged = true; - item.width = 36; - item.height = 24; - - - item.useTime = 11; - item.useAnimation = 11; - item.shoot = 1; - item.useAmmo = AmmoID.Arrow; - item.shootSpeed = 30f; - item.useStyle = 5; - item.damage=30; - item.knockBack = 4; - item.value = 30000; - item.rare = 5; - item.UseSound = SoundID.Item5; - item.autoReuse = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Brass Chain Repeater"); - Tooltip.SetDefault("Quickly launches arrows\n25% to shoot a heat ray"); - } - - - public override void UpdateInventory(Player player) -{ -if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SteamRangerBuff"))) -{ - item.damage=45; -} -else -{ - item.damage=30; -} -} + public class BrassChainRepeater : ModItem + { + public override void SetDefaults() + { + + item.ranged = true; + item.width = 36; + item.height = 24; + + + item.useTime = 11; + item.useAnimation = 11; + item.shoot = 1; + item.useAmmo = AmmoID.Arrow; + item.shootSpeed = 30f; + item.useStyle = 5; + item.damage = 30; + item.knockBack = 4; + item.value = 30000; + item.rare = 5; + item.UseSound = SoundID.Item5; + item.autoReuse = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Brass Chain Repeater"); + Tooltip.SetDefault("Quickly launches arrows\n25% to shoot a heat ray"); + } + + + public override void UpdateInventory(Player player) + { + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SteamRangerBuff"))) + { + item.damage = 45; + } + else + { + item.damage = 30; + } + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - if(Main.rand.Next(4) == 0) - { - type = 260; - } + if (Main.rand.Next(4) == 0) + { + type = 260; + } return base.Shoot(player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack); } -}} + } +} diff --git a/Items/BrassChestplate.cs b/Items/BrassChestplate.cs index 48ff80e0..0010429d 100644 --- a/Items/BrassChestplate.cs +++ b/Items/BrassChestplate.cs @@ -7,41 +7,41 @@ using Terraria.ID; namespace Tremor.Items -{ -[AutoloadEquip(EquipType.Body)] - public class BrassChestplate : ModItem - { - public override void SetDefaults() - { +{ + [AutoloadEquip(EquipType.Body)] + public class BrassChestplate : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 18; + item.width = 30; + item.height = 18; - item.value = 600; - item.rare = 5; - item.defense = 22; - } + item.value = 600; + item.rare = 5; + item.defense = 22; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Brass Chestplate"); - Tooltip.SetDefault("Increases maximum life by 50"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Brass Chestplate"); + Tooltip.SetDefault("Increases maximum life by 50"); + } - public override void UpdateEquip(Player player) - { - player.statLifeMax2 += 50; - } + public override void UpdateEquip(Player player) + { + player.statLifeMax2 += 50; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BrassBar", 18); - recipe.AddIngredient(ItemID.Cog, 16); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "BrassBar", 18); + recipe.AddIngredient(ItemID.Cog, 16); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } } diff --git a/Items/BrassChip.cs b/Items/BrassChip.cs index 7cab355f..ebf0834f 100644 --- a/Items/BrassChip.cs +++ b/Items/BrassChip.cs @@ -6,31 +6,31 @@ namespace Tremor.Items { - public class BrassChip : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Brass Chip"); - Tooltip.SetDefault("Shoots rockets from the sky when a flask is destroyed\nIf alchemic critical strike chance is more than 30 - alchemical damage is increased by 10%"); - } + public class BrassChip : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Brass Chip"); + Tooltip.SetDefault("Shoots rockets from the sky when a flask is destroyed\nIf alchemic critical strike chance is more than 30 - alchemical damage is increased by 10%"); + } - public override void SetDefaults() - { - item.width = 22; - item.height = 22; - item.value = 150000; - item.rare = 5; - item.defense = 4; - item.accessory = true; - } + public override void SetDefaults() + { + item.width = 22; + item.height = 22; + item.value = 150000; + item.rare = 5; + item.defense = 4; + item.accessory = true; + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.AddBuff(mod.BuffType("BrassChipBuff"), 2); - if (player.GetModPlayer(mod).alchemistCrit >= 30) - { - player.GetModPlayer(mod).alchemistDamage += 0.1f; - } - } - } + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.AddBuff(mod.BuffType("BrassChipBuff"), 2); + if (player.GetModPlayer(mod).alchemistCrit >= 30) + { + player.GetModPlayer(mod).alchemistDamage += 0.1f; + } + } + } } \ No newline at end of file diff --git a/Items/BrassGlaive.cs b/Items/BrassGlaive.cs index 12ec13c2..96917ebf 100644 --- a/Items/BrassGlaive.cs +++ b/Items/BrassGlaive.cs @@ -5,44 +5,46 @@ using System.Linq; using Terraria.ModLoader; -namespace Tremor.Items { -public class BrassGlaive : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BrassGlaive : ModItem + { + public override void SetDefaults() + { - item.damage = 60; - item.width = 76; - item.height = 78; - item.noUseGraphic = true; - item.melee = true; - item.useTime = 30; - item.shoot = mod.ProjectileType("BrassGlaive"); - item.shootSpeed = 3f; - item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 6; - item.value = 1000; - item.rare = 5; - item.UseSound = SoundID.Item71; - item.autoReuse = false; - } + item.damage = 60; + item.width = 76; + item.height = 78; + item.noUseGraphic = true; + item.melee = true; + item.useTime = 30; + item.shoot = mod.ProjectileType("BrassGlaive"); + item.shootSpeed = 3f; + item.useAnimation = 30; + item.useStyle = 5; + item.knockBack = 6; + item.value = 1000; + item.rare = 5; + item.UseSound = SoundID.Item71; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Brass Glaive"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Brass Glaive"); + Tooltip.SetDefault(""); + } - public override void UpdateInventory(Player player) -{ -if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SteamSwordBuff"))) -{ - item.damage=85; -} -else -{ - item.damage=60; -} + public override void UpdateInventory(Player player) + { + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SteamSwordBuff"))) + { + item.damage = 85; + } + else + { + item.damage = 60; + } + } + } } -}} diff --git a/Items/BrassGreaves.cs b/Items/BrassGreaves.cs index 51b49f42..50ad5e19 100644 --- a/Items/BrassGreaves.cs +++ b/Items/BrassGreaves.cs @@ -7,42 +7,42 @@ namespace Tremor.Items { - [AutoloadEquip(EquipType.Legs)] - public class BrassGreaves : ModItem - { - - - public override void SetDefaults() - { - - item.width = 22; - item.height = 18; - item.value = 500; - - item.rare = 5; - item.defense = 4; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Brass Greaves"); - Tooltip.SetDefault("15% increased movement speed"); - } - - - public override void UpdateEquip(Player player) - { - player.moveSpeed += 0.15f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BrassBar", 15); - recipe.AddIngredient(ItemID.Cog, 14); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } - } + [AutoloadEquip(EquipType.Legs)] + public class BrassGreaves : ModItem + { + + + public override void SetDefaults() + { + + item.width = 22; + item.height = 18; + item.value = 500; + + item.rare = 5; + item.defense = 4; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Brass Greaves"); + Tooltip.SetDefault("15% increased movement speed"); + } + + + public override void UpdateEquip(Player player) + { + player.moveSpeed += 0.15f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "BrassBar", 15); + recipe.AddIngredient(ItemID.Cog, 14); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } } diff --git a/Items/BrassHammer.cs b/Items/BrassHammer.cs index 7138d4b4..6c2b4cfc 100644 --- a/Items/BrassHammer.cs +++ b/Items/BrassHammer.cs @@ -4,43 +4,45 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class BrassHammer : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.damage = 40; - item.melee = true; - item.width = 42; - item.height = 40; - item.useTime = 10; - item.useAnimation = 15; - item.hammer = 95; - item.tileBoost++; - item.useStyle = 1; - item.knockBack = 6; - item.value = Item.buyPrice(0, 1, 50, 0); - item.rare = 5; - item.UseSound = SoundID.Item71; - item.autoReuse = true; - } + public class BrassHammer : ModItem + { + public override void SetDefaults() + { + + item.damage = 40; + item.melee = true; + item.width = 42; + item.height = 40; + item.useTime = 10; + item.useAnimation = 15; + item.hammer = 95; + item.tileBoost++; + item.useStyle = 1; + item.knockBack = 6; + item.value = Item.buyPrice(0, 1, 50, 0); + item.rare = 5; + item.UseSound = SoundID.Item71; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Brass Hammer"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Brass Hammer"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BrassBar", 10); - recipe.AddIngredient(ItemID.Cog, 10); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "BrassBar", 10); + recipe.AddIngredient(ItemID.Cog, 10); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/BrassHeadgear.cs b/Items/BrassHeadgear.cs index d16b66c7..6b778c26 100644 --- a/Items/BrassHeadgear.cs +++ b/Items/BrassHeadgear.cs @@ -7,61 +7,61 @@ namespace Tremor.Items { -[AutoloadEquip(EquipType.Head)] - public class BrassHeadgear : ModItem - { + [AutoloadEquip(EquipType.Head)] + public class BrassHeadgear : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 20; - item.height = 20; + item.width = 20; + item.height = 20; - item.value = 400; - item.rare = 5; - item.defense = 8; - } + item.value = 400; + item.rare = 5; + item.defense = 8; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Brass Headgear"); - Tooltip.SetDefault("10% increased magical damage\nIncreases magical critical strike chance by 8"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Brass Headgear"); + Tooltip.SetDefault("10% increased magical damage\nIncreases magical critical strike chance by 8"); + } - public override void UpdateEquip(Player player) - { - player.magicCrit += 8; - player.magicDamage += 0.1f; - } + public override void UpdateEquip(Player player) + { + player.magicCrit += 8; + player.magicDamage += 0.1f; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == mod.ItemType("BrassChestplate") && legs.type == mod.ItemType("BrassGreaves"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("BrassChestplate") && legs.type == mod.ItemType("BrassGreaves"); + } - public override void UpdateArmorSet(Player player) - { - player.AddBuff(mod.BuffType("buffSteampunkProbe"), 4); - player.AddBuff(mod.BuffType("SteamMageBuff"), 4); - player.setBonus = "Summons a friendly Steampunk Drone to defend you and increases damage of Brass Stave"; - } + public override void UpdateArmorSet(Player player) + { + player.AddBuff(mod.BuffType("buffSteampunkProbe"), 4); + player.AddBuff(mod.BuffType("SteamMageBuff"), 4); + player.setBonus = "Summons a friendly Steampunk Drone to defend you and increases damage of Brass Stave"; + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawOutlines=true; + player.armorEffectDrawOutlines = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BrassBar", 13); - recipe.AddIngredient(ItemID.Cog, 12); - recipe.AddIngredient(ItemID.Glass, 6); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "BrassBar", 13); + recipe.AddIngredient(ItemID.Cog, 12); + recipe.AddIngredient(ItemID.Glass, 6); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } } diff --git a/Items/BrassHelmet.cs b/Items/BrassHelmet.cs index 4cc82c92..a3d5a892 100644 --- a/Items/BrassHelmet.cs +++ b/Items/BrassHelmet.cs @@ -7,61 +7,61 @@ namespace Tremor.Items { -[AutoloadEquip(EquipType.Head)] - public class BrassHelmet : ModItem - { + [AutoloadEquip(EquipType.Head)] + public class BrassHelmet : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 20; - item.height = 20; + item.width = 20; + item.height = 20; - item.value = 400; - item.rare = 5; - item.defense = 8; - } + item.value = 400; + item.rare = 5; + item.defense = 8; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Brass Helmet"); - Tooltip.SetDefault("10% increased melee damage\nIncreases melee critical strike chance by 8"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Brass Helmet"); + Tooltip.SetDefault("10% increased melee damage\nIncreases melee critical strike chance by 8"); + } - public override void UpdateEquip(Player player) - { - player.meleeCrit += 8; - player.meleeDamage += 0.1f; - } + public override void UpdateEquip(Player player) + { + player.meleeCrit += 8; + player.meleeDamage += 0.1f; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == mod.ItemType("BrassChestplate") && legs.type == mod.ItemType("BrassGreaves"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("BrassChestplate") && legs.type == mod.ItemType("BrassGreaves"); + } - public override void UpdateArmorSet(Player player) - { - player.AddBuff(mod.BuffType("buffSteampunkProbe"), 4); - player.AddBuff(mod.BuffType("SteamSwordBuff"), 4); - player.setBonus = "Summons a friendly Steampunk Drone to defend you and increases damage of Brass Glaive and Rapier"; - } + public override void UpdateArmorSet(Player player) + { + player.AddBuff(mod.BuffType("buffSteampunkProbe"), 4); + player.AddBuff(mod.BuffType("SteamSwordBuff"), 4); + player.setBonus = "Summons a friendly Steampunk Drone to defend you and increases damage of Brass Glaive and Rapier"; + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawOutlines=true; + player.armorEffectDrawOutlines = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BrassBar", 13); - recipe.AddIngredient(ItemID.Cog, 12); - recipe.AddIngredient(ItemID.Glass, 6); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "BrassBar", 13); + recipe.AddIngredient(ItemID.Cog, 12); + recipe.AddIngredient(ItemID.Glass, 6); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } } diff --git a/Items/BrassMask.cs b/Items/BrassMask.cs index f7031cc5..6ecc1365 100644 --- a/Items/BrassMask.cs +++ b/Items/BrassMask.cs @@ -7,61 +7,61 @@ namespace Tremor.Items { -[AutoloadEquip(EquipType.Head)] - public class BrassMask : ModItem - { + [AutoloadEquip(EquipType.Head)] + public class BrassMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 20; - item.height = 20; + item.width = 20; + item.height = 20; - item.value = 400; - item.rare = 5; - item.defense = 8; - } + item.value = 400; + item.rare = 5; + item.defense = 8; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Brass Mask"); - Tooltip.SetDefault("10% increased ranged damage\nIncreases ranged critical strike chance by 8"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Brass Mask"); + Tooltip.SetDefault("10% increased ranged damage\nIncreases ranged critical strike chance by 8"); + } - public override void UpdateEquip(Player player) - { - player.rangedCrit += 8; - player.rangedDamage += 0.1f; - } + public override void UpdateEquip(Player player) + { + player.rangedCrit += 8; + player.rangedDamage += 0.1f; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == mod.ItemType("BrassChestplate") && legs.type == mod.ItemType("BrassGreaves"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("BrassChestplate") && legs.type == mod.ItemType("BrassGreaves"); + } - public override void UpdateArmorSet(Player player) - { - player.AddBuff(mod.BuffType("buffSteampunkProbe"), 4); - player.AddBuff(mod.BuffType("SteamRangerBuff"), 4); - player.setBonus = "Summons a friendly Steampunk Drone to defend you and increases damage of Brass Chain Repeater"; - } + public override void UpdateArmorSet(Player player) + { + player.AddBuff(mod.BuffType("buffSteampunkProbe"), 4); + player.AddBuff(mod.BuffType("SteamRangerBuff"), 4); + player.setBonus = "Summons a friendly Steampunk Drone to defend you and increases damage of Brass Chain Repeater"; + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawOutlines=true; + player.armorEffectDrawOutlines = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BrassBar", 13); - recipe.AddIngredient(ItemID.Cog, 12); - recipe.AddIngredient(ItemID.Glass, 6); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "BrassBar", 13); + recipe.AddIngredient(ItemID.Cog, 12); + recipe.AddIngredient(ItemID.Glass, 6); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } } diff --git a/Items/BrassNugget.cs b/Items/BrassNugget.cs index fa873419..bd667486 100644 --- a/Items/BrassNugget.cs +++ b/Items/BrassNugget.cs @@ -4,23 +4,25 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BrassNugget : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BrassNugget : ModItem + { + public override void SetDefaults() + { - item.width = 16; - item.height = 16; - item.maxStack = 99; - item.value = 300; - item.rare = 5; - } + item.width = 16; + item.height = 16; + item.maxStack = 99; + item.value = 300; + item.rare = 5; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Brass Nugget"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Brass Nugget"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/BrassPickaxeAxe.cs b/Items/BrassPickaxeAxe.cs index 8972ee5c..36df8e93 100644 --- a/Items/BrassPickaxeAxe.cs +++ b/Items/BrassPickaxeAxe.cs @@ -4,44 +4,46 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class BrassPickaxeAxe : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.damage = 40; - item.melee = true; - item.width = 42; - item.height = 40; - item.useTime = 5; - item.useAnimation = 15; - item.pick = 215; - item.axe = 26; - item.tileBoost++; - item.useStyle = 1; - item.knockBack = 6; - item.value = Item.buyPrice(0, 1, 50, 0); - item.rare = 5; - item.UseSound = SoundID.Item71; - item.autoReuse = true; - } + public class BrassPickaxeAxe : ModItem + { + public override void SetDefaults() + { + + item.damage = 40; + item.melee = true; + item.width = 42; + item.height = 40; + item.useTime = 5; + item.useAnimation = 15; + item.pick = 215; + item.axe = 26; + item.tileBoost++; + item.useStyle = 1; + item.knockBack = 6; + item.value = Item.buyPrice(0, 1, 50, 0); + item.rare = 5; + item.UseSound = SoundID.Item71; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Brass Pickaxe Axe"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Brass Pickaxe Axe"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BrassBar", 10); - recipe.AddIngredient(ItemID.Cog, 10); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "BrassBar", 10); + recipe.AddIngredient(ItemID.Cog, 10); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/BrassRapier.cs b/Items/BrassRapier.cs index fed73701..6b11b46f 100644 --- a/Items/BrassRapier.cs +++ b/Items/BrassRapier.cs @@ -5,49 +5,51 @@ using Terraria.ID; using System.Linq; -namespace Tremor.Items { -public class BrassRapier : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BrassRapier : ModItem + { + public override void SetDefaults() + { - item.damage = 69; - item.melee = true; - item.width = 52; - item.height = 54; - item.useTime = 25; - item.useAnimation = 25; - item.useStyle = 1; - item.knockBack = 4; - item.value = 12500; - item.rare = 5; - item.UseSound = SoundID.Item71; - item.shoot = mod.ProjectileType("BrassCog"); - item.shootSpeed = 10f; + item.damage = 69; + item.melee = true; + item.width = 52; + item.height = 54; + item.useTime = 25; + item.useAnimation = 25; + item.useStyle = 1; + item.knockBack = 4; + item.value = 12500; + item.rare = 5; + item.UseSound = SoundID.Item71; + item.shoot = mod.ProjectileType("BrassCog"); + item.shootSpeed = 10f; - item.autoReuse = true; - } + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Brass Rapier"); - Tooltip.SetDefault("Shoots spiky brass cogs on use"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Brass Rapier"); + Tooltip.SetDefault("Shoots spiky brass cogs on use"); + } - public override void UpdateInventory(Player player) -{ -if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SteamSwordBuff"))) -{ - item.damage=80; - item.useTime = 15; - item.useAnimation = 15; -} -else -{ - item.damage=65; - item.useTime = 25; - item.useAnimation = 25; -} + public override void UpdateInventory(Player player) + { + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SteamSwordBuff"))) + { + item.damage = 80; + item.useTime = 15; + item.useAnimation = 15; + } + else + { + item.damage = 65; + item.useTime = 25; + item.useAnimation = 25; + } + } + } } -}} diff --git a/Items/BrassStave.cs b/Items/BrassStave.cs index 08ba410a..4865cace 100644 --- a/Items/BrassStave.cs +++ b/Items/BrassStave.cs @@ -6,37 +6,38 @@ using System.Linq; using Terraria.ModLoader; -namespace Tremor.Items { -public class BrassStave : ModItem -{ +namespace Tremor.Items +{ + public class BrassStave : ModItem + { public override void SetDefaults() { - item.damage = 80; - item.magic = true; - item.mana = 60; - item.noMelee = true; - item.width = 40; - item.height = 40; - item.useTime = 45; - item.useAnimation = 45; - item.useStyle = 5; - item.value = 12500; - item.rare = 5; - item.UseSound = SoundID.Item43; - item.autoReuse = false; - item.shoot = 443; - item.shootSpeed = 12f; + item.damage = 80; + item.magic = true; + item.mana = 60; + item.noMelee = true; + item.width = 40; + item.height = 40; + item.useTime = 45; + item.useAnimation = 45; + item.useStyle = 5; + item.value = 12500; + item.rare = 5; + item.UseSound = SoundID.Item43; + item.autoReuse = false; + item.shoot = 443; + item.shootSpeed = 12f; - Item.staff[item.type] = true; //this makes the useStyle animate as a staff instead of as a gun + Item.staff[item.type] = true; //this makes the useStyle animate as a staff instead of as a gun } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Brass Stave"); - Tooltip.SetDefault("Shoots fast thin bolts\nPress RMB for powerful attack"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Brass Stave"); + Tooltip.SetDefault("Shoots fast thin bolts\nPress RMB for powerful attack"); + } public override bool AltFunctionUse(Player player) @@ -48,75 +49,75 @@ public override bool CanUseItem(Player player) { if (player.altFunctionUse == 2) { - item.damage = 80; - item.magic = true; - item.mana = 60; - item.noMelee = true; - item.width = 40; - item.height = 40; - item.useTime = 45; - item.useAnimation = 45; - item.useStyle = 5; + item.damage = 80; + item.magic = true; + item.mana = 60; + item.noMelee = true; + item.width = 40; + item.height = 40; + item.useTime = 45; + item.useAnimation = 45; + item.useStyle = 5; - item.rare = 5; - item.UseSound = SoundID.Item43; - item.autoReuse = false; - item.shoot = 443; - item.shootSpeed = 12f; - //item.toolTip = "Shoots fast thin bolts"; - //item.toolTip2 = "Press RMB for powerful attack"; - Item.staff[item.type] = true; //this makes the useStyle animate as a staff instead of as a gun + item.rare = 5; + item.UseSound = SoundID.Item43; + item.autoReuse = false; + item.shoot = 443; + item.shootSpeed = 12f; + //item.toolTip = "Shoots fast thin bolts"; + //item.toolTip2 = "Press RMB for powerful attack"; + Item.staff[item.type] = true; //this makes the useStyle animate as a staff instead of as a gun } else { - item.damage = 65; - item.magic = true; - item.mana = 10; - item.noMelee = true; - item.width = 40; - item.height = 40; - item.useTime = 22; - item.useAnimation = 22; - item.useStyle = 5; + item.damage = 65; + item.magic = true; + item.mana = 10; + item.noMelee = true; + item.width = 40; + item.height = 40; + item.useTime = 22; + item.useAnimation = 22; + item.useStyle = 5; - item.rare = 5; - item.UseSound = SoundID.Item43; - item.autoReuse = true; - item.shoot = 459; - item.shootSpeed = 15f; - //item.toolTip = "Shoots fast thin bolts"; - //item.toolTip2 = "Press RMB for powerful attack"; - Item.staff[item.type] = true; //this makes the useStyle animate as a staff instead of as a gun + item.rare = 5; + item.UseSound = SoundID.Item43; + item.autoReuse = true; + item.shoot = 459; + item.shootSpeed = 15f; + //item.toolTip = "Shoots fast thin bolts"; + //item.toolTip2 = "Press RMB for powerful attack"; + Item.staff[item.type] = true; //this makes the useStyle animate as a staff instead of as a gun } return base.CanUseItem(player); } - public override void UpdateInventory(Player player) -{ -if (player.altFunctionUse == 2) -{ -if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SteamMageBuff"))) -{ - item.damage=100; -} -else -{ - item.damage=80; -} -} -else -{ -if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SteamMageBuff"))) -{ - item.damage=80; -} -else -{ - item.damage=65; -} -} -} + public override void UpdateInventory(Player player) + { + if (player.altFunctionUse == 2) + { + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SteamMageBuff"))) + { + item.damage = 100; + } + else + { + item.damage = 80; + } + } + else + { + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SteamMageBuff"))) + { + item.damage = 80; + } + else + { + item.damage = 65; + } + } + } } } diff --git a/Items/BrilliantBehemoth.cs b/Items/BrilliantBehemoth.cs index 278d6fee..bd6f9cd3 100644 --- a/Items/BrilliantBehemoth.cs +++ b/Items/BrilliantBehemoth.cs @@ -5,46 +5,48 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BrilliantBehemoth : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BrilliantBehemoth : ModItem + { + public override void SetDefaults() + { - item.damage = 70; - item.thrown = true; - item.width = 40; - item.height = 40; - item.useTime = 40; - item.useAnimation = 40; - item.useStyle = 5; - item.knockBack = 3; - item.value = 90000; - item.rare = 5; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.noUseGraphic = true; - item.shoot = mod.ProjectileType("BrilliantBehemothPro"); - item.shootSpeed = 8f; - } + item.damage = 70; + item.thrown = true; + item.width = 40; + item.height = 40; + item.useTime = 40; + item.useAnimation = 40; + item.useStyle = 5; + item.knockBack = 3; + item.value = 90000; + item.rare = 5; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.noUseGraphic = true; + item.shoot = mod.ProjectileType("BrilliantBehemothPro"); + item.shootSpeed = 8f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Brilliant Behemoth"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Brilliant Behemoth"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "PerfectBehemoth", 1); - recipe.AddIngredient(ItemID.SoulofLight, 7); - recipe.AddIngredient(ItemID.SoulofNight, 7); - recipe.AddIngredient(null, "Opal", 3); - recipe.AddIngredient(ItemID.Amethyst, 25); - recipe.SetResult(this); - recipe.AddTile(null, "GreatAnvilTile"); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "PerfectBehemoth", 1); + recipe.AddIngredient(ItemID.SoulofLight, 7); + recipe.AddIngredient(ItemID.SoulofNight, 7); + recipe.AddIngredient(null, "Opal", 3); + recipe.AddIngredient(ItemID.Amethyst, 25); + recipe.SetResult(this); + recipe.AddTile(null, "GreatAnvilTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/BrokenHeroAmulet.cs b/Items/BrokenHeroAmulet.cs index 6c96878f..100ee78d 100644 --- a/Items/BrokenHeroAmulet.cs +++ b/Items/BrokenHeroAmulet.cs @@ -4,25 +4,27 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BrokenHeroAmulet : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BrokenHeroAmulet : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 44; - item.value = 10000; - item.rare = 8; - item.defense = 3; - item.accessory = true; - } + item.width = 22; + item.height = 44; + item.value = 10000; + item.rare = 8; + item.defense = 3; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Broken Hero Amulet"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Broken Hero Amulet"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/BrokenHeroArmorplate.cs b/Items/BrokenHeroArmorplate.cs index 3e5d8c3d..566ea8a0 100644 --- a/Items/BrokenHeroArmorplate.cs +++ b/Items/BrokenHeroArmorplate.cs @@ -4,24 +4,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BrokenHeroArmorplate : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BrokenHeroArmorplate : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 25000; - item.rare = 8; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 25000; + item.rare = 8; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Broken Hero Armorplate"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Broken Hero Armorplate"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/BrokenInvarShield.cs b/Items/BrokenInvarShield.cs index 78578bbd..47f05cd6 100644 --- a/Items/BrokenInvarShield.cs +++ b/Items/BrokenInvarShield.cs @@ -4,24 +4,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BrokenInvarShield : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BrokenInvarShield : ModItem + { + public override void SetDefaults() + { - item.width = 28; - item.height = 30; - item.maxStack = 99; - item.value = 25; - item.rare = 1; - } + item.width = 28; + item.height = 30; + item.maxStack = 99; + item.value = 25; + item.rare = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Broken Invar Shield"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Broken Invar Shield"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/BronzeBar.cs b/Items/BronzeBar.cs index 41c61fff..3ba8c108 100644 --- a/Items/BronzeBar.cs +++ b/Items/BronzeBar.cs @@ -4,39 +4,41 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BronzeBar : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BronzeBar : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 100; - item.rare = 1; - item.createTile = mod.TileType("BronzeBar"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 100; + item.rare = 1; + item.createTile = mod.TileType("BronzeBar"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bronze Bar"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bronze Bar"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.TinOre, 2); - recipe.AddIngredient(ItemID.CopperOre, 2); - recipe.AddTile(null, "BlastFurnace"); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.TinOre, 2); + recipe.AddIngredient(ItemID.CopperOre, 2); + recipe.AddTile(null, "BlastFurnace"); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/BronzeBow.cs b/Items/BronzeBow.cs index 0d8d947f..13238ffa 100644 --- a/Items/BronzeBow.cs +++ b/Items/BronzeBow.cs @@ -4,42 +4,44 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BronzeBow : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BronzeBow : ModItem + { + public override void SetDefaults() + { - item.damage = 10; - item.width = 16; - item.height = 32; - item.useTime = 30; - item.ranged = true; - item.shoot = 1; - item.shootSpeed = 12f; - item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 5; - item.value = 540; -item.useAmmo = AmmoID.Arrow; - item.rare = 1; - item.UseSound = SoundID.Item5; - item.autoReuse = false; - } + item.damage = 10; + item.width = 16; + item.height = 32; + item.useTime = 30; + item.ranged = true; + item.shoot = 1; + item.shootSpeed = 12f; + item.useAnimation = 30; + item.useStyle = 5; + item.knockBack = 5; + item.value = 540; + item.useAmmo = AmmoID.Arrow; + item.rare = 1; + item.UseSound = SoundID.Item5; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bronze Bow"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bronze Bow"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BronzeBar", 8); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "BronzeBar", 8); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/BronzeChestplate.cs b/Items/BronzeChestplate.cs index b10d347a..b303f114 100644 --- a/Items/BronzeChestplate.cs +++ b/Items/BronzeChestplate.cs @@ -5,39 +5,41 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class BronzeChestplate : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Body)] + public class BronzeChestplate : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 18; + item.width = 26; + item.height = 18; - item.value = 600; - item.rare = 1; - item.defense = 5; - } + item.value = 600; + item.rare = 1; + item.defense = 5; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bronze Chestplate"); - Tooltip.SetDefault("6% increased ranged critical strike chance"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bronze Chestplate"); + Tooltip.SetDefault("6% increased ranged critical strike chance"); + } - public override void UpdateEquip(Player player) - { - player.rangedCrit += 6; - } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BronzeBar", 22); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void UpdateEquip(Player player) + { + player.rangedCrit += 6; + } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "BronzeBar", 22); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/BronzeGreatsword.cs b/Items/BronzeGreatsword.cs index 6c70668f..3ebc129a 100644 --- a/Items/BronzeGreatsword.cs +++ b/Items/BronzeGreatsword.cs @@ -5,40 +5,42 @@ using Terraria.ModLoader; using Microsoft.Xna.Framework; -namespace Tremor.Items { -public class BronzeGreatsword : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BronzeGreatsword : ModItem + { + public override void SetDefaults() + { - item.damage = 11; - item.melee = true; - item.width = 42; - item.height = 42; - item.useTime = 21; - item.useAnimation = 21; - item.useStyle = 1; - item.knockBack = 5; - item.value = 660; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 11; + item.melee = true; + item.width = 42; + item.height = 42; + item.useTime = 21; + item.useAnimation = 21; + item.useStyle = 1; + item.knockBack = 5; + item.value = 660; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bronze Greatsword"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bronze Greatsword"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BronzeBar", 15); -recipe.AddIngredient(ItemID.Wood, 3); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "BronzeBar", 15); + recipe.AddIngredient(ItemID.Wood, 3); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/BronzeGreaves.cs b/Items/BronzeGreaves.cs index aa209d9a..19d6e1a6 100644 --- a/Items/BronzeGreaves.cs +++ b/Items/BronzeGreaves.cs @@ -4,39 +4,42 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class BronzeGreaves : ModItem +namespace Tremor.Items { - - - public override void SetDefaults() - { - - item.width = 22; - item.height = 18; - item.value = 500; - - item.rare = 1; - item.defense = 4; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bronze Greaves"); - Tooltip.SetDefault("6% increased magic critical strike chance"); - } - - - public override void UpdateEquip(Player player) - { - player.magicCrit += 6; - } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BronzeBar", 17); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + [AutoloadEquip(EquipType.Legs)] + public class BronzeGreaves : ModItem + { + + + public override void SetDefaults() + { + + item.width = 22; + item.height = 18; + item.value = 500; + + item.rare = 1; + item.defense = 4; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bronze Greaves"); + Tooltip.SetDefault("6% increased magic critical strike chance"); + } + + + public override void UpdateEquip(Player player) + { + player.magicCrit += 6; + } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "BronzeBar", 17); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/BronzeHamaxe.cs b/Items/BronzeHamaxe.cs index 9e66969e..6cb5c01c 100644 --- a/Items/BronzeHamaxe.cs +++ b/Items/BronzeHamaxe.cs @@ -4,42 +4,44 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BronzeHamaxe : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BronzeHamaxe : ModItem + { + public override void SetDefaults() + { - item.damage = 9; - item.melee = true; - item.width = 32; - item.height = 32; - item.useTime = 17; - item.useAnimation = 27; - item.axe = 9; - item.hammer = 45; - item.useStyle = 1; - item.knockBack = 4; - item.value = 600; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 9; + item.melee = true; + item.width = 32; + item.height = 32; + item.useTime = 17; + item.useAnimation = 27; + item.axe = 9; + item.hammer = 45; + item.useStyle = 1; + item.knockBack = 4; + item.value = 600; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bronze Hamaxe"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bronze Hamaxe"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BronzeBar", 12); -recipe.AddIngredient(ItemID.Wood, 3); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "BronzeBar", 12); + recipe.AddIngredient(ItemID.Wood, 3); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/BronzeHelmet.cs b/Items/BronzeHelmet.cs index 31e05cb0..1cdc3c63 100644 --- a/Items/BronzeHelmet.cs +++ b/Items/BronzeHelmet.cs @@ -4,59 +4,62 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class BronzeHelmet : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class BronzeHelmet : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 32; - item.height = 26; + item.width = 32; + item.height = 26; - item.value = 400; - item.rare = 1; - item.defense = 4; - } + item.value = 400; + item.rare = 1; + item.defense = 4; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bronze Helmet"); - Tooltip.SetDefault("6% increased melee critical strike chance"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bronze Helmet"); + Tooltip.SetDefault("6% increased melee critical strike chance"); + } - public override void UpdateEquip(Player player) - { - player.meleeCrit += 6; - } + public override void UpdateEquip(Player player) + { + player.meleeCrit += 6; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("BronzeChestplate") && legs.type == mod.ItemType("BronzeGreaves"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("BronzeChestplate") && legs.type == mod.ItemType("BronzeGreaves"); + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "8% increased all damage"; - player.meleeDamage += 0.08f; - player.magicDamage += 0.08f; - player.rangedDamage += 0.08f; - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "8% increased all damage"; + player.meleeDamage += 0.08f; + player.magicDamage += 0.08f; + player.rangedDamage += 0.08f; + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawShadowSubtle=true; + player.armorEffectDrawShadowSubtle = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BronzeBar", 13); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "BronzeBar", 13); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/BronzePickaxe.cs b/Items/BronzePickaxe.cs index 3bdca2be..10a151ce 100644 --- a/Items/BronzePickaxe.cs +++ b/Items/BronzePickaxe.cs @@ -4,41 +4,43 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BronzePickaxe : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BronzePickaxe : ModItem + { + public override void SetDefaults() + { - item.damage = 9; - item.melee = true; - item.width = 32; - item.height = 32; - item.useTime = 16; - item.useAnimation = 20; - item.pick = 44; - item.useStyle = 1; - item.knockBack = 5; - item.value = 600; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 9; + item.melee = true; + item.width = 32; + item.height = 32; + item.useTime = 16; + item.useAnimation = 20; + item.pick = 44; + item.useStyle = 1; + item.knockBack = 5; + item.value = 600; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bronze Pickaxe"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bronze Pickaxe"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BronzeBar", 12); -recipe.AddIngredient(ItemID.Wood, 3); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "BronzeBar", 12); + recipe.AddIngredient(ItemID.Wood, 3); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/BrutalliskBag.cs b/Items/BrutalliskBag.cs index a3f32e44..783312dd 100644 --- a/Items/BrutalliskBag.cs +++ b/Items/BrutalliskBag.cs @@ -4,69 +4,71 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BrutalliskBag : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BrutalliskBag : ModItem + { + public override void SetDefaults() + { - item.maxStack = 999; - item.consumable = true; - item.width = 24; - item.height = 24; + item.maxStack = 999; + item.consumable = true; + item.width = 24; + item.height = 24; - item.rare = 9; - item.expert = true; - bossBagNPC = mod.NPCType("Brutallisk"); - } + item.rare = 9; + item.expert = true; + bossBagNPC = mod.NPCType("Brutallisk"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Treasure Bag"); - Tooltip.SetDefault("Right click to open"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Treasure Bag"); + Tooltip.SetDefault("Right click to open"); + } - public override bool CanRightClick() - { - return true; - } + public override bool CanRightClick() + { + return true; + } - public override void OpenBossBag(Player player) - { - if(Main.rand.Next(7) == 0) - { - player.QuickSpawnItem(mod.ItemType("BrutalliskMask")); - } - if(Main.rand.Next(4) == 0) - { - player.QuickSpawnItem(mod.ItemType("Awakening")); - } - if(Main.rand.Next(4) == 0) - { - player.QuickSpawnItem(mod.ItemType("SnakeDevourer")); - } - if(Main.rand.Next(4) == 0) - { - player.QuickSpawnItem(mod.ItemType("LightningStaff")); - } - if(Main.rand.Next(4) == 0) - { - player.QuickSpawnItem(mod.ItemType("QuetzalcoatlStave")); - } - if(Main.rand.Next(4) == 0) - { - player.QuickSpawnItem(mod.ItemType("TreasureGlaive")); - } - if(Main.rand.Next(25) == 0) - { - player.QuickSpawnItem(mod.ItemType("FallenSnake")); - } - if(Main.rand.Next(100) == 0) - { - player.QuickSpawnItem(mod.ItemType("StrangeEgg")); - } - player.QuickSpawnItem(mod.ItemType("BrutalliskCrystal")); - player.QuickSpawnItem(mod.ItemType("Aquamarine"), Main.rand.Next(10, 18)); - } -}} + public override void OpenBossBag(Player player) + { + if (Main.rand.Next(7) == 0) + { + player.QuickSpawnItem(mod.ItemType("BrutalliskMask")); + } + if (Main.rand.Next(4) == 0) + { + player.QuickSpawnItem(mod.ItemType("Awakening")); + } + if (Main.rand.Next(4) == 0) + { + player.QuickSpawnItem(mod.ItemType("SnakeDevourer")); + } + if (Main.rand.Next(4) == 0) + { + player.QuickSpawnItem(mod.ItemType("LightningStaff")); + } + if (Main.rand.Next(4) == 0) + { + player.QuickSpawnItem(mod.ItemType("QuetzalcoatlStave")); + } + if (Main.rand.Next(4) == 0) + { + player.QuickSpawnItem(mod.ItemType("TreasureGlaive")); + } + if (Main.rand.Next(25) == 0) + { + player.QuickSpawnItem(mod.ItemType("FallenSnake")); + } + if (Main.rand.Next(100) == 0) + { + player.QuickSpawnItem(mod.ItemType("StrangeEgg")); + } + player.QuickSpawnItem(mod.ItemType("BrutalliskCrystal")); + player.QuickSpawnItem(mod.ItemType("Aquamarine"), Main.rand.Next(10, 18)); + } + } +} diff --git a/Items/BrutalliskChestplate.cs b/Items/BrutalliskChestplate.cs index 707f2f0d..54225080 100644 --- a/Items/BrutalliskChestplate.cs +++ b/Items/BrutalliskChestplate.cs @@ -5,50 +5,52 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class BrutalliskChestplate : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Body)] + public class BrutalliskChestplate : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 38; - item.height = 22; - item.value = 150000; - item.rare = 11; - item.defense = 32; - } + item.width = 38; + item.height = 22; + item.value = 150000; + item.rare = 11; + item.defense = 32; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Brutallisk Chestplate"); - Tooltip.SetDefault("Increases maximum life by 40\n15% increased melee speed\n25% increased all damage"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Brutallisk Chestplate"); + Tooltip.SetDefault("Increases maximum life by 40\n15% increased melee speed\n25% increased all damage"); + } - public override void UpdateEquip(Player player) - { - player.statLifeMax2 += 40; - player.meleeSpeed += 0.15f; - player.meleeDamage += 0.25f; - player.minionDamage += 0.25f; - player.rangedDamage += 0.25f; - player.magicDamage += 0.25f; - player.thrownDamage += 0.25f; - player.GetModPlayer(mod).alchemistDamage += 0.25f; - } + public override void UpdateEquip(Player player) + { + player.statLifeMax2 += 40; + player.meleeSpeed += 0.15f; + player.meleeDamage += 0.25f; + player.minionDamage += 0.25f; + player.rangedDamage += 0.25f; + player.magicDamage += 0.25f; + player.thrownDamage += 0.25f; + player.GetModPlayer(mod).alchemistDamage += 0.25f; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Aquamarine", 10); - recipe.AddIngredient(null, "NightmareBar", 6); - recipe.AddIngredient(null, "EvershinyBar", 8); - recipe.AddIngredient(null, "SteelBar", 2); - recipe.AddIngredient(null, "Phantaplasm", 4); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Aquamarine", 10); + recipe.AddIngredient(null, "NightmareBar", 6); + recipe.AddIngredient(null, "EvershinyBar", 8); + recipe.AddIngredient(null, "SteelBar", 2); + recipe.AddIngredient(null, "Phantaplasm", 4); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/BrutalliskCrystal.cs b/Items/BrutalliskCrystal.cs index 3c62d82d..dda89c51 100644 --- a/Items/BrutalliskCrystal.cs +++ b/Items/BrutalliskCrystal.cs @@ -8,13 +8,13 @@ namespace Tremor.Items { public class BrutalliskCrystal : ModItem { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Aquamarine Crystal"); - Tooltip.SetDefault("Summons a rideable aquamarine crystal mount"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Aquamarine Crystal"); + Tooltip.SetDefault("Summons a rideable aquamarine crystal mount"); + } - public override void SetDefaults() + public override void SetDefaults() { item.width = 30; item.height = 26; diff --git a/Items/BrutalliskGreaves.cs b/Items/BrutalliskGreaves.cs index 5f1a948b..b072bae7 100644 --- a/Items/BrutalliskGreaves.cs +++ b/Items/BrutalliskGreaves.cs @@ -5,46 +5,49 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class BrutalliskGreaves : ModItem +namespace Tremor.Items { - - - public override void SetDefaults() - { - - item.width = 38; - item.height = 22; - item.value = 150000; - item.rare = 11; - item.defense = 20; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Brutallisk Greaves"); - Tooltip.SetDefault("Increases maximum life by 40\n15% increased melee speed\n90% increased movement speed\nGreatly increases jump height"); - } - - - public override void UpdateEquip(Player player) - { - player.statLifeMax2 += 40; - player.meleeSpeed += 0.15f; - player.moveSpeed += 0.9f; - player.jumpBoost = true; - player.jumpSpeedBoost += 0.9f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Aquamarine", 8); - recipe.AddIngredient(null, "NightmareBar", 5); - recipe.AddIngredient(null, "SteelBar", 5); - recipe.AddIngredient(null, "Phantaplasm", 3); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + [AutoloadEquip(EquipType.Legs)] + public class BrutalliskGreaves : ModItem + { + + + public override void SetDefaults() + { + + item.width = 38; + item.height = 22; + item.value = 150000; + item.rare = 11; + item.defense = 20; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Brutallisk Greaves"); + Tooltip.SetDefault("Increases maximum life by 40\n15% increased melee speed\n90% increased movement speed\nGreatly increases jump height"); + } + + + public override void UpdateEquip(Player player) + { + player.statLifeMax2 += 40; + player.meleeSpeed += 0.15f; + player.moveSpeed += 0.9f; + player.jumpBoost = true; + player.jumpSpeedBoost += 0.9f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Aquamarine", 8); + recipe.AddIngredient(null, "NightmareBar", 5); + recipe.AddIngredient(null, "SteelBar", 5); + recipe.AddIngredient(null, "Phantaplasm", 3); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/BrutalliskHelmet.cs b/Items/BrutalliskHelmet.cs index 6b0987bf..3082461d 100644 --- a/Items/BrutalliskHelmet.cs +++ b/Items/BrutalliskHelmet.cs @@ -7,68 +7,71 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class BrutalliskHelmet : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class BrutalliskHelmet : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 38; - item.height = 22; - item.value = 150000; - item.rare = 11; - item.defense = 20; - } + item.width = 38; + item.height = 22; + item.value = 150000; + item.rare = 11; + item.defense = 20; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Brutallisk Helmet"); - Tooltip.SetDefault("Increases maximum life by 40\n15% increased melee speed"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Brutallisk Helmet"); + Tooltip.SetDefault("Increases maximum life by 40\n15% increased melee speed"); + } - public override void UpdateEquip(Player player) - { - player.statLifeMax2 += 40; - player.meleeSpeed += 0.15f; - } + public override void UpdateEquip(Player player) + { + player.statLifeMax2 += 40; + player.meleeSpeed += 0.15f; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("BrutalliskChestplate") && legs.type == mod.ItemType("BrutalliskGreaves"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("BrutalliskChestplate") && legs.type == mod.ItemType("BrutalliskGreaves"); + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Greatly increases health regeneration"; - player.lifeRegen = +30; + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Greatly increases health regeneration"; + player.lifeRegen = +30; - if(Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y) > 1f && !player.rocketFrame) // Makes sure the player is actually moving - { - for (int k = 0; k < 1; k++) - { - int index= Dust.NewDust(new Vector2(player.position.X - player.velocity.X * 2f, player.position.Y - 2f - player.velocity.Y * 2f), player.width, player.height, 13, 0f, 0f, 100, default(Color), 2f); - Main.dust[index].noGravity = true; - Main.dust[index].noLight = true; - Dust dust = Main.dust[index]; - dust.velocity.X = dust.velocity.X - player.velocity.X * 0.5f; - dust.velocity.Y = dust.velocity.Y - player.velocity.Y * 0.5f; - } - } - } + if (Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y) > 1f && !player.rocketFrame) // Makes sure the player is actually moving + { + for (int k = 0; k < 1; k++) + { + int index = Dust.NewDust(new Vector2(player.position.X - player.velocity.X * 2f, player.position.Y - 2f - player.velocity.Y * 2f), player.width, player.height, 13, 0f, 0f, 100, default(Color), 2f); + Main.dust[index].noGravity = true; + Main.dust[index].noLight = true; + Dust dust = Main.dust[index]; + dust.velocity.X = dust.velocity.X - player.velocity.X * 0.5f; + dust.velocity.Y = dust.velocity.Y - player.velocity.Y * 0.5f; + } + } + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Aquamarine", 10); - recipe.AddIngredient(null, "NightmareBar", 6); - recipe.AddIngredient(null, "EvershinyBar", 6); - recipe.AddIngredient(null, "SteelBar", 3); - recipe.AddIngredient(null, "Phantaplasm", 2); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Aquamarine", 10); + recipe.AddIngredient(null, "NightmareBar", 6); + recipe.AddIngredient(null, "EvershinyBar", 6); + recipe.AddIngredient(null, "SteelBar", 3); + recipe.AddIngredient(null, "Phantaplasm", 2); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/BrutalliskMask.cs b/Items/BrutalliskMask.cs index d6ffa7c8..45e73e0d 100644 --- a/Items/BrutalliskMask.cs +++ b/Items/BrutalliskMask.cs @@ -4,25 +4,28 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class BrutalliskMask : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class BrutalliskMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 20; - item.height = 24; - item.rare = 1; - item.vanity = true; - } + item.width = 20; + item.height = 24; + item.rare = 1; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Brutallisk Mask"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Brutallisk Mask"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/BrutalliskTrophy.cs b/Items/BrutalliskTrophy.cs index cc897b7d..f6a19395 100644 --- a/Items/BrutalliskTrophy.cs +++ b/Items/BrutalliskTrophy.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BrutalliskTrophy : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BrutalliskTrophy : ModItem + { + public override void SetDefaults() + { - item.width = 32; - item.height = 32; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 50000; - item.createTile = mod.TileType("BrutalliskTrophy"); - item.placeStyle = 0; - } + item.width = 32; + item.height = 32; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 50000; + item.createTile = mod.TileType("BrutalliskTrophy"); + item.placeStyle = 0; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Brutallisk Trophy"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Brutallisk Trophy"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/BrutalliskWings.cs b/Items/BrutalliskWings.cs index 20a7d379..04a1033c 100644 --- a/Items/BrutalliskWings.cs +++ b/Items/BrutalliskWings.cs @@ -5,47 +5,49 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Wings)] -public class BrutalliskWings : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Wings)] + public class BrutalliskWings : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 20; + item.width = 22; + item.height = 20; - item.value = 100000; - item.rare = 11; - item.accessory = true; - } + item.value = 100000; + item.rare = 11; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Brutallisk Wings"); - Tooltip.SetDefault("Allows flight and slow fall"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Brutallisk Wings"); + Tooltip.SetDefault("Allows flight and slow fall"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.wingTimeMax = 290; - } + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.wingTimeMax = 290; + } public override void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend) - { - ascentWhenFalling = 0.85f; - ascentWhenRising = 0.45f; - maxCanAscendMultiplier = 1f; - maxAscentMultiplier = 3f; - constantAscend = 0.135f; - } + { + ascentWhenFalling = 0.85f; + ascentWhenRising = 0.45f; + maxCanAscendMultiplier = 1f; + maxAscentMultiplier = 3f; + constantAscend = 0.135f; + } public override void HorizontalWingSpeeds(Player player, ref float speed, ref float acceleration) - { - speed = 10f; - acceleration *= 4.5f; - } -}} + { + speed = 10f; + acceleration *= 4.5f; + } + } +} diff --git a/Items/BulbTorch.cs b/Items/BulbTorch.cs index cf80781e..92c21c6a 100644 --- a/Items/BulbTorch.cs +++ b/Items/BulbTorch.cs @@ -27,11 +27,11 @@ public override void SetDefaults() item.value = 50; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bulb Torch"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bulb Torch"); + Tooltip.SetDefault(""); + } public override void HoldItem(Player player) diff --git a/Items/BurningFist.cs b/Items/BurningFist.cs index f7347675..e3e07eb3 100644 --- a/Items/BurningFist.cs +++ b/Items/BurningFist.cs @@ -5,45 +5,47 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BurningFist : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BurningFist : ModItem + { + public override void SetDefaults() + { - item.damage = 29; - item.magic = true; - item.width = 28; - item.height = 30; - item.useTime = 42; - item.useAnimation = 42; - item.shoot = mod.ProjectileType("BurningFist"); - item.shootSpeed = 15f; - item.mana = 16; - item.useStyle = 5; - item.knockBack = 3; - item.value = 30000; - item.noUseGraphic = true; - item.rare = 3; - item.UseSound = SoundID.Item116; - item.autoReuse = true; - } + item.damage = 29; + item.magic = true; + item.width = 28; + item.height = 30; + item.useTime = 42; + item.useAnimation = 42; + item.shoot = mod.ProjectileType("BurningFist"); + item.shootSpeed = 15f; + item.mana = 16; + item.useStyle = 5; + item.knockBack = 3; + item.value = 30000; + item.noUseGraphic = true; + item.rare = 3; + item.UseSound = SoundID.Item116; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Burning Fist"); - Tooltip.SetDefault("Shoots a burning fist that explodes on contact and erupts burning bolts"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Burning Fist"); + Tooltip.SetDefault("Shoots a burning fist that explodes on contact and erupts burning bolts"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.HellstoneBar, 12); - recipe.AddIngredient(ItemID.MeteoriteBar, 12); - recipe.AddIngredient(null, "DemonBlood", 10); - recipe.AddTile(null, "DevilForge"); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.HellstoneBar, 12); + recipe.AddIngredient(ItemID.MeteoriteBar, 12); + recipe.AddIngredient(null, "DemonBlood", 10); + recipe.AddTile(null, "DevilForge"); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/BurningFlask.cs b/Items/BurningFlask.cs index 66e729e7..8669175a 100644 --- a/Items/BurningFlask.cs +++ b/Items/BurningFlask.cs @@ -9,73 +9,74 @@ namespace Tremor.Items { public class BurningFlask : AlchemistItem - { + { - public override void SetDefaults() - { - item.crit = 4; - item.damage = 17; - //item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("BurningFlaskPro"); - item.shootSpeed = 8f; - item.useStyle = 1; - item.knockBack = 1; - item.UseSound = SoundID.Item106; - item.value = 120; - item.rare = 1; - item.autoReuse = false; + public override void SetDefaults() + { + item.crit = 4; + item.damage = 17; + //item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("BurningFlaskPro"); + item.shootSpeed = 8f; + item.useStyle = 1; + item.knockBack = 1; + item.UseSound = SoundID.Item106; + item.value = 120; + item.rare = 1; + item.autoReuse = false; - item.ammo = mod.ItemType("BoomFlask"); - } + item.ammo = mod.ItemType("BoomFlask"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Burning Flask"); - Tooltip.SetDefault("Throws a flask that explodes into clouds\nClouds deal damage to enemies and burn them"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Burning Flask"); + Tooltip.SetDefault("Throws a flask that explodes into clouds\nClouds deal damage to enemies and burn them"); + } - public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) - { - type = mod.ProjectileType("FieryCloudPro"); - } + public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) + { + type = mod.ProjectileType("FieryCloudPro"); + } - public override void UpdateInventory(Player player) - { - MPlayer modPlayer = player.GetModPlayer(mod); - if (modPlayer.novaHelmet) - { - item.autoReuse = true; - } - if (!modPlayer.novaHelmet) - { - item.autoReuse = false; - } - - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) - { - item.shootSpeed = 11f; - } - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) - { - item.shootSpeed = 8f; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) - { - item.autoReuse = true; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) - { - item.autoReuse = false; - } - } + public override void UpdateInventory(Player player) + { + MPlayer modPlayer = player.GetModPlayer(mod); + if (modPlayer.novaHelmet) + { + item.autoReuse = true; + } + if (!modPlayer.novaHelmet) + { + item.autoReuse = false; + } -}} + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) + { + item.shootSpeed = 11f; + } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) + { + item.shootSpeed = 8f; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) + { + item.autoReuse = true; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) + { + item.autoReuse = false; + } + } + + } +} diff --git a/Items/BurningHammer.cs b/Items/BurningHammer.cs index 74d59186..674df388 100644 --- a/Items/BurningHammer.cs +++ b/Items/BurningHammer.cs @@ -5,35 +5,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BurningHammer : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BurningHammer : ModItem + { + public override void SetDefaults() + { - item.damage = 18; - item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("BurningHammerPro"); - item.shootSpeed = 10f; - item.useStyle = 1; - item.knockBack = 4; - item.value = 7; - item.rare = 3; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 18; + item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("BurningHammerPro"); + item.shootSpeed = 10f; + item.useStyle = 1; + item.knockBack = 4; + item.value = 7; + item.rare = 3; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Burning Hammer"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Burning Hammer"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/BurningTome.cs b/Items/BurningTome.cs index d282bd2c..9d74413e 100644 --- a/Items/BurningTome.cs +++ b/Items/BurningTome.cs @@ -5,36 +5,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class BurningTome : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class BurningTome : ModItem + { + public override void SetDefaults() + { - item.damage = 7; - item.melee = false; - item.magic = true; - item.width = 50; - item.height = 55; - item.useTime = 20; - item.useAnimation = 20; - item.mana = 6; - item.useStyle = 5; - //item.shoot = mod.ProjectileType("BurningTome"); -item.shoot = 376; - item.shootSpeed = 26f; - item.knockBack = 4; - item.value = 12000; - item.rare = 2; - //item.UseSound = SoundID.Item9; - item.autoReuse = true; - } + item.damage = 7; + item.melee = false; + item.magic = true; + item.width = 50; + item.height = 55; + item.useTime = 20; + item.useAnimation = 20; + item.mana = 6; + item.useStyle = 5; + //item.shoot = mod.ProjectileType("BurningTome"); + item.shoot = 376; + item.shootSpeed = 26f; + item.knockBack = 4; + item.value = 12000; + item.rare = 2; + //item.UseSound = SoundID.Item9; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Burning Tome"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Burning Tome"); + Tooltip.SetDefault(""); + } -} + } } diff --git a/Items/ButcherAxe.cs b/Items/ButcherAxe.cs index 9d42ec7b..4c55ae9c 100644 --- a/Items/ButcherAxe.cs +++ b/Items/ButcherAxe.cs @@ -4,32 +4,34 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ButcherAxe : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ButcherAxe : ModItem + { + public override void SetDefaults() + { - item.damage = 14; - item.melee = true; - item.width = 32; - item.height = 32; - item.useTime = 15; - item.useAnimation = 27; - item.axe = 9; - item.useStyle = 1; - item.knockBack = 4; - item.value = 6000; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 14; + item.melee = true; + item.width = 32; + item.height = 32; + item.useTime = 15; + item.useAnimation = 27; + item.axe = 9; + item.useStyle = 1; + item.knockBack = 4; + item.value = 6000; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Butcher Axe"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Butcher Axe"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/ButcherMask.cs b/Items/ButcherMask.cs index ef763f5a..cdf6e9d8 100644 --- a/Items/ButcherMask.cs +++ b/Items/ButcherMask.cs @@ -4,26 +4,29 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class ButcherMask : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class ButcherMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 20; - item.value = 20000; - item.rare = 0; - item.vanity = true; - } + item.width = 22; + item.height = 20; + item.value = 20000; + item.rare = 0; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Butcher Mask"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Butcher Mask"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/CactusBow.cs b/Items/CactusBow.cs index 686e4b01..98a2c5f2 100644 --- a/Items/CactusBow.cs +++ b/Items/CactusBow.cs @@ -4,33 +4,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class CactusBow : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CactusBow : ModItem + { + public override void SetDefaults() + { - item.damage = 14; - item.width = 16; - item.height = 32; - item.ranged = true; - item.useTime = 40; - item.shoot = 1; - item.shootSpeed = 10f; - item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 5; - item.value = 2040; - item.useAmmo = AmmoID.Arrow; - item.rare = 2; - item.UseSound = SoundID.Item5; - item.autoReuse = false; - } + item.damage = 14; + item.width = 16; + item.height = 32; + item.ranged = true; + item.useTime = 40; + item.shoot = 1; + item.shootSpeed = 10f; + item.useAnimation = 30; + item.useStyle = 5; + item.knockBack = 5; + item.value = 2040; + item.useAmmo = AmmoID.Arrow; + item.rare = 2; + item.UseSound = SoundID.Item5; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cactus Bow"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cactus Bow"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/CactusHammer.cs b/Items/CactusHammer.cs index 12dfd05b..0211bdfd 100644 --- a/Items/CactusHammer.cs +++ b/Items/CactusHammer.cs @@ -4,41 +4,43 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class CactusHammer : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CactusHammer : ModItem + { + public override void SetDefaults() + { - item.autoReuse = true; - item.useStyle = 1; - item.useTurn = true; - item.useAnimation = 30; - item.useTime = 20; - item.hammer = 38; - item.width = 24; - item.height = 28; - item.damage = 9; - item.knockBack = 5.5f; - item.scale = 1.2f; - item.UseSound = SoundID.Item1; - item.value = 1600; - item.melee = true; - } + item.autoReuse = true; + item.useStyle = 1; + item.useTurn = true; + item.useAnimation = 30; + item.useTime = 20; + item.hammer = 38; + item.width = 24; + item.height = 28; + item.damage = 9; + item.knockBack = 5.5f; + item.scale = 1.2f; + item.UseSound = SoundID.Item1; + item.value = 1600; + item.melee = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cactus Hammer"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cactus Hammer"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Cactus, 16); - recipe.AddTile(16); - recipe.SetResult(this); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Cactus, 16); + recipe.AddTile(16); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } -}} diff --git a/Items/Candent.cs b/Items/Candent.cs index b032cab6..e0cfed17 100644 --- a/Items/Candent.cs +++ b/Items/Candent.cs @@ -4,41 +4,43 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Candent : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Candent : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 44; + item.width = 22; + item.height = 44; - item.value = 10000; - item.rare = 3; - item.defense = 3; - item.accessory = true; - } + item.value = 10000; + item.rare = 3; + item.defense = 3; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Candent"); - Tooltip.SetDefault("Increases melee damage and critical strike chance by 7%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Candent"); + Tooltip.SetDefault("Increases melee damage and critical strike chance by 7%"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.meleeDamage += 0.07f; - player.meleeCrit += 7; - } + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.meleeDamage += 0.07f; + player.meleeCrit += 7; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "FireFragment", 12); - recipe.AddIngredient(ItemID.HellstoneBar, 20); - recipe.SetResult(this); - recipe.AddTile(null, "GreatAnvilTile"); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "FireFragment", 12); + recipe.AddIngredient(ItemID.HellstoneBar, 20); + recipe.SetResult(this); + recipe.AddTile(null, "GreatAnvilTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CandyBar.cs b/Items/CandyBar.cs index b8e87915..09bbd5db 100644 --- a/Items/CandyBar.cs +++ b/Items/CandyBar.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class CandyBar : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CandyBar : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 6000; - item.rare = 10; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.createTile = mod.TileType("CandyBarTile"); - item.useStyle = 1; - item.consumable = true; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 6000; + item.rare = 10; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.createTile = mod.TileType("CandyBarTile"); + item.useStyle = 1; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Candy Bar"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Candy Bar"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/CandyBlaster.cs b/Items/CandyBlaster.cs index 0c8f3215..091f19a1 100644 --- a/Items/CandyBlaster.cs +++ b/Items/CandyBlaster.cs @@ -27,18 +27,18 @@ public override void SetDefaults() item.UseSound = SoundID.Item40; item.autoReuse = false; item.shoot = 10; - item.shootSpeed = 15f; - item.useAmmo = AmmoID.Bullet; + item.shootSpeed = 15f; + item.useAmmo = AmmoID.Bullet; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Candy Blaster"); - Tooltip.SetDefault("Spends bullets and fires candies"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Candy Blaster"); + Tooltip.SetDefault("Spends bullets and fires candies"); + } - public override bool ConsumeAmmo(Player p) + public override bool ConsumeAmmo(Player p) { return Main.rand.Next(3) == 0; } diff --git a/Items/CandyBow.cs b/Items/CandyBow.cs index dd3a04d6..05a90fe7 100644 --- a/Items/CandyBow.cs +++ b/Items/CandyBow.cs @@ -3,33 +3,35 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { -public class CandyBow : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CandyBow : ModItem + { + public override void SetDefaults() + { - item.damage = 18; - item.ranged = true; - item.width = 24; - item.height = 46; - item.useTime = 30; - item.shoot = 1; - item.shootSpeed = 8f; - item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 5; - item.value = 30000; - item.useAmmo = AmmoID.Arrow; - item.rare = 1; - item.UseSound = SoundID.Item5; - item.autoReuse = false; - } + item.damage = 18; + item.ranged = true; + item.width = 24; + item.height = 46; + item.useTime = 30; + item.shoot = 1; + item.shootSpeed = 8f; + item.useAnimation = 30; + item.useStyle = 5; + item.knockBack = 5; + item.value = 30000; + item.useAmmo = AmmoID.Arrow; + item.rare = 1; + item.UseSound = SoundID.Item5; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Candy Bow"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Candy Bow"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/CandyCane.cs b/Items/CandyCane.cs index 7ee0c680..58bed2ac 100644 --- a/Items/CandyCane.cs +++ b/Items/CandyCane.cs @@ -4,31 +4,33 @@ using Terraria.ModLoader; using Terraria.ID; -namespace Tremor.Items { -public class CandyCane : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CandyCane : ModItem + { + public override void SetDefaults() + { - item.damage = 14; - item.melee = true; - item.width = 32; - item.height = 28; - item.useTime = 32; - item.useAnimation = 22; - item.useStyle = 1; - item.knockBack = 7; - item.value = 2000; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 14; + item.melee = true; + item.width = 32; + item.height = 28; + item.useTime = 32; + item.useAnimation = 22; + item.useStyle = 1; + item.knockBack = 7; + item.value = 2000; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Candy Cane"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Candy Cane"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/CarbonSteel.cs b/Items/CarbonSteel.cs index e26ecc8e..b81217e5 100644 --- a/Items/CarbonSteel.cs +++ b/Items/CarbonSteel.cs @@ -4,24 +4,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class CarbonSteel : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CarbonSteel : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 21000; - item.rare = 10; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 21000; + item.rare = 10; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Carbon Steel"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Carbon Steel"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/Carrot.cs b/Items/Carrot.cs index 87631c06..c03e3af6 100644 --- a/Items/Carrot.cs +++ b/Items/Carrot.cs @@ -23,14 +23,14 @@ public override void SetDefaults() item.rare = 0; item.shoot = mod.ProjectileType("Carrot"); item.ammo = item.type; - item.value = 15; + item.value = 15; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Carrot"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Carrot"); + Tooltip.SetDefault(""); + } } } diff --git a/Items/Carrow.cs b/Items/Carrow.cs index eaf5d409..05579e0d 100644 --- a/Items/Carrow.cs +++ b/Items/Carrow.cs @@ -5,48 +5,50 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Carrow : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Carrow : ModItem + { + public override void SetDefaults() + { - item.damage = 20; - item.ranged = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 1; + item.damage = 20; + item.ranged = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 1; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("Carrot"); - item.shootSpeed = 19f; - item.useAmmo = mod.ItemType("Carrot"); - item.useStyle = 1; - item.knockBack = 4; - item.value = 70000; - item.rare = 3; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("Carrot"); + item.shootSpeed = 19f; + item.useAmmo = mod.ItemType("Carrot"); + item.useStyle = 1; + item.knockBack = 4; + item.value = 70000; + item.rare = 3; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Carrow"); - Tooltip.SetDefault("Uses carrots as ammo"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Carrow"); + Tooltip.SetDefault("Uses carrots as ammo"); + } -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) -{ - for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. - { - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); - } - return false; -} + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. + { + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); + } + return false; + } -}} + } +} diff --git a/Items/Catalyst.cs b/Items/Catalyst.cs index 5b88f3e7..7bc9334b 100644 --- a/Items/Catalyst.cs +++ b/Items/Catalyst.cs @@ -4,23 +4,25 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Catalyst : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Catalyst : ModItem + { + public override void SetDefaults() + { - item.width = 14; - item.height = 22; - item.maxStack = 999; - item.rare = 11; - item.value = Item.buyPrice(0, 1, 0, 0); - } + item.width = 14; + item.height = 22; + item.maxStack = 999; + item.rare = 11; + item.value = Item.buyPrice(0, 1, 0, 0); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Catalyst"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Catalyst"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/CaveGolemBanner.cs b/Items/CaveGolemBanner.cs index a965a0cd..04d0958b 100644 --- a/Items/CaveGolemBanner.cs +++ b/Items/CaveGolemBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class CaveGolemBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CaveGolemBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 18; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 18; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cave Golem Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cave Golem Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/ChainBow.cs b/Items/ChainBow.cs index abb9c96e..7849c47b 100644 --- a/Items/ChainBow.cs +++ b/Items/ChainBow.cs @@ -4,40 +4,42 @@ using Terraria.ModLoader; using Microsoft.Xna.Framework; -namespace Tremor.Items { -public class ChainBow : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ChainBow : ModItem + { + public override void SetDefaults() + { - item.damage = 300; - item.width = 16; - item.height = 32; - item.ranged = true; - item.useTime = 20; - item.shoot = 1; + item.damage = 300; + item.width = 16; + item.height = 32; + item.ranged = true; + item.useTime = 20; + item.shoot = 1; - item.shootSpeed = 60f; - item.useAnimation = 20; - item.useStyle = 5; - item.knockBack = 5; - item.value = 1250000; - item.useAmmo = AmmoID.Arrow; - item.rare = 11; - item.crit = 7; - item.UseSound = SoundID.Item114; - item.autoReuse = true; - } + item.shootSpeed = 60f; + item.useAnimation = 20; + item.useStyle = 5; + item.knockBack = 5; + item.value = 1250000; + item.useAmmo = AmmoID.Arrow; + item.rare = 11; + item.crit = 7; + item.UseSound = SoundID.Item114; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Chain Bow"); - Tooltip.SetDefault("Shoots cosmic rays!"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Chain Bow"); + Tooltip.SetDefault("Shoots cosmic rays!"); + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { type = 255; return base.Shoot(player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack); } -}} + } +} diff --git a/Items/ChainCoif.cs b/Items/ChainCoif.cs index fd918546..ccba0c0d 100644 --- a/Items/ChainCoif.cs +++ b/Items/ChainCoif.cs @@ -5,25 +5,28 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class ChainCoif : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class ChainCoif : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 18; - item.height = 24; - item.value = 600; - item.rare = 1; - item.defense = 2; - } + item.width = 18; + item.height = 24; + item.value = 600; + item.rare = 1; + item.defense = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Chain Coif"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Chain Coif"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/ChainGreaves.cs b/Items/ChainGreaves.cs index 04484795..6258f9c4 100644 --- a/Items/ChainGreaves.cs +++ b/Items/ChainGreaves.cs @@ -5,25 +5,28 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class ChainGreaves : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Legs)] + public class ChainGreaves : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 14; - item.value = 600; - item.rare = 1; - item.defense = 2; - } + item.width = 22; + item.height = 14; + item.value = 600; + item.rare = 1; + item.defense = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Chain Greaves"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Chain Greaves"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/ChainedRocket.cs b/Items/ChainedRocket.cs index 21e75b56..e3afadc7 100644 --- a/Items/ChainedRocket.cs +++ b/Items/ChainedRocket.cs @@ -7,36 +7,36 @@ namespace Tremor.Items { - public class ChainedRocket : ModItem - { - public override void SetDefaults() - { + public class ChainedRocket : ModItem + { + public override void SetDefaults() + { - item.width = 24; - item.height = 28; - item.rare = 11; - item.noMelee = true; - item.useStyle = 5; - item.useAnimation = 30; - item.useTime = 30; - item.value = 2100000; - item.knockBack = 7.5F; - item.damage = 262; - item.autoReuse = true; - item.scale = 1.1F; - item.noUseGraphic = true; - item.shoot = mod.ProjectileType("ChainedRocketPro"); - item.shootSpeed = 22.9F; - item.UseSound = SoundID.Item1; - item.melee = true; - item.channel = true; - } + item.width = 24; + item.height = 28; + item.rare = 11; + item.noMelee = true; + item.useStyle = 5; + item.useAnimation = 30; + item.useTime = 30; + item.value = 2100000; + item.knockBack = 7.5F; + item.damage = 262; + item.autoReuse = true; + item.scale = 1.1F; + item.noUseGraphic = true; + item.shoot = mod.ProjectileType("ChainedRocketPro"); + item.shootSpeed = 22.9F; + item.UseSound = SoundID.Item1; + item.melee = true; + item.channel = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Chained Rocket"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Chained Rocket"); + Tooltip.SetDefault(""); + } - } + } } diff --git a/Items/Chainjaw.cs b/Items/Chainjaw.cs index 1f21b869..5ce20d3d 100644 --- a/Items/Chainjaw.cs +++ b/Items/Chainjaw.cs @@ -4,54 +4,56 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class Chainjaw : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.damage = 8; - item.melee = true; - item.width = 20; - item.height = 12; - item.useTime = 15; - item.useAnimation = 25; - item.channel = true; - item.noUseGraphic = true; - item.noMelee = true; - item.axe = 15; - item.tileBoost++; - item.useStyle = 5; - item.knockBack = 6; - item.value = Item.buyPrice(0, 1, 50, 0); - item.rare = 3; - item.UseSound = SoundID.Item23; - item.autoReuse = true; - item.shoot = mod.ProjectileType("ChainjawPro"); - item.shootSpeed = 26f; - } + public class Chainjaw : ModItem + { + public override void SetDefaults() + { + + item.damage = 8; + item.melee = true; + item.width = 20; + item.height = 12; + item.useTime = 15; + item.useAnimation = 25; + item.channel = true; + item.noUseGraphic = true; + item.noMelee = true; + item.axe = 15; + item.tileBoost++; + item.useStyle = 5; + item.knockBack = 6; + item.value = Item.buyPrice(0, 1, 50, 0); + item.rare = 3; + item.UseSound = SoundID.Item23; + item.autoReuse = true; + item.shoot = mod.ProjectileType("ChainjawPro"); + item.shootSpeed = 26f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Chainjaw"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Chainjaw"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.CrimtaneBar, 10); - recipe.AddIngredient(null, "SharpenedTooth", 5); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.CrimtaneBar, 10); + recipe.AddIngredient(null, "SharpenedTooth", 5); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.DemoniteBar, 10); - recipe.AddIngredient(null, "SharpenedTooth", 5); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.DemoniteBar, 10); + recipe.AddIngredient(null, "SharpenedTooth", 5); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Chainmail.cs b/Items/Chainmail.cs index 1cc4f64d..2becb22f 100644 --- a/Items/Chainmail.cs +++ b/Items/Chainmail.cs @@ -5,25 +5,27 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class Chainmail : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Body)] + public class Chainmail : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 30; - item.height = 18; - item.value = 600; - item.rare = 1; - item.defense = 2; - } + item.width = 30; + item.height = 18; + item.value = 600; + item.rare = 1; + item.defense = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Chainmail"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Chainmail"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/Chainsword.cs b/Items/Chainsword.cs index 867d49ee..fbb29394 100644 --- a/Items/Chainsword.cs +++ b/Items/Chainsword.cs @@ -4,33 +4,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Chainsword : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Chainsword : ModItem + { + public override void SetDefaults() + { - item.damage = 55; - item.melee = true; - item.width = 56; - item.height = 64; - item.useTime = 25; - item.useAnimation = 25; - item.axe = 22; + item.damage = 55; + item.melee = true; + item.width = 56; + item.height = 64; + item.useTime = 25; + item.useAnimation = 25; + item.axe = 22; - item.useStyle = 1; - item.knockBack = 4; - item.value = 60000; - item.rare = 5; - item.UseSound = SoundID.Item22; - item.autoReuse = true; - } + item.useStyle = 1; + item.knockBack = 4; + item.value = 60000; + item.rare = 5; + item.UseSound = SoundID.Item22; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Chainsword"); - Tooltip.SetDefault("'It looks like a sword, but its actually a saw! Buy yours today!'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Chainsword"); + Tooltip.SetDefault("'It looks like a sword, but its actually a saw! Buy yours today!'"); + } -}} + } +} diff --git a/Items/ChaosBar.cs b/Items/ChaosBar.cs index 1ecb239a..5415a2da 100644 --- a/Items/ChaosBar.cs +++ b/Items/ChaosBar.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ChaosBar : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ChaosBar : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 500; - item.rare = 5; - item.createTile = mod.TileType("ChaosBar"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 500; + item.rare = 5; + item.createTile = mod.TileType("ChaosBar"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Chaos Bar"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Chaos Bar"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/ChaosBreastplate.cs b/Items/ChaosBreastplate.cs index b7a44e83..b7bf9d68 100644 --- a/Items/ChaosBreastplate.cs +++ b/Items/ChaosBreastplate.cs @@ -5,40 +5,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class ChaosBreastplate : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Body)] + public class ChaosBreastplate : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 18; + item.width = 26; + item.height = 18; - item.value = 6000; - item.rare = 5; - item.defense = 13; - } + item.value = 6000; + item.rare = 5; + item.defense = 13; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Chaos Breastplate"); - Tooltip.SetDefault("Increases movement speed"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Chaos Breastplate"); + Tooltip.SetDefault("Increases movement speed"); + } - public override void UpdateEquip(Player player) - { - player.moveSpeed += 0.20f; - } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ChaosBar", 22); - recipe.AddIngredient(ItemID.CrystalShard, 15); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void UpdateEquip(Player player) + { + player.moveSpeed += 0.20f; + } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ChaosBar", 22); + recipe.AddIngredient(ItemID.CrystalShard, 15); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/ChaosElement.cs b/Items/ChaosElement.cs index 35d0493f..4d3a4ca1 100644 --- a/Items/ChaosElement.cs +++ b/Items/ChaosElement.cs @@ -6,32 +6,32 @@ namespace Tremor.Items { - public class ChaosElement : ModItem - { + public class ChaosElement : ModItem + { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Chaos Element"); - Tooltip.SetDefault("Flasks spawn crystal splinters when destroyed\nSplinters heal you when hit enemy"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Chaos Element"); + Tooltip.SetDefault("Flasks spawn crystal splinters when destroyed\nSplinters heal you when hit enemy"); + } - public override void SetDefaults() - { - item.width = 22; - item.height = 22; - item.value = 100000; - item.rare = 5; - item.defense = 3; - item.accessory = true; - } + public override void SetDefaults() + { + item.width = 22; + item.height = 22; + item.value = 100000; + item.rare = 5; + item.defense = 3; + item.accessory = true; + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.AddBuff(mod.BuffType("ChaosElementBuff"), 2); - if (player.GetModPlayer(mod).alchemistCrit >= 30) - { - player.GetModPlayer(mod).alchemistDamage += 0.1f; - } - } - } + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.AddBuff(mod.BuffType("ChaosElementBuff"), 2); + if (player.GetModPlayer(mod).alchemistCrit >= 30) + { + player.GetModPlayer(mod).alchemistDamage += 0.1f; + } + } + } } \ No newline at end of file diff --git a/Items/ChaosGreaves.cs b/Items/ChaosGreaves.cs index 04b34489..cfe63b11 100644 --- a/Items/ChaosGreaves.cs +++ b/Items/ChaosGreaves.cs @@ -4,41 +4,44 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class ChaosGreaves : ModItem +namespace Tremor.Items { - - - public override void SetDefaults() - { - - item.width = 22; - item.height = 18; - item.value = 6000; - - - item.rare = 5; - item.defense = 11; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Chaos Greaves"); - Tooltip.SetDefault("Increased life max by 25\nIncreased wing time"); - } - - - public override void UpdateEquip(Player p) - { - p.wingTime += 0.15f; - p.statLifeMax2 += 25; - } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ChaosBar", 17); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + [AutoloadEquip(EquipType.Legs)] + public class ChaosGreaves : ModItem + { + + + public override void SetDefaults() + { + + item.width = 22; + item.height = 18; + item.value = 6000; + + + item.rare = 5; + item.defense = 11; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Chaos Greaves"); + Tooltip.SetDefault("Increased life max by 25\nIncreased wing time"); + } + + + public override void UpdateEquip(Player p) + { + p.wingTime += 0.15f; + p.statLifeMax2 += 25; + } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ChaosBar", 17); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/ChaosHelmet.cs b/Items/ChaosHelmet.cs index 45a31675..14087ddb 100644 --- a/Items/ChaosHelmet.cs +++ b/Items/ChaosHelmet.cs @@ -4,74 +4,77 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class ChaosHelmet : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class ChaosHelmet : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 32; - item.height = 26; + item.width = 32; + item.height = 26; - item.value = 6000; - item.rare = 5; - item.defense = 8; - } + item.value = 6000; + item.rare = 5; + item.defense = 8; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Chaos Helmet"); - Tooltip.SetDefault("Increases maximum life by 25\nImmune to most debuffs!"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Chaos Helmet"); + Tooltip.SetDefault("Increases maximum life by 25\nImmune to most debuffs!"); + } - public override void UpdateEquip(Player p) - { - p.statLifeMax2 += 25; + public override void UpdateEquip(Player p) + { + p.statLifeMax2 += 25; p.buffImmune[44] = true; - p.buffImmune[46] = true; - p.buffImmune[47] = true; + p.buffImmune[46] = true; + p.buffImmune[47] = true; p.buffImmune[20] = true; - p.buffImmune[22] = true; - p.buffImmune[24] = true; - p.buffImmune[23] = true; - p.buffImmune[30] = true; - p.buffImmune[31] = true; - p.buffImmune[32] = true; - p.buffImmune[33] = true; - p.buffImmune[35] = true; - p.buffImmune[36] = true; - p.buffImmune[69] = true; + p.buffImmune[22] = true; + p.buffImmune[24] = true; + p.buffImmune[23] = true; + p.buffImmune[30] = true; + p.buffImmune[31] = true; + p.buffImmune[32] = true; + p.buffImmune[33] = true; + p.buffImmune[35] = true; + p.buffImmune[36] = true; + p.buffImmune[69] = true; p.buffImmune[70] = true; - p.buffImmune[80] = true; - } + p.buffImmune[80] = true; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("ChaosBreastplate") && legs.type == mod.ItemType("ChaosGreaves"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("ChaosBreastplate") && legs.type == mod.ItemType("ChaosGreaves"); + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increases life regeneration"; - player.lifeRegen +=2; - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increases life regeneration"; + player.lifeRegen += 2; + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawShadowLokis = true; + player.armorEffectDrawShadowLokis = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ChaosBar", 14); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ChaosBar", 14); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/ChaosWings.cs b/Items/ChaosWings.cs index 4da6f838..81eca5ae 100644 --- a/Items/ChaosWings.cs +++ b/Items/ChaosWings.cs @@ -5,60 +5,62 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Wings)] -public class ChaosWings : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Wings)] + public class ChaosWings : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 28; - item.height = 30; + item.width = 28; + item.height = 30; - item.value = 80000; - item.rare = 5; - item.accessory = true; - } + item.value = 80000; + item.rare = 5; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Chaos Wings"); - Tooltip.SetDefault("Allows flight and slow fall"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Chaos Wings"); + Tooltip.SetDefault("Allows flight and slow fall"); + } - //these wings use the same values as the solar wings + //these wings use the same values as the solar wings - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.wingTimeMax = 127; - } + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.wingTimeMax = 127; + } public override void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend) - { - ascentWhenFalling = 0.85f; - ascentWhenRising = 0.15f; - maxCanAscendMultiplier = 1f; - maxAscentMultiplier = 3f; - constantAscend = 0.135f; - } + { + ascentWhenFalling = 0.85f; + ascentWhenRising = 0.15f; + maxCanAscendMultiplier = 1f; + maxAscentMultiplier = 3f; + constantAscend = 0.135f; + } public override void HorizontalWingSpeeds(Player player, ref float speed, ref float acceleration) - { - speed = 9f; - acceleration *= 2.5f; - } + { + speed = 9f; + acceleration *= 2.5f; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ChaosBar", 15); - recipe.AddIngredient(ItemID.SoulofFlight, 20); - recipe.AddIngredient(ItemID.CrystalShard, 25); - recipe.AddTile(134); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ChaosBar", 15); + recipe.AddIngredient(ItemID.SoulofFlight, 20); + recipe.AddIngredient(ItemID.CrystalShard, 25); + recipe.AddTile(134); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/ChaoticAmplifier.cs b/Items/ChaoticAmplifier.cs index 02bde580..b43fcafb 100644 --- a/Items/ChaoticAmplifier.cs +++ b/Items/ChaoticAmplifier.cs @@ -4,55 +4,57 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ChaoticAmplifier : ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 24; - item.height = 28; - - item.value = 120000; - item.rare = 5; - item.accessory = true; - item.defense = 1; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Chaotic Amplifier"); - Tooltip.SetDefault("The less health, the more crit chance..."); - } - - - public override void UpdateAccessory(Player player, bool hideVisual) - - { - if (player.statLife < 50) - { - player.magicCrit += 20; - player.meleeCrit += 20; - player.rangedCrit += 20; - } - if (player.statLife < 100) - { - player.magicCrit += 15; - player.meleeCrit += 15; - player.rangedCrit += 15; - } - if (player.statLife < 200) - { - player.magicCrit += 10; - player.meleeCrit += 10; - player.rangedCrit += 10; - } - if (player.statLife < 300) - { - player.magicCrit += 5; - player.meleeCrit += 5; - player.rangedCrit += 5; - } - } -}} + public class ChaoticAmplifier : ModItem + { + + public override void SetDefaults() + { + + item.width = 24; + item.height = 28; + + item.value = 120000; + item.rare = 5; + item.accessory = true; + item.defense = 1; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Chaotic Amplifier"); + Tooltip.SetDefault("The less health, the more crit chance..."); + } + + + public override void UpdateAccessory(Player player, bool hideVisual) + + { + if (player.statLife < 50) + { + player.magicCrit += 20; + player.meleeCrit += 20; + player.rangedCrit += 20; + } + if (player.statLife < 100) + { + player.magicCrit += 15; + player.meleeCrit += 15; + player.rangedCrit += 15; + } + if (player.statLife < 200) + { + player.magicCrit += 10; + player.meleeCrit += 10; + player.rangedCrit += 10; + } + if (player.statLife < 300) + { + player.magicCrit += 5; + player.meleeCrit += 5; + player.rangedCrit += 5; + } + } + } +} diff --git a/Items/ChaoticCross.cs b/Items/ChaoticCross.cs index bc8338d5..2e4f5b47 100644 --- a/Items/ChaoticCross.cs +++ b/Items/ChaoticCross.cs @@ -4,78 +4,80 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ChaoticCross : ModItem +namespace Tremor.Items { + public class ChaoticCross : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 24; - item.height = 28; + item.width = 24; + item.height = 28; - item.value = 150000; - item.rare = 6; - item.accessory = true; - item.defense = 1; - } + item.value = 150000; + item.rare = 6; + item.accessory = true; + item.defense = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Chaotic Cross"); - Tooltip.SetDefault("The less health, the more critical strike chance...\nThe less health, the more damage..."); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Chaotic Cross"); + Tooltip.SetDefault("The less health, the more critical strike chance...\nThe less health, the more damage..."); + } - public override void UpdateAccessory(Player player, bool hideVisual) + public override void UpdateAccessory(Player player, bool hideVisual) - { - if (player.statLife < 50) - { - player.magicCrit += 20; - player.meleeCrit += 20; - player.rangedCrit += 20; - player.magicDamage += 0.20f; - player.meleeDamage += 0.20f; - player.rangedDamage += 0.20f; - } - if (player.statLife < 100) - { - player.magicCrit += 15; - player.meleeCrit += 15; - player.rangedCrit += 15; - player.magicDamage += 0.15f; - player.meleeDamage += 0.15f; - player.rangedDamage += 0.15f; - } - if (player.statLife < 200) - { - player.magicCrit += 10; - player.meleeCrit += 10; - player.rangedCrit += 10; - player.magicDamage += 0.10f; - player.meleeDamage += 0.10f; - player.rangedDamage += 0.10f; - } - if (player.statLife < 300) - { - player.magicCrit += 5; - player.meleeCrit += 5; - player.rangedCrit += 5; - player.magicDamage += 0.05f; - player.meleeDamage += 0.05f; - player.rangedDamage += 0.05f; - } - } + { + if (player.statLife < 50) + { + player.magicCrit += 20; + player.meleeCrit += 20; + player.rangedCrit += 20; + player.magicDamage += 0.20f; + player.meleeDamage += 0.20f; + player.rangedDamage += 0.20f; + } + if (player.statLife < 100) + { + player.magicCrit += 15; + player.meleeCrit += 15; + player.rangedCrit += 15; + player.magicDamage += 0.15f; + player.meleeDamage += 0.15f; + player.rangedDamage += 0.15f; + } + if (player.statLife < 200) + { + player.magicCrit += 10; + player.meleeCrit += 10; + player.rangedCrit += 10; + player.magicDamage += 0.10f; + player.meleeDamage += 0.10f; + player.rangedDamage += 0.10f; + } + if (player.statLife < 300) + { + player.magicCrit += 5; + player.meleeCrit += 5; + player.rangedCrit += 5; + player.magicDamage += 0.05f; + player.meleeDamage += 0.05f; + player.rangedDamage += 0.05f; + } + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ChaoticAmplifier", 1); - recipe.AddIngredient(null, "Stigmata", 1); - recipe.SetResult(this); - recipe.AddTile(114); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ChaoticAmplifier", 1); + recipe.AddIngredient(null, "Stigmata", 1); + recipe.SetResult(this); + recipe.AddTile(114); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Charcoal.cs b/Items/Charcoal.cs index a9c78cc4..2543f816 100644 --- a/Items/Charcoal.cs +++ b/Items/Charcoal.cs @@ -4,37 +4,39 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Charcoal : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Charcoal : ModItem + { + public override void SetDefaults() + { - item.width = 16; - item.height = 16; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.createTile = mod.TileType("CoalBlock"); - } + item.width = 16; + item.height = 16; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.createTile = mod.TileType("CoalBlock"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Charcoal"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Charcoal"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Wood, 5); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Wood, 5); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } + } +} diff --git a/Items/ChargedCrystal.cs b/Items/ChargedCrystal.cs index 964e4b9d..76fc466b 100644 --- a/Items/ChargedCrystal.cs +++ b/Items/ChargedCrystal.cs @@ -4,23 +4,25 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ChargedCrystal : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ChargedCrystal : ModItem + { + public override void SetDefaults() + { - item.width = 14; - item.height = 22; - item.maxStack = 999; - item.rare = 11; - item.value = Item.buyPrice(0, 1, 0, 0); - } + item.width = 14; + item.height = 22; + item.maxStack = 999; + item.rare = 11; + item.value = Item.buyPrice(0, 1, 0, 0); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Charged Crystal"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Charged Crystal"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/ChatteringTeethBanner.cs b/Items/ChatteringTeethBanner.cs index 87ab1173..8f4ed60f 100644 --- a/Items/ChatteringTeethBanner.cs +++ b/Items/ChatteringTeethBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ChatteringTeethBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ChatteringTeethBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 17; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 17; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Chattering Teeth Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Chattering Teeth Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/ChefHat.cs b/Items/ChefHat.cs index e9601576..5b5f238a 100644 --- a/Items/ChefHat.cs +++ b/Items/ChefHat.cs @@ -5,24 +5,27 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class ChefHat : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class ChefHat : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 24; - item.rare = 1; - } + item.width = 26; + item.height = 24; + item.rare = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Chef Hat"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Chef Hat"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/Chemikaze.cs b/Items/Chemikaze.cs index c8cd3045..740dc732 100644 --- a/Items/Chemikaze.cs +++ b/Items/Chemikaze.cs @@ -4,58 +4,60 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Chemikaze : ModItem +namespace Tremor.Items { - - public override bool CanEquipAccessory(Player player, int slot) - { - for(int i=0; i < player.armor.Length; i++) - { - MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - if(modPlayer.pyro == true) - { - return false; - } - } - return true; - } - - public override void SetDefaults() - { - - item.width = 22; - item.height = 44; - - item.value = 300000; - item.rare = 6; - item.accessory = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("The Chemikaze"); - Tooltip.SetDefault("Alchemical flasks leave five explosions"); - } - - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.ExplosivePowder, 25); - recipe.AddIngredient(null, "Pyro", 1); - recipe.AddIngredient(null, "MoltenParts", 1); - recipe.AddIngredient(ItemID.SoulofLight, 3); - recipe.AddIngredient(ItemID.SoulofNight, 3); - recipe.SetResult(this); - recipe.AddTile(114); - recipe.AddRecipe(); - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - player.AddBuff(mod.BuffType("ChemikazeBuff"), 2); - modPlayer.pyro = true; - } -}} + public class Chemikaze : ModItem + { + + public override bool CanEquipAccessory(Player player, int slot) + { + for (int i = 0; i < player.armor.Length; i++) + { + MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); + if (modPlayer.pyro == true) + { + return false; + } + } + return true; + } + + public override void SetDefaults() + { + + item.width = 22; + item.height = 44; + + item.value = 300000; + item.rare = 6; + item.accessory = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("The Chemikaze"); + Tooltip.SetDefault("Alchemical flasks leave five explosions"); + } + + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.ExplosivePowder, 25); + recipe.AddIngredient(null, "Pyro", 1); + recipe.AddIngredient(null, "MoltenParts", 1); + recipe.AddIngredient(ItemID.SoulofLight, 3); + recipe.AddIngredient(ItemID.SoulofNight, 3); + recipe.SetResult(this); + recipe.AddTile(114); + recipe.AddRecipe(); + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); + player.AddBuff(mod.BuffType("ChemikazeBuff"), 2); + modPlayer.pyro = true; + } + } +} diff --git a/Items/ChemistHelmet.cs b/Items/ChemistHelmet.cs index 7528073b..1e4adf2b 100644 --- a/Items/ChemistHelmet.cs +++ b/Items/ChemistHelmet.cs @@ -5,54 +5,57 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class ChemistHelmet : ModItem +namespace Tremor.Items { - - - public override void SetDefaults() - { - - item.width = 38; - item.height = 22; - - item.value = 10000; - item.rare = 2; - item.defense = 2; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Chemist Helmet"); - Tooltip.SetDefault("Increases alchemic damage by 6%"); - } - - - public override void UpdateEquip(Player player) - { - player.GetModPlayer(mod).alchemistDamage += 0.06f; - } - - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("ChemistJacket") && legs.type == mod.ItemType("ChemistPants"); - } - - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increases alchemic critical strike chance by 10%"; - player.GetModPlayer(mod).alchemistCrit += 10; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "LeatherHat", 1); - recipe.AddIngredient(null, "ChainCoif", 1); - recipe.AddIngredient(ItemID.Goggles, 1); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } - -}} + [AutoloadEquip(EquipType.Head)] + public class ChemistHelmet : ModItem + { + + + public override void SetDefaults() + { + + item.width = 38; + item.height = 22; + + item.value = 10000; + item.rare = 2; + item.defense = 2; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Chemist Helmet"); + Tooltip.SetDefault("Increases alchemic damage by 6%"); + } + + + public override void UpdateEquip(Player player) + { + player.GetModPlayer(mod).alchemistDamage += 0.06f; + } + + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("ChemistJacket") && legs.type == mod.ItemType("ChemistPants"); + } + + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increases alchemic critical strike chance by 10%"; + player.GetModPlayer(mod).alchemistCrit += 10; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "LeatherHat", 1); + recipe.AddIngredient(null, "ChainCoif", 1); + recipe.AddIngredient(ItemID.Goggles, 1); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } + + } +} diff --git a/Items/ChemistJacket.cs b/Items/ChemistJacket.cs index 56a91ca1..b2b7ab42 100644 --- a/Items/ChemistJacket.cs +++ b/Items/ChemistJacket.cs @@ -6,8 +6,8 @@ using Terraria.ModLoader; namespace Tremor.Items -{ -[AutoloadEquip(EquipType.Body)] +{ + [AutoloadEquip(EquipType.Body)] public class ChemistJacket : ModItem { @@ -22,27 +22,27 @@ public override void SetDefaults() item.defense = 3; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Chemist Jacket"); - Tooltip.SetDefault("Increases alchemic damage by 6%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Chemist Jacket"); + Tooltip.SetDefault("Increases alchemic damage by 6%"); + } public override void UpdateEquip(Player player) { - player.GetModPlayer(mod).alchemistDamage += 0.06f; + player.GetModPlayer(mod).alchemistDamage += 0.06f; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "LeatherShirt", 1); - recipe.AddIngredient(null, "Chainmail", 1); - recipe.AddIngredient(null, "HazardousChemicals", 1); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "LeatherShirt", 1); + recipe.AddIngredient(null, "Chainmail", 1); + recipe.AddIngredient(null, "HazardousChemicals", 1); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } } } diff --git a/Items/ChemistPants.cs b/Items/ChemistPants.cs index 8a54a08c..66fb9e36 100644 --- a/Items/ChemistPants.cs +++ b/Items/ChemistPants.cs @@ -5,42 +5,45 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class ChemistPants : ModItem +namespace Tremor.Items { - - - public override void SetDefaults() - { - - item.width = 38; - item.height = 22; - - item.value = 10000; - item.rare = 2; - item.defense = 2; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Chemist Pants"); - Tooltip.SetDefault("Increases alchemic damage by 6%"); - } - - - public override void UpdateEquip(Player player) - { - player.GetModPlayer(mod).alchemistDamage += 0.06f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ChainGreaves", 1); - recipe.AddIngredient(null, "LeatherGreaves", 1); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } - -}} + [AutoloadEquip(EquipType.Legs)] + public class ChemistPants : ModItem + { + + + public override void SetDefaults() + { + + item.width = 38; + item.height = 22; + + item.value = 10000; + item.rare = 2; + item.defense = 2; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Chemist Pants"); + Tooltip.SetDefault("Increases alchemic damage by 6%"); + } + + + public override void UpdateEquip(Player player) + { + player.GetModPlayer(mod).alchemistDamage += 0.06f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ChainGreaves", 1); + recipe.AddIngredient(null, "LeatherGreaves", 1); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } + + } +} diff --git a/Items/ChickenLegMace.cs b/Items/ChickenLegMace.cs index c5882cae..7c1fbf4c 100644 --- a/Items/ChickenLegMace.cs +++ b/Items/ChickenLegMace.cs @@ -4,30 +4,32 @@ using Terraria.ModLoader; using Terraria.ID; -namespace Tremor.Items { -public class ChickenLegMace : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ChickenLegMace : ModItem + { + public override void SetDefaults() + { - item.damage = 22; - item.melee = true; - item.width = 54; - item.height = 54; - item.useTime = 45; - item.useAnimation = 45; - item.useStyle = 1; - item.knockBack = 12; - item.value = 10000; - item.rare = 2; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 22; + item.melee = true; + item.width = 54; + item.height = 54; + item.useTime = 45; + item.useAnimation = 45; + item.useStyle = 1; + item.knockBack = 12; + item.value = 10000; + item.rare = 2; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Chicken Leg Mace"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Chicken Leg Mace"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/ChilledBow.cs b/Items/ChilledBow.cs index b2dcc0ee..27b309e7 100644 --- a/Items/ChilledBow.cs +++ b/Items/ChilledBow.cs @@ -4,41 +4,43 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ChilledBow : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ChilledBow : ModItem + { + public override void SetDefaults() + { - item.damage = 13; - item.width = 18; - item.height = 56; - item.ranged = true; - item.useTime = 30; - item.shoot = 1; - item.shootSpeed = 12f; - item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 5; - item.value = 2500; - item.useAmmo = AmmoID.Arrow; - item.rare = 1; - item.UseSound = SoundID.Item5; - item.autoReuse = true; - } + item.damage = 13; + item.width = 18; + item.height = 56; + item.ranged = true; + item.useTime = 30; + item.shoot = 1; + item.shootSpeed = 12f; + item.useAnimation = 30; + item.useStyle = 5; + item.knockBack = 5; + item.value = 2500; + item.useAmmo = AmmoID.Arrow; + item.rare = 1; + item.UseSound = SoundID.Item5; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Chilled Bow"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Chilled Bow"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "FrostCore", 9); - recipe.AddTile(16); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "FrostCore", 9); + recipe.AddTile(16); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/ChippyRedSteelSword.cs b/Items/ChippyRedSteelSword.cs index f5a14605..f79b14ba 100644 --- a/Items/ChippyRedSteelSword.cs +++ b/Items/ChippyRedSteelSword.cs @@ -4,24 +4,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ChippyRedSteelSword : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ChippyRedSteelSword : ModItem + { + public override void SetDefaults() + { - item.width = 20; - item.height = 20; - item.maxStack = 99; - item.value = 50; - item.rare = 1; - } + item.width = 20; + item.height = 20; + item.maxStack = 99; + item.value = 50; + item.rare = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Chippy Red Steel Sword"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Chippy Red Steel Sword"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/ChlorophyteDeadshooter.cs b/Items/ChlorophyteDeadshooter.cs index 7a190faf..0266fbe1 100644 --- a/Items/ChlorophyteDeadshooter.cs +++ b/Items/ChlorophyteDeadshooter.cs @@ -5,55 +5,57 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ChlorophyteDeadshooter : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ChlorophyteDeadshooter : ModItem + { + public override void SetDefaults() + { - item.damage = 39; - item.ranged = true; - item.width = 40; - item.height = 20; - item.useTime = 29; - item.useAnimation = 29; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 6; - item.value = 30000; - item.rare = 6; - item.UseSound = SoundID.Item11; - item.autoReuse = true; - item.shoot = 10; - item.shootSpeed = 10f; - item.useAmmo = AmmoID.Bullet; - } + item.damage = 39; + item.ranged = true; + item.width = 40; + item.height = 20; + item.useTime = 29; + item.useAnimation = 29; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 6; + item.value = 30000; + item.rare = 6; + item.UseSound = SoundID.Item11; + item.autoReuse = true; + item.shoot = 10; + item.shootSpeed = 10f; + item.useAmmo = AmmoID.Bullet; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Chlorophyte Deadshooter"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Chlorophyte Deadshooter"); + Tooltip.SetDefault(""); + } -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) -{ - for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. - { - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); - } - return false; -} + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. + { + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); + } + return false; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.ChlorophyteBar, 15); - recipe.AddIngredient(ItemID.ShroomiteBar, 10); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.ChlorophyteBar, 15); + recipe.AddIngredient(ItemID.ShroomiteBar, 10); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/ChlorophyteHat.cs b/Items/ChlorophyteHat.cs index a7213e8f..405ab5d5 100644 --- a/Items/ChlorophyteHat.cs +++ b/Items/ChlorophyteHat.cs @@ -5,58 +5,61 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class ChlorophyteHat : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class ChlorophyteHat : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 24; - item.height = 26; + item.width = 24; + item.height = 26; - item.value = 60000; - item.rare = 4; - item.defense = 8; - } + item.value = 60000; + item.rare = 4; + item.defense = 8; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Chlorophyte Hat"); - Tooltip.SetDefault("Increases minion damage by 25%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Chlorophyte Hat"); + Tooltip.SetDefault("Increases minion damage by 25%"); + } - public override void UpdateEquip(Player player) - { - player.minionDamage += 0.25f; - } + public override void UpdateEquip(Player player) + { + player.minionDamage += 0.25f; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == 1004 && legs.type == 1005; - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == 1004 && legs.type == 1005; + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increases your max number of minions and summons a powerful leaf crystal to shoot at nearby enemies."; - player.maxMinions += 3; - player.AddBuff(60, 60, true); - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increases your max number of minions and summons a powerful leaf crystal to shoot at nearby enemies."; + player.maxMinions += 3; + player.AddBuff(60, 60, true); + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawOutlines=true; + player.armorEffectDrawOutlines = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.ChlorophyteBar, 12); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.ChlorophyteBar, 12); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/ChlorophyteHeader.cs b/Items/ChlorophyteHeader.cs index f5f174bd..8ec10432 100644 --- a/Items/ChlorophyteHeader.cs +++ b/Items/ChlorophyteHeader.cs @@ -5,58 +5,61 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class ChlorophyteHeader : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class ChlorophyteHeader : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 24; - item.height = 26; + item.width = 24; + item.height = 26; - item.value = 60000; - item.rare = 4; - item.defense = 8; - } + item.value = 60000; + item.rare = 4; + item.defense = 8; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Chlorophyte Header"); - Tooltip.SetDefault("Increases thrown damage by 28%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Chlorophyte Header"); + Tooltip.SetDefault("Increases thrown damage by 28%"); + } - public override void UpdateEquip(Player player) - { - player.thrownDamage += 0.28f; - } + public override void UpdateEquip(Player player) + { + player.thrownDamage += 0.28f; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == 1004 && legs.type == 1005; - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == 1004 && legs.type == 1005; + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increases thrown weapon velocity and summons a powerful leaf crystal to shoot at nearby enemies."; - player.thrownVelocity +=0.25f; - player.AddBuff(60, 60, true); - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increases thrown weapon velocity and summons a powerful leaf crystal to shoot at nearby enemies."; + player.thrownVelocity += 0.25f; + player.AddBuff(60, 60, true); + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawOutlines=true; + player.armorEffectDrawOutlines = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.ChlorophyteBar, 12); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.ChlorophyteBar, 12); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/ChlorophyteVisage.cs b/Items/ChlorophyteVisage.cs index 4c1c047c..a59c69b2 100644 --- a/Items/ChlorophyteVisage.cs +++ b/Items/ChlorophyteVisage.cs @@ -7,57 +7,57 @@ namespace Tremor.Items { -[AutoloadEquip(EquipType.Head)] - public class ChlorophyteVisage : ModItem - { - - public override void SetDefaults() - { - - item.width = 24; - item.height = 22; - - item.value = 60000; - item.rare = 7; - item.defense = 13; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Chlorophyte Visage"); - Tooltip.SetDefault("Increases alchemic damage by 29%"); - } - - - public override void UpdateEquip(Player player) - { - player.GetModPlayer(mod).alchemistDamage += 0.29f; - } - - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == 1004 && legs.type == 1005; - } - - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increases alchemic critical chance by 25% and summons a powerful leaf crystal to shoot at nearby enemies."; - player.GetModPlayer(mod).alchemistCrit += 22; - player.AddBuff(60, 60, true); - } - - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawOutlines = true; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.ChlorophyteBar, 12); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } - } + [AutoloadEquip(EquipType.Head)] + public class ChlorophyteVisage : ModItem + { + + public override void SetDefaults() + { + + item.width = 24; + item.height = 22; + + item.value = 60000; + item.rare = 7; + item.defense = 13; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Chlorophyte Visage"); + Tooltip.SetDefault("Increases alchemic damage by 29%"); + } + + + public override void UpdateEquip(Player player) + { + player.GetModPlayer(mod).alchemistDamage += 0.29f; + } + + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == 1004 && legs.type == 1005; + } + + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increases alchemic critical chance by 25% and summons a powerful leaf crystal to shoot at nearby enemies."; + player.GetModPlayer(mod).alchemistCrit += 22; + player.AddBuff(60, 60, true); + } + + public override void ArmorSetShadows(Player player) + { + player.armorEffectDrawOutlines = true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.ChlorophyteBar, 12); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } } diff --git a/Items/ChristmasFireplace.cs b/Items/ChristmasFireplace.cs index aee2c50e..fe6e605f 100644 --- a/Items/ChristmasFireplace.cs +++ b/Items/ChristmasFireplace.cs @@ -4,40 +4,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ChristmasFireplace : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ChristmasFireplace : ModItem + { + public override void SetDefaults() + { - item.width = 48; - item.height = 32; - item.maxStack = 99; - item.rare = 1; - item.createTile = mod.TileType("ChristmasFireplace"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - } + item.width = 48; + item.height = 32; + item.maxStack = 99; + item.rare = 1; + item.createTile = mod.TileType("ChristmasFireplace"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Christmas Fireplace"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Christmas Fireplace"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.RedBrick, 10); - recipe.AddIngredient(ItemID.Wood, 4); - recipe.AddIngredient(ItemID.Torch, 2); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.RedBrick, 10); + recipe.AddIngredient(ItemID.Wood, 4); + recipe.AddIngredient(ItemID.Torch, 2); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CinderBlade.cs b/Items/CinderBlade.cs index b3269f5c..8e576677 100644 --- a/Items/CinderBlade.cs +++ b/Items/CinderBlade.cs @@ -4,39 +4,41 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class CinderBlade : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CinderBlade : ModItem + { + public override void SetDefaults() + { - item.damage = 70; - item.melee = true; - item.width = 52; - item.height = 52; - item.useTime = 22; - item.useAnimation = 22; - item.useStyle = 1; - item.knockBack = 4; - item.value = 600; - item.rare = 8; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 70; + item.melee = true; + item.width = 52; + item.height = 52; + item.useTime = 22; + item.useAnimation = 22; + item.useStyle = 1; + item.knockBack = 4; + item.value = 600; + item.rare = 8; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cinder Blade"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cinder Blade"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "MagmoniumBar", 12); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "MagmoniumBar", 12); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CloudSlimeBanner.cs b/Items/CloudSlimeBanner.cs index 04172a8d..3ea16668 100644 --- a/Items/CloudSlimeBanner.cs +++ b/Items/CloudSlimeBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class CloudSlimeBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CloudSlimeBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 48; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 48; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cloud Slime Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cloud Slime Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/ClusterFlask.cs b/Items/ClusterFlask.cs index 16e31196..0dcd3952 100644 --- a/Items/ClusterFlask.cs +++ b/Items/ClusterFlask.cs @@ -9,80 +9,81 @@ namespace Tremor.Items { public class ClusterFlask : AlchemistItem - { + { - public override void SetDefaults() - { - item.crit = 4; - item.damage = 132; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 15; - item.useAnimation = 15; - item.shoot = mod.ProjectileType("ClusterFlaskPro"); - item.shootSpeed = 8f; - item.useStyle = 1; - item.knockBack = 1; - item.UseSound = SoundID.Item106; - item.value = 30; - item.rare = 1; - item.autoReuse = false; + public override void SetDefaults() + { + item.crit = 4; + item.damage = 132; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 15; + item.useAnimation = 15; + item.shoot = mod.ProjectileType("ClusterFlaskPro"); + item.shootSpeed = 8f; + item.useStyle = 1; + item.knockBack = 1; + item.UseSound = SoundID.Item106; + item.value = 30; + item.rare = 1; + item.autoReuse = false; - item.ammo = mod.ItemType("BoomFlask"); - } + item.ammo = mod.ItemType("BoomFlask"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cluster Flask"); - Tooltip.SetDefault("Throws a flask that explodes into cluster clouds"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cluster Flask"); + Tooltip.SetDefault("Throws a flask that explodes into cluster clouds"); + } - public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) - { - type = mod.ProjectileType("ClusterCloudPro"); - } + public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) + { + type = mod.ProjectileType("ClusterCloudPro"); + } + + public override void UpdateInventory(Player player) + { + MPlayer modPlayer = player.GetModPlayer(mod); + if (modPlayer.novaHelmet) + { + item.autoReuse = true; + } + if (!modPlayer.novaHelmet) + { + item.autoReuse = false; + } - public override void UpdateInventory(Player player) - { - MPlayer modPlayer = player.GetModPlayer(mod); - if (modPlayer.novaHelmet) - { - item.autoReuse = true; - } - if (!modPlayer.novaHelmet) - { - item.autoReuse = false; - } - - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) - { - item.shootSpeed = 11f; - } - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) - { - item.shootSpeed = 8f; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) - { - item.autoReuse = true; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) - { - item.autoReuse = false; - } - } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) + { + item.shootSpeed = 11f; + } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) + { + item.shootSpeed = 8f; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) + { + item.autoReuse = true; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) + { + item.autoReuse = false; + } + } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.BottledWater, 1); - recipe.AddIngredient(null, "GelCube", 1); - recipe.AddIngredient(null, "ClusterShard", 1); + recipe.AddIngredient(null, "GelCube", 1); + recipe.AddIngredient(null, "ClusterShard", 1); recipe.SetResult(this, 50); recipe.AddRecipe(); } -}} + } +} diff --git a/Items/ClusterShard.cs b/Items/ClusterShard.cs index 674dc938..6faee34d 100644 --- a/Items/ClusterShard.cs +++ b/Items/ClusterShard.cs @@ -4,24 +4,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ClusterShard : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ClusterShard : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 12000; - item.rare = 11; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 12000; + item.rare = 11; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cluster Shard"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cluster Shard"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/ClusterSpear.cs b/Items/ClusterSpear.cs index 1dcf4c56..356a7bc8 100644 --- a/Items/ClusterSpear.cs +++ b/Items/ClusterSpear.cs @@ -4,34 +4,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ClusterSpear : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ClusterSpear : ModItem + { + public override void SetDefaults() + { - item.damage = 295; - item.width = 70; - item.height = 70; - item.noUseGraphic = true; - item.melee = true; - item.useTime = 16; - item.shoot = mod.ProjectileType("ClusterSpearPro"); - item.shootSpeed = 5f; - item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 4; - item.value = 512500; - item.rare = 11; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 295; + item.width = 70; + item.height = 70; + item.noUseGraphic = true; + item.melee = true; + item.useTime = 16; + item.shoot = mod.ProjectileType("ClusterSpearPro"); + item.shootSpeed = 5f; + item.useAnimation = 30; + item.useStyle = 5; + item.knockBack = 4; + item.value = 512500; + item.rare = 11; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cluster Spear"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cluster Spear"); + Tooltip.SetDefault(""); + } public override void AddRecipes() { @@ -43,5 +44,6 @@ public override void AddRecipes() recipe.AddTile(412); recipe.SetResult(this); recipe.AddRecipe(); - } -}} + } + } +} diff --git a/Items/CoalFish.cs b/Items/CoalFish.cs index 9e766bdf..9a2493e8 100644 --- a/Items/CoalFish.cs +++ b/Items/CoalFish.cs @@ -21,11 +21,11 @@ public override void SetDefaults() item.rare = -11; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Coal Fish"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Coal Fish"); + Tooltip.SetDefault(""); + } public override bool IsQuestFish() diff --git a/Items/CobaltDisc.cs b/Items/CobaltDisc.cs index 1744f5ab..3e09ab7c 100644 --- a/Items/CobaltDisc.cs +++ b/Items/CobaltDisc.cs @@ -4,53 +4,55 @@ using Terraria.ModLoader; using Terraria.ID; -namespace Tremor.Items { -public class CobaltDisc : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CobaltDisc : ModItem + { + public override void SetDefaults() + { - item.damage = 35; - item.thrown = true; - item.width = 48; - item.height = 48; - item.useTime = 20; - item.shootSpeed = 12f; - item.useAnimation = 20; - item.useStyle = 1; - item.knockBack = 3f; - item.shoot = mod.ProjectileType("CobaltDiscPro"); - item.value = 27600; - item.rare = 4; - item.noUseGraphic = true; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 35; + item.thrown = true; + item.width = 48; + item.height = 48; + item.useTime = 20; + item.shootSpeed = 12f; + item.useAnimation = 20; + item.useStyle = 1; + item.knockBack = 3f; + item.shoot = mod.ProjectileType("CobaltDiscPro"); + item.value = 27600; + item.rare = 4; + item.noUseGraphic = true; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cobalt Disc"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cobalt Disc"); + Tooltip.SetDefault(""); + } -public override bool CanUseItem(Player player) -{ - for (int i = 0; i < 1000; ++i) - { - if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) - { - return false; - } - } - return true; + public override bool CanUseItem(Player player) + { + for (int i = 0; i < 1000; ++i) + { + if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) + { + return false; + } + } + return true; + } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.CobaltBar, 12); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.CobaltBar, 12); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} diff --git a/Items/CobaltHeader.cs b/Items/CobaltHeader.cs index 69216508..d3bca626 100644 --- a/Items/CobaltHeader.cs +++ b/Items/CobaltHeader.cs @@ -5,56 +5,59 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class CobaltHeader : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class CobaltHeader : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 20; - item.height = 26; + item.width = 20; + item.height = 26; - item.value = 400; - item.rare = 4; - item.defense = 3; - } + item.value = 400; + item.rare = 4; + item.defense = 3; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cobalt Header"); - Tooltip.SetDefault("Increases thrown damage by 18%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cobalt Header"); + Tooltip.SetDefault("Increases thrown damage by 18%"); + } - public override void UpdateEquip(Player player) - { - player.thrownDamage += 0.18f; - } + public override void UpdateEquip(Player player) + { + player.thrownDamage += 0.18f; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == 374 && legs.type == 375; - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == 374 && legs.type == 375; + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increases thrown weapon velocity"; - player.thrownVelocity +=0.25f; - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increases thrown weapon velocity"; + player.thrownVelocity += 0.25f; + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawShadow=true; + player.armorEffectDrawShadow = true; + } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.CobaltBar, 12); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.CobaltBar, 12); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + } +} diff --git a/Items/CobaltHeadgear.cs b/Items/CobaltHeadgear.cs index f1352534..12a5589d 100644 --- a/Items/CobaltHeadgear.cs +++ b/Items/CobaltHeadgear.cs @@ -5,56 +5,59 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class CobaltHeadgear : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class CobaltHeadgear : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 20; - item.height = 26; + item.width = 20; + item.height = 26; - item.value = 400; - item.rare = 4; - item.defense = 3; - } + item.value = 400; + item.rare = 4; + item.defense = 3; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cobalt Headgear"); - Tooltip.SetDefault("Increases minion damage by 18%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cobalt Headgear"); + Tooltip.SetDefault("Increases minion damage by 18%"); + } - public override void UpdateEquip(Player player) - { - player.minionDamage += 0.18f; - } + public override void UpdateEquip(Player player) + { + player.minionDamage += 0.18f; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == 374 && legs.type == 375; - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == 374 && legs.type == 375; + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increases your max number of minions"; - player.maxMinions += 1; - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increases your max number of minions"; + player.maxMinions += 1; + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawShadow=true; + player.armorEffectDrawShadow = true; + } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.CobaltBar, 12); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.CobaltBar, 12); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + } +} diff --git a/Items/CobaltRifle.cs b/Items/CobaltRifle.cs index b9bee6ca..3d8b07bc 100644 --- a/Items/CobaltRifle.cs +++ b/Items/CobaltRifle.cs @@ -5,47 +5,49 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class CobaltRifle : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CobaltRifle : ModItem + { + public override void SetDefaults() + { - item.damage = 35; - item.ranged = true; - item.width = 40; - item.height = 20; - item.useTime = 15; - item.useAnimation = 15; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 6; - item.value = 10000; - item.rare = 4; - item.UseSound = SoundID.Item11; - item.autoReuse = true; - item.shoot = 10; - item.shootSpeed = 12f; - item.useAmmo = AmmoID.Bullet; - } + item.damage = 35; + item.ranged = true; + item.width = 40; + item.height = 20; + item.useTime = 15; + item.useAnimation = 15; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 6; + item.value = 10000; + item.rare = 4; + item.UseSound = SoundID.Item11; + item.autoReuse = true; + item.shoot = 10; + item.shootSpeed = 12f; + item.useAmmo = AmmoID.Bullet; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cobalt Rifle"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cobalt Rifle"); + Tooltip.SetDefault(""); + } - public override Vector2? HoldoutOffset() - { - return new Vector2(-15, 0); - } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.CobaltBar, 15); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override Vector2? HoldoutOffset() + { + return new Vector2(-15, 0); + } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.CobaltBar, 15); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CobaltStaff.cs b/Items/CobaltStaff.cs index 64e97f5c..12d918d3 100644 --- a/Items/CobaltStaff.cs +++ b/Items/CobaltStaff.cs @@ -5,44 +5,46 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class CobaltStaff : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CobaltStaff : ModItem + { + public override void SetDefaults() + { - item.damage = 32; - item.magic = true; - item.mana = 9; - item.width = 40; - item.height = 40; - item.useTime = 28; - item.useAnimation = 28; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 3; - item.value = 13800; - item.rare = 4; - item.UseSound = SoundID.Item43; - item.autoReuse = true; - Item.staff[item.type] = true; //this makes the useStyle animate as a staff instead of as a gun - item.shoot = mod.ProjectileType("CobaltBolt"); - item.shootSpeed = 12f; - } + item.damage = 32; + item.magic = true; + item.mana = 9; + item.width = 40; + item.height = 40; + item.useTime = 28; + item.useAnimation = 28; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 3; + item.value = 13800; + item.rare = 4; + item.UseSound = SoundID.Item43; + item.autoReuse = true; + Item.staff[item.type] = true; //this makes the useStyle animate as a staff instead of as a gun + item.shoot = mod.ProjectileType("CobaltBolt"); + item.shootSpeed = 12f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cobalt Staff"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cobalt Staff"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.CobaltBar, 12); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.CobaltBar, 12); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CobaltVisage.cs b/Items/CobaltVisage.cs index 25b16a01..0c2ef139 100644 --- a/Items/CobaltVisage.cs +++ b/Items/CobaltVisage.cs @@ -7,56 +7,56 @@ namespace Tremor.Items { -[AutoloadEquip(EquipType.Head)] - public class CobaltVisage : ModItem - { - - public override void SetDefaults() - { - - item.width = 26; - item.height = 22; - - item.value = 400; - item.rare = 4; - item.defense = 4; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cobalt Visage"); - Tooltip.SetDefault("Increases alchemic damage by 18%"); - } - - - public override void UpdateEquip(Player player) - { - player.GetModPlayer(mod).alchemistDamage += 0.18f; - } - - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == 374 && legs.type == 375; - } - - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increases alchemic critical strike chance by 12%"; - player.GetModPlayer(mod).alchemistCrit += 12; - } - - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawShadow = true; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.CobaltBar, 10); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } - } + [AutoloadEquip(EquipType.Head)] + public class CobaltVisage : ModItem + { + + public override void SetDefaults() + { + + item.width = 26; + item.height = 22; + + item.value = 400; + item.rare = 4; + item.defense = 4; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cobalt Visage"); + Tooltip.SetDefault("Increases alchemic damage by 18%"); + } + + + public override void UpdateEquip(Player player) + { + player.GetModPlayer(mod).alchemistDamage += 0.18f; + } + + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == 374 && legs.type == 375; + } + + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increases alchemic critical strike chance by 12%"; + player.GetModPlayer(mod).alchemistCrit += 12; + } + + public override void ArmorSetShadows(Player player) + { + player.armorEffectDrawShadow = true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.CobaltBar, 10); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } } diff --git a/Items/CobaltWarhammer.cs b/Items/CobaltWarhammer.cs index 234c0baa..f7332e43 100644 --- a/Items/CobaltWarhammer.cs +++ b/Items/CobaltWarhammer.cs @@ -4,40 +4,42 @@ using Terraria.ModLoader; using Terraria.ID; -namespace Tremor.Items { -public class CobaltWarhammer : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CobaltWarhammer : ModItem + { + public override void SetDefaults() + { - item.damage = 38; - item.melee = true; - item.width = 44; - item.height = 40; - item.useTime = 39; - item.useAnimation = 39; - item.hammer = 80; - item.useStyle = 1; - item.knockBack = 5; - item.value = 13800; - item.rare = 4; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 38; + item.melee = true; + item.width = 44; + item.height = 40; + item.useTime = 39; + item.useAnimation = 39; + item.hammer = 80; + item.useStyle = 1; + item.knockBack = 5; + item.value = 13800; + item.rare = 4; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cobalt Warhammer"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cobalt Warhammer"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.CobaltBar, 10); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.CobaltBar, 10); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CogLordBag.cs b/Items/CogLordBag.cs index 3c88afc1..52bc2d74 100644 --- a/Items/CogLordBag.cs +++ b/Items/CogLordBag.cs @@ -4,59 +4,61 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class CogLordBag : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.maxStack = 999; - item.consumable = true; - item.width = 24; - item.height = 24; - - item.rare = 9; - item.expert = true; - bossBagNPC = mod.NPCType("CogLord"); - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Treasure Bag"); - Tooltip.SetDefault("Right click to open"); - } - - - public override bool CanRightClick() - { - return true; - } - - public override void OpenBossBag(Player player) - { - if(Main.rand.Next(7) == 0) - { - player.QuickSpawnItem(mod.ItemType("CogLordMask")); - } - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("BrassRapier")); - } - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("BrassChainRepeater")); - } - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("BrassStave")); - } - if(Main.rand.Next(10) == 0) - { - player.QuickSpawnItem(mod.ItemType("BrassChip")); - } - player.TryGettingDevArmor(); - player.QuickSpawnItem(mod.ItemType("HeatCore")); - player.QuickSpawnItem(mod.ItemType("BrassNugget"), Main.rand.Next(18,32)); - } - -}} + public class CogLordBag : ModItem + { + public override void SetDefaults() + { + + item.maxStack = 999; + item.consumable = true; + item.width = 24; + item.height = 24; + + item.rare = 9; + item.expert = true; + bossBagNPC = mod.NPCType("CogLord"); + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Treasure Bag"); + Tooltip.SetDefault("Right click to open"); + } + + + public override bool CanRightClick() + { + return true; + } + + public override void OpenBossBag(Player player) + { + if (Main.rand.Next(7) == 0) + { + player.QuickSpawnItem(mod.ItemType("CogLordMask")); + } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("BrassRapier")); + } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("BrassChainRepeater")); + } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("BrassStave")); + } + if (Main.rand.Next(10) == 0) + { + player.QuickSpawnItem(mod.ItemType("BrassChip")); + } + player.TryGettingDevArmor(); + player.QuickSpawnItem(mod.ItemType("HeatCore")); + player.QuickSpawnItem(mod.ItemType("BrassNugget"), Main.rand.Next(18, 32)); + } + + } +} diff --git a/Items/CogLordMask.cs b/Items/CogLordMask.cs index 14c875a1..7d3bf467 100644 --- a/Items/CogLordMask.cs +++ b/Items/CogLordMask.cs @@ -4,25 +4,28 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class CogLordMask : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class CogLordMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 20; - item.height = 24; - item.rare = 1; - item.vanity = true; - } + item.width = 20; + item.height = 24; + item.rare = 1; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cog Lord Mask"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cog Lord Mask"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/CogLordMusicBox.cs b/Items/CogLordMusicBox.cs index 09ad1efb..fc25421f 100644 --- a/Items/CogLordMusicBox.cs +++ b/Items/CogLordMusicBox.cs @@ -25,11 +25,11 @@ public override void SetDefaults() item.accessory = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Music Box (Cog Lord)"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Music Box (Cog Lord)"); + Tooltip.SetDefault(""); + } } } diff --git a/Items/CogLordTrophy.cs b/Items/CogLordTrophy.cs index 3bad5203..d66dcdfd 100644 --- a/Items/CogLordTrophy.cs +++ b/Items/CogLordTrophy.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class CogLordTrophy : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CogLordTrophy : ModItem + { + public override void SetDefaults() + { - item.width = 32; - item.height = 32; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 50000; - item.createTile = mod.TileType("CogLordTrophy"); - item.placeStyle = 0; - } + item.width = 32; + item.height = 32; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 50000; + item.createTile = mod.TileType("CogLordTrophy"); + item.placeStyle = 0; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cog Lord Trophy"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cog Lord Trophy"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/ColdMetalWings.cs b/Items/ColdMetalWings.cs index 32d74e5b..1632ec9d 100644 --- a/Items/ColdMetalWings.cs +++ b/Items/ColdMetalWings.cs @@ -7,7 +7,7 @@ namespace Tremor.Items { -[AutoloadEquip(EquipType.Wings)] + [AutoloadEquip(EquipType.Wings)] public class ColdMetalWings : ModItem { @@ -23,15 +23,15 @@ public override void SetDefaults() } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Frosteel Wings"); - Tooltip.SetDefault("Allows flight and slow fall"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Frosteel Wings"); + Tooltip.SetDefault("Allows flight and slow fall"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { + public override void UpdateAccessory(Player player, bool hideVisual) + { player.wingTimeMax = 200; } @@ -39,30 +39,30 @@ public override void VerticalWingSpeeds(Player player, ref float ascentWhenFalli ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend) { - ascentWhenFalling = 0.85f; - ascentWhenRising = 0.15f; - maxCanAscendMultiplier = 1f; - maxAscentMultiplier = 3f; - constantAscend = 0.155f; - } + ascentWhenFalling = 0.85f; + ascentWhenRising = 0.15f; + maxCanAscendMultiplier = 1f; + maxAscentMultiplier = 3f; + constantAscend = 0.155f; + } public override void HorizontalWingSpeeds(Player player, ref float speed, ref float acceleration) { - speed = 15f; - acceleration *= 2.5f; - } + speed = 15f; + acceleration *= 2.5f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "FrostoneBar", 5); + recipe.AddIngredient(null, "IceSoul", 5); + recipe.AddIngredient(ItemID.SoulofFlight, 20); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "FrostoneBar", 5); - recipe.AddIngredient(null, "IceSoul", 5); - recipe.AddIngredient(ItemID.SoulofFlight, 20); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } - } } diff --git a/Items/ColdTooth.cs b/Items/ColdTooth.cs index d941b26e..6bdc6d18 100644 --- a/Items/ColdTooth.cs +++ b/Items/ColdTooth.cs @@ -6,62 +6,64 @@ using Terraria.ModLoader; -namespace Tremor.Items { -public class ColdTooth : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ColdTooth : ModItem + { + public override void SetDefaults() + { - item.damage = 18; - item.melee = true; - item.width = 42; - item.height = 46; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = 309; - item.shootSpeed = 6f; - item.useStyle = 1; - item.knockBack = 2; - item.value = 46000; - item.rare = 8; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 18; + item.melee = true; + item.width = 42; + item.height = 46; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = 309; + item.shootSpeed = 6f; + item.useStyle = 1; + item.knockBack = 2; + item.value = 46000; + item.rare = 8; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cold Tooth"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cold Tooth"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.GoldBroadsword, 1); - recipe.AddIngredient(null, "FrostCore", 8); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.GoldBroadsword, 1); + recipe.AddIngredient(null, "FrostCore", 8); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.PlatinumBroadsword, 1); - recipe.AddIngredient(null, "FrostCore", 8); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.PlatinumBroadsword, 1); + recipe.AddIngredient(null, "FrostCore", 8); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(44, 60); - } + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(44, 60); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if(Main.rand.Next(1) == 0) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 80); - } - } -}} + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.Next(1) == 0) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 80); + } + } + } +} diff --git a/Items/CollapsiumBar.cs b/Items/CollapsiumBar.cs index 772df810..283f5555 100644 --- a/Items/CollapsiumBar.cs +++ b/Items/CollapsiumBar.cs @@ -5,44 +5,46 @@ using Terraria.ID; using Microsoft.Xna.Framework; -namespace Tremor.Items { -public class CollapsiumBar : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CollapsiumBar : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 17500; - item.rare = 0; - item.createTile = mod.TileType("CollapsiumBarTile"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 17500; + item.rare = 0; + item.createTile = mod.TileType("CollapsiumBarTile"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Collapsium Bar"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Collapsium Bar"); + Tooltip.SetDefault(""); + } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) - { - tooltips[0].overrideColor = new Color(238, 194, 73); - } + public override void ModifyTooltips(System.Collections.Generic.List tooltips) + { + tooltips[0].overrideColor = new Color(238, 194, 73); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "CollapsiumOre", 6); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "CollapsiumOre", 6); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CollapsiumOre.cs b/Items/CollapsiumOre.cs index 58e91ecc..9e35fd4d 100644 --- a/Items/CollapsiumOre.cs +++ b/Items/CollapsiumOre.cs @@ -5,35 +5,37 @@ using Terraria.ID; using Microsoft.Xna.Framework; -namespace Tremor.Items { -public class CollapsiumOre : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CollapsiumOre : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 999; - item.value = 12500; - item.rare = 110; - item.createTile = mod.TileType("CollapsiumOreTile"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - } + item.width = 30; + item.height = 24; + item.maxStack = 999; + item.value = 12500; + item.rare = 110; + item.createTile = mod.TileType("CollapsiumOreTile"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Collapsium Ore"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Collapsium Ore"); + Tooltip.SetDefault(""); + } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) - { - tooltips[0].overrideColor = new Color(238, 194, 73); - } -}} + public override void ModifyTooltips(System.Collections.Generic.List tooltips) + { + tooltips[0].overrideColor = new Color(238, 194, 73); + } + } +} diff --git a/Items/ColossusSword.cs b/Items/ColossusSword.cs index 55b1aa6a..1055bc6b 100644 --- a/Items/ColossusSword.cs +++ b/Items/ColossusSword.cs @@ -4,30 +4,32 @@ using Terraria.ModLoader; using Terraria.ID; -namespace Tremor.Items { -public class ColossusSword : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ColossusSword : ModItem + { + public override void SetDefaults() + { - item.damage = 22; - item.melee = true; - item.width = 56; - item.height = 56; - item.useTime = 30; - item.useAnimation = 30; - item.useStyle = 1; - item.knockBack = 3; - item.value = 8000; - item.rare = 2; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 22; + item.melee = true; + item.width = 56; + item.height = 56; + item.useTime = 30; + item.useAnimation = 30; + item.useStyle = 1; + item.knockBack = 3; + item.value = 8000; + item.rare = 2; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Colossus Sword"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Colossus Sword"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/CometiteBar.cs b/Items/CometiteBar.cs index 471ee985..5c556e8d 100644 --- a/Items/CometiteBar.cs +++ b/Items/CometiteBar.cs @@ -4,38 +4,40 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class CometiteBar : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CometiteBar : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 17500; - item.rare = 11; - item.createTile = mod.TileType("CometiteBarTile"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 17500; + item.rare = 11; + item.createTile = mod.TileType("CometiteBarTile"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cometite Bar"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cometite Bar"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "CometiteOre", 5); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "CometiteOre", 5); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CometiteOre.cs b/Items/CometiteOre.cs index 625f589d..7305495c 100644 --- a/Items/CometiteOre.cs +++ b/Items/CometiteOre.cs @@ -12,24 +12,24 @@ public override void SetDefaults() { item.width = 12; - item.value = 10000; + item.value = 10000; item.height = 12; item.maxStack = 999; item.useTurn = true; item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.rare = 11; + item.rare = 11; item.useStyle = 1; item.consumable = true; item.createTile = mod.TileType("CometiteOreTile"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cometite Ore"); - Tooltip.SetDefault("'Ore from the depths of space'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cometite Ore"); + Tooltip.SetDefault("'Ore from the depths of space'"); + } } } diff --git a/Items/ConcentratedEther.cs b/Items/ConcentratedEther.cs index cb1c206f..b4fd3d2f 100644 --- a/Items/ConcentratedEther.cs +++ b/Items/ConcentratedEther.cs @@ -4,24 +4,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ConcentratedEther : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ConcentratedEther : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 15000; - item.rare = 9; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 15000; + item.rare = 9; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Concentrated Ether"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Concentrated Ether"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/ConcentratedTincture.cs b/Items/ConcentratedTincture.cs index 7752bd99..6c4f28d1 100644 --- a/Items/ConcentratedTincture.cs +++ b/Items/ConcentratedTincture.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ConcentratedTincture : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ConcentratedTincture : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 44; + item.width = 22; + item.height = 44; - item.value = 450000; - item.rare = 5; - item.accessory = true; - item.defense = 1; - } + item.value = 450000; + item.rare = 5; + item.accessory = true; + item.defense = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Concentrated Tincture"); - Tooltip.SetDefault("Increases life regeneration from healing flasks"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Concentrated Tincture"); + Tooltip.SetDefault("Increases life regeneration from healing flasks"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.AddBuff(mod.BuffType("ConcentratedTinctureBuff"), 2); - } -}} + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.AddBuff(mod.BuffType("ConcentratedTinctureBuff"), 2); + } + } +} diff --git a/Items/Conglomeration.cs b/Items/Conglomeration.cs index 35f7ea4a..08c47cd3 100644 --- a/Items/Conglomeration.cs +++ b/Items/Conglomeration.cs @@ -4,42 +4,44 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Conglomeration : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Conglomeration : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 44; - item.value = 250000; - item.rare = 11; - item.accessory = true; - } + item.width = 22; + item.height = 44; + item.value = 250000; + item.rare = 11; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Conglomeration"); - Tooltip.SetDefault("Prolonged after hit invincibility\nGreatly increased life regeneration\nIncreases maximum life by 140"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Conglomeration"); + Tooltip.SetDefault("Prolonged after hit invincibility\nGreatly increased life regeneration\nIncreases maximum life by 140"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.moveSpeed -=0.2f; - player.longInvince = true; - player.lifeRegen += 45; - player.statLifeMax2 += 140; - } + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.moveSpeed -= 0.2f; + player.longInvince = true; + player.lifeRegen += 45; + player.statLifeMax2 += 140; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "SwampClump"); - recipe.AddIngredient(null, "ExtraterrestrialRubies"); - recipe.AddIngredient(null, "DelightfulClump"); - recipe.SetResult(this); - recipe.AddTile(114); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "SwampClump"); + recipe.AddIngredient(null, "ExtraterrestrialRubies"); + recipe.AddIngredient(null, "DelightfulClump"); + recipe.SetResult(this); + recipe.AddTile(114); + recipe.AddRecipe(); + } + } +} diff --git a/Items/ConjurerSkeletonBanner.cs b/Items/ConjurerSkeletonBanner.cs index 59b13362..e25aea71 100644 --- a/Items/ConjurerSkeletonBanner.cs +++ b/Items/ConjurerSkeletonBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ConjurerSkeletonBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ConjurerSkeletonBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 49; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 49; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Conjurer Skeleton Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Conjurer Skeleton Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/CopperShield.cs b/Items/CopperShield.cs index ebd8315b..4df724fa 100644 --- a/Items/CopperShield.cs +++ b/Items/CopperShield.cs @@ -5,37 +5,39 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Shield)] -public class CopperShield : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + [AutoloadEquip(EquipType.Shield)] + public class CopperShield : ModItem + { + public override void SetDefaults() + { - item.width = 24; - item.height = 26; - item.value = 110; - item.rare = 0; - item.accessory = true; - item.defense = 2; - } + item.width = 24; + item.height = 26; + item.value = 110; + item.rare = 0; + item.accessory = true; + item.defense = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Copper Shield"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Copper Shield"); + Tooltip.SetDefault(""); + } - public override void UpdateEquip(Player player) - { - player.moveSpeed -= 0.10f; - } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.CopperBar, 15); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void UpdateEquip(Player player) + { + player.moveSpeed -= 0.10f; + } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.CopperBar, 15); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CopperSpear.cs b/Items/CopperSpear.cs index 6d729b79..707e7b15 100644 --- a/Items/CopperSpear.cs +++ b/Items/CopperSpear.cs @@ -4,42 +4,44 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class CopperSpear : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CopperSpear : ModItem + { + public override void SetDefaults() + { - item.damage = 9; - item.width = 14; - item.height = 84; - item.noUseGraphic = true; - item.melee = true; - item.useTime = 30; - item.shoot = mod.ProjectileType("CopperSpearPro"); - item.shootSpeed = 3f; - item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 4; - item.value = 1000; - item.rare = 0; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 9; + item.width = 14; + item.height = 84; + item.noUseGraphic = true; + item.melee = true; + item.useTime = 30; + item.shoot = mod.ProjectileType("CopperSpearPro"); + item.shootSpeed = 3f; + item.useAnimation = 30; + item.useStyle = 5; + item.knockBack = 4; + item.value = 1000; + item.rare = 0; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Copper Spear"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Copper Spear"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.CopperBar, 9); - recipe.AddTile(16); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.CopperBar, 9); + recipe.AddTile(16); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CoralChestplate.cs b/Items/CoralChestplate.cs index 47afb887..84fe37df 100644 --- a/Items/CoralChestplate.cs +++ b/Items/CoralChestplate.cs @@ -5,34 +5,36 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class CoralChestplate : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + [AutoloadEquip(EquipType.Body)] + public class CoralChestplate : ModItem + { + public override void SetDefaults() + { - item.width = 26; - item.height = 18; - item.value = 100; - item.rare = 1; - item.defense = 3; - } + item.width = 26; + item.height = 18; + item.value = 100; + item.rare = 1; + item.defense = 3; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Coral Chestplate"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Coral Chestplate"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Coral, 12); - recipe.AddIngredient(ItemID.Seashell, 4); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Coral, 12); + recipe.AddIngredient(ItemID.Seashell, 4); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CoralGreaves.cs b/Items/CoralGreaves.cs index ce890b82..e0861d84 100644 --- a/Items/CoralGreaves.cs +++ b/Items/CoralGreaves.cs @@ -5,36 +5,39 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class CoralGreaves : ModItem +namespace Tremor.Items { - - - public override void SetDefaults() - { - - item.width = 22; - item.height = 18; - item.value = 180; - item.rare = 1; - item.defense = 2; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Coral Greaves"); - Tooltip.SetDefault(""); - } - - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Coral, 10); - recipe.AddIngredient(ItemID.Starfish, 6); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } - -}} + [AutoloadEquip(EquipType.Legs)] + public class CoralGreaves : ModItem + { + + + public override void SetDefaults() + { + + item.width = 22; + item.height = 18; + item.value = 180; + item.rare = 1; + item.defense = 2; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Coral Greaves"); + Tooltip.SetDefault(""); + } + + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Coral, 10); + recipe.AddIngredient(ItemID.Starfish, 6); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } + + } +} diff --git a/Items/CoralHamaxe.cs b/Items/CoralHamaxe.cs index 1f1b520d..f39adf8c 100644 --- a/Items/CoralHamaxe.cs +++ b/Items/CoralHamaxe.cs @@ -4,41 +4,43 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class CoralHamaxe : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CoralHamaxe : ModItem + { + public override void SetDefaults() + { - item.damage = 8; - item.melee = true; - item.width = 36; - item.height = 34; - item.useTime = 20; - item.useAnimation = 20; - item.axe = 9; - item.hammer = 60; - item.useStyle = 1; - item.knockBack = 4; - item.value = 100; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 8; + item.melee = true; + item.width = 36; + item.height = 34; + item.useTime = 20; + item.useAnimation = 20; + item.axe = 9; + item.hammer = 60; + item.useStyle = 1; + item.knockBack = 4; + item.value = 100; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Coral Hamaxe"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Coral Hamaxe"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Coral, 10); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Coral, 10); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } + } } -}} diff --git a/Items/CoralHelmet.cs b/Items/CoralHelmet.cs index 671c3397..863727ea 100644 --- a/Items/CoralHelmet.cs +++ b/Items/CoralHelmet.cs @@ -5,62 +5,65 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class CoralHelmet : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class CoralHelmet : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 24; - item.height = 26; + item.width = 24; + item.height = 26; - item.value = 100; - item.rare = 1; - item.defense = 2; - } + item.value = 100; + item.rare = 1; + item.defense = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Coral Helmet"); - Tooltip.SetDefault("Allows you to swim"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Coral Helmet"); + Tooltip.SetDefault("Allows you to swim"); + } - public override void UpdateEquip(Player player) - { - player.accFlipper = true; - } + public override void UpdateEquip(Player player) + { + player.accFlipper = true; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == mod.ItemType("CoralChestplate") && legs.type == mod.ItemType("CoralGreaves"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("CoralChestplate") && legs.type == mod.ItemType("CoralGreaves"); + } - public override void UpdateArmorSet(Player player) - { + public override void UpdateArmorSet(Player player) + { player.setBonus = "Allows you to breath underwater and summons an starfish"; if (player.breath < player.breathMax - 1) { - player.breath = player.breathMax - 1; + player.breath = player.breathMax - 1; } - player.AddBuff(mod.BuffType("StarfishBuff"), 2); - } + player.AddBuff(mod.BuffType("StarfishBuff"), 2); + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawShadow=true; + player.armorEffectDrawShadow = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Coral, 8); - recipe.AddIngredient(ItemID.Starfish, 6); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Coral, 8); + recipe.AddIngredient(ItemID.Starfish, 6); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } -}} + } +} diff --git a/Items/CoralPickaxe.cs b/Items/CoralPickaxe.cs index 9320a1b0..7200b3e0 100644 --- a/Items/CoralPickaxe.cs +++ b/Items/CoralPickaxe.cs @@ -4,40 +4,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class CoralPickaxe : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CoralPickaxe : ModItem + { + public override void SetDefaults() + { - item.damage = 9; - item.melee = true; - item.width = 36; - item.height = 36; - item.useTime = 20; - item.useAnimation = 20; - item.pick = 43; - item.useStyle = 1; - item.knockBack = 5; - item.value = 100; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 9; + item.melee = true; + item.width = 36; + item.height = 36; + item.useTime = 20; + item.useAnimation = 20; + item.pick = 43; + item.useStyle = 1; + item.knockBack = 5; + item.value = 100; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Coral Pickaxe"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Coral Pickaxe"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Coral, 9); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Coral, 9); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } + } } -}} diff --git a/Items/CoralSlasher.cs b/Items/CoralSlasher.cs index 14910050..4b2bd373 100644 --- a/Items/CoralSlasher.cs +++ b/Items/CoralSlasher.cs @@ -4,39 +4,41 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class CoralSlasher : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CoralSlasher : ModItem + { + public override void SetDefaults() + { - item.damage = 12; - item.melee = true; - item.width = 48; - item.height = 48; - item.useTime = 100; - item.useAnimation = 20; - item.useStyle = 1; - item.knockBack = 2; - item.value = 100; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 12; + item.melee = true; + item.width = 48; + item.height = 48; + item.useTime = 100; + item.useAnimation = 20; + item.useStyle = 1; + item.knockBack = 2; + item.value = 100; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Coral Slasher"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Coral Slasher"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Coral, 15); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Coral, 15); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } + } } -}} diff --git a/Items/CoreBugBanner.cs b/Items/CoreBugBanner.cs index 056de82d..555ffda6 100644 --- a/Items/CoreBugBanner.cs +++ b/Items/CoreBugBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class CoreBugBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CoreBugBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 50; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 50; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Core Bug Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Core Bug Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/CoreSlimeBanner.cs b/Items/CoreSlimeBanner.cs index 15c2cabb..9f008f3b 100644 --- a/Items/CoreSlimeBanner.cs +++ b/Items/CoreSlimeBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class CoreSlimeBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CoreSlimeBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 51; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 51; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Core Slime Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Core Slime Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/Corfire.cs b/Items/Corfire.cs index 4c012ae5..c8641b93 100644 --- a/Items/Corfire.cs +++ b/Items/Corfire.cs @@ -5,38 +5,39 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Corfire : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.CloneDefaults(3279); + public class Corfire : ModItem + { + public override void SetDefaults() + { + item.CloneDefaults(3279); - item.damage = 56; - item.width = 30; - item.height = 26; - item.shoot = mod.ProjectileType("CorfirePro"); - item.knockBack = 4; - item.value = 10000; - item.rare = 2; - } + item.damage = 56; + item.width = 30; + item.height = 26; + item.shoot = mod.ProjectileType("CorfirePro"); + item.knockBack = 4; + item.value = 10000; + item.rare = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Corfire"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Corfire"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(3290, 1); - recipe.AddIngredient(ItemID.SoulofSight, 5); - recipe.AddIngredient(ItemID.CursedFlame, 18); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(3290, 1); + recipe.AddIngredient(ItemID.SoulofSight, 5); + recipe.AddIngredient(ItemID.CursedFlame, 18); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } } diff --git a/Items/Corn.cs b/Items/Corn.cs index 3d695ce3..ea714086 100644 --- a/Items/Corn.cs +++ b/Items/Corn.cs @@ -4,23 +4,25 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Corn : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Corn : ModItem + { + public override void SetDefaults() + { - item.width = 26; - item.height = 26; - item.maxStack = 99; - item.value = 10; - item.rare = 2; - } + item.width = 26; + item.height = 26; + item.maxStack = 99; + item.value = 10; + item.rare = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Corn"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Corn"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/CornFish.cs b/Items/CornFish.cs index e2df5d0e..f30fcb92 100644 --- a/Items/CornFish.cs +++ b/Items/CornFish.cs @@ -21,11 +21,11 @@ public override void SetDefaults() item.rare = -11; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Corn Fish"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Corn Fish"); + Tooltip.SetDefault(""); + } public override bool IsQuestFish() diff --git a/Items/CornHeater.cs b/Items/CornHeater.cs index eee46e75..cef9b849 100644 --- a/Items/CornHeater.cs +++ b/Items/CornHeater.cs @@ -5,35 +5,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class CornHeater : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CornHeater : ModItem + { + public override void SetDefaults() + { - item.damage = 20; - item.ranged = true; - item.width = 58; - item.height = 26; - item.useTime = 15; - item.useAnimation = 15; - item.shoot = mod.ProjectileType("PopcornAmmo"); - item.shootSpeed = 8f; - item.useStyle = 5; - item.knockBack = 4; - item.useAmmo = mod.ItemType("PopcornAmmo"); - item.value = 60000; - item.rare = 9; -item.expert = true; - item.UseSound = SoundID.Item11; + item.damage = 20; + item.ranged = true; + item.width = 58; + item.height = 26; + item.useTime = 15; + item.useAnimation = 15; + item.shoot = mod.ProjectileType("PopcornAmmo"); + item.shootSpeed = 8f; + item.useStyle = 5; + item.knockBack = 4; + item.useAmmo = mod.ItemType("PopcornAmmo"); + item.value = 60000; + item.rare = 9; + item.expert = true; + item.UseSound = SoundID.Item11; - item.autoReuse = true; - } + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Corn Heater"); - Tooltip.SetDefault("Uses popcorn as ammo"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Corn Heater"); + Tooltip.SetDefault("Uses popcorn as ammo"); + } -}} + } +} diff --git a/Items/CornJavelin.cs b/Items/CornJavelin.cs index 31812e85..3eb3898e 100644 --- a/Items/CornJavelin.cs +++ b/Items/CornJavelin.cs @@ -5,36 +5,38 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class CornJavelin : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CornJavelin : ModItem + { + public override void SetDefaults() + { - item.damage = 22; - item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 17; - item.useAnimation = 17; - item.shoot = mod.ProjectileType("CornJavelinPro"); - item.shootSpeed = 22f; - item.useStyle = 1; - item.knockBack = 4; - item.value = 7; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 22; + item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 17; + item.useAnimation = 17; + item.shoot = mod.ProjectileType("CornJavelinPro"); + item.shootSpeed = 22f; + item.useStyle = 1; + item.knockBack = 4; + item.value = 7; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Corn Javelin"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Corn Javelin"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/CornSeed.cs b/Items/CornSeed.cs index 93b65bf9..7111661f 100644 --- a/Items/CornSeed.cs +++ b/Items/CornSeed.cs @@ -6,33 +6,33 @@ namespace Tremor.Items { - class CornSeed : ModItem - { - public override void SetDefaults() - { - Tile tile = new Tile(); + class CornSeed : ModItem + { + public override void SetDefaults() + { + Tile tile = new Tile(); - item.maxStack = 999; - item.height = 2; - item.width = 2; - item.createTile = mod.TileType("Corn"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.value = 100; - item.useTime = 10; - item.useStyle = 1; + item.maxStack = 999; + item.height = 2; + item.width = 2; + item.createTile = mod.TileType("Corn"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.value = 100; + item.useTime = 10; + item.useStyle = 1; item.rare = 2; - item.consumable = true; + item.consumable = true; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Corn Seeds"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Corn Seeds"); + Tooltip.SetDefault(""); + } - } + } } diff --git a/Items/CornSword.cs b/Items/CornSword.cs index aac72876..4e45bf85 100644 --- a/Items/CornSword.cs +++ b/Items/CornSword.cs @@ -4,30 +4,32 @@ using Terraria.ModLoader; using Terraria.ID; -namespace Tremor.Items { -public class CornSword : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CornSword : ModItem + { + public override void SetDefaults() + { - item.damage = 22; - item.melee = true; - item.width = 46; - item.height = 46; - item.useTime = 30; - item.useAnimation = 30; - item.useStyle = 1; - item.knockBack = 3; - item.value = 1000; - item.rare = 2; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 22; + item.melee = true; + item.width = 46; + item.height = 46; + item.useTime = 30; + item.useAnimation = 30; + item.useStyle = 1; + item.knockBack = 3; + item.value = 1000; + item.rare = 2; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Corn Sword"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Corn Sword"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/CorruptedBiholmerBanner.cs b/Items/CorruptedBiholmerBanner.cs index 9f24b853..edd4afd4 100644 --- a/Items/CorruptedBiholmerBanner.cs +++ b/Items/CorruptedBiholmerBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class CorruptedBiholmerBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CorruptedBiholmerBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 16; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 16; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Corrupted Biholmer Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Corrupted Biholmer Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/CorruptorGun.cs b/Items/CorruptorGun.cs index 70b97b0c..d5de346c 100644 --- a/Items/CorruptorGun.cs +++ b/Items/CorruptorGun.cs @@ -29,14 +29,14 @@ public override void SetDefaults() item.autoReuse = false; item.shoot = 10; item.shootSpeed = 15f; - item.useAmmo = AmmoID.Bullet; + item.useAmmo = AmmoID.Bullet; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Corruptor Gun"); - Tooltip.SetDefault("Spends bullets and fires small corruptors"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Corruptor Gun"); + Tooltip.SetDefault("Spends bullets and fires small corruptors"); + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) diff --git a/Items/CorruptorStaff.cs b/Items/CorruptorStaff.cs index f130884c..84b8608b 100644 --- a/Items/CorruptorStaff.cs +++ b/Items/CorruptorStaff.cs @@ -31,26 +31,26 @@ public override void SetDefaults() item.buffTime = 3600; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Corruptor Staff"); - Tooltip.SetDefault("Summons a corruptor to fight for you."); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Corruptor Staff"); + Tooltip.SetDefault("Summons a corruptor to fight for you."); + } public override bool AltFunctionUse(Player player) { return true; } - + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { return player.altFunctionUse != 2; } - + public override bool UseItem(Player player) { - if(player.altFunctionUse == 2) + if (player.altFunctionUse == 2) { player.MinionNPCTargetAim(); } diff --git a/Items/CosmicAssaultRifle.cs b/Items/CosmicAssaultRifle.cs index 540a8b65..514ecac7 100644 --- a/Items/CosmicAssaultRifle.cs +++ b/Items/CosmicAssaultRifle.cs @@ -4,37 +4,38 @@ using Terraria.ModLoader; using Microsoft.Xna.Framework; -namespace Tremor.Items { -public class CosmicAssaultRifle : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CosmicAssaultRifle : ModItem + { + public override void SetDefaults() + { - item.damage = 190; - item.width = 64; - item.height = 28; - item.ranged = true; - item.useTime = 15; - item.shoot = 207; + item.damage = 190; + item.width = 64; + item.height = 28; + item.ranged = true; + item.useTime = 15; + item.shoot = 207; - item.shootSpeed = 20f; - item.useAnimation = 15; - item.useStyle = 5; - item.knockBack = 5; - item.value = 1000000; - item.useAmmo = AmmoID.Bullet; - item.rare = 11; - item.crit = 7; - item.UseSound = SoundID.Item11; - item.autoReuse = true; - } + item.shootSpeed = 20f; + item.useAnimation = 15; + item.useStyle = 5; + item.knockBack = 5; + item.value = 1000000; + item.useAmmo = AmmoID.Bullet; + item.rare = 11; + item.crit = 7; + item.UseSound = SoundID.Item11; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cosmic Assault Rifle"); - Tooltip.SetDefault("Uses bullets as ammo\nShoots homing bullets"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cosmic Assault Rifle"); + Tooltip.SetDefault("Uses bullets as ammo\nShoots homing bullets"); + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { @@ -42,8 +43,9 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX return base.Shoot(player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack); } - public override Vector2? HoldoutOffset() - { - return new Vector2(-22, 0); - } -}} + public override Vector2? HoldoutOffset() + { + return new Vector2(-22, 0); + } + } +} diff --git a/Items/CosmicFuel.cs b/Items/CosmicFuel.cs index 26da1dbc..521e9bdc 100644 --- a/Items/CosmicFuel.cs +++ b/Items/CosmicFuel.cs @@ -6,25 +6,27 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class CosmicFuel : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CosmicFuel : ModItem + { + public override void SetDefaults() + { - item.width = 20; - item.height = 20; + item.width = 20; + item.height = 20; - item.value = 10000000; - item.rare = 11; - ItemID.Sets.ItemNoGravity[item.type] = true; - } + item.value = 10000000; + item.rare = 11; + ItemID.Sets.ItemNoGravity[item.type] = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cosmic Fuel"); - Tooltip.SetDefault("'Infinity energy!'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cosmic Fuel"); + Tooltip.SetDefault("'Infinity energy!'"); + } -}} + } +} diff --git a/Items/CosmicKrill.cs b/Items/CosmicKrill.cs index 0c5cc5fa..4d9c10cc 100644 --- a/Items/CosmicKrill.cs +++ b/Items/CosmicKrill.cs @@ -8,58 +8,58 @@ namespace Tremor.Items { - public class CosmicKrill: ModItem - { - const int XOffset = -400; - const int YOffset = -400; + public class CosmicKrill : ModItem + { + const int XOffset = -400; + const int YOffset = -400; - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 28; - item.maxStack = 20; - item.value = 100; - item.rare = 11; - item.useAnimation = 15; - item.useTime = 15; - item.useStyle = 4; - item.consumable = true; + item.width = 26; + item.height = 28; + item.maxStack = 20; + item.value = 100; + item.rare = 11; + item.useAnimation = 15; + item.useTime = 15; + item.useStyle = 4; + item.consumable = true; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cosmic Krill"); - Tooltip.SetDefault("Summons the Space Whale"); - } - - public override bool UseItem(Player player) - { - Main.NewText("Space Whale has awoken!", 175, 75, 255); - Main.PlaySound(15, (int)player.position.X, (int)player.position.Y, 0); - if(Main.netMode !=1) - { - NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y + YOffset, mod.NPCType("SpaceWhale")); - } - return true; - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cosmic Krill"); + Tooltip.SetDefault("Summons the Space Whale"); + } + public override bool UseItem(Player player) + { + Main.NewText("Space Whale has awoken!", 175, 75, 255); + Main.PlaySound(15, (int)player.position.X, (int)player.position.Y, 0); + if (Main.netMode != 1) + { + NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y + YOffset, mod.NPCType("SpaceWhale")); + } + return true; + } - public override bool CanUseItem(Player player) - { - return NPC.downedMoonlord && !NPC.AnyNPCs(mod.NPCType("SpaceWhale")); - } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Shrimp, 1); - recipe.AddIngredient(null, "StarBar", 16); - recipe.AddIngredient(null, "Phantaplasm", 16); - recipe.SetResult(this); - recipe.AddTile(null, "StarvilTile"); - recipe.AddRecipe(); - } - } + public override bool CanUseItem(Player player) + { + return NPC.downedMoonlord && !NPC.AnyNPCs(mod.NPCType("SpaceWhale")); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Shrimp, 1); + recipe.AddIngredient(null, "StarBar", 16); + recipe.AddIngredient(null, "Phantaplasm", 16); + recipe.SetResult(this); + recipe.AddTile(null, "StarvilTile"); + recipe.AddRecipe(); + } + } } diff --git a/Items/CrabClaw.cs b/Items/CrabClaw.cs index 1228a478..ac9dcfa8 100644 --- a/Items/CrabClaw.cs +++ b/Items/CrabClaw.cs @@ -5,31 +5,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class CrabClaw : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CrabClaw : ModItem + { + public override void SetDefaults() + { - item.damage = 36; - item.melee = true; - item.width = 40; - item.height = 40; - item.useTime = 25; - item.useAnimation = 10; - item.useStyle = 1; - item.knockBack = 2; - item.value = 5025; - item.rare = 5; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 36; + item.melee = true; + item.width = 40; + item.height = 40; + item.useTime = 25; + item.useAnimation = 10; + item.useStyle = 1; + item.knockBack = 2; + item.value = 5025; + item.rare = 5; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crab Claw"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crab Claw"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/CrabStaff.cs b/Items/CrabStaff.cs index e29630b7..7ef18221 100644 --- a/Items/CrabStaff.cs +++ b/Items/CrabStaff.cs @@ -29,43 +29,43 @@ public override void SetDefaults() item.shootSpeed = 1f; item.buffType = mod.BuffType("CrabBuff"); item.buffTime = 3600; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crab Staff"); - Tooltip.SetDefault("Summons a little crab to fight for you."); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crab Staff"); + Tooltip.SetDefault("Summons a little crab to fight for you."); + } public override bool AltFunctionUse(Player player) { return true; } - + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { return player.altFunctionUse != 2; } - + public override bool UseItem(Player player) { - if(player.altFunctionUse == 2) + if (player.altFunctionUse == 2) { player.MinionNPCTargetAim(); } return base.UseItem(player); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Coral, 16); - recipe.AddIngredient(null, "SeaFragment", 5); - recipe.AddIngredient(ItemID.Seashell, 2); - recipe.AddIngredient(ItemID.Wood, 8); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Coral, 16); + recipe.AddIngredient(null, "SeaFragment", 5); + recipe.AddIngredient(ItemID.Seashell, 2); + recipe.AddIngredient(ItemID.Wood, 8); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } } } diff --git a/Items/CrateFish.cs b/Items/CrateFish.cs index 59f94a0e..c3360756 100644 --- a/Items/CrateFish.cs +++ b/Items/CrateFish.cs @@ -21,11 +21,11 @@ public override void SetDefaults() item.rare = -11; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crate Fish"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crate Fish"); + Tooltip.SetDefault(""); + } public override bool IsQuestFish() diff --git a/Items/CrawlerHook.cs b/Items/CrawlerHook.cs index 404cd956..529ba48d 100644 --- a/Items/CrawlerHook.cs +++ b/Items/CrawlerHook.cs @@ -17,15 +17,15 @@ public override void SetDefaults() item.shoot = mod.ProjectileType("CrawlerHookProjectile"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crawler Hook"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crawler Hook"); + Tooltip.SetDefault(""); + } } - class CrawlerHookProjectile : ModProjectile + class CrawlerHookProjectile : ModProjectile { public override void SetStaticDefaults() { @@ -39,24 +39,24 @@ public override void SetDefaults() // Use this hook for hooks that can have multiple hooks midflight: Dual Hook, Web Slinger, Fish Hook, Static Hook, Lunar Hook -/* - public override bool? CanUseGrapple(Player player) - { - int hooksOut = 0; - for (int l = 0; l < 1000; l++) - { - if (Main.projectile[l].active && Main.projectile[l].owner == Main.myPlayer && Main.projectile[l].type == projectile.type) + /* + public override bool? CanUseGrapple(Player player) { - hooksOut++; + int hooksOut = 0; + for (int l = 0; l < 1000; l++) + { + if (Main.projectile[l].active && Main.projectile[l].owner == Main.myPlayer && Main.projectile[l].type == projectile.type) + { + hooksOut++; + } + } + if (hooksOut > 2) // This hook can have 3 hooks out. + { + return false; + } + return true; } - } - if (hooksOut > 2) // This hook can have 3 hooks out. - { - return false; - } - return true; - } -*/ + */ // Return true if it is like: Hook, CandyCaneHook, BatHook, GemHooks //public override bool? SingleGrappleHook(Player player) diff --git a/Items/CreeperStaff.cs b/Items/CreeperStaff.cs index ad97806a..e1daf624 100644 --- a/Items/CreeperStaff.cs +++ b/Items/CreeperStaff.cs @@ -31,26 +31,26 @@ public override void SetDefaults() item.buffTime = 3600; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Creeper Staff"); - Tooltip.SetDefault("Summons a creeper to fight for you."); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Creeper Staff"); + Tooltip.SetDefault("Summons a creeper to fight for you."); + } public override bool AltFunctionUse(Player player) { return true; } - + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { return player.altFunctionUse != 2; } - + public override bool UseItem(Player player) { - if(player.altFunctionUse == 2) + if (player.altFunctionUse == 2) { player.MinionNPCTargetAim(); } diff --git a/Items/CreepyDoor.cs b/Items/CreepyDoor.cs index 8c87d683..40fb9830 100644 --- a/Items/CreepyDoor.cs +++ b/Items/CreepyDoor.cs @@ -19,27 +19,27 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 10; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 150; item.createTile = mod.TileType("ScaryDoorClosed"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Creepy Door"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Creepy Door"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Wood, 6); - recipe.AddIngredient(ItemID.Cobweb, 6); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Wood, 6); + recipe.AddIngredient(ItemID.Cobweb, 6); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } } } diff --git a/Items/CreepyThrone.cs b/Items/CreepyThrone.cs index 2222ab72..e0098ffc 100644 --- a/Items/CreepyThrone.cs +++ b/Items/CreepyThrone.cs @@ -4,49 +4,51 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class CreepyThrone : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CreepyThrone : ModItem + { + public override void SetDefaults() + { - item.width = 48; - item.height = 64; - item.maxStack = 999; - item.value = 100; - item.rare = 1; - item.createTile = mod.TileType("CreepyThrone"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - } + item.width = 48; + item.height = 64; + item.maxStack = 999; + item.value = 100; + item.rare = 1; + item.createTile = mod.TileType("CreepyThrone"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Creepy Throne"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Creepy Throne"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.SilverBar, 25); - recipe.AddIngredient(null, "MinotaurHorn", 2); - recipe.AddIngredient(ItemID.Silk, 15); - recipe.SetResult(this); - recipe.AddTile(106); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.SilverBar, 25); + recipe.AddIngredient(null, "MinotaurHorn", 2); + recipe.AddIngredient(ItemID.Silk, 15); + recipe.SetResult(this); + recipe.AddTile(106); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.TungstenBar, 25); - recipe.AddIngredient(null, "MinotaurHorn", 2); - recipe.AddIngredient(ItemID.Silk, 15); - recipe.SetResult(this); - recipe.AddTile(106); - recipe.AddRecipe(); - } -}} + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.TungstenBar, 25); + recipe.AddIngredient(null, "MinotaurHorn", 2); + recipe.AddIngredient(ItemID.Silk, 15); + recipe.SetResult(this); + recipe.AddTile(106); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CrimCudgel.cs b/Items/CrimCudgel.cs index 02a52307..cfa47b10 100644 --- a/Items/CrimCudgel.cs +++ b/Items/CrimCudgel.cs @@ -4,30 +4,32 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { -public class CrimCudgel : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CrimCudgel : ModItem + { + public override void SetDefaults() + { - item.damage = 16; - item.melee = true; - item.width = 40; - item.height = 40; - item.useTime = 30; - item.useAnimation = 20; - item.useStyle = 1; - item.knockBack = 9; - item.value = 36000; - item.rare = 2; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 16; + item.melee = true; + item.width = 40; + item.height = 40; + item.useTime = 30; + item.useAnimation = 20; + item.useStyle = 1; + item.knockBack = 9; + item.value = 36000; + item.rare = 2; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crimera Cudgel"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crimera Cudgel"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/CrimerBanner.cs b/Items/CrimerBanner.cs index 2c764918..5092def4 100644 --- a/Items/CrimerBanner.cs +++ b/Items/CrimerBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class CrimerBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CrimerBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 13; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 13; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crimer Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crimer Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/CrimsonBiholmerBanner.cs b/Items/CrimsonBiholmerBanner.cs index 64c02da6..44e4c889 100644 --- a/Items/CrimsonBiholmerBanner.cs +++ b/Items/CrimsonBiholmerBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class CrimsonBiholmerBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CrimsonBiholmerBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 15; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 15; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crimson Biholmer Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crimson Biholmer Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/CrimstoneBathtub.cs b/Items/CrimstoneBathtub.cs index 5942d4f4..ea8dc96d 100644 --- a/Items/CrimstoneBathtub.cs +++ b/Items/CrimstoneBathtub.cs @@ -19,27 +19,27 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("CrimstoneBathtub"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crimstone Bathtub"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crimstone Bathtub"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(836, 14); - recipe.AddIngredient(1257, 1); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(836, 14); + recipe.AddIngredient(1257, 1); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/CrimstoneBed.cs b/Items/CrimstoneBed.cs index 86ebd9ca..b6d6f87c 100644 --- a/Items/CrimstoneBed.cs +++ b/Items/CrimstoneBed.cs @@ -19,28 +19,28 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("CrimstoneBed"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crimstone Bed"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crimstone Bed"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(836, 15); - recipe.AddIngredient(1257, 1); - recipe.AddIngredient(ItemID.Silk, 5); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(836, 15); + recipe.AddIngredient(1257, 1); + recipe.AddIngredient(ItemID.Silk, 5); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/CrimstoneBench.cs b/Items/CrimstoneBench.cs index 4aecfd2c..7ad3f486 100644 --- a/Items/CrimstoneBench.cs +++ b/Items/CrimstoneBench.cs @@ -19,27 +19,27 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("CrimstoneBench"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crimstone Bench"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crimstone Bench"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(836, 8); - recipe.AddIngredient(1257, 1); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(836, 8); + recipe.AddIngredient(1257, 1); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/CrimstoneBookcase.cs b/Items/CrimstoneBookcase.cs index 00d9c824..6f9c33e0 100644 --- a/Items/CrimstoneBookcase.cs +++ b/Items/CrimstoneBookcase.cs @@ -19,28 +19,28 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("CrimstoneBookcase"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crimstone Bookcase"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crimstone Bookcase"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(836, 20); - recipe.AddIngredient(1257, 1); - recipe.AddIngredient(ItemID.Book, 10); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(836, 20); + recipe.AddIngredient(1257, 1); + recipe.AddIngredient(ItemID.Book, 10); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/CrimstoneChair.cs b/Items/CrimstoneChair.cs index f7b981e9..54283b7a 100644 --- a/Items/CrimstoneChair.cs +++ b/Items/CrimstoneChair.cs @@ -19,27 +19,27 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("CrimstoneChair"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crimstone Chair"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crimstone Chair"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(836, 4); - recipe.AddIngredient(1257, 1); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(836, 4); + recipe.AddIngredient(1257, 1); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/CrimstoneChest.cs b/Items/CrimstoneChest.cs index be068dba..83b857be 100644 --- a/Items/CrimstoneChest.cs +++ b/Items/CrimstoneChest.cs @@ -19,36 +19,36 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("CrimstoneChest"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crimstone Chest"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crimstone Chest"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(836, 8); - recipe.AddIngredient(1257, 1); - recipe.AddIngredient(ItemID.IronBar, 2); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(836, 8); + recipe.AddIngredient(1257, 1); + recipe.AddIngredient(ItemID.IronBar, 2); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(836, 8); - recipe.AddIngredient(1257, 1); - recipe.AddIngredient(ItemID.LeadBar, 2); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + recipe = new ModRecipe(mod); + recipe.AddIngredient(836, 8); + recipe.AddIngredient(1257, 1); + recipe.AddIngredient(ItemID.LeadBar, 2); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/CrimstoneDoor.cs b/Items/CrimstoneDoor.cs index 32fbfb26..4301b394 100644 --- a/Items/CrimstoneDoor.cs +++ b/Items/CrimstoneDoor.cs @@ -19,27 +19,27 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 10; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 150; item.createTile = mod.TileType("CrimstoneDoorClosed"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crimstone Door"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crimstone Door"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(836, 6); - recipe.AddIngredient(1257, 1); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(836, 6); + recipe.AddIngredient(1257, 1); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/CrimstoneDresser.cs b/Items/CrimstoneDresser.cs index 740f52ee..ceccac90 100644 --- a/Items/CrimstoneDresser.cs +++ b/Items/CrimstoneDresser.cs @@ -19,27 +19,27 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("CrimstoneDresser"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crimstone Dresser"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crimstone Dresser"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(836, 16); - recipe.AddIngredient(1257, 1); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(836, 16); + recipe.AddIngredient(1257, 1); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/CrimstoneGrandfatherClock.cs b/Items/CrimstoneGrandfatherClock.cs index ba97d854..c67758bb 100644 --- a/Items/CrimstoneGrandfatherClock.cs +++ b/Items/CrimstoneGrandfatherClock.cs @@ -19,39 +19,39 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("CrimstoneGrandfatherClock"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crimstone Grandfather Clock"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crimstone Grandfather Clock"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(836, 10); - recipe.AddIngredient(ItemID.IronBar, 3); - recipe.AddIngredient(ItemID.Glass, 6); - recipe.AddIngredient(1257, 1); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(836, 10); + recipe.AddIngredient(ItemID.IronBar, 3); + recipe.AddIngredient(ItemID.Glass, 6); + recipe.AddIngredient(1257, 1); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(836, 10); - recipe.AddIngredient(ItemID.LeadBar, 3); - recipe.AddIngredient(ItemID.Glass, 6); - recipe.AddIngredient(1257, 1); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + recipe = new ModRecipe(mod); + recipe.AddIngredient(836, 10); + recipe.AddIngredient(ItemID.LeadBar, 3); + recipe.AddIngredient(ItemID.Glass, 6); + recipe.AddIngredient(1257, 1); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/CrimstonePiano.cs b/Items/CrimstonePiano.cs index 799bef65..e54121bc 100644 --- a/Items/CrimstonePiano.cs +++ b/Items/CrimstonePiano.cs @@ -19,28 +19,28 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("CrimstonePiano"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crimstone Piano"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crimstone Piano"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(836, 15); - recipe.AddIngredient(154, 15); - recipe.AddIngredient(1257, 1); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(836, 15); + recipe.AddIngredient(154, 15); + recipe.AddIngredient(1257, 1); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/CrimstonePlatform.cs b/Items/CrimstonePlatform.cs index 97c49a11..a33887d0 100644 --- a/Items/CrimstonePlatform.cs +++ b/Items/CrimstonePlatform.cs @@ -19,26 +19,26 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("CrimstonePlatform"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crimstone Platform"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crimstone Platform"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(836, 1); - recipe.SetResult(this, 2); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(836, 1); + recipe.SetResult(this, 2); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/CrimstoneSink.cs b/Items/CrimstoneSink.cs index b02a214f..cd43650f 100644 --- a/Items/CrimstoneSink.cs +++ b/Items/CrimstoneSink.cs @@ -19,28 +19,28 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("CrimstoneSink"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crimstone Sink"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crimstone Sink"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(836, 6); - recipe.AddIngredient(1257, 1); - recipe.AddIngredient(206); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(836, 6); + recipe.AddIngredient(1257, 1); + recipe.AddIngredient(206); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/CrimstoneTable.cs b/Items/CrimstoneTable.cs index 8c84cca3..6355f8e1 100644 --- a/Items/CrimstoneTable.cs +++ b/Items/CrimstoneTable.cs @@ -19,27 +19,27 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("CrimstoneTable"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crimstone Table"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crimstone Table"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(836, 8); - recipe.AddIngredient(1257, 1); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(836, 8); + recipe.AddIngredient(1257, 1); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/CrimstoneWorkbench.cs b/Items/CrimstoneWorkbench.cs index d53deb98..4ee9302e 100644 --- a/Items/CrimstoneWorkbench.cs +++ b/Items/CrimstoneWorkbench.cs @@ -19,27 +19,27 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("CrimstoneWorkbench"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crimstone Work Bench"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crimstone Work Bench"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(836, 10); - recipe.AddIngredient(1257, 1); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(836, 10); + recipe.AddIngredient(1257, 1); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/CrimtaneProtector.cs b/Items/CrimtaneProtector.cs index bbe70e51..78be086d 100644 --- a/Items/CrimtaneProtector.cs +++ b/Items/CrimtaneProtector.cs @@ -4,40 +4,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class CrimtaneProtector : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CrimtaneProtector : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 44; + item.width = 22; + item.height = 44; - item.value = 12500; - item.rare = 2; - item.defense = 2; - item.accessory = true; - } + item.value = 12500; + item.rare = 2; + item.defense = 2; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crimtane Protector"); - Tooltip.SetDefault("Increases max health by 50"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crimtane Protector"); + Tooltip.SetDefault("Increases max health by 50"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.statLifeMax2 += 50; - } + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.statLifeMax2 += 50; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.CrimtaneBar, 25); - recipe.AddIngredient(ItemID.TissueSample, 20); - recipe.SetResult(this); - recipe.AddTile(null, "GreatAnvilTile"); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.CrimtaneBar, 25); + recipe.AddIngredient(ItemID.TissueSample, 20); + recipe.SetResult(this); + recipe.AddTile(null, "GreatAnvilTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CrimtaneScythe.cs b/Items/CrimtaneScythe.cs index f6dbda7f..abfbf231 100644 --- a/Items/CrimtaneScythe.cs +++ b/Items/CrimtaneScythe.cs @@ -4,42 +4,44 @@ using Terraria.ModLoader; using Terraria.ID; -namespace Tremor.Items { -public class CrimtaneScythe : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CrimtaneScythe : ModItem + { + public override void SetDefaults() + { - item.damage = 19; - item.melee = true; - item.width = 50; - item.height = 40; - item.useTime = 18; - item.useAnimation = 18; - item.useStyle = 1; - item.knockBack = 7; - item.value = 2700; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 19; + item.melee = true; + item.width = 50; + item.height = 40; + item.useTime = 18; + item.useAnimation = 18; + item.useStyle = 1; + item.knockBack = 7; + item.value = 2700; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crimtane Scythe"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crimtane Scythe"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.CrimtaneBar, 8); - recipe.AddIngredient(ItemID.TissueSample, 8); - recipe.AddIngredient(ItemID.Wood, 25); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.CrimtaneBar, 8); + recipe.AddIngredient(ItemID.TissueSample, 8); + recipe.AddIngredient(ItemID.Wood, 25); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } -}} + } +} diff --git a/Items/CrossBlast.cs b/Items/CrossBlast.cs index cde8a1fb..b8667d66 100644 --- a/Items/CrossBlast.cs +++ b/Items/CrossBlast.cs @@ -4,65 +4,67 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class CrossBlast : ModItem +namespace Tremor.Items { - public override bool CanEquipAccessory(Player player, int slot) - { - for(int i=0; i < player.armor.Length; i++) - { - MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - if(modPlayer.pyro == true) - { - return false; - } - } - return true; - } + public class CrossBlast : ModItem + { + public override bool CanEquipAccessory(Player player, int slot) + { + for (int i = 0; i < player.armor.Length; i++) + { + MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); + if (modPlayer.pyro == true) + { + return false; + } + } + return true; + } - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 44; + item.width = 22; + item.height = 44; - item.value = 300000; - item.rare = 6; - item.accessory = true; - } + item.value = 300000; + item.rare = 6; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cross Blast"); - Tooltip.SetDefault("Alchemical projectiles leave explosions in the shape of cross"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cross Blast"); + Tooltip.SetDefault("Alchemical projectiles leave explosions in the shape of cross"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.ExplosivePowder, 25); - recipe.AddIngredient(null, "Chemikaze", 1); - recipe.AddIngredient(ItemID.HellstoneBar, 25); - recipe.AddIngredient(ItemID.SoulofMight, 3); - recipe.SetResult(this); - recipe.AddTile(114); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.ExplosivePowder, 25); + recipe.AddIngredient(null, "Chemikaze", 1); + recipe.AddIngredient(ItemID.HellstoneBar, 25); + recipe.AddIngredient(ItemID.SoulofMight, 3); + recipe.SetResult(this); + recipe.AddTile(114); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.ExplosivePowder, 25); - recipe.AddIngredient(null, "Chemikaze", 1); - recipe.AddIngredient(ItemID.HellstoneBar, 25); - recipe.AddIngredient(null, "SoulofMind", 3); - recipe.SetResult(this); - recipe.AddTile(114); - recipe.AddRecipe(); - } + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.ExplosivePowder, 25); + recipe.AddIngredient(null, "Chemikaze", 1); + recipe.AddIngredient(ItemID.HellstoneBar, 25); + recipe.AddIngredient(null, "SoulofMind", 3); + recipe.SetResult(this); + recipe.AddTile(114); + recipe.AddRecipe(); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - player.AddBuff(mod.BuffType("CrossBlastBuff"), 2); - modPlayer.pyro = true; - } -}} + public override void UpdateAccessory(Player player, bool hideVisual) + { + MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); + player.AddBuff(mod.BuffType("CrossBlastBuff"), 2); + modPlayer.pyro = true; + } + } +} diff --git a/Items/Crossbow.cs b/Items/Crossbow.cs index ccaa4918..655cd80d 100644 --- a/Items/Crossbow.cs +++ b/Items/Crossbow.cs @@ -5,39 +5,41 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Crossbow : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Crossbow : ModItem + { + public override void SetDefaults() + { - item.damage = 11; - item.noMelee = true; - item.ranged = true; - item.width = 16; - item.height = 32; - item.useTime = 30; - item.shoot = 1; - item.shootSpeed = 11f; - item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 1; - item.value = 10000; - item.useAmmo = AmmoID.Arrow; - item.rare = 1; - item.UseSound = SoundID.Item5; - item.autoReuse = true; - } + item.damage = 11; + item.noMelee = true; + item.ranged = true; + item.width = 16; + item.height = 32; + item.useTime = 30; + item.shoot = 1; + item.shootSpeed = 11f; + item.useAnimation = 30; + item.useStyle = 5; + item.knockBack = 1; + item.value = 10000; + item.useAmmo = AmmoID.Arrow; + item.rare = 1; + item.UseSound = SoundID.Item5; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crossbow"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crossbow"); + Tooltip.SetDefault(""); + } - public override Vector2? HoldoutOffset() - { - return new Vector2(-12, -2); - } -}} + public override Vector2? HoldoutOffset() + { + return new Vector2(-12, -2); + } + } +} diff --git a/Items/Crowbar.cs b/Items/Crowbar.cs index 3cd0b6c8..8d4c04fe 100644 --- a/Items/Crowbar.cs +++ b/Items/Crowbar.cs @@ -4,32 +4,34 @@ using Terraria.ModLoader; using Terraria.ID; -namespace Tremor.Items { -public class Crowbar : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Crowbar : ModItem + { + public override void SetDefaults() + { - item.damage = 14; - item.melee = true; - item.width = 56; - item.height = 56; - item.useTime = 25; - item.useAnimation = 30; - item.useStyle = 1; - item.knockBack = 3; - item.value = 12000; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = true; + item.damage = 14; + item.melee = true; + item.width = 56; + item.height = 56; + item.useTime = 25; + item.useAnimation = 30; + item.useStyle = 1; + item.knockBack = 3; + item.value = 12000; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crowbar"); - Tooltip.SetDefault("'Actually it snaps in two'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crowbar"); + Tooltip.SetDefault("'Actually it snaps in two'"); + } -}} + } +} diff --git a/Items/Crusher.cs b/Items/Crusher.cs index a5e12b32..31954db6 100644 --- a/Items/Crusher.cs +++ b/Items/Crusher.cs @@ -5,48 +5,50 @@ using Terraria.ID; using Microsoft.Xna.Framework; -namespace Tremor.Items { -public class Crusher: ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Crusher : ModItem + { + public override void SetDefaults() + { - item.damage = 32; - item.melee = true; - item.width = 60; - item.height = 60; - item.useTime = 40; - item.useAnimation = 38; - item.useStyle = 1; - item.knockBack = 12; - item.value = 26025; - item.rare = 3; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 32; + item.melee = true; + item.width = 60; + item.height = 60; + item.useTime = 40; + item.useAnimation = 38; + item.useStyle = 1; + item.knockBack = 12; + item.value = 26025; + item.rare = 3; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("The Crusher"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("The Crusher"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "FireFragment", 15); - recipe.AddIngredient(null, "MoltenParts", 1); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "FireFragment", 15); + recipe.AddIngredient(null, "MoltenParts", 1); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if(Main.rand.Next(3) == 0) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 6); - } - } -}} + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.Next(3) == 0) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 6); + } + } + } +} diff --git a/Items/CrystalChainmer.cs b/Items/CrystalChainmer.cs index a63d6c5e..22f8698c 100644 --- a/Items/CrystalChainmer.cs +++ b/Items/CrystalChainmer.cs @@ -4,48 +4,50 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class CrystalChainmer : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.damage = 18; - item.melee = true; - item.width = 20; - item.height = 12; - item.useTime = 12; - item.useAnimation = 25; - item.channel = true; - item.noUseGraphic = true; - item.noMelee = true; - item.hammer = 100; - item.axe = 22; - item.tileBoost++; - item.useStyle = 5; - item.knockBack = 6; - item.value = Item.buyPrice(0, 1, 50, 0); - item.rare = 5; - item.UseSound = SoundID.Item23; - item.autoReuse = true; - item.shoot = mod.ProjectileType("CrystalChainmer"); - item.shootSpeed = 40f; - } + public class CrystalChainmer : ModItem + { + public override void SetDefaults() + { + + item.damage = 18; + item.melee = true; + item.width = 20; + item.height = 12; + item.useTime = 12; + item.useAnimation = 25; + item.channel = true; + item.noUseGraphic = true; + item.noMelee = true; + item.hammer = 100; + item.axe = 22; + item.tileBoost++; + item.useStyle = 5; + item.knockBack = 6; + item.value = Item.buyPrice(0, 1, 50, 0); + item.rare = 5; + item.UseSound = SoundID.Item23; + item.autoReuse = true; + item.shoot = mod.ProjectileType("CrystalChainmer"); + item.shootSpeed = 40f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crystal Chainmer"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crystal Chainmer"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ChaosBar", 15); - recipe.AddIngredient(ItemID.CrystalShard, 22); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ChaosBar", 15); + recipe.AddIngredient(ItemID.CrystalShard, 22); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CrystalChestplate.cs b/Items/CrystalChestplate.cs index 1ff949fa..78700ea8 100644 --- a/Items/CrystalChestplate.cs +++ b/Items/CrystalChestplate.cs @@ -5,41 +5,43 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class CrystalChestplate : ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 22; - item.height = 18; - - item.value = 200; - item.rare = 4; - item.defense = 9; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crystal Chestplate"); - Tooltip.SetDefault("30% increased throwing velocity"); - } - - - public override void UpdateEquip(Player p) - { - p.thrownVelocity += 0.3f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.CrystalShard, 30); - recipe.AddIngredient(ItemID.SoulofLight, 6); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + [AutoloadEquip(EquipType.Body)] + public class CrystalChestplate : ModItem + { + + public override void SetDefaults() + { + + item.width = 22; + item.height = 18; + + item.value = 200; + item.rare = 4; + item.defense = 9; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crystal Chestplate"); + Tooltip.SetDefault("30% increased throwing velocity"); + } + + + public override void UpdateEquip(Player p) + { + p.thrownVelocity += 0.3f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.CrystalShard, 30); + recipe.AddIngredient(ItemID.SoulofLight, 6); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CrystalDagger.cs b/Items/CrystalDagger.cs index 5a18ba91..0e344031 100644 --- a/Items/CrystalDagger.cs +++ b/Items/CrystalDagger.cs @@ -5,44 +5,46 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class CrystalDagger : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CrystalDagger : ModItem + { + public override void SetDefaults() + { - item.damage = 35; - item.thrown = true; - item.width = 18; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 38; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("CrystalDagger"); - item.shootSpeed = 16f; - item.useStyle = 1; - item.knockBack = 4; - item.value = 60; - item.rare = 4; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 35; + item.thrown = true; + item.width = 18; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 38; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("CrystalDagger"); + item.shootSpeed = 16f; + item.useStyle = 1; + item.knockBack = 4; + item.value = 60; + item.rare = 4; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crystal Dagger"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crystal Dagger"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.ThrowingKnife, 50); - recipe.AddIngredient(ItemID.CrystalShard, 1); - recipe.SetResult(this, 50); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.ThrowingKnife, 50); + recipe.AddIngredient(ItemID.CrystalShard, 1); + recipe.SetResult(this, 50); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CrystalDrill.cs b/Items/CrystalDrill.cs index b7e5238e..aa5f8d32 100644 --- a/Items/CrystalDrill.cs +++ b/Items/CrystalDrill.cs @@ -4,47 +4,49 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class CrystalDrill : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.damage = 18; - item.melee = true; - item.width = 20; - item.height = 12; - item.useTime = 8; - item.useAnimation = 25; - item.channel = true; - item.noUseGraphic = true; - item.noMelee = true; - item.pick = 150; - item.tileBoost++; - item.useStyle = 5; - item.knockBack = 6; - item.value = Item.buyPrice(0, 1, 50, 0); - item.rare = 5; - item.UseSound = SoundID.Item23; - item.autoReuse = true; - item.shoot = mod.ProjectileType("CrystalDrill"); - item.shootSpeed = 40f; - } + public class CrystalDrill : ModItem + { + public override void SetDefaults() + { + + item.damage = 18; + item.melee = true; + item.width = 20; + item.height = 12; + item.useTime = 8; + item.useAnimation = 25; + item.channel = true; + item.noUseGraphic = true; + item.noMelee = true; + item.pick = 150; + item.tileBoost++; + item.useStyle = 5; + item.knockBack = 6; + item.value = Item.buyPrice(0, 1, 50, 0); + item.rare = 5; + item.UseSound = SoundID.Item23; + item.autoReuse = true; + item.shoot = mod.ProjectileType("CrystalDrill"); + item.shootSpeed = 40f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crystal Drill"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crystal Drill"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ChaosBar", 15); - recipe.AddIngredient(ItemID.CrystalShard, 22); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ChaosBar", 15); + recipe.AddIngredient(ItemID.CrystalShard, 22); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CrystalFlask.cs b/Items/CrystalFlask.cs index 769638a4..b1c991a5 100644 --- a/Items/CrystalFlask.cs +++ b/Items/CrystalFlask.cs @@ -9,80 +9,81 @@ namespace Tremor.Items { public class CrystalFlask : AlchemistItem - { + { - public override void SetDefaults() - { - item.crit = 4; - item.damage = 56; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 18; - item.useAnimation = 18; - item.shoot = mod.ProjectileType("CrystalFlaskPro"); - item.shootSpeed = 8f; - item.useStyle = 1; - item.knockBack = 1; - item.UseSound = SoundID.Item106; - item.value = 30; - item.rare = 1; - item.autoReuse = false; + public override void SetDefaults() + { + item.crit = 4; + item.damage = 56; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 18; + item.useAnimation = 18; + item.shoot = mod.ProjectileType("CrystalFlaskPro"); + item.shootSpeed = 8f; + item.useStyle = 1; + item.knockBack = 1; + item.UseSound = SoundID.Item106; + item.value = 30; + item.rare = 1; + item.autoReuse = false; - item.ammo = mod.ItemType("BoomFlask"); - } + item.ammo = mod.ItemType("BoomFlask"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crystal Flask"); - Tooltip.SetDefault("Throws a flask that explodes into crystal clouds"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crystal Flask"); + Tooltip.SetDefault("Throws a flask that explodes into crystal clouds"); + } - public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) - { - type = mod.ProjectileType("CrystalCloudPro"); - } + public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) + { + type = mod.ProjectileType("CrystalCloudPro"); + } + + public override void UpdateInventory(Player player) + { + MPlayer modPlayer = player.GetModPlayer(mod); + if (modPlayer.novaHelmet) + { + item.autoReuse = true; + } + if (!modPlayer.novaHelmet) + { + item.autoReuse = false; + } - public override void UpdateInventory(Player player) - { - MPlayer modPlayer = player.GetModPlayer(mod); - if (modPlayer.novaHelmet) - { - item.autoReuse = true; - } - if (!modPlayer.novaHelmet) - { - item.autoReuse = false; - } - - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) - { - item.shootSpeed = 11f; - } - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) - { - item.shootSpeed = 8f; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) - { - item.autoReuse = true; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) - { - item.autoReuse = false; - } - } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) + { + item.shootSpeed = 11f; + } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) + { + item.shootSpeed = 8f; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) + { + item.autoReuse = true; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) + { + item.autoReuse = false; + } + } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.BottledWater, 1); - recipe.AddIngredient(null, "GelCube", 1); + recipe.AddIngredient(null, "GelCube", 1); recipe.AddIngredient(ItemID.CrystalShard, 1); recipe.SetResult(this, 50); recipe.AddRecipe(); } -}} + } +} diff --git a/Items/CrystalGreaves.cs b/Items/CrystalGreaves.cs index 899e5fb4..3711f5fd 100644 --- a/Items/CrystalGreaves.cs +++ b/Items/CrystalGreaves.cs @@ -7,42 +7,44 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class CrystalGreaves : ModItem +namespace Tremor.Items { - - - public override void SetDefaults() - { - - - item.defense = 5; - item.width = 22; - item.height = 18; - item.value = 2500; - item.rare = 4; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crystal Greaves"); - Tooltip.SetDefault("20% increased throwing critical strike chance"); - } - - - public override void UpdateEquip(Player p) - { - p.thrownCrit += 20; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.CrystalShard, 25); - recipe.AddIngredient(ItemID.SoulofLight, 6); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } - } + [AutoloadEquip(EquipType.Legs)] + public class CrystalGreaves : ModItem + { + + + public override void SetDefaults() + { + + + item.defense = 5; + item.width = 22; + item.height = 18; + item.value = 2500; + item.rare = 4; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crystal Greaves"); + Tooltip.SetDefault("20% increased throwing critical strike chance"); + } + + + public override void UpdateEquip(Player p) + { + p.thrownCrit += 20; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.CrystalShard, 25); + recipe.AddIngredient(ItemID.SoulofLight, 6); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } } diff --git a/Items/CrystalHelmet.cs b/Items/CrystalHelmet.cs index 88a98abe..b7d13996 100644 --- a/Items/CrystalHelmet.cs +++ b/Items/CrystalHelmet.cs @@ -7,57 +7,59 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class CrystalHelmet : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class CrystalHelmet : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.defense = 5; - item.width = 26; - item.height = 22; - item.value = 2500; - item.rare = 4; - } + item.defense = 5; + item.width = 26; + item.height = 22; + item.value = 2500; + item.rare = 4; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crystal Helmet"); - Tooltip.SetDefault("20% increased throwing damage"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crystal Helmet"); + Tooltip.SetDefault("20% increased throwing damage"); + } - public override void UpdateEquip(Player p) - { - p.thrownDamage += 0.2f; - } + public override void UpdateEquip(Player p) + { + p.thrownDamage += 0.2f; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == mod.ItemType("CrystalChestplate") && legs.type == mod.ItemType("CrystalGreaves"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("CrystalChestplate") && legs.type == mod.ItemType("CrystalGreaves"); + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increases movement speed"; - player.moveSpeed += 0.25f; - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increases movement speed"; + player.moveSpeed += 0.25f; + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawShadow=true; + player.armorEffectDrawShadow = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.CrystalShard, 30); - recipe.AddIngredient(ItemID.SoulofLight, 6); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.CrystalShard, 30); + recipe.AddIngredient(ItemID.SoulofLight, 6); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } } diff --git a/Items/CrystalPickaxe.cs b/Items/CrystalPickaxe.cs index 492cb794..a45d1d51 100644 --- a/Items/CrystalPickaxe.cs +++ b/Items/CrystalPickaxe.cs @@ -5,54 +5,56 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class CrystalPickaxe : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CrystalPickaxe : ModItem + { + public override void SetDefaults() + { - item.damage = 20; - item.melee = true; - item.width = 40; - item.height = 40; - item.useTime = 10; - item.useAnimation = 10; - item.pick = 150; - item.useStyle = 1; - item.tileBoost++; - item.knockBack = 6; - item.value = 15000; - item.rare = 5; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 20; + item.melee = true; + item.width = 40; + item.height = 40; + item.useTime = 10; + item.useAnimation = 10; + item.pick = 150; + item.useStyle = 1; + item.tileBoost++; + item.knockBack = 6; + item.value = 15000; + item.rare = 5; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crystal Pickaxe"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crystal Pickaxe"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ChaosBar", 15); - recipe.AddIngredient(ItemID.CrystalShard, 22); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ChaosBar", 15); + recipe.AddIngredient(ItemID.CrystalShard, 22); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if(Main.rand.Next(3) == 0) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 71); - } - } - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(31, 60); - } -}} + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.Next(3) == 0) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 71); + } + } + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(31, 60); + } + } +} diff --git a/Items/CrystalSpear.cs b/Items/CrystalSpear.cs index ef19a089..6db8d603 100644 --- a/Items/CrystalSpear.cs +++ b/Items/CrystalSpear.cs @@ -7,34 +7,34 @@ namespace Tremor.Items { - public class CrystalSpear : ModItem - { - public override void SetDefaults() - { - item.CloneDefaults(165); + public class CrystalSpear : ModItem + { + public override void SetDefaults() + { + item.CloneDefaults(165); - item.damage = 49; - item.magic = true; - item.width = 26; + item.damage = 49; + item.magic = true; + item.width = 26; - item.height = 30; - item.useTime = 25; - item.useAnimation = 25; - item.shoot = mod.ProjectileType("CrSpear"); - item.shootSpeed = 11.5f; - item.useStyle = 5; - item.knockBack = 4; - item.rare = 5; - item.UseSound = SoundID.Item1; - item.autoReuse = false; + item.height = 30; + item.useTime = 25; + item.useAnimation = 25; + item.shoot = mod.ProjectileType("CrSpear"); + item.shootSpeed = 11.5f; + item.useStyle = 5; + item.knockBack = 4; + item.rare = 5; + item.UseSound = SoundID.Item1; + item.autoReuse = false; item.mana = 12; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crystal Spear"); - Tooltip.SetDefault("Shoots sharp crystal spears"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crystal Spear"); + Tooltip.SetDefault("Shoots sharp crystal spears"); + } } } diff --git a/Items/CrystalWarhamaxe.cs b/Items/CrystalWarhamaxe.cs index 85f36ca1..5652db7c 100644 --- a/Items/CrystalWarhamaxe.cs +++ b/Items/CrystalWarhamaxe.cs @@ -5,55 +5,57 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class CrystalWarhamaxe : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CrystalWarhamaxe : ModItem + { + public override void SetDefaults() + { - item.damage = 20; - item.melee = true; - item.width = 44; - item.height = 44; - item.useTime = 20; - item.useAnimation = 20; - item.hammer = 100; - item.axe = 22; - item.tileBoost++; - item.useStyle = 1; - item.knockBack = 6; - item.value = 15000; - item.rare = 5; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 20; + item.melee = true; + item.width = 44; + item.height = 44; + item.useTime = 20; + item.useAnimation = 20; + item.hammer = 100; + item.axe = 22; + item.tileBoost++; + item.useStyle = 1; + item.knockBack = 6; + item.value = 15000; + item.rare = 5; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crystal Warhamaxe"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crystal Warhamaxe"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ChaosBar", 15); - recipe.AddIngredient(ItemID.CrystalShard, 22); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ChaosBar", 15); + recipe.AddIngredient(ItemID.CrystalShard, 22); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if(Main.rand.Next(3) == 0) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 71); - } - } - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(31, 60); - } -}} + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.Next(3) == 0) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 71); + } + } + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(31, 60); + } + } +} diff --git a/Items/CrystalWhirlwind.cs b/Items/CrystalWhirlwind.cs index dcca5387..9872a22c 100644 --- a/Items/CrystalWhirlwind.cs +++ b/Items/CrystalWhirlwind.cs @@ -5,37 +5,38 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class CrystalWhirlwind : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.CloneDefaults(ItemID.Starfury); - - item.damage = 85; - item.melee = false; - item.magic = true; - item.width = 50; - item.height = 55; - item.useTime = 7; - item.mana = 20; - - - item.useAnimation = 30; - item.useStyle = 5; - item.shootSpeed = 30f; - item.knockBack = 3; - item.value = 30000; - item.rare = 3; - item.UseSound = SoundID.Item4; - item.autoReuse = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crystal Hail"); - Tooltip.SetDefault("Causes crystals to fall from the sky\n'Made of pure friendship''"); - } + public class CrystalWhirlwind : ModItem + { + public override void SetDefaults() + { + item.CloneDefaults(ItemID.Starfury); + + item.damage = 85; + item.melee = false; + item.magic = true; + item.width = 50; + item.height = 55; + item.useTime = 7; + item.mana = 20; + + + item.useAnimation = 30; + item.useStyle = 5; + item.shootSpeed = 30f; + item.knockBack = 3; + item.value = 30000; + item.rare = 3; + item.UseSound = SoundID.Item4; + item.autoReuse = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crystal Hail"); + Tooltip.SetDefault("Causes crystals to fall from the sky\n'Made of pure friendship''"); + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) @@ -54,5 +55,5 @@ public override void AddRecipes() recipe.SetResult(this); recipe.AddRecipe(); } -} + } } diff --git a/Items/CthulhuBlood.cs b/Items/CthulhuBlood.cs index 3c39082f..8888282a 100644 --- a/Items/CthulhuBlood.cs +++ b/Items/CthulhuBlood.cs @@ -6,33 +6,34 @@ namespace Tremor.Items { -public class CthulhuBlood : ModItem -{ - public override void SetDefaults() - { + public class CthulhuBlood : ModItem + { + public override void SetDefaults() + { - item.width = 24; - item.height = 30; - item.maxStack = 1; + item.width = 24; + item.height = 30; + item.maxStack = 1; - item.value = 255000; - item.rare = 8; - item.accessory = true; - } + item.value = 255000; + item.rare = 8; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bottled Cthulhu Blood"); - Tooltip.SetDefault("Increased life regeneration\nIncreased alchemical damage and critical strike chance by 25%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bottled Cthulhu Blood"); + Tooltip.SetDefault("Increased life regeneration\nIncreased alchemical damage and critical strike chance by 25%"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.lifeRegen += 3; - player.GetModPlayer(mod).alchemistDamage += 0.25f; - player.GetModPlayer(mod).alchemistCrit += 25; - } -}} + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.lifeRegen += 3; + player.GetModPlayer(mod).alchemistDamage += 0.25f; + player.GetModPlayer(mod).alchemistCrit += 25; + } + } +} diff --git a/Items/CursedBanner.cs b/Items/CursedBanner.cs index af0a92de..a6bb5d54 100644 --- a/Items/CursedBanner.cs +++ b/Items/CursedBanner.cs @@ -4,42 +4,44 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class CursedBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CursedBanner : ModItem + { + public override void SetDefaults() + { - item.width = 48; - item.height = 64; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; + item.width = 48; + item.height = 64; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 50000; - item.rare = 11; - item.createTile = mod.TileType("CursedBanner"); - } + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 50000; + item.rare = 11; + item.createTile = mod.TileType("CursedBanner"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cursed Banner"); - Tooltip.SetDefault("Increases all critical strike chance by 25 if placed"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cursed Banner"); + Tooltip.SetDefault("Increases all critical strike chance by 25 if placed"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Gloomstone", 10); - recipe.AddIngredient(null, "UnstableCrystal", 2); - recipe.AddIngredient(null, "CursedCloth", 25); - recipe.SetResult(this); - recipe.AddTile(106); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Gloomstone", 10); + recipe.AddIngredient(null, "UnstableCrystal", 2); + recipe.AddIngredient(null, "CursedCloth", 25); + recipe.SetResult(this); + recipe.AddTile(106); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CursedBreath.cs b/Items/CursedBreath.cs index 139d47b9..a9367fc7 100644 --- a/Items/CursedBreath.cs +++ b/Items/CursedBreath.cs @@ -5,44 +5,46 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class CursedBreath : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CursedBreath : ModItem + { + public override void SetDefaults() + { - item.damage = 56; - item.thrown = true; - item.width = 18; - item.height = 18; - item.useTime = 14; - item.useAnimation = 14; - item.maxStack = 999; - item.shoot = mod.ProjectileType("CursedBreathPro"); - item.shootSpeed = 8f; - item.useStyle = 1; - item.knockBack = 3; - item.value = 155; - item.rare = 5; - item.consumable = true; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 56; + item.thrown = true; + item.width = 18; + item.height = 18; + item.useTime = 14; + item.useAnimation = 14; + item.maxStack = 999; + item.shoot = mod.ProjectileType("CursedBreathPro"); + item.shootSpeed = 8f; + item.useStyle = 1; + item.knockBack = 3; + item.value = 155; + item.rare = 5; + item.consumable = true; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cursed Breath"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cursed Breath"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "DragonBreath", 25); - recipe.AddIngredient(ItemID.CursedFlame, 3); - recipe.SetResult(this, 25); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "DragonBreath", 25); + recipe.AddIngredient(ItemID.CursedFlame, 3); + recipe.SetResult(this, 25); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CursedCauldron.cs b/Items/CursedCauldron.cs index 5ea2e7b8..13088f3e 100644 --- a/Items/CursedCauldron.cs +++ b/Items/CursedCauldron.cs @@ -7,41 +7,43 @@ using Terraria.ModLoader; -namespace Tremor.Items { -public class CursedCauldron : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CursedCauldron : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 44; - item.value = 100000; - item.rare = 5; - item.accessory = true; - } + item.width = 22; + item.height = 44; + item.value = 100000; + item.rare = 5; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cursed Cauldron"); - Tooltip.SetDefault("Increases alchemic damage by 15\nIncreases alchemic critical strike chance by 20\nAlchemic weapons confuse enemies"); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(8, 4)); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cursed Cauldron"); + Tooltip.SetDefault("Increases alchemic damage by 15\nIncreases alchemic critical strike chance by 20\nAlchemic weapons confuse enemies"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(8, 4)); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.GetModPlayer(mod).alchemistDamage += 0.15f; - player.AddBuff(mod.BuffType("CursedCloudBuff"), 2); - player.GetModPlayer(mod).alchemistCrit += 20; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BlackCauldron", 1); - recipe.AddIngredient(null, "DeathFormula", 1); - recipe.SetResult(this); - recipe.AddTile(114); - recipe.AddRecipe(); - } -}} + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.GetModPlayer(mod).alchemistDamage += 0.15f; + player.AddBuff(mod.BuffType("CursedCloudBuff"), 2); + player.GetModPlayer(mod).alchemistCrit += 20; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "BlackCauldron", 1); + recipe.AddIngredient(null, "DeathFormula", 1); + recipe.SetResult(this); + recipe.AddTile(114); + recipe.AddRecipe(); + } + } +} diff --git a/Items/CursedKnife.cs b/Items/CursedKnife.cs index a5b36c57..1f4de166 100644 --- a/Items/CursedKnife.cs +++ b/Items/CursedKnife.cs @@ -5,53 +5,55 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class CursedKnife : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CursedKnife : ModItem + { + public override void SetDefaults() + { - item.damage = 22; - item.melee = true; - item.width = 32; - item.height = 32; - item.useTime = 11; - item.useAnimation = 9; - item.useStyle = 3; - item.knockBack = 2; - item.value = 2800; - item.rare = 4; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 22; + item.melee = true; + item.width = 32; + item.height = 32; + item.useTime = 11; + item.useAnimation = 9; + item.useStyle = 3; + item.knockBack = 2; + item.value = 2800; + item.rare = 4; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cursed Knife"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cursed Knife"); + Tooltip.SetDefault(""); + } - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(39, 60); - } + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(39, 60); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "RipperKnife"); - recipe.AddIngredient(ItemID.CursedFlame, 20); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "RipperKnife"); + recipe.AddIngredient(ItemID.CursedFlame, 20); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if(Main.rand.Next(3) == 0) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 74); - } - } -}} + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.Next(3) == 0) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 74); + } + } + } +} diff --git a/Items/CursedKnightBreastplate.cs b/Items/CursedKnightBreastplate.cs index 6eb0becb..80343bde 100644 --- a/Items/CursedKnightBreastplate.cs +++ b/Items/CursedKnightBreastplate.cs @@ -5,8 +5,8 @@ using Terraria.ModLoader; namespace Tremor.Items -{ -[AutoloadEquip(EquipType.Body)] +{ + [AutoloadEquip(EquipType.Body)] public class CursedKnightBreastplate : ModItem { @@ -20,11 +20,11 @@ public override void SetDefaults() item.rare = 9; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cursed Knight Breastplate"); - Tooltip.SetDefault("'Great for impersonating devs!'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cursed Knight Breastplate"); + Tooltip.SetDefault("'Great for impersonating devs!'"); + } } } diff --git a/Items/CursedKnightGreaves.cs b/Items/CursedKnightGreaves.cs index f0193458..76920c91 100644 --- a/Items/CursedKnightGreaves.cs +++ b/Items/CursedKnightGreaves.cs @@ -3,7 +3,9 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] +namespace Tremor.Items +{ + [AutoloadEquip(EquipType.Legs)] public class CursedKnightGreaves : ModItem { @@ -17,11 +19,11 @@ public override void SetDefaults() item.rare = 9; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cursed Knight Greaves"); - Tooltip.SetDefault("'Great for impersonating devs!'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cursed Knight Greaves"); + Tooltip.SetDefault("'Great for impersonating devs!'"); + } } } diff --git a/Items/CursedKnightHelmet.cs b/Items/CursedKnightHelmet.cs index 1482e316..379d5d14 100644 --- a/Items/CursedKnightHelmet.cs +++ b/Items/CursedKnightHelmet.cs @@ -8,7 +8,7 @@ namespace Tremor.Items { -[AutoloadEquip(EquipType.Head)] + [AutoloadEquip(EquipType.Head)] public class CursedKnightHelmet : ModItem { @@ -22,11 +22,11 @@ public override void SetDefaults() item.rare = 9; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cursed Knight Helmet"); - Tooltip.SetDefault("'Great for impersonating devs!'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cursed Knight Helmet"); + Tooltip.SetDefault("'Great for impersonating devs!'"); + } } } diff --git a/Items/CursedPopcorn.cs b/Items/CursedPopcorn.cs index adfae5f0..e1c5d195 100644 --- a/Items/CursedPopcorn.cs +++ b/Items/CursedPopcorn.cs @@ -4,37 +4,38 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class CursedPopcorn : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CursedPopcorn : ModItem + { + + public override void SetDefaults() + { - item.width = 26; - item.height = 34; - item.maxStack = 20; + item.width = 26; + item.height = 34; + item.maxStack = 20; - item.rare = 2; - item.value = 50000; - item.useAnimation = 45; - item.useTime = 45; - item.useStyle = 4; - item.consumable = true; - } + item.rare = 2; + item.value = 50000; + item.useAnimation = 45; + item.useTime = 45; + item.useStyle = 4; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cursed Popcorn"); - Tooltip.SetDefault("Summons the Evil Corn"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cursed Popcorn"); + Tooltip.SetDefault("Summons the Evil Corn"); + } - public override bool CanUseItem(Player player) - { - return !Main.dayTime && !NPC.AnyNPCs(mod.NPCType("EvilCorn")); - } + public override bool CanUseItem(Player player) + { + return !Main.dayTime && !NPC.AnyNPCs(mod.NPCType("EvilCorn")); + } public override bool UseItem(Player player) { @@ -42,4 +43,5 @@ public override bool UseItem(Player player) Main.PlaySound(SoundID.Roar, player.position, 0); return true; } -}} + } +} diff --git a/Items/CursedSoul.cs b/Items/CursedSoul.cs index 8f154d25..92f09448 100644 --- a/Items/CursedSoul.cs +++ b/Items/CursedSoul.cs @@ -8,24 +8,24 @@ namespace Tremor.Items { - public class CursedSoul : ModItem - { + public class CursedSoul : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 40; - item.height = 28; - item.maxStack = 99; - item.value = 1000; - item.rare = 4; - } + item.width = 40; + item.height = 28; + item.maxStack = 99; + item.value = 1000; + item.rare = 4; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cursed Soul"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cursed Soul"); + Tooltip.SetDefault(""); + } - } + } } diff --git a/Items/CursedTwister.cs b/Items/CursedTwister.cs index 227cc515..f171f69c 100644 --- a/Items/CursedTwister.cs +++ b/Items/CursedTwister.cs @@ -5,34 +5,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class CursedTwister : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CursedTwister : ModItem + { + public override void SetDefaults() + { - item.damage = 82; - item.magic = true; - item.width = 28; - item.height = 30; - item.useTime = 14; - item.useAnimation = 14; - item.shoot = mod.ProjectileType("CursedTwisterPro"); - item.shootSpeed = 14f; - item.mana = 6; - item.useStyle = 5; - item.knockBack = 3; - item.value = 122355; - item.rare = 5; - item.UseSound = SoundID.Item21; - item.autoReuse = true; - } + item.damage = 82; + item.magic = true; + item.width = 28; + item.height = 30; + item.useTime = 14; + item.useAnimation = 14; + item.shoot = mod.ProjectileType("CursedTwisterPro"); + item.shootSpeed = 14f; + item.mana = 6; + item.useStyle = 5; + item.knockBack = 3; + item.value = 122355; + item.rare = 5; + item.UseSound = SoundID.Item21; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cursed Twister"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cursed Twister"); + Tooltip.SetDefault(""); + } public override void AddRecipes() @@ -44,5 +45,6 @@ public override void AddRecipes() recipe.AddTile(412); recipe.SetResult(this); recipe.AddRecipe(); - } -}} + } + } +} diff --git a/Items/CyberCutter.cs b/Items/CyberCutter.cs index 58e699cd..65ffea34 100644 --- a/Items/CyberCutter.cs +++ b/Items/CyberCutter.cs @@ -33,14 +33,14 @@ public override void SetDefaults() item.rare = 5; item.shoot = mod.ProjectileType("CyberCutterPro"); item.shootSpeed = 5f; - item.mana = 14; + item.mana = 14; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cyber Cutter"); - Tooltip.SetDefault("Casts a controllable saw"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cyber Cutter"); + Tooltip.SetDefault("Casts a controllable saw"); + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) diff --git a/Items/CyberKingBag.cs b/Items/CyberKingBag.cs index 3707308b..d3ee22c4 100644 --- a/Items/CyberKingBag.cs +++ b/Items/CyberKingBag.cs @@ -4,54 +4,56 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class CyberKingBag : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.maxStack = 999; - item.consumable = true; - item.width = 24; - item.height = 24; - - item.rare = 9; - item.expert = true; - bossBagNPC = mod.NPCType("CyberKing"); - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Treasure Bag"); - Tooltip.SetDefault("Right click to open"); - } - - - public override bool CanRightClick() - { - return true; - } - - public override void OpenBossBag(Player player) - { - if(Main.rand.Next(7) == 0) - { - player.QuickSpawnItem(mod.ItemType("CyberKingMask")); - } - switch (Main.rand.Next(4)) - { - case 0: - player.QuickSpawnItem(mod.ItemType("RedStorm")); - break; - case 1: - player.QuickSpawnItem(mod.ItemType("CyberCutter")); - break; - case 2: - player.QuickSpawnItem(mod.ItemType("ShockwaveClaymore")); - break; - } - player.TryGettingDevArmor(); - player.QuickSpawnItem(mod.ItemType("CyberStaff")); - } - -}} + public class CyberKingBag : ModItem + { + public override void SetDefaults() + { + + item.maxStack = 999; + item.consumable = true; + item.width = 24; + item.height = 24; + + item.rare = 9; + item.expert = true; + bossBagNPC = mod.NPCType("CyberKing"); + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Treasure Bag"); + Tooltip.SetDefault("Right click to open"); + } + + + public override bool CanRightClick() + { + return true; + } + + public override void OpenBossBag(Player player) + { + if (Main.rand.Next(7) == 0) + { + player.QuickSpawnItem(mod.ItemType("CyberKingMask")); + } + switch (Main.rand.Next(4)) + { + case 0: + player.QuickSpawnItem(mod.ItemType("RedStorm")); + break; + case 1: + player.QuickSpawnItem(mod.ItemType("CyberCutter")); + break; + case 2: + player.QuickSpawnItem(mod.ItemType("ShockwaveClaymore")); + break; + } + player.TryGettingDevArmor(); + player.QuickSpawnItem(mod.ItemType("CyberStaff")); + } + + } +} diff --git a/Items/CyberKingMask.cs b/Items/CyberKingMask.cs index 0fa9c143..0789c1f1 100644 --- a/Items/CyberKingMask.cs +++ b/Items/CyberKingMask.cs @@ -4,25 +4,28 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class CyberKingMask : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class CyberKingMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.rare = 1; - item.vanity = true; - } + item.width = 30; + item.height = 24; + item.rare = 1; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cyber King Mask"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cyber King Mask"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/CyberKingMusicBox.cs b/Items/CyberKingMusicBox.cs index 27ccbb2b..4c64d42d 100644 --- a/Items/CyberKingMusicBox.cs +++ b/Items/CyberKingMusicBox.cs @@ -25,11 +25,11 @@ public override void SetDefaults() item.accessory = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Music Box (Cyber King)"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Music Box (Cyber King)"); + Tooltip.SetDefault(""); + } } } diff --git a/Items/CyberKingTrophy.cs b/Items/CyberKingTrophy.cs index d1d0e553..fdedcc34 100644 --- a/Items/CyberKingTrophy.cs +++ b/Items/CyberKingTrophy.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class CyberKingTrophy : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class CyberKingTrophy : ModItem + { + public override void SetDefaults() + { - item.width = 32; - item.height = 32; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 50000; - item.createTile = mod.TileType("CyberKingTrophy"); - item.placeStyle = 0; - } + item.width = 32; + item.height = 32; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 50000; + item.createTile = mod.TileType("CyberKingTrophy"); + item.placeStyle = 0; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cyber King Trophy"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cyber King Trophy"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/CyberStaff.cs b/Items/CyberStaff.cs index b35bd809..484c7b81 100644 --- a/Items/CyberStaff.cs +++ b/Items/CyberStaff.cs @@ -16,7 +16,7 @@ public override void SetDefaults() item.mana = 15; item.width = 26; item.height = 28; - item.expert = true; + item.expert = true; item.useTime = 36; item.useAnimation = 36; @@ -32,26 +32,26 @@ public override void SetDefaults() item.buffTime = 3600; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cyber Staff"); - Tooltip.SetDefault("Summons a cyber saw to fight for you."); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cyber Staff"); + Tooltip.SetDefault("Summons a cyber saw to fight for you."); + } public override bool AltFunctionUse(Player player) { return true; } - + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { return player.altFunctionUse != 2; } - + public override bool UseItem(Player player) { - if(player.altFunctionUse == 2) + if (player.altFunctionUse == 2) { player.MinionNPCTargetAim(); } diff --git a/Items/Cyclone.cs b/Items/Cyclone.cs index 29698cf3..e15bd03b 100644 --- a/Items/Cyclone.cs +++ b/Items/Cyclone.cs @@ -4,45 +4,47 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Cyclone : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Cyclone : ModItem + { + public override void SetDefaults() + { - item.damage = 84; - item.width = 14; - item.height = 84; - item.magic = true; - item.mana = 16; - item.useTime = 12; - item.useAnimation = 12; - item.shoot = mod.ProjectileType("CyclonePro"); - item.shootSpeed = 4f; - item.useStyle = 5; - item.knockBack = 4; - item.value = 230000; - item.rare = 10; - item.UseSound = SoundID.Item20; - item.autoReuse = true; - } + item.damage = 84; + item.width = 14; + item.height = 84; + item.magic = true; + item.mana = 16; + item.useTime = 12; + item.useAnimation = 12; + item.shoot = mod.ProjectileType("CyclonePro"); + item.shootSpeed = 4f; + item.useStyle = 5; + item.knockBack = 4; + item.value = 230000; + item.rare = 10; + item.UseSound = SoundID.Item20; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cyclone"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cyclone"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "AncientTechnology", 1); - recipe.AddIngredient(3457, 30); - recipe.AddIngredient(null, "SeaFragment", 25); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "AncientTechnology", 1); + recipe.AddIngredient(3457, 30); + recipe.AddIngredient(null, "SeaFragment", 25); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } +} diff --git a/Items/DakkharnsMask.cs b/Items/DakkharnsMask.cs index 56a751fd..4b8ddddb 100644 --- a/Items/DakkharnsMask.cs +++ b/Items/DakkharnsMask.cs @@ -6,33 +6,36 @@ using Terraria.ModLoader; using Microsoft.Xna.Framework; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class DakkharnsMask: ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class DakkharnsMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 38; - item.height = 22; + item.width = 38; + item.height = 22; - item.value = 1000000; - item.rare = 11; - item.defense = 50; - } + item.value = 1000000; + item.rare = 11; + item.defense = 50; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dakkharn Mask"); - Tooltip.SetDefault("Summons and ancient predator to defend you from foes\nPredator attacks enemies and inflicts curses"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dakkharn Mask"); + Tooltip.SetDefault("Summons and ancient predator to defend you from foes\nPredator attacks enemies and inflicts curses"); + } - public override void UpdateEquip(Player player) - { - player.AddBuff(mod.BuffType("AncientPredatorBuff"), 2); - } -}} + public override void UpdateEquip(Player player) + { + player.AddBuff(mod.BuffType("AncientPredatorBuff"), 2); + } + } +} diff --git a/Items/DangerBlade.cs b/Items/DangerBlade.cs index 88c5861e..b159558c 100644 --- a/Items/DangerBlade.cs +++ b/Items/DangerBlade.cs @@ -15,23 +15,23 @@ public override void SetDefaults() item.shootSpeed *= 0.75f; - item.useTime = 6; - item.useAnimation = 30; - item.autoReuse = true; - item.rare = 0; + item.useTime = 6; + item.useAnimation = 30; + item.autoReuse = true; + item.rare = 0; item.damage = 255; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Danger Blade"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Danger Blade"); + } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) - { - tooltips[0].overrideColor = new Color(238, 194, 73); - } + public override void ModifyTooltips(System.Collections.Generic.List tooltips) + { + tooltips[0].overrideColor = new Color(238, 194, 73); + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { @@ -39,17 +39,17 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX return base.Shoot(player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "CollapsiumBar", 16); - recipe.AddIngredient(null, "ClusterShard", 16); - recipe.AddIngredient(null, "AngryShard", 5); - recipe.AddIngredient(null, "TrueEssense", 3); - recipe.AddIngredient(null, "GoldenClaw", 3); - recipe.SetResult(this); - recipe.AddTile(null, "DivineForgeTile"); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "CollapsiumBar", 16); + recipe.AddIngredient(null, "ClusterShard", 16); + recipe.AddIngredient(null, "AngryShard", 5); + recipe.AddIngredient(null, "TrueEssense", 3); + recipe.AddIngredient(null, "GoldenClaw", 3); + recipe.SetResult(this); + recipe.AddTile(null, "DivineForgeTile"); + recipe.AddRecipe(); + } } } diff --git a/Items/DarkAbsorber.cs b/Items/DarkAbsorber.cs index 435f9062..694ea17b 100644 --- a/Items/DarkAbsorber.cs +++ b/Items/DarkAbsorber.cs @@ -5,45 +5,47 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Shield)] -public class DarkAbsorber : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + [AutoloadEquip(EquipType.Shield)] + public class DarkAbsorber : ModItem + { + public override void SetDefaults() + { - item.width = 24; - item.height = 28; + item.width = 24; + item.height = 28; - item.value = 45000; - item.rare = 5; - item.accessory = true; - item.defense = 3; - } + item.value = 45000; + item.rare = 5; + item.accessory = true; + item.defense = 3; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dark Absorber"); - Tooltip.SetDefault("Gives health when in Corruption"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dark Absorber"); + Tooltip.SetDefault("Gives health when in Corruption"); + } -public override void UpdateAccessory(Player player, bool hideVisual) -{ - if (player.ZoneCorrupt) - { - player.statLifeMax2 += 100; - } -} + public override void UpdateAccessory(Player player, bool hideVisual) + { + if (player.ZoneCorrupt) + { + player.statLifeMax2 += 100; + } + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.DemoniteBar, 28); - recipe.AddIngredient(ItemID.ShadowScale, 45); - recipe.AddIngredient(ItemID.SoulofNight, 15); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.DemoniteBar, 28); + recipe.AddIngredient(ItemID.ShadowScale, 45); + recipe.AddIngredient(ItemID.SoulofNight, 15); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/DarkBulb.cs b/Items/DarkBulb.cs index 1d0fdd03..30fb5c0c 100644 --- a/Items/DarkBulb.cs +++ b/Items/DarkBulb.cs @@ -4,33 +4,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DarkBulb : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class DarkBulb : ModItem + { + public override void SetDefaults() + { - item.width = 14; - item.height = 22; - item.maxStack = 999; - item.rare = 3; - item.value = Item.buyPrice(0, 0, 10, 0); - } + item.width = 14; + item.height = 22; + item.maxStack = 999; + item.rare = 3; + item.value = Item.buyPrice(0, 0, 10, 0); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dark Bulb"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dark Bulb"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "LightBulb", 1); - recipe.AddIngredient(null, "TearsofDeath", 1); - recipe.AddIngredient(null, "Charcoal", 1); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "LightBulb", 1); + recipe.AddIngredient(null, "TearsofDeath", 1); + recipe.AddIngredient(null, "Charcoal", 1); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/DarkDruidBanner.cs b/Items/DarkDruidBanner.cs index e9b09283..011567f8 100644 --- a/Items/DarkDruidBanner.cs +++ b/Items/DarkDruidBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DarkDruidBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class DarkDruidBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 5; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 5; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dark Druid Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dark Druid Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/DarkDruidMask.cs b/Items/DarkDruidMask.cs index f743c171..75b9a406 100644 --- a/Items/DarkDruidMask.cs +++ b/Items/DarkDruidMask.cs @@ -5,24 +5,27 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class DarkDruidMask : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class DarkDruidMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 36; - item.height = 26; - item.value = 2500; - item.rare = 1; - } + item.width = 36; + item.height = 26; + item.value = 2500; + item.rare = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dark Druid Mask"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dark Druid Mask"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/DarkEmperorBag.cs b/Items/DarkEmperorBag.cs index cf6008fe..7ad1ade1 100644 --- a/Items/DarkEmperorBag.cs +++ b/Items/DarkEmperorBag.cs @@ -4,55 +4,57 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DarkEmperorBag : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class DarkEmperorBag : ModItem + { + public override void SetDefaults() + { - item.maxStack = 999; - item.consumable = true; - item.width = 24; - item.height = 24; + item.maxStack = 999; + item.consumable = true; + item.width = 24; + item.height = 24; - item.rare = 9; - item.expert = true; - bossBagNPC = mod.NPCType("TheDarkEmperorTwo"); - } + item.rare = 9; + item.expert = true; + bossBagNPC = mod.NPCType("TheDarkEmperorTwo"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Treasure Bag"); - Tooltip.SetDefault("Right click to open"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Treasure Bag"); + Tooltip.SetDefault("Right click to open"); + } - public override bool CanRightClick() - { - return true; - } + public override bool CanRightClick() + { + return true; + } - public override void OpenBossBag(Player player) - { - if(Main.rand.Next(7) == 0) - { - player.QuickSpawnItem(mod.ItemType("DarkEmperorMask")); - } - if(Main.rand.Next(5) == 0) - { - player.QuickSpawnItem(mod.ItemType("DrippingScythe")); - } - if(Main.rand.Next(5) == 0) - { - player.QuickSpawnItem(mod.ItemType("DelightfulClump")); - } - if(Main.rand.Next(1) == 0) - { - player.QuickSpawnItem(mod.ItemType("NastyJavelin"), Main.rand.Next(30,50)); - } - player.QuickSpawnItem(mod.ItemType("SuperBigCannon")); - player.QuickSpawnItem(mod.ItemType("SBCCannonballAmmo"), Main.rand.Next(50, 150)); - player.QuickSpawnItem(mod.ItemType("DarkGel"), Main.rand.Next(50, 100)); - player.QuickSpawnItem(mod.ItemType("SoulofFight"), Main.rand.Next(20, 30)); - } -}} + public override void OpenBossBag(Player player) + { + if (Main.rand.Next(7) == 0) + { + player.QuickSpawnItem(mod.ItemType("DarkEmperorMask")); + } + if (Main.rand.Next(5) == 0) + { + player.QuickSpawnItem(mod.ItemType("DrippingScythe")); + } + if (Main.rand.Next(5) == 0) + { + player.QuickSpawnItem(mod.ItemType("DelightfulClump")); + } + if (Main.rand.Next(1) == 0) + { + player.QuickSpawnItem(mod.ItemType("NastyJavelin"), Main.rand.Next(30, 50)); + } + player.QuickSpawnItem(mod.ItemType("SuperBigCannon")); + player.QuickSpawnItem(mod.ItemType("SBCCannonballAmmo"), Main.rand.Next(50, 150)); + player.QuickSpawnItem(mod.ItemType("DarkGel"), Main.rand.Next(50, 100)); + player.QuickSpawnItem(mod.ItemType("SoulofFight"), Main.rand.Next(20, 30)); + } + } +} diff --git a/Items/DarkEmperorMask.cs b/Items/DarkEmperorMask.cs index d109ed2e..9af082a0 100644 --- a/Items/DarkEmperorMask.cs +++ b/Items/DarkEmperorMask.cs @@ -4,25 +4,28 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class DarkEmperorMask : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class DarkEmperorMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 20; - item.height = 24; - item.rare = 1; - item.vanity = true; - } + item.width = 20; + item.height = 24; + item.rare = 1; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dark Emperor Mask"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dark Emperor Mask"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/DarkEmperorTrophy.cs b/Items/DarkEmperorTrophy.cs index 81791e29..e83927ba 100644 --- a/Items/DarkEmperorTrophy.cs +++ b/Items/DarkEmperorTrophy.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DarkEmperorTrophy : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class DarkEmperorTrophy : ModItem + { + public override void SetDefaults() + { - item.width = 32; - item.height = 32; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 50000; - item.createTile = mod.TileType("DarkEmperorTrophy"); - item.placeStyle = 0; - } + item.width = 32; + item.height = 32; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 50000; + item.createTile = mod.TileType("DarkEmperorTrophy"); + item.placeStyle = 0; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dark Emperor Trophy"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dark Emperor Trophy"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/DarkGel.cs b/Items/DarkGel.cs index 0533c9cd..d5cce588 100644 --- a/Items/DarkGel.cs +++ b/Items/DarkGel.cs @@ -4,23 +4,25 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DarkGel : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class DarkGel : ModItem + { + public override void SetDefaults() + { - item.width = 28; - item.height = 30; - item.maxStack = 99; - item.value = 1000; - item.rare = 11; - } + item.width = 28; + item.height = 30; + item.maxStack = 99; + item.value = 1000; + item.rare = 11; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dark Gel"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dark Gel"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/DarkMass.cs b/Items/DarkMass.cs index 3f4dd0d6..8b3c5edf 100644 --- a/Items/DarkMass.cs +++ b/Items/DarkMass.cs @@ -6,25 +6,27 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DarkMass : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class DarkMass : ModItem + { + public override void SetDefaults() + { - item.width = 20; - item.height = 20; - item.value = 100000; - item.rare = 11; - item.maxStack = 99; - ItemID.Sets.ItemNoGravity[item.type] = true; - } + item.width = 20; + item.height = 20; + item.value = 100000; + item.rare = 11; + item.maxStack = 99; + ItemID.Sets.ItemNoGravity[item.type] = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dark Mass"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dark Mass"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/DarkMatter.cs b/Items/DarkMatter.cs index 6e51dcb4..84446c86 100644 --- a/Items/DarkMatter.cs +++ b/Items/DarkMatter.cs @@ -6,24 +6,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DarkMatter : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class DarkMatter : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 100; - item.rare = 6; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 100; + item.rare = 6; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dark Matter"); - Tooltip.SetDefault(""); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(8, 4)); - } - -}} + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dark Matter"); + Tooltip.SetDefault(""); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(8, 4)); + } + + } +} diff --git a/Items/Darkhalis.cs b/Items/Darkhalis.cs index c902b870..43d84fda 100644 --- a/Items/Darkhalis.cs +++ b/Items/Darkhalis.cs @@ -17,11 +17,11 @@ public override void SetDefaults() } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Darkhalis"); - Tooltip.SetDefault("'It came from the deep abyss...'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Darkhalis"); + Tooltip.SetDefault("'It came from the deep abyss...'"); + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) @@ -30,16 +30,16 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX return base.Shoot(player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Arkhalis, 1); - recipe.AddIngredient(null, "NightmareBar", 22); - recipe.AddIngredient(null, "Doomstone", 15); - recipe.AddIngredient(null, "Phantaplasm", 12); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Arkhalis, 1); + recipe.AddIngredient(null, "NightmareBar", 22); + recipe.AddIngredient(null, "Doomstone", 15); + recipe.AddIngredient(null, "Phantaplasm", 12); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } } } diff --git a/Items/DarknessBreastplate.cs b/Items/DarknessBreastplate.cs index 66eef656..168aed64 100644 --- a/Items/DarknessBreastplate.cs +++ b/Items/DarknessBreastplate.cs @@ -6,43 +6,43 @@ using Terraria.ModLoader; namespace Tremor.Items -{ -[AutoloadEquip(EquipType.Body)] - public class DarknessBreastplate : ModItem - { - - public override void SetDefaults() - { - - item.width = 26; - item.height = 18; - - item.value = 600000; - item.rare = 11; - item.defense = 30; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Breastplate of Darkness"); - Tooltip.SetDefault("Increases life regeneration"); - } - - - public override void UpdateEquip(Player player) - { - player.lifeRegen +=5; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "DarkGel", 38); - recipe.AddIngredient(null, "DarkMatter", 38); - recipe.AddIngredient(null, "DarkMass", 1); - recipe.SetResult(this); - recipe.AddTile(247); - recipe.AddRecipe(); - } - } +{ + [AutoloadEquip(EquipType.Body)] + public class DarknessBreastplate : ModItem + { + + public override void SetDefaults() + { + + item.width = 26; + item.height = 18; + + item.value = 600000; + item.rare = 11; + item.defense = 30; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Breastplate of Darkness"); + Tooltip.SetDefault("Increases life regeneration"); + } + + + public override void UpdateEquip(Player player) + { + player.lifeRegen += 5; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "DarkGel", 38); + recipe.AddIngredient(null, "DarkMatter", 38); + recipe.AddIngredient(null, "DarkMass", 1); + recipe.SetResult(this); + recipe.AddTile(247); + recipe.AddRecipe(); + } + } } diff --git a/Items/DarknessCloth.cs b/Items/DarknessCloth.cs index 8382fba5..f8a3b08f 100644 --- a/Items/DarknessCloth.cs +++ b/Items/DarknessCloth.cs @@ -4,23 +4,25 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DarknessCloth : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class DarknessCloth : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 999; - item.value = 600; - item.rare = 7; - } + item.width = 30; + item.height = 24; + item.maxStack = 999; + item.value = 600; + item.rare = 7; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Darkness Cloth"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Darkness Cloth"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/DarknessDust.cs b/Items/DarknessDust.cs index 5651315d..41a39af7 100644 --- a/Items/DarknessDust.cs +++ b/Items/DarknessDust.cs @@ -6,41 +6,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DarknessDust : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class DarknessDust : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 36; - item.value = 12500; - item.rare = 5; - item.accessory = true; - } + item.width = 22; + item.height = 36; + item.value = 12500; + item.rare = 5; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Darkness Dust"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Darkness Dust"); + Tooltip.SetDefault(""); + } -public override void UpdateAccessory(Player player, bool hideVisual) -{ - if(Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y) > 1f && !player.rocketFrame) // Makes sure the player is actually moving - { - for (int k = 0; k < 2; k++) - { - int index= Dust.NewDust(new Vector2(player.position.X - player.velocity.X * 2f, player.position.Y - 2f - player.velocity.Y * 2f), player.width, player.height, 27, 0f, 0f, 100, default(Color), 2f); - Main.dust[index].noGravity = true; - Main.dust[index].noLight = true; - Dust dust = Main.dust[index]; - dust.velocity.X = dust.velocity.X - player.velocity.X * 0.5f; - dust.velocity.Y = dust.velocity.Y - player.velocity.Y * 0.5f; - } - } -} + public override void UpdateAccessory(Player player, bool hideVisual) + { + if (Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y) > 1f && !player.rocketFrame) // Makes sure the player is actually moving + { + for (int k = 0; k < 2; k++) + { + int index = Dust.NewDust(new Vector2(player.position.X - player.velocity.X * 2f, player.position.Y - 2f - player.velocity.Y * 2f), player.width, player.height, 27, 0f, 0f, 100, default(Color), 2f); + Main.dust[index].noGravity = true; + Main.dust[index].noLight = true; + Dust dust = Main.dust[index]; + dust.velocity.X = dust.velocity.X - player.velocity.X * 0.5f; + dust.velocity.Y = dust.velocity.Y - player.velocity.Y * 0.5f; + } + } + } public override void AddRecipes() { @@ -52,4 +53,5 @@ public override void AddRecipes() recipe.AddRecipe(); } -}} + } +} diff --git a/Items/DarknessHat.cs b/Items/DarknessHat.cs index 86a6d80e..94a1fdbf 100644 --- a/Items/DarknessHat.cs +++ b/Items/DarknessHat.cs @@ -7,79 +7,81 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class DarknessHat : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class DarknessHat : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.defense = 22; - item.width = 26; + item.defense = 22; + item.width = 26; - item.height = 32; - item.value = 600000; - item.rare = 11; - } + item.height = 32; + item.value = 600000; + item.rare = 11; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Hat of Darkness"); - Tooltip.SetDefault("Increases life regeneration\nIncreases maximum mana by 80"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Hat of Darkness"); + Tooltip.SetDefault("Increases life regeneration\nIncreases maximum mana by 80"); + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == mod.ItemType("DarknessBreastplate") && legs.type == mod.ItemType("DarknessGreaves"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("DarknessBreastplate") && legs.type == mod.ItemType("DarknessGreaves"); + } - public override void UpdateEquip(Player player) - { - player.lifeRegen +=5; - player.statManaMax2 += 80; - } + public override void UpdateEquip(Player player) + { + player.lifeRegen += 5; + player.statManaMax2 += 80; + } - public override void UpdateArmorSet(Player player) -{ + public override void UpdateArmorSet(Player player) + { - player.setBonus = "Your magic stats are increased during the night!"; + player.setBonus = "Your magic stats are increased during the night!"; - if(Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y) > 1f && !player.rocketFrame) // Makes sure the player is actually moving - { - for (int k = 0; k < 2; k++) - { - int index= Dust.NewDust(new Vector2(player.position.X - player.velocity.X * 2f, player.position.Y - 2f - player.velocity.Y * 2f), player.width, player.height, 54, 0f, 0f, 100, default(Color), 2f); - Main.dust[index].noGravity = true; - Main.dust[index].noLight = true; - Dust dust = Main.dust[index]; - dust.velocity.X = dust.velocity.X - player.velocity.X * 0.5f; - dust.velocity.Y = dust.velocity.Y - player.velocity.Y * 0.5f; - } - } + if (Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y) > 1f && !player.rocketFrame) // Makes sure the player is actually moving + { + for (int k = 0; k < 2; k++) + { + int index = Dust.NewDust(new Vector2(player.position.X - player.velocity.X * 2f, player.position.Y - 2f - player.velocity.Y * 2f), player.width, player.height, 54, 0f, 0f, 100, default(Color), 2f); + Main.dust[index].noGravity = true; + Main.dust[index].noLight = true; + Dust dust = Main.dust[index]; + dust.velocity.X = dust.velocity.X - player.velocity.X * 0.5f; + dust.velocity.Y = dust.velocity.Y - player.velocity.Y * 0.5f; + } + } - if (!Main.dayTime) - { - player.magicCrit += 25; - player.magicDamage += 0.30f; - } -} + if (!Main.dayTime) + { + player.magicCrit += 25; + player.magicDamage += 0.30f; + } + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawShadowLokis = true; + player.armorEffectDrawShadowLokis = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "DarkGel", 32); - recipe.AddIngredient(null, "DarkMatter", 32); - recipe.AddIngredient(null, "DarkMass", 1); - recipe.SetResult(this); - recipe.AddTile(247); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "DarkGel", 32); + recipe.AddIngredient(null, "DarkMatter", 32); + recipe.AddIngredient(null, "DarkMass", 1); + recipe.SetResult(this); + recipe.AddTile(247); + recipe.AddRecipe(); + } + } } diff --git a/Items/DarknessHeadgear.cs b/Items/DarknessHeadgear.cs index cb54e121..97e63117 100644 --- a/Items/DarknessHeadgear.cs +++ b/Items/DarknessHeadgear.cs @@ -7,79 +7,81 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class DarknessHeadgear : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class DarknessHeadgear : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.defense = 22; - item.width = 26; + item.defense = 22; + item.width = 26; - item.height = 32; - item.value = 600000; - item.rare = 11; - } + item.height = 32; + item.value = 600000; + item.rare = 11; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Headgear of Darkness"); - Tooltip.SetDefault("Increases life regeneration\n20% chance not consume ammo"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Headgear of Darkness"); + Tooltip.SetDefault("Increases life regeneration\n20% chance not consume ammo"); + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == mod.ItemType("DarknessBreastplate") && legs.type == mod.ItemType("DarknessGreaves"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("DarknessBreastplate") && legs.type == mod.ItemType("DarknessGreaves"); + } - public override void UpdateEquip(Player player) - { - player.lifeRegen +=5; - player.ammoCost80 = true; - } + public override void UpdateEquip(Player player) + { + player.lifeRegen += 5; + player.ammoCost80 = true; + } - public override void UpdateArmorSet(Player player) -{ + public override void UpdateArmorSet(Player player) + { - player.setBonus = "Your ranged stats are increased during the night!"; + player.setBonus = "Your ranged stats are increased during the night!"; - if(Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y) > 1f && !player.rocketFrame) // Makes sure the player is actually moving - { - for (int k = 0; k < 2; k++) - { - int index= Dust.NewDust(new Vector2(player.position.X - player.velocity.X * 2f, player.position.Y - 2f - player.velocity.Y * 2f), player.width, player.height, 54, 0f, 0f, 100, default(Color), 2f); - Main.dust[index].noGravity = true; - Main.dust[index].noLight = true; - Dust dust = Main.dust[index]; - dust.velocity.X = dust.velocity.X - player.velocity.X * 0.5f; - dust.velocity.Y = dust.velocity.Y - player.velocity.Y * 0.5f; - } - } + if (Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y) > 1f && !player.rocketFrame) // Makes sure the player is actually moving + { + for (int k = 0; k < 2; k++) + { + int index = Dust.NewDust(new Vector2(player.position.X - player.velocity.X * 2f, player.position.Y - 2f - player.velocity.Y * 2f), player.width, player.height, 54, 0f, 0f, 100, default(Color), 2f); + Main.dust[index].noGravity = true; + Main.dust[index].noLight = true; + Dust dust = Main.dust[index]; + dust.velocity.X = dust.velocity.X - player.velocity.X * 0.5f; + dust.velocity.Y = dust.velocity.Y - player.velocity.Y * 0.5f; + } + } - if (!Main.dayTime) - { - player.rangedCrit += 25; - player.rangedDamage += 0.30f; - } -} + if (!Main.dayTime) + { + player.rangedCrit += 25; + player.rangedDamage += 0.30f; + } + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawShadowLokis = true; + player.armorEffectDrawShadowLokis = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "DarkGel", 32); - recipe.AddIngredient(null, "DarkMatter", 32); - recipe.AddIngredient(null, "DarkMass", 1); - recipe.SetResult(this); - recipe.AddTile(247); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "DarkGel", 32); + recipe.AddIngredient(null, "DarkMatter", 32); + recipe.AddIngredient(null, "DarkMass", 1); + recipe.SetResult(this); + recipe.AddTile(247); + recipe.AddRecipe(); + } + } } diff --git a/Items/DarknessHelmet.cs b/Items/DarknessHelmet.cs index 9f08911b..7f347146 100644 --- a/Items/DarknessHelmet.cs +++ b/Items/DarknessHelmet.cs @@ -7,85 +7,87 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class DarknessHelmet : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class DarknessHelmet : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.defense = 22; - item.width = 26; + item.defense = 22; + item.width = 26; - item.height = 32; - item.value = 600000; - item.rare = 11; - } + item.height = 32; + item.value = 600000; + item.rare = 11; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Helmet of Darkness"); - Tooltip.SetDefault("Increases life regeneration\nIncreases melee speed by 25%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Helmet of Darkness"); + Tooltip.SetDefault("Increases life regeneration\nIncreases melee speed by 25%"); + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == mod.ItemType("DarknessBreastplate") && legs.type == mod.ItemType("DarknessGreaves"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("DarknessBreastplate") && legs.type == mod.ItemType("DarknessGreaves"); + } -public virtual void ArmorSetShadows(Player player, ref bool longTrail, ref bool smallPulse, ref bool largePulse, ref bool shortTrail) -{ -longTrail = true; -Main.NewText("1", 175, 75, 255); -} + public virtual void ArmorSetShadows(Player player, ref bool longTrail, ref bool smallPulse, ref bool largePulse, ref bool shortTrail) + { + longTrail = true; + Main.NewText("1", 175, 75, 255); + } - public override void UpdateEquip(Player player) - { - player.lifeRegen +=5; - player.meleeSpeed += 0.25f; - } + public override void UpdateEquip(Player player) + { + player.lifeRegen += 5; + player.meleeSpeed += 0.25f; + } - public override void UpdateArmorSet(Player player) -{ + public override void UpdateArmorSet(Player player) + { - if(Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y) > 1f && !player.rocketFrame) // Makes sure the player is actually moving - { - for (int k = 0; k < 2; k++) - { - int index= Dust.NewDust(new Vector2(player.position.X - player.velocity.X * 2f, player.position.Y - 2f - player.velocity.Y * 2f), player.width, player.height, 54, 0f, 0f, 100, default(Color), 2f); - Main.dust[index].noGravity = true; - Main.dust[index].noLight = true; - Dust dust = Main.dust[index]; - dust.velocity.X = dust.velocity.X - player.velocity.X * 0.5f; - dust.velocity.Y = dust.velocity.Y - player.velocity.Y * 0.5f; - } - } - - player.setBonus = "Your melee stats are increased during the night!"; - if (!Main.dayTime) - { - player.meleeCrit += 25; - player.meleeDamage += 0.30f; - } -} + if (Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y) > 1f && !player.rocketFrame) // Makes sure the player is actually moving + { + for (int k = 0; k < 2; k++) + { + int index = Dust.NewDust(new Vector2(player.position.X - player.velocity.X * 2f, player.position.Y - 2f - player.velocity.Y * 2f), player.width, player.height, 54, 0f, 0f, 100, default(Color), 2f); + Main.dust[index].noGravity = true; + Main.dust[index].noLight = true; + Dust dust = Main.dust[index]; + dust.velocity.X = dust.velocity.X - player.velocity.X * 0.5f; + dust.velocity.Y = dust.velocity.Y - player.velocity.Y * 0.5f; + } + } + + player.setBonus = "Your melee stats are increased during the night!"; + if (!Main.dayTime) + { + player.meleeCrit += 25; + player.meleeDamage += 0.30f; + } + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawShadowLokis = true; + player.armorEffectDrawShadowLokis = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "DarkGel", 32); - recipe.AddIngredient(null, "DarkMatter", 32); - recipe.AddIngredient(null, "DarkMass", 1); - recipe.SetResult(this); - recipe.AddTile(247); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "DarkGel", 32); + recipe.AddIngredient(null, "DarkMatter", 32); + recipe.AddIngredient(null, "DarkMass", 1); + recipe.SetResult(this); + recipe.AddTile(247); + recipe.AddRecipe(); + } + } } diff --git a/Items/DarknessLeggings.cs b/Items/DarknessLeggings.cs index a39917c4..6e9e8d63 100644 --- a/Items/DarknessLeggings.cs +++ b/Items/DarknessLeggings.cs @@ -4,41 +4,44 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class DarknessLeggings : ModItem +namespace Tremor.Items { - - - public override void SetDefaults() - { - - item.width = 22; - item.height = 18; - item.value = 600000; - - item.rare = 11; - item.defense = 25; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Leggings of Darkness"); - Tooltip.SetDefault("Increases life regeneration"); - } - - public override void UpdateEquip(Player player) - { - player.lifeRegen +=5; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "DarkGel", 45); - recipe.AddIngredient(null, "DarkMatter", 45); - recipe.AddIngredient(null, "DarkMass", 1); - recipe.SetResult(this); - recipe.AddTile(247); - recipe.AddRecipe(); - } -}} + [AutoloadEquip(EquipType.Legs)] + public class DarknessLeggings : ModItem + { + + + public override void SetDefaults() + { + + item.width = 22; + item.height = 18; + item.value = 600000; + + item.rare = 11; + item.defense = 25; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Leggings of Darkness"); + Tooltip.SetDefault("Increases life regeneration"); + } + + public override void UpdateEquip(Player player) + { + player.lifeRegen += 5; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "DarkGel", 45); + recipe.AddIngredient(null, "DarkMatter", 45); + recipe.AddIngredient(null, "DarkMass", 1); + recipe.SetResult(this); + recipe.AddTile(247); + recipe.AddRecipe(); + } + } +} diff --git a/Items/DarknessMask.cs b/Items/DarknessMask.cs index a9364e10..78c3e89c 100644 --- a/Items/DarknessMask.cs +++ b/Items/DarknessMask.cs @@ -7,71 +7,73 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class DarknessMask : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class DarknessMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.defense = 22; - item.width = 26; - item.height = 32; - item.value = 600000; - item.rare = 11; - } + item.defense = 22; + item.width = 26; + item.height = 32; + item.value = 600000; + item.rare = 11; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Mask of Darkness"); - Tooltip.SetDefault("Increases life regeneration\nIncreases maximum amount of minions"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Mask of Darkness"); + Tooltip.SetDefault("Increases life regeneration\nIncreases maximum amount of minions"); + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == mod.ItemType("DarknessBreastplate") && legs.type == mod.ItemType("DarknessGreaves"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("DarknessBreastplate") && legs.type == mod.ItemType("DarknessGreaves"); + } - public override void UpdateEquip(Player player) - { - player.lifeRegen +=5; - player.maxMinions += 2; - } + public override void UpdateEquip(Player player) + { + player.lifeRegen += 5; + player.maxMinions += 2; + } - public override void UpdateArmorSet(Player player) -{ + public override void UpdateArmorSet(Player player) + { - if(Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y) > 1f && !player.rocketFrame) // Makes sure the player is actually moving - { - for (int k = 0; k < 2; k++) - { - int index= Dust.NewDust(new Vector2(player.position.X - player.velocity.X * 2f, player.position.Y - 2f - player.velocity.Y * 2f), player.width, player.height, 54, 0f, 0f, 100, default(Color), 2f); - Main.dust[index].noGravity = true; - Main.dust[index].noLight = true; - Dust dust = Main.dust[index]; - dust.velocity.X = dust.velocity.X - player.velocity.X * 0.5f; - dust.velocity.Y = dust.velocity.Y - player.velocity.Y * 0.5f; - } - } + if (Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y) > 1f && !player.rocketFrame) // Makes sure the player is actually moving + { + for (int k = 0; k < 2; k++) + { + int index = Dust.NewDust(new Vector2(player.position.X - player.velocity.X * 2f, player.position.Y - 2f - player.velocity.Y * 2f), player.width, player.height, 54, 0f, 0f, 100, default(Color), 2f); + Main.dust[index].noGravity = true; + Main.dust[index].noLight = true; + Dust dust = Main.dust[index]; + dust.velocity.X = dust.velocity.X - player.velocity.X * 0.5f; + dust.velocity.Y = dust.velocity.Y - player.velocity.Y * 0.5f; + } + } - player.setBonus = "Your summoner stats increases during the night!"; - if (!Main.dayTime) - { - player.minionDamage += 0.30f; - player.maxMinions += 2; - } -} + player.setBonus = "Your summoner stats increases during the night!"; + if (!Main.dayTime) + { + player.minionDamage += 0.30f; + player.maxMinions += 2; + } + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "DarkGel", 32); - recipe.AddIngredient(null, "DarkMatter", 32); - recipe.AddIngredient(null, "DarkMass", 1); - recipe.SetResult(this); - recipe.AddTile(247); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "DarkGel", 32); + recipe.AddIngredient(null, "DarkMatter", 32); + recipe.AddIngredient(null, "DarkMass", 1); + recipe.SetResult(this); + recipe.AddTile(247); + recipe.AddRecipe(); + } + } } diff --git a/Items/DeadFlower.cs b/Items/DeadFlower.cs index c56ecd8a..5dc7fcd9 100644 --- a/Items/DeadFlower.cs +++ b/Items/DeadFlower.cs @@ -31,23 +31,23 @@ public override void SetDefaults() item.shootSpeed = 15f; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dead Flower"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dead Flower"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Wood, 12); - recipe.AddIngredient(null, "UntreatedFlesh", 5); - recipe.AddIngredient(ItemID.Lens, 2); - recipe.AddIngredient(ItemID.FallenStar, 1); - recipe.SetResult(this); - recipe.AddTile(null, "FleshWorkstationTile"); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Wood, 12); + recipe.AddIngredient(null, "UntreatedFlesh", 5); + recipe.AddIngredient(ItemID.Lens, 2); + recipe.AddIngredient(ItemID.FallenStar, 1); + recipe.SetResult(this); + recipe.AddTile(null, "FleshWorkstationTile"); + recipe.AddRecipe(); + } } } diff --git a/Items/DeadHead.cs b/Items/DeadHead.cs index 53c349c4..e0d562f0 100644 --- a/Items/DeadHead.cs +++ b/Items/DeadHead.cs @@ -5,55 +5,57 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DeadHead: ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 26; - item.height = 20; - item.value = 110; - item.rare = 4; - item.defense = 5; - - item.accessory = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dead Head"); - Tooltip.SetDefault("Increases damage, critical strike chance and movement speed"); - } - - - public override void UpdateAccessory(Player player, bool hideVisual) - - { - player.meleeDamage += 0.04f; - player.meleeCrit += 4; - player.magicDamage += 0.04f; - player.magicCrit += 4; - player.rangedDamage += 0.04f; - player.rangedCrit += 4; - player.minionDamage += 0.04f; - //player.minionCrit += 4; - player.thrownDamage += 0.04f; - player.moveSpeed += 0.15f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "TheBrain", 1); - recipe.AddIngredient(null, "AtisBlood", 15); - recipe.AddIngredient(ItemID.Bone, 25); - recipe.AddIngredient(null, "UntreatedFlesh", 25); - recipe.AddIngredient(null, "SharpenedTooth", 6); - recipe.AddIngredient(ItemID.Lens, 2); - recipe.SetResult(this); - recipe.AddTile(null, "FleshWorkstationTile"); - recipe.AddRecipe(); - } -}} + public class DeadHead : ModItem + { + + public override void SetDefaults() + { + + item.width = 26; + item.height = 20; + item.value = 110; + item.rare = 4; + item.defense = 5; + + item.accessory = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dead Head"); + Tooltip.SetDefault("Increases damage, critical strike chance and movement speed"); + } + + + public override void UpdateAccessory(Player player, bool hideVisual) + + { + player.meleeDamage += 0.04f; + player.meleeCrit += 4; + player.magicDamage += 0.04f; + player.magicCrit += 4; + player.rangedDamage += 0.04f; + player.rangedCrit += 4; + player.minionDamage += 0.04f; + //player.minionCrit += 4; + player.thrownDamage += 0.04f; + player.moveSpeed += 0.15f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "TheBrain", 1); + recipe.AddIngredient(null, "AtisBlood", 15); + recipe.AddIngredient(ItemID.Bone, 25); + recipe.AddIngredient(null, "UntreatedFlesh", 25); + recipe.AddIngredient(null, "SharpenedTooth", 6); + recipe.AddIngredient(ItemID.Lens, 2); + recipe.SetResult(this); + recipe.AddTile(null, "FleshWorkstationTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/DeadHeadII.cs b/Items/DeadHeadII.cs index ef608a58..92ba6b08 100644 --- a/Items/DeadHeadII.cs +++ b/Items/DeadHeadII.cs @@ -5,54 +5,56 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DeadHeadII: ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 26; - item.height = 20; - item.value = 110; - item.rare = 4; - item.defense = 10; - - item.accessory = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Robotic Dead Head"); - Tooltip.SetDefault("Increases all stats"); - } - - - public override void UpdateAccessory(Player player, bool hideVisual) - - { - player.meleeDamage += 0.15f; - player.meleeCrit += 12; - player.magicDamage += 0.15f; - player.magicCrit += 12; - player.rangedDamage += 0.15f; - player.rangedCrit += 12; - player.minionDamage += 0.15f; - player.thrownDamage += 0.15f; - player.moveSpeed += 0.25f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "DeadHead", 1); - recipe.AddIngredient(null, "CarbonSteel", 15); - recipe.AddIngredient(null, "Doomstone", 5); - recipe.AddIngredient(null, "DeadTissue", 5); - recipe.AddIngredient(null, "Phantaplasm", 8); - recipe.AddIngredient(null, "EyeofOblivion", 2); - recipe.SetResult(this); - recipe.AddTile(null, "AlchemyStationTile"); - recipe.AddRecipe(); - } -}} + public class DeadHeadII : ModItem + { + + public override void SetDefaults() + { + + item.width = 26; + item.height = 20; + item.value = 110; + item.rare = 4; + item.defense = 10; + + item.accessory = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Robotic Dead Head"); + Tooltip.SetDefault("Increases all stats"); + } + + + public override void UpdateAccessory(Player player, bool hideVisual) + + { + player.meleeDamage += 0.15f; + player.meleeCrit += 12; + player.magicDamage += 0.15f; + player.magicCrit += 12; + player.rangedDamage += 0.15f; + player.rangedCrit += 12; + player.minionDamage += 0.15f; + player.thrownDamage += 0.15f; + player.moveSpeed += 0.25f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "DeadHead", 1); + recipe.AddIngredient(null, "CarbonSteel", 15); + recipe.AddIngredient(null, "Doomstone", 5); + recipe.AddIngredient(null, "DeadTissue", 5); + recipe.AddIngredient(null, "Phantaplasm", 8); + recipe.AddIngredient(null, "EyeofOblivion", 2); + recipe.SetResult(this); + recipe.AddTile(null, "AlchemyStationTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/DeadTissue.cs b/Items/DeadTissue.cs index b6d755ae..77e91979 100644 --- a/Items/DeadTissue.cs +++ b/Items/DeadTissue.cs @@ -4,24 +4,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DeadTissue : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class DeadTissue : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 12000; - item.rare = 10; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 12000; + item.rare = 10; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dead Tissue"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dead Tissue"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/DeadlyTreats.cs b/Items/DeadlyTreats.cs index 04809794..ecea6d63 100644 --- a/Items/DeadlyTreats.cs +++ b/Items/DeadlyTreats.cs @@ -4,55 +4,57 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class DeadlyTreats : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.width = 20; - item.height = 30; - item.maxStack = 20; - item.rare = 2; - item.useAnimation = 15; - item.useTime = 15; - item.useStyle = 2; - item.UseSound = SoundID.Item3; - item.consumable = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Deadly Treats"); - Tooltip.SetDefault("Increases life regeneration\nLowers visibilty"); - } - - - public override bool UseItem(Player player) - { - player.AddBuff(22, 10000, true); - player.AddBuff(2, 14400, true); - player.AddBuff(6, 14400, true); - return true; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Bowl, 1); - recipe.AddIngredient(null, "SpiderMeat", 1); - recipe.AddIngredient(ItemID.VileMushroom, 2); - recipe.SetResult(this); - recipe.AddTile(96); - recipe.AddRecipe(); - - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Bowl, 1); - recipe.AddIngredient(null, "SpiderMeat", 1); - recipe.AddIngredient(ItemID.ViciousMushroom, 2); - recipe.SetResult(this); - recipe.AddTile(96); - recipe.AddRecipe(); - } -}} + + public class DeadlyTreats : ModItem + { + public override void SetDefaults() + { + + item.width = 20; + item.height = 30; + item.maxStack = 20; + item.rare = 2; + item.useAnimation = 15; + item.useTime = 15; + item.useStyle = 2; + item.UseSound = SoundID.Item3; + item.consumable = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Deadly Treats"); + Tooltip.SetDefault("Increases life regeneration\nLowers visibilty"); + } + + + public override bool UseItem(Player player) + { + player.AddBuff(22, 10000, true); + player.AddBuff(2, 14400, true); + player.AddBuff(6, 14400, true); + return true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Bowl, 1); + recipe.AddIngredient(null, "SpiderMeat", 1); + recipe.AddIngredient(ItemID.VileMushroom, 2); + recipe.SetResult(this); + recipe.AddTile(96); + recipe.AddRecipe(); + + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Bowl, 1); + recipe.AddIngredient(null, "SpiderMeat", 1); + recipe.AddIngredient(ItemID.ViciousMushroom, 2); + recipe.SetResult(this); + recipe.AddTile(96); + recipe.AddRecipe(); + } + } +} diff --git a/Items/DeathBlaze.cs b/Items/DeathBlaze.cs index 7c025d97..a7a12b44 100644 --- a/Items/DeathBlaze.cs +++ b/Items/DeathBlaze.cs @@ -5,44 +5,46 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DeathBlaze : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class DeathBlaze : ModItem + { + public override void SetDefaults() + { - item.damage = 26; - item.magic = true; - item.width = 28; - item.height = 30; - item.useTime = 12; - item.useAnimation = 12; - item.shoot = 585; - item.shootSpeed = 11f; - item.mana = 4; - item.useStyle = 5; - item.knockBack = 3; - item.value = 99999; - item.rare = 5; - item.UseSound = SoundID.Item20; - item.autoReuse = true; - } + item.damage = 26; + item.magic = true; + item.width = 28; + item.height = 30; + item.useTime = 12; + item.useAnimation = 12; + item.shoot = 585; + item.shootSpeed = 11f; + item.mana = 4; + item.useStyle = 5; + item.knockBack = 3; + item.value = 99999; + item.rare = 5; + item.UseSound = SoundID.Item20; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Death Blaze"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Death Blaze"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.BookofSkulls, 1); - recipe.AddIngredient(ItemID.SpellTome, 1); - recipe.AddIngredient(ItemID.SoulofNight, 15); - recipe.SetResult(this); - recipe.AddTile(101); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.BookofSkulls, 1); + recipe.AddIngredient(ItemID.SpellTome, 1); + recipe.AddIngredient(ItemID.SoulofNight, 15); + recipe.SetResult(this); + recipe.AddTile(101); + recipe.AddRecipe(); + } + } +} diff --git a/Items/DeathFormula.cs b/Items/DeathFormula.cs index fac20f5c..d366feb3 100644 --- a/Items/DeathFormula.cs +++ b/Items/DeathFormula.cs @@ -4,43 +4,45 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DeathFormula : ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 22; - item.height = 44; - - item.value = 30000; - item.rare = 3; - item.maxStack = 1; - item.accessory = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Death Formula"); - Tooltip.SetDefault("Increases alchemic critical strike chance by 20%"); - } - - - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.GetModPlayer(mod).alchemistCrit += 20; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.BottledWater, 1); - recipe.AddIngredient(null, "GelCube", 25); - recipe.AddIngredient(null, "CursedSoul", 1); - recipe.AddIngredient(null, "TearsofDeath", 15); - recipe.SetResult(this); - recipe.AddTile(13); - recipe.AddRecipe(); - } -}} + public class DeathFormula : ModItem + { + + public override void SetDefaults() + { + + item.width = 22; + item.height = 44; + + item.value = 30000; + item.rare = 3; + item.maxStack = 1; + item.accessory = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Death Formula"); + Tooltip.SetDefault("Increases alchemic critical strike chance by 20%"); + } + + + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.GetModPlayer(mod).alchemistCrit += 20; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.BottledWater, 1); + recipe.AddIngredient(null, "GelCube", 25); + recipe.AddIngredient(null, "CursedSoul", 1); + recipe.AddIngredient(null, "TearsofDeath", 15); + recipe.SetResult(this); + recipe.AddTile(13); + recipe.AddRecipe(); + } + } +} diff --git a/Items/DeathHooks.cs b/Items/DeathHooks.cs index 7c7201fe..488eaf28 100644 --- a/Items/DeathHooks.cs +++ b/Items/DeathHooks.cs @@ -4,34 +4,36 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DeathHooks : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class DeathHooks : ModItem + { + public override void SetDefaults() + { - item.damage = 262; - item.width = 14; - item.melee = true; - item.height = 84; - item.noUseGraphic = true; - item.maxStack = 999; - item.useTime = 16; - item.shoot = mod.ProjectileType("DeathHooksPro"); - item.shootSpeed = 20f; - item.useAnimation = 16; - item.useStyle = 1; - item.knockBack = 4; - item.value = 10000; - item.rare = 11; - item.UseSound = SoundID.Item5; - item.autoReuse = true; - } + item.damage = 262; + item.width = 14; + item.melee = true; + item.height = 84; + item.noUseGraphic = true; + item.maxStack = 999; + item.useTime = 16; + item.shoot = mod.ProjectileType("DeathHooksPro"); + item.shootSpeed = 20f; + item.useAnimation = 16; + item.useStyle = 1; + item.knockBack = 4; + item.value = 10000; + item.rare = 11; + item.UseSound = SoundID.Item5; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Death Hooks"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Death Hooks"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/Decayed.cs b/Items/Decayed.cs index d65162ab..f0ef3da3 100644 --- a/Items/Decayed.cs +++ b/Items/Decayed.cs @@ -5,38 +5,40 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Decayed : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Decayed : ModItem + { + public override void SetDefaults() + { - item.damage = 18; - item.ranged = true; - item.width = 60; - item.height = 22; - item.useTime = 15; - item.useAnimation = 15; - item.shoot = 10; - item.shootSpeed = 12f; - item.useAmmo = AmmoID.Bullet; - item.useStyle = 5; - item.knockBack = 4; - item.value = 10000; - item.rare = 2; - item.UseSound = SoundID.Item11; - item.autoReuse = true; - } + item.damage = 18; + item.ranged = true; + item.width = 60; + item.height = 22; + item.useTime = 15; + item.useAnimation = 15; + item.shoot = 10; + item.shootSpeed = 12f; + item.useAmmo = AmmoID.Bullet; + item.useStyle = 5; + item.knockBack = 4; + item.value = 10000; + item.rare = 2; + item.UseSound = SoundID.Item11; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Decayed"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Decayed"); + Tooltip.SetDefault(""); + } - public override Vector2? HoldoutOffset() - { - return new Vector2(-16, 0); - } -}} + public override Vector2? HoldoutOffset() + { + return new Vector2(-16, 0); + } + } +} diff --git a/Items/DeepwaterVilefishBanner.cs b/Items/DeepwaterVilefishBanner.cs index 4bf924e4..fbff4e90 100644 --- a/Items/DeepwaterVilefishBanner.cs +++ b/Items/DeepwaterVilefishBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DeepwaterVilefishBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class DeepwaterVilefishBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 12; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 12; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Deepwater Vilefish Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Deepwater Vilefish Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/DeimosBanner.cs b/Items/DeimosBanner.cs index 31adc3bf..ea27422e 100644 --- a/Items/DeimosBanner.cs +++ b/Items/DeimosBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DeimosBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class DeimosBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 52; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 52; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Deimos Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Deimos Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/DelightfulClump.cs b/Items/DelightfulClump.cs index 8955958a..335eb25b 100644 --- a/Items/DelightfulClump.cs +++ b/Items/DelightfulClump.cs @@ -5,34 +5,36 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DelightfulClump : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class DelightfulClump : ModItem + { + public override void SetDefaults() + { - item.accessory = true; - item.width = 22; - item.height = 18; - item.value = 250000; - item.rare = 11; - } + item.accessory = true; + item.width = 22; + item.height = 18; + item.value = 250000; + item.rare = 11; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Delightful Clump"); - Tooltip.SetDefault("Increases maximum life by 100\n15% increased critical strike chance"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Delightful Clump"); + Tooltip.SetDefault("Increases maximum life by 100\n15% increased critical strike chance"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.statLifeMax2 += 100; - player.rangedCrit += 5; - player.meleeCrit += 5; - player.magicCrit += 5; - player.thrownCrit += 5; - } + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.statLifeMax2 += 100; + player.rangedCrit += 5; + player.meleeCrit += 5; + player.magicCrit += 5; + player.thrownCrit += 5; + } - -}} + + } +} diff --git a/Items/DemonBlood.cs b/Items/DemonBlood.cs index cf7ac84b..6012dcbc 100644 --- a/Items/DemonBlood.cs +++ b/Items/DemonBlood.cs @@ -6,24 +6,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DemonBlood : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class DemonBlood : ModItem + { + public override void SetDefaults() + { - item.width = 26; - item.height = 26; - item.maxStack = 99; - item.value = 100; - item.rare = 4; - } + item.width = 26; + item.height = 26; + item.maxStack = 99; + item.value = 100; + item.rare = 4; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Demon Blood"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Demon Blood"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/DemoniteProtector.cs b/Items/DemoniteProtector.cs index 8e3655aa..9df53958 100644 --- a/Items/DemoniteProtector.cs +++ b/Items/DemoniteProtector.cs @@ -4,40 +4,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DemoniteProtector : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class DemoniteProtector : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 44; + item.width = 22; + item.height = 44; - item.value = 12500; - item.rare = 2; - item.defense = 2; - item.accessory = true; - } + item.value = 12500; + item.rare = 2; + item.defense = 2; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Demonite Protector"); - Tooltip.SetDefault("Increases max health by 50"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Demonite Protector"); + Tooltip.SetDefault("Increases max health by 50"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.statLifeMax2 += 50; - } + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.statLifeMax2 += 50; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.DemoniteBar, 12); - recipe.AddIngredient(ItemID.ShadowScale, 25); - recipe.SetResult(this); - recipe.AddTile(null, "GreatAnvilTile"); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.DemoniteBar, 12); + recipe.AddIngredient(ItemID.ShadowScale, 25); + recipe.SetResult(this); + recipe.AddTile(null, "GreatAnvilTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/DemoniteScythe.cs b/Items/DemoniteScythe.cs index 3c6a0003..d631ac6d 100644 --- a/Items/DemoniteScythe.cs +++ b/Items/DemoniteScythe.cs @@ -4,41 +4,43 @@ using Terraria.ModLoader; using Terraria.ID; -namespace Tremor.Items { -public class DemoniteScythe : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class DemoniteScythe : ModItem + { + public override void SetDefaults() + { - item.damage = 19; - item.melee = true; - item.width = 50; - item.height = 40; - item.useTime = 18; - item.useAnimation = 18; - item.useStyle = 1; - item.knockBack = 7; - item.value = 2700; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 19; + item.melee = true; + item.width = 50; + item.height = 40; + item.useTime = 18; + item.useAnimation = 18; + item.useStyle = 1; + item.knockBack = 7; + item.value = 2700; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Demonite Scythe"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Demonite Scythe"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.DemoniteBar, 8); - recipe.AddIngredient(ItemID.ShadowScale, 8); - recipe.AddIngredient(ItemID.Wood, 25); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.DemoniteBar, 8); + recipe.AddIngredient(ItemID.ShadowScale, 8); + recipe.AddIngredient(ItemID.Wood, 25); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/DesertClaymore.cs b/Items/DesertClaymore.cs index 03176cdf..a94e65ec 100644 --- a/Items/DesertClaymore.cs +++ b/Items/DesertClaymore.cs @@ -5,57 +5,57 @@ namespace Tremor.Items { - public class DesertClaymore : ModItem - { - public override void SetDefaults() - { - - item.width = 30; - item.height = 60; - item.rare = 9; - item.expert = true; - item.damage = 23; - item.magic = true; - item.mana = 20; - - item.useTime = 8; - item.useAnimation = 8; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 1; - item.value = 270000; - item.UseSound = SoundID.Item20; - item.autoReuse = false; - item.noUseGraphic = true; - item.shoot = mod.ProjectileType("DesertClaymorePro"); - item.shootSpeed = 0f; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Desert Claymore"); - Tooltip.SetDefault(""); - } - - - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - Projectile.NewProjectile(position.X, position.Y, 0, 0, type, damage, knockBack, player.whoAmI, player.direction); - return false; - } - - public override bool CanUseItem(Player player) - { - for (int i = 0; i < Main.projectile.Length; i++) - { - if (Main.projectile[i].type == mod.ProjectileType("DesertClaymorePro") && Main.projectile[i].owner == item.owner && Main.projectile[i].active) - { - Main.projectile[i].aiStyle = 3; - return false; - } - } - return true; - } - - } + public class DesertClaymore : ModItem + { + public override void SetDefaults() + { + + item.width = 30; + item.height = 60; + item.rare = 9; + item.expert = true; + item.damage = 23; + item.magic = true; + item.mana = 20; + + item.useTime = 8; + item.useAnimation = 8; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 1; + item.value = 270000; + item.UseSound = SoundID.Item20; + item.autoReuse = false; + item.noUseGraphic = true; + item.shoot = mod.ProjectileType("DesertClaymorePro"); + item.shootSpeed = 0f; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Desert Claymore"); + Tooltip.SetDefault(""); + } + + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + Projectile.NewProjectile(position.X, position.Y, 0, 0, type, damage, knockBack, player.whoAmI, player.direction); + return false; + } + + public override bool CanUseItem(Player player) + { + for (int i = 0; i < Main.projectile.Length; i++) + { + if (Main.projectile[i].type == mod.ProjectileType("DesertClaymorePro") && Main.projectile[i].owner == item.owner && Main.projectile[i].active) + { + Main.projectile[i].aiStyle = 3; + return false; + } + } + return true; + } + + } } diff --git a/Items/DesertCrown.cs b/Items/DesertCrown.cs index afaf0d9b..01f6bb44 100644 --- a/Items/DesertCrown.cs +++ b/Items/DesertCrown.cs @@ -4,36 +4,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class DesertCrown : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.width = 24; - item.height = 16; - item.maxStack = 20; + public class DesertCrown : ModItem + { + public override void SetDefaults() + { - item.rare = 2; - item.useAnimation = 45; - item.useTime = 45; - item.useStyle = 4; -item.value = 50000; - item.consumable = true; - } + item.width = 24; + item.height = 16; + item.maxStack = 20; - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Desert Crown"); - Tooltip.SetDefault("Summons the Rukh"); - } + item.rare = 2; + item.useAnimation = 45; + item.useTime = 45; + item.useStyle = 4; + item.value = 50000; + item.consumable = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Desert Crown"); + Tooltip.SetDefault("Summons the Rukh"); + } - public override bool CanUseItem(Player player) - { - return !NPC.AnyNPCs(mod.NPCType("npcVultureKing")) && player.ZoneDesert; - } + public override bool CanUseItem(Player player) + { + return !NPC.AnyNPCs(mod.NPCType("npcVultureKing")) && player.ZoneDesert; + } public override bool UseItem(Player player) { @@ -42,24 +43,25 @@ public override bool UseItem(Player player) return true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.GoldCrown); - recipe.AddIngredient(ItemID.AntlionMandible, 5); - recipe.AddIngredient(null, "AntlionShell", 3); - recipe.AddIngredient(ItemID.SandBlock, 15); - recipe.AddTile(16); - recipe.SetResult(this); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.GoldCrown); + recipe.AddIngredient(ItemID.AntlionMandible, 5); + recipe.AddIngredient(null, "AntlionShell", 3); + recipe.AddIngredient(ItemID.SandBlock, 15); + recipe.AddTile(16); + recipe.SetResult(this); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.PlatinumCrown); - recipe.AddIngredient(ItemID.AntlionMandible, 5); - recipe.AddIngredient(null, "AntlionShell", 3); - recipe.AddIngredient(ItemID.SandBlock, 15); - recipe.AddTile(16); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.PlatinumCrown); + recipe.AddIngredient(ItemID.AntlionMandible, 5); + recipe.AddIngredient(null, "AntlionShell", 3); + recipe.AddIngredient(ItemID.SandBlock, 15); + recipe.AddTile(16); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/DesertEagle.cs b/Items/DesertEagle.cs index eb5ef676..f0e88356 100644 --- a/Items/DesertEagle.cs +++ b/Items/DesertEagle.cs @@ -5,33 +5,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DesertEagle : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class DesertEagle : ModItem + { + public override void SetDefaults() + { - item.damage = 56; - item.ranged = true; - item.width = 52; - item.height = 34; - item.useTime = 30; - item.useAnimation = 30; - item.shoot = 14; - item.shootSpeed = 15f; - item.useAmmo = AmmoID.Bullet; - item.useStyle = 5; - item.knockBack = 4; - item.value = 150000; - item.rare = 5; - item.UseSound = SoundID.Item11; - item.autoReuse = false; - } + item.damage = 56; + item.ranged = true; + item.width = 52; + item.height = 34; + item.useTime = 30; + item.useAnimation = 30; + item.shoot = 14; + item.shootSpeed = 15f; + item.useAmmo = AmmoID.Bullet; + item.useStyle = 5; + item.knockBack = 4; + item.value = 150000; + item.rare = 5; + item.UseSound = SoundID.Item11; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Desert Eagle"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Desert Eagle"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/DesertExplorerBreastplate.cs b/Items/DesertExplorerBreastplate.cs index 7320dbfd..9742eded 100644 --- a/Items/DesertExplorerBreastplate.cs +++ b/Items/DesertExplorerBreastplate.cs @@ -6,34 +6,34 @@ using Terraria.ModLoader; namespace Tremor.Items -{ -[AutoloadEquip(EquipType.Body)] - public class DesertExplorerBreastplate : ModItem - { +{ + [AutoloadEquip(EquipType.Body)] + public class DesertExplorerBreastplate : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 38; - item.height = 22; + item.width = 38; + item.height = 22; - item.value = 16500; - item.rare = 8; - item.defense = 17; - } + item.value = 16500; + item.rare = 8; + item.defense = 17; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Desert Explorer Breastplate"); - Tooltip.SetDefault("Increases alchemic damage by 19%\nIncreases throwing damage by 35%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Desert Explorer Breastplate"); + Tooltip.SetDefault("Increases alchemic damage by 19%\nIncreases throwing damage by 35%"); + } - public override void UpdateEquip(Player player) - { - player.GetModPlayer(mod).alchemistDamage += 0.5f; - player.thrownDamage += 0.35f; - } - } + public override void UpdateEquip(Player player) + { + player.GetModPlayer(mod).alchemistDamage += 0.5f; + player.thrownDamage += 0.35f; + } + } } diff --git a/Items/DesertExplorerGreaves.cs b/Items/DesertExplorerGreaves.cs index b6c10f67..b06e3438 100644 --- a/Items/DesertExplorerGreaves.cs +++ b/Items/DesertExplorerGreaves.cs @@ -7,40 +7,40 @@ namespace Tremor.Items { -[AutoloadEquip(EquipType.Legs)] - public class DesertExplorerGreaves : ModItem - { + [AutoloadEquip(EquipType.Legs)] + public class DesertExplorerGreaves : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 18; - item.height = 22; + item.width = 18; + item.height = 22; - item.value = 13500; - item.rare = 8; - item.defense = 13; - } + item.value = 13500; + item.rare = 8; + item.defense = 13; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Desert Explorer Greaves"); - Tooltip.SetDefault("Increases alchemic damage by 11%\nIncreases movement speed by 30%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Desert Explorer Greaves"); + Tooltip.SetDefault("Increases alchemic damage by 11%\nIncreases movement speed by 30%"); + } - public override void UpdateEquip(Player player) - { - player.GetModPlayer(mod).alchemistDamage += 0.16f; - player.moveSpeed += 0.3f; - } + public override void UpdateEquip(Player player) + { + player.GetModPlayer(mod).alchemistDamage += 0.16f; + player.moveSpeed += 0.3f; + } - public override void DrawArmorColor(Player drawPlayer, float shadow, ref Color color, ref int glowMask, ref Color glowMaskColor) - { - glowMask = TremorGlowMask.DEG; - glowMaskColor = Color.White; - } - } + public override void DrawArmorColor(Player drawPlayer, float shadow, ref Color color, ref int glowMask, ref Color glowMaskColor) + { + glowMask = TremorGlowMask.DEG; + glowMaskColor = Color.White; + } + } } diff --git a/Items/DesertExplorerVisage.cs b/Items/DesertExplorerVisage.cs index e56958bc..9ea31527 100644 --- a/Items/DesertExplorerVisage.cs +++ b/Items/DesertExplorerVisage.cs @@ -7,53 +7,53 @@ namespace Tremor.Items { -[AutoloadEquip(EquipType.Head)] - public class DesertExplorerVisage : ModItem - { - public override void SetDefaults() - { - - item.width = 30; - item.height = 22; - - item.value = 15000; - item.rare = 8; - item.defense = 11; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Desert Explorer Visage"); - Tooltip.SetDefault("Increases alchemic critical chance by 14"); - } - - - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawShadowSubtle = true; - player.armorEffectDrawOutlines = true; - } - - public override void DrawArmorColor(Player drawPlayer, float shadow, ref Color color, ref int glowMask, ref Color glowMaskColor) - { - glowMask = TremorGlowMask.DEH; - glowMaskColor = Color.White; - } - - public override void UpdateEquip(Player player) - { - player.GetModPlayer(mod).alchemistCrit += 15; - } - - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == mod.ItemType("DesertExplorerBreastplate") && legs.type == mod.ItemType("DesertExplorerGreaves"); - } - - public override void UpdateArmorSet(Player player) - { - player.setBonus = "When a flask explodes a wasp appears to attack enemies"; - player.AddBuff(mod.BuffType("DesertEmperorSetBuff"), 4); - } - } + [AutoloadEquip(EquipType.Head)] + public class DesertExplorerVisage : ModItem + { + public override void SetDefaults() + { + + item.width = 30; + item.height = 22; + + item.value = 15000; + item.rare = 8; + item.defense = 11; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Desert Explorer Visage"); + Tooltip.SetDefault("Increases alchemic critical chance by 14"); + } + + + public override void ArmorSetShadows(Player player) + { + player.armorEffectDrawShadowSubtle = true; + player.armorEffectDrawOutlines = true; + } + + public override void DrawArmorColor(Player drawPlayer, float shadow, ref Color color, ref int glowMask, ref Color glowMaskColor) + { + glowMask = TremorGlowMask.DEH; + glowMaskColor = Color.White; + } + + public override void UpdateEquip(Player player) + { + player.GetModPlayer(mod).alchemistCrit += 15; + } + + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("DesertExplorerBreastplate") && legs.type == mod.ItemType("DesertExplorerGreaves"); + } + + public override void UpdateArmorSet(Player player) + { + player.setBonus = "When a flask explodes a wasp appears to attack enemies"; + player.AddBuff(mod.BuffType("DesertEmperorSetBuff"), 4); + } + } } diff --git a/Items/DesertSigil.cs b/Items/DesertSigil.cs index d0593b4d..1ca7472f 100644 --- a/Items/DesertSigil.cs +++ b/Items/DesertSigil.cs @@ -6,29 +6,31 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DesertSigil : ModItem +namespace Tremor.Items { + public class DesertSigil : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 38; - item.height = 34; + item.width = 38; + item.height = 34; - item.rare = 5; - item.accessory = true; - item.value = 50000; - } + item.rare = 5; + item.accessory = true; + item.value = 50000; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Desert Sigil"); - Tooltip.SetDefault("Summons a sigil to shoot your enemies"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Desert Sigil"); + Tooltip.SetDefault("Summons a sigil to shoot your enemies"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.AddBuff(mod.BuffType("DesertSigilBuff"), 60, true); - } -}} + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.AddBuff(mod.BuffType("DesertSigilBuff"), 60, true); + } + } +} diff --git a/Items/Destructor.cs b/Items/Destructor.cs index 5c3db985..551ee499 100644 --- a/Items/Destructor.cs +++ b/Items/Destructor.cs @@ -5,44 +5,46 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Destructor : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Destructor : ModItem + { + public override void SetDefaults() + { - item.damage = 40; - item.ranged = true; - item.width = 40; - item.height = 40; + item.damage = 40; + item.ranged = true; + item.width = 40; + item.height = 40; - item.useTime = 10; - item.useAnimation = 10; - item.shoot = 14; - item.shootSpeed = 8f; - item.useAmmo = AmmoID.Bullet; - item.useStyle = 5; - item.knockBack = 4; - item.value = 60000; - item.rare = 5; - item.UseSound = SoundID.Item11; - item.autoReuse = true; - } + item.useTime = 10; + item.useAnimation = 10; + item.shoot = 14; + item.shootSpeed = 8f; + item.useAmmo = AmmoID.Bullet; + item.useStyle = 5; + item.knockBack = 4; + item.value = 60000; + item.rare = 5; + item.UseSound = SoundID.Item11; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("The Destructor"); - Tooltip.SetDefault("'Exterminate!'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("The Destructor"); + Tooltip.SetDefault("'Exterminate!'"); + } - public override bool ConsumeAmmo(Player p) + public override bool ConsumeAmmo(Player p) { return Main.rand.Next(2) == 0; } - public override Vector2? HoldoutOffset() - { - return new Vector2(-18, -4); - } -}} + public override Vector2? HoldoutOffset() + { + return new Vector2(-18, -4); + } + } +} diff --git a/Items/Devastator.cs b/Items/Devastator.cs index 90bf981c..2de3e424 100644 --- a/Items/Devastator.cs +++ b/Items/Devastator.cs @@ -5,57 +5,59 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Devastator : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Devastator : ModItem + { + public override void SetDefaults() + { - item.damage = 162; - item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 1; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("DevastatorPro"); - item.shootSpeed = 19f; - item.useStyle = 1; - item.knockBack = 4; - item.value = 70000; - item.rare = 11; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 162; + item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 1; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("DevastatorPro"); + item.shootSpeed = 19f; + item.useStyle = 1; + item.knockBack = 4; + item.value = 70000; + item.rare = 11; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Devastator"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Devastator"); + Tooltip.SetDefault(""); + } -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) -{ - for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. - { - Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 2, speedY - 2, type, damage, knockBack, Main.myPlayer); - } - return false; -} + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. + { + Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 2, speedY - 2, type, damage, knockBack, Main.myPlayer); + } + return false; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "VoidBar", 20); - recipe.AddIngredient(null, "Doomstone", 10); - recipe.AddIngredient(null, "DarkMatter", 100); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "VoidBar", 20); + recipe.AddIngredient(null, "Doomstone", 10); + recipe.AddIngredient(null, "DarkMatter", 100); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } -}} + } +} diff --git a/Items/DevilForge.cs b/Items/DevilForge.cs index 5af31076..ebdd0b19 100644 --- a/Items/DevilForge.cs +++ b/Items/DevilForge.cs @@ -4,39 +4,41 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DevilForge : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class DevilForge : ModItem + { + public override void SetDefaults() + { - item.width = 50; - item.height = 26; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 150; - item.createTile = mod.TileType("DevilForge"); - } + item.width = 50; + item.height = 26; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 150; + item.createTile = mod.TileType("DevilForge"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Devil Forge"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Devil Forge"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "DemonBlood", 5); - recipe.AddIngredient(ItemID.Hellstone, 25); - recipe.AddIngredient(ItemID.Obsidian, 10); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "DemonBlood", 5); + recipe.AddIngredient(ItemID.Hellstone, 25); + recipe.AddIngredient(ItemID.Obsidian, 10); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/DevilishTortoiseBanner.cs b/Items/DevilishTortoiseBanner.cs index 9c632c7b..fd8ec64d 100644 --- a/Items/DevilishTortoiseBanner.cs +++ b/Items/DevilishTortoiseBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DevilishTortoiseBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class DevilishTortoiseBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 43; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 43; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Devilish Tortoise Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Devilish Tortoise Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/DiamondBeam.cs b/Items/DiamondBeam.cs index 35c3ed95..cfa38526 100644 --- a/Items/DiamondBeam.cs +++ b/Items/DiamondBeam.cs @@ -4,46 +4,48 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DiamondBeam : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.channel = true; - item.damage = 288; - item.magic = true; - item.mana = 7; - item.width = 40; - item.height = 40; - item.useTime = 16; - item.useAnimation = 16; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 3; - item.value = 13800; - item.rare = 4; - item.UseSound = SoundID.Item43; - item.autoReuse = false; - Item.staff[item.type] = true; - item.shoot = mod.ProjectileType("DiamondBeamPro"); - item.shootSpeed = 15f; - } + public class DiamondBeam : ModItem + { + public override void SetDefaults() + { + item.channel = true; + item.damage = 288; + item.magic = true; + item.mana = 7; + item.width = 40; + item.height = 40; + item.useTime = 16; + item.useAnimation = 16; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 3; + item.value = 13800; + item.rare = 4; + item.UseSound = SoundID.Item43; + item.autoReuse = false; + Item.staff[item.type] = true; + item.shoot = mod.ProjectileType("DiamondBeamPro"); + item.shootSpeed = 15f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Diamond Beam"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Diamond Beam"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "RuneBar", 12); - recipe.AddIngredient(null, "Gloomstone", 15); - recipe.AddIngredient(ItemID.Diamond, 10); - recipe.AddIngredient(null, "LapisLazuli", 8); - recipe.SetResult(this); - recipe.AddTile(null, "DivineForgeTile"); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "RuneBar", 12); + recipe.AddIngredient(null, "Gloomstone", 15); + recipe.AddIngredient(ItemID.Diamond, 10); + recipe.AddIngredient(null, "LapisLazuli", 8); + recipe.SetResult(this); + recipe.AddTile(null, "DivineForgeTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/DiamondBlade.cs b/Items/DiamondBlade.cs index 0362b63a..a6e5c561 100644 --- a/Items/DiamondBlade.cs +++ b/Items/DiamondBlade.cs @@ -5,46 +5,48 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DiamondBlade : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class DiamondBlade : ModItem + { + public override void SetDefaults() + { - item.damage = 18; - item.melee = true; - item.width = 46; - item.height = 48; - item.useTime = 25; - item.useAnimation = 25; - item.useStyle = 1; - item.knockBack = 3; - item.value = 6400; - item.rare = 2; - item.UseSound = SoundID.Item15; - item.autoReuse = true; - item.useTurn = true; - } + item.damage = 18; + item.melee = true; + item.width = 46; + item.height = 48; + item.useTime = 25; + item.useAnimation = 25; + item.useStyle = 1; + item.knockBack = 3; + item.value = 6400; + item.rare = 2; + item.UseSound = SoundID.Item15; + item.autoReuse = true; + item.useTurn = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Diamond Blade"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Diamond Blade"); + Tooltip.SetDefault(""); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 63); - } + public override void MeleeEffects(Player player, Rectangle hitbox) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 63); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Diamond, 12); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Diamond, 12); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/DiamondDrill.cs b/Items/DiamondDrill.cs index a2e336e0..92c9cb4c 100644 --- a/Items/DiamondDrill.cs +++ b/Items/DiamondDrill.cs @@ -4,47 +4,49 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class DiamondDrill : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.damage = 9; - item.melee = true; - item.width = 20; - item.height = 12; - item.useTime = 8; - item.useAnimation = 25; - item.channel = true; - item.noUseGraphic = true; - item.noMelee = true; - item.pick = 85; - item.useStyle = 5; - item.knockBack = 6; - item.value = Item.buyPrice(0, 0, 50, 0); - item.rare = 2; - item.UseSound = SoundID.Item23; - item.autoReuse = true; - item.shoot = mod.ProjectileType("DiamondDrillPro"); - item.shootSpeed = 40f; - } + public class DiamondDrill : ModItem + { + public override void SetDefaults() + { + + item.damage = 9; + item.melee = true; + item.width = 20; + item.height = 12; + item.useTime = 8; + item.useAnimation = 25; + item.channel = true; + item.noUseGraphic = true; + item.noMelee = true; + item.pick = 85; + item.useStyle = 5; + item.knockBack = 6; + item.value = Item.buyPrice(0, 0, 50, 0); + item.rare = 2; + item.UseSound = SoundID.Item23; + item.autoReuse = true; + item.shoot = mod.ProjectileType("DiamondDrillPro"); + item.shootSpeed = 40f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Diamond Drill"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Diamond Drill"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Obsidian, 25); - recipe.AddIngredient(ItemID.MeteoriteBar, 16); - recipe.AddIngredient(ItemID.Diamond, 12); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Obsidian, 25); + recipe.AddIngredient(ItemID.MeteoriteBar, 16); + recipe.AddIngredient(ItemID.Diamond, 12); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/DimensionalTopHat.cs b/Items/DimensionalTopHat.cs index 737521f4..a6504f90 100644 --- a/Items/DimensionalTopHat.cs +++ b/Items/DimensionalTopHat.cs @@ -5,35 +5,38 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class DimensionalTopHat: ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class DimensionalTopHat : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 18; - item.value = 456600; - item.rare = 11; - item.defense = 12; - } + item.width = 22; + item.height = 18; + item.value = 456600; + item.rare = 11; + item.defense = 12; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dimensional Top Hat"); - Tooltip.SetDefault("Grants clairvoyance\n25% increased magic and minion damage\nGreatly increases mana regeneration"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dimensional Top Hat"); + Tooltip.SetDefault("Grants clairvoyance\n25% increased magic and minion damage\nGreatly increases mana regeneration"); + } - public override void UpdateEquip(Player player) - { - player.minionDamage += 0.25f; - player.magicDamage += 0.25f; - player.AddBuff(29, 60, true); - player.manaRegen += 25; - } + public override void UpdateEquip(Player player) + { + player.minionDamage += 0.25f; + player.magicDamage += 0.25f; + player.AddBuff(29, 60, true); + player.manaRegen += 25; + } - -}} + + } +} diff --git a/Items/DinictisBanner.cs b/Items/DinictisBanner.cs index fd63e89f..11d93cff 100644 --- a/Items/DinictisBanner.cs +++ b/Items/DinictisBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DinictisBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class DinictisBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 27; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 27; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dinictis Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dinictis Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/Dissolver.cs b/Items/Dissolver.cs index 3442732b..040c9fd8 100644 --- a/Items/Dissolver.cs +++ b/Items/Dissolver.cs @@ -5,38 +5,39 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Dissolver : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.CloneDefaults(3279); + public class Dissolver : ModItem + { + public override void SetDefaults() + { + item.CloneDefaults(3279); - item.damage = 58; - item.width = 30; - item.height = 26; - item.shoot = mod.ProjectileType("DissolverPro"); - item.knockBack = 4; - item.value = 10000; - item.rare = 4; - } + item.damage = 58; + item.width = 30; + item.height = 26; + item.shoot = mod.ProjectileType("DissolverPro"); + item.knockBack = 4; + item.value = 10000; + item.rare = 4; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dissolver"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dissolver"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(3290, 1); - recipe.AddIngredient(ItemID.SoulofSight, 5); - recipe.AddIngredient(ItemID.Ichor, 18); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(3290, 1); + recipe.AddIngredient(ItemID.SoulofSight, 5); + recipe.AddIngredient(ItemID.Ichor, 18); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } } diff --git a/Items/DivineClaymore.cs b/Items/DivineClaymore.cs index aa9dd00c..7965fbc4 100644 --- a/Items/DivineClaymore.cs +++ b/Items/DivineClaymore.cs @@ -5,54 +5,56 @@ using Terraria.ID; using Microsoft.Xna.Framework; -namespace Tremor.Items { -public class DivineClaymore : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class DivineClaymore : ModItem + { + public override void SetDefaults() + { - item.damage = 232; - item.melee = true; - item.width = 46; - item.height = 48; - item.useTime = 30; - item.useAnimation = 30; - item.useStyle = 1; - item.knockBack = 3; + item.damage = 232; + item.melee = true; + item.width = 46; + item.height = 48; + item.useTime = 30; + item.useAnimation = 30; + item.useStyle = 1; + item.knockBack = 3; item.shoot = mod.ProjectileType("DivineClaymorePro"); item.shootSpeed = 12f; - item.value = 12400; - item.rare = 0; - item.UseSound = SoundID.Item15; - item.autoReuse = true; - item.useTurn = true; - } + item.value = 12400; + item.rare = 0; + item.UseSound = SoundID.Item15; + item.autoReuse = true; + item.useTurn = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Divine Claymore"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Divine Claymore"); + Tooltip.SetDefault(""); + } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) - { - tooltips[0].overrideColor = new Color(238, 194, 73); - } + public override void ModifyTooltips(System.Collections.Generic.List tooltips) + { + tooltips[0].overrideColor = new Color(238, 194, 73); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "VoidBlade", 1); - recipe.AddIngredient(null, "AngeliteBar", 30); - recipe.AddIngredient(null, "Aquamarine", 8); - recipe.AddIngredient(null, "AngryShard", 3); - recipe.AddIngredient(null, "Doomstone", 3); - recipe.AddIngredient(ItemID.SoulofLight, 25); - recipe.AddIngredient(null, "PurpleQuartz", 5); - recipe.SetResult(this); - recipe.AddTile(null, "DivineForgeTile"); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "VoidBlade", 1); + recipe.AddIngredient(null, "AngeliteBar", 30); + recipe.AddIngredient(null, "Aquamarine", 8); + recipe.AddIngredient(null, "AngryShard", 3); + recipe.AddIngredient(null, "Doomstone", 3); + recipe.AddIngredient(ItemID.SoulofLight, 25); + recipe.AddIngredient(null, "PurpleQuartz", 5); + recipe.SetResult(this); + recipe.AddTile(null, "DivineForgeTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/DivineForge.cs b/Items/DivineForge.cs index d02c7986..207f6981 100644 --- a/Items/DivineForge.cs +++ b/Items/DivineForge.cs @@ -6,88 +6,90 @@ using Microsoft.Xna.Framework; using Terraria.DataStructures; -namespace Tremor.Items { -public class DivineForge : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class DivineForge : ModItem + { + public override void SetDefaults() + { - item.width = 50; - item.height = 26; - item.maxStack = 99; - item.useTurn = true; - item.rare = 11; - item.autoReuse = true; - item.useAnimation = 15; + item.width = 50; + item.height = 26; + item.maxStack = 99; + item.useTurn = true; + item.rare = 11; + item.autoReuse = true; + item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 150; - item.createTile = mod.TileType("DivineForgeTile"); - } + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 150; + item.createTile = mod.TileType("DivineForgeTile"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Divine Forge"); - Tooltip.SetDefault("Combines the function of the anvil, furnace and the ancient manipulator\nAllows you to work with heavenly materials"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Divine Forge"); + Tooltip.SetDefault("Combines the function of the anvil, furnace and the ancient manipulator\nAllows you to work with heavenly materials"); + } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) - { - tooltips[0].overrideColor = new Color(238, 194, 73); - } + public override void ModifyTooltips(System.Collections.Generic.List tooltips) + { + tooltips[0].overrideColor = new Color(238, 194, 73); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "CollapsiumOre", 30); - recipe.AddIngredient(null, "AngeliteOre", 30); - recipe.AddIngredient(null, "OmnikronBar", 5); - recipe.AddIngredient(ItemID.MythrilAnvil, 1); - recipe.AddIngredient(ItemID.AdamantiteForge, 1); - recipe.AddIngredient(null, "TrueEssense", 10); - recipe.AddIngredient(3549, 1); - recipe.AddTile(null, "StarvilTile"); - recipe.SetResult(this); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "CollapsiumOre", 30); + recipe.AddIngredient(null, "AngeliteOre", 30); + recipe.AddIngredient(null, "OmnikronBar", 5); + recipe.AddIngredient(ItemID.MythrilAnvil, 1); + recipe.AddIngredient(ItemID.AdamantiteForge, 1); + recipe.AddIngredient(null, "TrueEssense", 10); + recipe.AddIngredient(3549, 1); + recipe.AddTile(null, "StarvilTile"); + recipe.SetResult(this); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "CollapsiumOre", 30); - recipe.AddIngredient(null, "AngeliteOre", 30); - recipe.AddIngredient(null, "OmnikronBar", 5); - recipe.AddIngredient(ItemID.OrichalcumAnvil, 1); - recipe.AddIngredient(ItemID.AdamantiteForge, 1); - recipe.AddIngredient(null, "TrueEssense", 10); - recipe.AddIngredient(3549, 1); - recipe.AddTile(null, "StarvilTile"); - recipe.SetResult(this); - recipe.AddRecipe(); + recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "CollapsiumOre", 30); + recipe.AddIngredient(null, "AngeliteOre", 30); + recipe.AddIngredient(null, "OmnikronBar", 5); + recipe.AddIngredient(ItemID.OrichalcumAnvil, 1); + recipe.AddIngredient(ItemID.AdamantiteForge, 1); + recipe.AddIngredient(null, "TrueEssense", 10); + recipe.AddIngredient(3549, 1); + recipe.AddTile(null, "StarvilTile"); + recipe.SetResult(this); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "CollapsiumOre", 30); - recipe.AddIngredient(null, "AngeliteOre", 30); - recipe.AddIngredient(null, "OmnikronBar", 5); - recipe.AddIngredient(ItemID.OrichalcumAnvil, 1); - recipe.AddIngredient(ItemID.TitaniumForge, 1); - recipe.AddIngredient(null, "TrueEssense", 10); - recipe.AddIngredient(3549, 1); - recipe.AddTile(null, "StarvilTile"); - recipe.SetResult(this); - recipe.AddRecipe(); + recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "CollapsiumOre", 30); + recipe.AddIngredient(null, "AngeliteOre", 30); + recipe.AddIngredient(null, "OmnikronBar", 5); + recipe.AddIngredient(ItemID.OrichalcumAnvil, 1); + recipe.AddIngredient(ItemID.TitaniumForge, 1); + recipe.AddIngredient(null, "TrueEssense", 10); + recipe.AddIngredient(3549, 1); + recipe.AddTile(null, "StarvilTile"); + recipe.SetResult(this); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "CollapsiumOre", 30); - recipe.AddIngredient(null, "AngeliteOre", 30); - recipe.AddIngredient(null, "OmnikronBar", 5); - recipe.AddIngredient(ItemID.MythrilAnvil, 1); - recipe.AddIngredient(ItemID.TitaniumForge, 1); - recipe.AddIngredient(null, "TrueEssense", 10); - recipe.AddIngredient(3549, 1); - recipe.AddTile(null, "StarvilTile"); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "CollapsiumOre", 30); + recipe.AddIngredient(null, "AngeliteOre", 30); + recipe.AddIngredient(null, "OmnikronBar", 5); + recipe.AddIngredient(ItemID.MythrilAnvil, 1); + recipe.AddIngredient(ItemID.TitaniumForge, 1); + recipe.AddIngredient(null, "TrueEssense", 10); + recipe.AddIngredient(3549, 1); + recipe.AddTile(null, "StarvilTile"); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/DivineGift.cs b/Items/DivineGift.cs index 78d09717..ec4665f3 100644 --- a/Items/DivineGift.cs +++ b/Items/DivineGift.cs @@ -5,48 +5,50 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DivineGift : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class DivineGift : ModItem + { + public override void SetDefaults() + { - item.damage = 310; - item.melee = true; - item.width = 72; - item.height = 84; - item.useTime = 35; - item.useAnimation = 35; - item.useStyle = 1; - item.knockBack = 7; - item.shoot = 524; - item.shootSpeed = 17f; - item.value = 12500; - item.rare = 11; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 310; + item.melee = true; + item.width = 72; + item.height = 84; + item.useTime = 35; + item.useAnimation = 35; + item.useStyle = 1; + item.knockBack = 7; + item.shoot = 524; + item.shootSpeed = 17f; + item.value = 12500; + item.rare = 11; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Divine Gift"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Divine Gift"); + Tooltip.SetDefault(""); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 64); - } + public override void MeleeEffects(Player player, Rectangle hitbox) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 64); + } -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) -{ - for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. - { - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); - } - return false; + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. + { + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); + } + return false; + } + } } -}} diff --git a/Items/DogeMask.cs b/Items/DogeMask.cs index 066062e1..1a793e78 100644 --- a/Items/DogeMask.cs +++ b/Items/DogeMask.cs @@ -5,34 +5,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class DogeMask : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class DogeMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 24; + item.width = 26; + item.height = 24; - item.rare = 1; - } + item.rare = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Doge Mask"); - Tooltip.SetDefault("'Let it wow'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Doge Mask"); + Tooltip.SetDefault("'Let it wow'"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Silk, 8); - recipe.SetResult(this); - recipe.AddTile(86); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Silk, 8); + recipe.SetResult(this); + recipe.AddTile(86); + recipe.AddRecipe(); + } -}} + } +} diff --git a/Items/DoomKey.cs b/Items/DoomKey.cs index 5a09481a..e5c07a9f 100644 --- a/Items/DoomKey.cs +++ b/Items/DoomKey.cs @@ -5,36 +5,36 @@ namespace Tremor.Items { - public class DoomKey : ModItem - { - public override void SetDefaults() - { - - item.width = 30; - item.height = 30; - item.maxStack = 1; - - item.rare = 4; - item.maxStack = 20; - item.useAnimation = 45; - item.useTime = 45; - item.useStyle = 4; - item.UseSound = SoundID.Item44; - item.consumable = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Doom Key"); - Tooltip.SetDefault("Summons the Skeletron"); - } - - - public override bool CanUseItem(Player player) - { - return !Main.dayTime && !NPC.AnyNPCs(35); - } - + public class DoomKey : ModItem + { + public override void SetDefaults() + { + + item.width = 30; + item.height = 30; + item.maxStack = 1; + + item.rare = 4; + item.maxStack = 20; + item.useAnimation = 45; + item.useTime = 45; + item.useStyle = 4; + item.UseSound = SoundID.Item44; + item.consumable = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Doom Key"); + Tooltip.SetDefault("Summons the Skeletron"); + } + + + public override bool CanUseItem(Player player) + { + return !Main.dayTime && !NPC.AnyNPCs(35); + } + public override bool UseItem(Player player) { NPC.SpawnOnPlayer(player.whoAmI, 35); @@ -42,15 +42,15 @@ public override bool UseItem(Player player) return true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "CursedSoul", 1); - recipe.AddIngredient(ItemID.Bone, 25); - recipe.SetResult(this); - recipe.AddTile(26); - recipe.AddRecipe(); - } - - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "CursedSoul", 1); + recipe.AddIngredient(ItemID.Bone, 25); + recipe.SetResult(this); + recipe.AddTile(26); + recipe.AddRecipe(); + } + + } } diff --git a/Items/Doombrick.cs b/Items/Doombrick.cs index 1591a244..c4b325fb 100644 --- a/Items/Doombrick.cs +++ b/Items/Doombrick.cs @@ -15,37 +15,38 @@ public override void SetDefaults() item.height = 12; item.maxStack = 999; item.useTurn = true; - item.value = 2000; + item.value = 2000; item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.rare = 7; + item.rare = 7; item.useStyle = 1; item.consumable = true; item.createTile = mod.TileType("DoombrickTile"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Doombrick"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Doombrick"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "DoombrickWall", 4); - recipe.SetResult(this, 1); - recipe.AddTile(17); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "DoombrickWall", 4); + recipe.SetResult(this, 1); + recipe.AddTile(17); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Doomstone", 1); - recipe.AddIngredient(ItemID.StoneBlock, 50); - recipe.SetResult(this, 50); - recipe.AddTile(17); - recipe.AddRecipe(); - } -}} + recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Doomstone", 1); + recipe.AddIngredient(ItemID.StoneBlock, 50); + recipe.SetResult(this, 50); + recipe.AddTile(17); + recipe.AddRecipe(); + } + } +} diff --git a/Items/DoombrickWall.cs b/Items/DoombrickWall.cs index 5b0c0b4f..84bc7995 100644 --- a/Items/DoombrickWall.cs +++ b/Items/DoombrickWall.cs @@ -4,38 +4,40 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DoombrickWall : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class DoombrickWall : ModItem + { + public override void SetDefaults() + { - item.width = 12; - item.height = 12; - item.maxStack = 999; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 7; - item.useStyle = 1; - item.rare = 7; - item.consumable = true; - item.createWall = mod.WallType("DoombrickWall"); - } + item.width = 12; + item.height = 12; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 7; + item.useStyle = 1; + item.rare = 7; + item.consumable = true; + item.createWall = mod.WallType("DoombrickWall"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Doombrick Wall"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Doombrick Wall"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Doombrick", 1); - recipe.SetResult(this, 4); - recipe.AddTile(17); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Doombrick", 1); + recipe.SetResult(this, 4); + recipe.AddTile(17); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Doomhammer.cs b/Items/Doomhammer.cs index 6de032d6..29fd1259 100644 --- a/Items/Doomhammer.cs +++ b/Items/Doomhammer.cs @@ -5,27 +5,29 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Doomhammer : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.CloneDefaults(367); + public class Doomhammer : ModItem + { + public override void SetDefaults() + { + item.CloneDefaults(367); - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Doomhammer"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Doomhammer"); + Tooltip.SetDefault(""); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if(Main.rand.Next(3) == 0) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 27); - } - } -}} + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.Next(3) == 0) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 27); + } + } + } +} diff --git a/Items/Doomstick.cs b/Items/Doomstick.cs index e68933a8..ee218bd5 100644 --- a/Items/Doomstick.cs +++ b/Items/Doomstick.cs @@ -5,58 +5,60 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Doomstick : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Doomstick : ModItem + { + public override void SetDefaults() + { - item.damage = 65; - item.ranged = true; - item.width = 40; - item.height = 20; - item.useTime = 29; - item.useAnimation = 29; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 6; - item.value = 75000; - item.rare = 7; - item.UseSound = SoundID.Item36; - item.autoReuse = false; - item.shoot = 10; - item.shootSpeed = 8f; - item.useAmmo = AmmoID.Bullet; - } + item.damage = 65; + item.ranged = true; + item.width = 40; + item.height = 20; + item.useTime = 29; + item.useAnimation = 29; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 6; + item.value = 75000; + item.rare = 7; + item.UseSound = SoundID.Item36; + item.autoReuse = false; + item.shoot = 10; + item.shootSpeed = 8f; + item.useAmmo = AmmoID.Bullet; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Doomstick"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Doomstick"); + Tooltip.SetDefault(""); + } -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) -{ - for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. - { - Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 2, speedY - 2, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); - } - return false; -} + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. + { + Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 2, speedY - 2, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); + } + return false; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Boomstick, 1); - recipe.AddIngredient(null, "EarthFragment", 15); - recipe.AddIngredient(null, "DarkMatter", 30); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Boomstick, 1); + recipe.AddIngredient(null, "EarthFragment", 15); + recipe.AddIngredient(null, "DarkMatter", 30); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Doomstone.cs b/Items/Doomstone.cs index b30fb463..dc66d2f4 100644 --- a/Items/Doomstone.cs +++ b/Items/Doomstone.cs @@ -4,23 +4,25 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Doomstone : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Doomstone : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 20000; - item.rare = 10; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 20000; + item.rare = 10; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Doomstone"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Doomstone"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/DopelgangerCandle.cs b/Items/DopelgangerCandle.cs index adbe428f..8654afea 100644 --- a/Items/DopelgangerCandle.cs +++ b/Items/DopelgangerCandle.cs @@ -6,31 +6,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DopelgangerCandle : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class DopelgangerCandle : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 36; - item.value = 1250; - item.rare = 5; - item.accessory = true; - } + item.width = 22; + item.height = 36; + item.value = 1250; + item.rare = 5; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dopelganger Candle"); - Tooltip.SetDefault("'Takes a piece of your soul in return for additional minion'\n6% increased minion damage"); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(10, 4)); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dopelganger Candle"); + Tooltip.SetDefault("'Takes a piece of your soul in return for additional minion'\n6% increased minion damage"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(10, 4)); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.statLifeMax2 -= 25; - player.maxMinions += 1; - player.minionDamage += 0.06f; - } -}} + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.statLifeMax2 -= 25; + player.maxMinions += 1; + player.minionDamage += 0.06f; + } + } +} diff --git a/Items/DragonBreastplate.cs b/Items/DragonBreastplate.cs index 8385ff57..3c113c84 100644 --- a/Items/DragonBreastplate.cs +++ b/Items/DragonBreastplate.cs @@ -5,39 +5,40 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class DragonBreastplate : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + [AutoloadEquip(EquipType.Body)] + public class DragonBreastplate : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 26; + item.width = 30; + item.height = 26; - item.value = 35000; - item.rare = 11; - item.defense = 29; - } + item.value = 35000; + item.rare = 11; + item.defense = 29; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dragon Breastplate"); - Tooltip.SetDefault("50% increased ranged damage\nIncreased ranged critical strike chance by 34"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dragon Breastplate"); + Tooltip.SetDefault("50% increased ranged damage\nIncreased ranged critical strike chance by 34"); + } public override void UpdateEquip(Player player) { player.rangedDamage += 0.5f; - player.rangedCrit += 34; + player.rangedCrit += 34; } -public virtual void ArmorSetShadows(Player player, ref bool longTrail, ref bool smallPulse, ref bool largePulse, ref bool shortTrail) -{ -longTrail = true; -} + public virtual void ArmorSetShadows(Player player, ref bool longTrail, ref bool smallPulse, ref bool largePulse, ref bool shortTrail) + { + longTrail = true; + } public override void AddRecipes() { @@ -47,5 +48,6 @@ public override void AddRecipes() recipe.AddTile(412); recipe.SetResult(this); recipe.AddRecipe(); - } -}} + } + } +} diff --git a/Items/DragonBreath.cs b/Items/DragonBreath.cs index 1c4c4fed..ee22e92a 100644 --- a/Items/DragonBreath.cs +++ b/Items/DragonBreath.cs @@ -5,35 +5,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DragonBreath : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class DragonBreath : ModItem + { + public override void SetDefaults() + { - item.damage = 46; - item.thrown = true; - item.width = 18; - item.height = 18; - item.useTime = 14; - item.useAnimation = 14; - item.maxStack = 999; - item.shoot = mod.ProjectileType("DragonBreathPro"); - item.shootSpeed = 8f; - item.useStyle = 1; - item.knockBack = 3; - item.value = 155; - item.rare = 5; - item.consumable = true; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 46; + item.thrown = true; + item.width = 18; + item.height = 18; + item.useTime = 14; + item.useAnimation = 14; + item.maxStack = 999; + item.shoot = mod.ProjectileType("DragonBreathPro"); + item.shootSpeed = 8f; + item.useStyle = 1; + item.knockBack = 3; + item.value = 155; + item.rare = 5; + item.consumable = true; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dragon Breath"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dragon Breath"); + Tooltip.SetDefault(""); + } - -}} + + } +} diff --git a/Items/DragonCapsule.cs b/Items/DragonCapsule.cs index 5c1e4bac..1d6b80f7 100644 --- a/Items/DragonCapsule.cs +++ b/Items/DragonCapsule.cs @@ -4,24 +4,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DragonCapsule : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class DragonCapsule : ModItem + { + public override void SetDefaults() + { - item.width = 44; - item.height = 44; + item.width = 44; + item.height = 44; - item.value = 1500; - item.maxStack = 999; - item.rare = 11; - } + item.value = 1500; + item.maxStack = 999; + item.rare = 11; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dragon Capsule"); - Tooltip.SetDefault("A capsule of great creature"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dragon Capsule"); + Tooltip.SetDefault("A capsule of great creature"); + } -}} + } +} diff --git a/Items/DragonGem.cs b/Items/DragonGem.cs index 56e50ff1..3b806fc0 100644 --- a/Items/DragonGem.cs +++ b/Items/DragonGem.cs @@ -4,34 +4,36 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DragonGem : ModItem +namespace Tremor.Items { + public class DragonGem : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 24; - item.height = 28; - item.value = 30000; + item.width = 24; + item.height = 28; + item.value = 30000; - item.rare = 1; - item.accessory = true; - } + item.rare = 1; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dragon Gem"); - Tooltip.SetDefault("Increases regeneration during night"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dragon Gem"); + Tooltip.SetDefault("Increases regeneration during night"); + } - public override void UpdateAccessory(Player player, bool hideVisual) + public override void UpdateAccessory(Player player, bool hideVisual) - { - if (!Main.dayTime) - { - player.lifeRegen +=1; - } - } -}} + { + if (!Main.dayTime) + { + player.lifeRegen += 1; + } + } + } +} diff --git a/Items/DragonGreaves.cs b/Items/DragonGreaves.cs index 154abce8..ff8edb94 100644 --- a/Items/DragonGreaves.cs +++ b/Items/DragonGreaves.cs @@ -7,27 +7,29 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class DragonGreaves : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Legs)] + public class DragonGreaves : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.defense = 26; - item.width = 22; - item.height = 18; + item.defense = 26; + item.width = 22; + item.height = 18; - item.value = 33000; - item.rare = 11; - } + item.value = 33000; + item.rare = 11; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dragon Greaves"); - Tooltip.SetDefault("95% increased movement speed"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dragon Greaves"); + Tooltip.SetDefault("95% increased movement speed"); + } public override void UpdateEquip(Player player) @@ -35,10 +37,10 @@ public override void UpdateEquip(Player player) player.moveSpeed += 0.95f; } -public virtual void ArmorSetShadows(Player player, ref bool longTrail, ref bool smallPulse, ref bool largePulse, ref bool shortTrail) -{ -longTrail = true; -} + public virtual void ArmorSetShadows(Player player, ref bool longTrail, ref bool smallPulse, ref bool largePulse, ref bool shortTrail) + { + longTrail = true; + } public override void AddRecipes() { @@ -48,7 +50,7 @@ public override void AddRecipes() recipe.AddTile(412); recipe.SetResult(this); recipe.AddRecipe(); - } + } - } + } } diff --git a/Items/DragonHead.cs b/Items/DragonHead.cs index 172319c0..a0b996d8 100644 --- a/Items/DragonHead.cs +++ b/Items/DragonHead.cs @@ -7,36 +7,36 @@ namespace Tremor.Items { - public class DragonHead : ModItem - { - public override void SetDefaults() - { + public class DragonHead : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 10; - item.rare = 2; - item.noMelee = true; - item.useStyle = 5; - item.useAnimation = 40; - item.useTime = 40; - item.knockBack = 7.5F; - item.damage = 19; - item.scale = 1.1F; - item.noUseGraphic = true; - item.shoot = mod.ProjectileType("DragonHead"); - item.shootSpeed = 13f; - item.UseSound = SoundID.Item1; - item.melee = true; - item.channel = true; - item.value = 30000; + item.width = 30; + item.height = 10; + item.rare = 2; + item.noMelee = true; + item.useStyle = 5; + item.useAnimation = 40; + item.useTime = 40; + item.knockBack = 7.5F; + item.damage = 19; + item.scale = 1.1F; + item.noUseGraphic = true; + item.shoot = mod.ProjectileType("DragonHead"); + item.shootSpeed = 13f; + item.UseSound = SoundID.Item1; + item.melee = true; + item.channel = true; + item.value = 30000; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dragon Head"); - Tooltip.SetDefault("Has 33% chance to spawn fire when hitting an enemy"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dragon Head"); + Tooltip.SetDefault("Has 33% chance to spawn fire when hitting an enemy"); + } - } + } } diff --git a/Items/DragonHelmet.cs b/Items/DragonHelmet.cs index efbe0a4d..ea518a37 100644 --- a/Items/DragonHelmet.cs +++ b/Items/DragonHelmet.cs @@ -5,49 +5,51 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class DragonHelmet : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class DragonHelmet : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 32; - item.height = 22; + item.width = 32; + item.height = 22; - item.value = 38000; - item.rare = 11; - item.defense = 31; - } + item.value = 38000; + item.rare = 11; + item.defense = 31; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dragon Helmet"); - Tooltip.SetDefault("Increases arrow speed and damage"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dragon Helmet"); + Tooltip.SetDefault("Increases arrow speed and damage"); + } public override void UpdateEquip(Player player) { - player.archery = true; + player.archery = true; } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("DragonBreastplate") && legs.type == mod.ItemType("DragonGreaves"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("DragonBreastplate") && legs.type == mod.ItemType("DragonGreaves"); + } - public override void UpdateArmorSet(Player p) - { - p.setBonus = "Allows you to detect enemies and increases ranged critical strike chance by 25"; - p.rangedCrit += 25; - p.detectCreature = true; - } + public override void UpdateArmorSet(Player p) + { + p.setBonus = "Allows you to detect enemies and increases ranged critical strike chance by 25"; + p.rangedCrit += 25; + p.detectCreature = true; + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawOutlines=true; + player.armorEffectDrawOutlines = true; } public override void AddRecipes() @@ -58,5 +60,6 @@ public override void AddRecipes() recipe.AddTile(412); recipe.SetResult(this); recipe.AddRecipe(); - } -}} + } + } +} diff --git a/Items/DragonRafale.cs b/Items/DragonRafale.cs index e007e9bc..3f903241 100644 --- a/Items/DragonRafale.cs +++ b/Items/DragonRafale.cs @@ -5,43 +5,44 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DragonRafale : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.damage = 236; - item.ranged = true; - item.width = 50; - item.maxStack = 1; - item.height = 30; - item.useTime = 10; - item.useAnimation = 15; - //item.shoot = mod.ProjectileType("DragonLaser"); - item.shoot = 20; - - item.useAmmo = AmmoID.Bullet; - item.shootSpeed = 15f; - item.useStyle = 5; - item.knockBack = 4; - item.value = 31000;; - item.rare = 11; - item.UseSound = SoundID.Item11; - item.autoReuse = false; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dragon Rafale"); - Tooltip.SetDefault("Two round burst"); - } - - - public override Vector2? HoldoutOffset() - { - return new Vector2(-10, -4); - } + public class DragonRafale : ModItem + { + public override void SetDefaults() + { + + item.damage = 236; + item.ranged = true; + item.width = 50; + item.maxStack = 1; + item.height = 30; + item.useTime = 10; + item.useAnimation = 15; + //item.shoot = mod.ProjectileType("DragonLaser"); + item.shoot = 20; + + item.useAmmo = AmmoID.Bullet; + item.shootSpeed = 15f; + item.useStyle = 5; + item.knockBack = 4; + item.value = 31000; ; + item.rare = 11; + item.UseSound = SoundID.Item11; + item.autoReuse = false; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dragon Rafale"); + Tooltip.SetDefault("Two round burst"); + } + + + public override Vector2? HoldoutOffset() + { + return new Vector2(-10, -4); + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { @@ -58,5 +59,6 @@ public override void AddRecipes() recipe.AddTile(412); recipe.SetResult(this); recipe.AddRecipe(); - } -}} + } + } +} diff --git a/Items/DragonShield.cs b/Items/DragonShield.cs index ccac775f..c00a72b5 100644 --- a/Items/DragonShield.cs +++ b/Items/DragonShield.cs @@ -5,33 +5,34 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Shield)] -public class DragonShield : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + [AutoloadEquip(EquipType.Shield)] + public class DragonShield : ModItem + { + public override void SetDefaults() + { - item.width = 34; - item.height = 36; - item.value = 32000; - item.rare = 11; - item.accessory = true; - item.defense = 24; - } + item.width = 34; + item.height = 36; + item.value = 32000; + item.rare = 11; + item.accessory = true; + item.defense = 24; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dragon Shield"); - Tooltip.SetDefault("Allows to dash\nDouble tap a direction\n60% increased movement speed"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dragon Shield"); + Tooltip.SetDefault("Allows to dash\nDouble tap a direction\n60% increased movement speed"); + } - public override void UpdateEquip(Player player) - { - player.dash = 1; - player.moveSpeed += 0.6f; - } + public override void UpdateEquip(Player player) + { + player.dash = 1; + player.moveSpeed += 0.6f; + } public override void AddRecipes() { @@ -41,5 +42,6 @@ public override void AddRecipes() recipe.AddTile(412); recipe.SetResult(this); recipe.AddRecipe(); - } -}} + } + } +} diff --git a/Items/DragonSkullBanner.cs b/Items/DragonSkullBanner.cs index 90ae84f7..d97ef22a 100644 --- a/Items/DragonSkullBanner.cs +++ b/Items/DragonSkullBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DragonSkullBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class DragonSkullBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 29; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 29; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dragon Skull Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dragon Skull Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/DragonSpear.cs b/Items/DragonSpear.cs index d638aa5a..45762f36 100644 --- a/Items/DragonSpear.cs +++ b/Items/DragonSpear.cs @@ -4,34 +4,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DragonSpear : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class DragonSpear : ModItem + { + public override void SetDefaults() + { - item.damage = 278; - item.width = 44; - item.height = 44; - item.noUseGraphic = true; - item.melee = true; - item.useTime = 16; - item.shoot = mod.ProjectileType("DragonSpearPro"); - item.shootSpeed = 3f; - item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 4; - item.value = 30000; - item.rare = 11; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 278; + item.width = 44; + item.height = 44; + item.noUseGraphic = true; + item.melee = true; + item.useTime = 16; + item.shoot = mod.ProjectileType("DragonSpearPro"); + item.shootSpeed = 3f; + item.useAnimation = 30; + item.useStyle = 5; + item.knockBack = 4; + item.value = 30000; + item.rare = 11; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dragon Spear"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dragon Spear"); + Tooltip.SetDefault(""); + } public override void AddRecipes() { @@ -41,5 +42,6 @@ public override void AddRecipes() recipe.AddTile(412); recipe.SetResult(this); recipe.AddRecipe(); - } -}} + } + } +} diff --git a/Items/DranixBanner.cs b/Items/DranixBanner.cs index cd4685b9..62b1a04d 100644 --- a/Items/DranixBanner.cs +++ b/Items/DranixBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DranixBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class DranixBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 53; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 53; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dranix Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dranix Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/DreadBeetleBanner.cs b/Items/DreadBeetleBanner.cs index 930f6fcc..434cba7b 100644 --- a/Items/DreadBeetleBanner.cs +++ b/Items/DreadBeetleBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DreadBeetleBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class DreadBeetleBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 54; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 54; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dread Beetle Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dread Beetle Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/DrippingKnife.cs b/Items/DrippingKnife.cs index b37f71fe..ddf1599d 100644 --- a/Items/DrippingKnife.cs +++ b/Items/DrippingKnife.cs @@ -5,45 +5,47 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DrippingKnife : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class DrippingKnife : ModItem + { + public override void SetDefaults() + { - item.damage = 25; - item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("DrippingKnifePro"); - item.shootSpeed = 25f; - item.useStyle = 1; - item.knockBack = 4; - item.value = 7; - item.rare = 3; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 25; + item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("DrippingKnifePro"); + item.shootSpeed = 25f; + item.useStyle = 1; + item.knockBack = 4; + item.value = 7; + item.rare = 3; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dripping Knife"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dripping Knife"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "AtisBlood", 1); - recipe.AddIngredient(null, "DrippingRoot", 1); - recipe.SetResult(this, 75); - recipe.AddTile(14); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "AtisBlood", 1); + recipe.AddIngredient(null, "DrippingRoot", 1); + recipe.SetResult(this, 75); + recipe.AddTile(14); + recipe.AddRecipe(); + } + } +} diff --git a/Items/DrippingRoot.cs b/Items/DrippingRoot.cs index 54c967b5..122281ba 100644 --- a/Items/DrippingRoot.cs +++ b/Items/DrippingRoot.cs @@ -4,23 +4,25 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DrippingRoot : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class DrippingRoot : ModItem + { + public override void SetDefaults() + { - item.width = 26; - item.height = 26; - item.maxStack = 99; - item.value = 250; - item.rare = 4; - } + item.width = 26; + item.height = 26; + item.maxStack = 99; + item.value = 250; + item.rare = 4; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dripping Root"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dripping Root"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/DrippingScythe.cs b/Items/DrippingScythe.cs index dc46ae81..aa42733f 100644 --- a/Items/DrippingScythe.cs +++ b/Items/DrippingScythe.cs @@ -5,33 +5,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DrippingScythe : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.autoReuse = true; + public class DrippingScythe : ModItem + { + public override void SetDefaults() + { + item.autoReuse = true; - item.useStyle = 1; - item.useAnimation = 20; - item.useTime = 20; - item.knockBack = 7f; - item.width = 24; - item.height = 28; - item.damage = 297; - item.UseSound = SoundID.Item71; - item.rare = 11; - item.shootSpeed = 15f; - item.value = 450000; - item.melee = true; - } + item.useStyle = 1; + item.useAnimation = 20; + item.useTime = 20; + item.knockBack = 7f; + item.width = 24; + item.height = 28; + item.damage = 297; + item.UseSound = SoundID.Item71; + item.rare = 11; + item.shootSpeed = 15f; + item.value = 450000; + item.melee = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dripping Sickle"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dripping Sickle"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/DukeFlask.cs b/Items/DukeFlask.cs index 001fb0e1..95f4ef86 100644 --- a/Items/DukeFlask.cs +++ b/Items/DukeFlask.cs @@ -7,57 +7,57 @@ namespace Tremor.Items { - public class DukeFlask : AlchemistItem - { + public class DukeFlask : AlchemistItem + { - public override void SetDefaults() - { - item.crit = 4; - item.damage = 74; - item.width = 30; - item.noUseGraphic = true; - item.height = 30; - item.useTime = 16; - item.useAnimation = 16; - item.shoot = mod.ProjectileType("DukeFlaskPro"); - item.shootSpeed = 9f; - item.useStyle = 1; - item.knockBack = 1; - item.UseSound = SoundID.Item106; - item.value = 20; - item.rare = 8; - item.maxStack = 999; - item.consumable = true; - item.autoReuse = false; + public override void SetDefaults() + { + item.crit = 4; + item.damage = 74; + item.width = 30; + item.noUseGraphic = true; + item.height = 30; + item.useTime = 16; + item.useAnimation = 16; + item.shoot = mod.ProjectileType("DukeFlaskPro"); + item.shootSpeed = 9f; + item.useStyle = 1; + item.knockBack = 1; + item.UseSound = SoundID.Item106; + item.value = 20; + item.rare = 8; + item.maxStack = 999; + item.consumable = true; + item.autoReuse = false; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Duke Flask"); - Tooltip.SetDefault("Throws a flask that explodes into water tornados\nTornados deal damage to enemies"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Duke Flask"); + Tooltip.SetDefault("Throws a flask that explodes into water tornados\nTornados deal damage to enemies"); + } - public override void UpdateInventory(Player player) - { - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) - { - item.shootSpeed = 11f; - } - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) - { - item.shootSpeed = 8f; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) - { - item.autoReuse = true; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) - { - item.autoReuse = false; - } - } - } + public override void UpdateInventory(Player player) + { + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) + { + item.shootSpeed = 11f; + } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) + { + item.shootSpeed = 8f; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) + { + item.autoReuse = true; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) + { + item.autoReuse = false; + } + } + } } diff --git a/Items/DungeonGuardian.cs b/Items/DungeonGuardian.cs index 5957414b..fd9890e7 100644 --- a/Items/DungeonGuardian.cs +++ b/Items/DungeonGuardian.cs @@ -5,60 +5,61 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DungeonGuardian : ModItem +namespace Tremor.Items { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dungeon Guardian"); - Tooltip.SetDefault(""); - } + public class DungeonGuardian : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dungeon Guardian"); + Tooltip.SetDefault(""); + } - public override void SetDefaults() - { - item.CloneDefaults(3279); - item.width = 30; - item.height = 26; - item.shoot = mod.ProjectileType("DungeonGuardianPro"); - item.knockBack = 4; - item.value = 10000; - item.rare = 2; - if (!NPC.downedBoss1) - { - item.damage = 15; - } - if (NPC.downedBoss1) - { - item.damage = 25; - } - if (NPC.downedBoss2) - { - item.damage = 30; - } - if (NPC.downedBoss3) - { - item.damage = 35; - } - if (Main.hardMode) - { - item.damage = 50; - } - if (NPC.downedMechBossAny) - { - item.damage = 75; - } - if (NPC.downedPlantBoss) - { - item.damage = 100; - } - if (NPC.downedGolemBoss) - { - item.damage = 125; - } - if (NPC.downedMoonlord) - { - item.damage = 175; - } - } -} + public override void SetDefaults() + { + item.CloneDefaults(3279); + item.width = 30; + item.height = 26; + item.shoot = mod.ProjectileType("DungeonGuardianPro"); + item.knockBack = 4; + item.value = 10000; + item.rare = 2; + if (!NPC.downedBoss1) + { + item.damage = 15; + } + if (NPC.downedBoss1) + { + item.damage = 25; + } + if (NPC.downedBoss2) + { + item.damage = 30; + } + if (NPC.downedBoss3) + { + item.damage = 35; + } + if (Main.hardMode) + { + item.damage = 50; + } + if (NPC.downedMechBossAny) + { + item.damage = 75; + } + if (NPC.downedPlantBoss) + { + item.damage = 100; + } + if (NPC.downedGolemBoss) + { + item.damage = 125; + } + if (NPC.downedMoonlord) + { + item.damage = 175; + } + } + } } diff --git a/Items/DungeonKeeperBanner.cs b/Items/DungeonKeeperBanner.cs index 5581fc47..f7825558 100644 --- a/Items/DungeonKeeperBanner.cs +++ b/Items/DungeonKeeperBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class DungeonKeeperBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class DungeonKeeperBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 30; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 30; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dungeon Keeper Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dungeon Keeper Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/Durian.cs b/Items/Durian.cs index 1e5978be..33ab7bfc 100644 --- a/Items/Durian.cs +++ b/Items/Durian.cs @@ -5,46 +5,48 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Durian : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Durian : ModItem + { + public override void SetDefaults() + { - item.damage = 18; - item.magic = true; - item.width = 40; - item.mana = 9; - item.height = 20; - item.useTime = 20; - item.useAnimation = 12; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 6; - item.value = 100000; - item.rare = 3; - //item.UseSound = SoundID.Item11; - item.autoReuse = true; - item.shoot = 374; - item.shootSpeed = 12f; - } + item.damage = 18; + item.magic = true; + item.width = 40; + item.mana = 9; + item.height = 20; + item.useTime = 20; + item.useAnimation = 12; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 6; + item.value = 100000; + item.rare = 3; + //item.UseSound = SoundID.Item11; + item.autoReuse = true; + item.shoot = 374; + item.shootSpeed = 12f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Durian"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Durian"); + Tooltip.SetDefault(""); + } -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) -{ - for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. - { - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); - } - return false; -} + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. + { + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); + } + return false; + } -}} + } +} diff --git a/Items/EarthBender.cs b/Items/EarthBender.cs index b3f1403c..a6f53bce 100644 --- a/Items/EarthBender.cs +++ b/Items/EarthBender.cs @@ -4,42 +4,44 @@ using Terraria.ModLoader; using Terraria.ID; -namespace Tremor.Items { -public class EarthBender : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class EarthBender : ModItem + { + public override void SetDefaults() + { - item.damage = 42; - item.melee = true; - item.width = 56; - item.height = 56; - item.useTime = 25; - item.useAnimation = 30; - item.useStyle = 1; - item.knockBack = 3; - item.value = 12000; - item.rare = 4; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 42; + item.melee = true; + item.width = 56; + item.height = 56; + item.useTime = 25; + item.useAnimation = 30; + item.useStyle = 1; + item.knockBack = 3; + item.value = 12000; + item.rare = 4; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Earth Bender"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Earth Bender"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ColossusSword", 1); - recipe.AddIngredient(null, "EarthFragment", 12); - recipe.AddIngredient(ItemID.SoulofLight, 8); - recipe.AddIngredient(ItemID.SoulofNight, 8); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ColossusSword", 1); + recipe.AddIngredient(null, "EarthFragment", 12); + recipe.AddIngredient(ItemID.SoulofLight, 8); + recipe.AddIngredient(ItemID.SoulofNight, 8); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/EarthFragment.cs b/Items/EarthFragment.cs index cf8fba49..00ac4e54 100644 --- a/Items/EarthFragment.cs +++ b/Items/EarthFragment.cs @@ -6,24 +6,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class EarthFragment : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class EarthFragment : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 100; - item.rare = 1; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 100; + item.rare = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Earth Fragment"); - Tooltip.SetDefault(""); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(9, 4)); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Earth Fragment"); + Tooltip.SetDefault(""); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(9, 4)); + } -}} + } +} diff --git a/Items/Earthquake.cs b/Items/Earthquake.cs index d0fd6f06..8afef778 100644 --- a/Items/Earthquake.cs +++ b/Items/Earthquake.cs @@ -5,44 +5,46 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Earthquake : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Earthquake : ModItem + { + public override void SetDefaults() + { - item.damage = 41; - item.magic = true; - item.width = 28; - item.height = 30; - item.useTime = 12; - item.useAnimation = 12; - item.shootSpeed = 15f; - item.mana = 8; - item.useStyle = 5; - item.shoot = mod.ProjectileType("EarthquakePro"); - item.knockBack = 3; - item.value = 10000; - item.rare = 5; - item.UseSound = SoundID.Item20; - item.autoReuse = true; - } + item.damage = 41; + item.magic = true; + item.width = 28; + item.height = 30; + item.useTime = 12; + item.useAnimation = 12; + item.shootSpeed = 15f; + item.mana = 8; + item.useStyle = 5; + item.shoot = mod.ProjectileType("EarthquakePro"); + item.knockBack = 3; + item.value = 10000; + item.rare = 5; + item.UseSound = SoundID.Item20; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Earthquake"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Earthquake"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.SpellTome, 1); - recipe.AddIngredient(ItemID.MudBlock, 25); - recipe.AddIngredient(null, "EarthFragment", 14); - recipe.AddIngredient(null, "SeaFragment", 10); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.SpellTome, 1); + recipe.AddIngredient(ItemID.MudBlock, 25); + recipe.AddIngredient(null, "EarthFragment", 14); + recipe.AddIngredient(null, "SeaFragment", 10); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/EaterofDreams.cs b/Items/EaterofDreams.cs index 0b527de1..b80fff87 100644 --- a/Items/EaterofDreams.cs +++ b/Items/EaterofDreams.cs @@ -12,9 +12,9 @@ namespace Tremor.Items { public class EaterofDreams : ModItem { - - public override void SetDefaults() - { + + public override void SetDefaults() + { item.damage = 99; item.ranged = true; @@ -34,24 +34,24 @@ public override void SetDefaults() item.useAmmo = AmmoID.Gel; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Eater of Dreams"); - Tooltip.SetDefault("Consumes gel as ammo"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Eater of Dreams"); + Tooltip.SetDefault("Consumes gel as ammo"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "NightmareBar", 16); - recipe.AddIngredient(ItemID.Flamethrower, 1); - recipe.AddIngredient(null, "PhantomSoul", 25); - recipe.AddIngredient(null, "PurpleQuartz", 15); - recipe.AddIngredient(null, "TearsofDeath", 8); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "NightmareBar", 16); + recipe.AddIngredient(ItemID.Flamethrower, 1); + recipe.AddIngredient(null, "PhantomSoul", 25); + recipe.AddIngredient(null, "PurpleQuartz", 15); + recipe.AddIngredient(null, "TearsofDeath", 8); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } } } diff --git a/Items/EaterofWorld.cs b/Items/EaterofWorld.cs index 71ac5f85..1edf715b 100644 --- a/Items/EaterofWorld.cs +++ b/Items/EaterofWorld.cs @@ -5,58 +5,60 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class EaterofWorld : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class EaterofWorld : ModItem + { + public override void SetDefaults() + { - item.damage = 139; - item.thrown = true; - item.width = 40; - item.height = 20; - item.noUseGraphic = true; - item.useTime = 30; - item.useAnimation = 20; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 6; - item.melee = true; - item.value = 50000; - item.rare = 9; - item.UseSound = SoundID.Item11; - item.autoReuse = true; - item.shoot = 306; - item.shootSpeed = 9f; - } + item.damage = 139; + item.thrown = true; + item.width = 40; + item.height = 20; + item.noUseGraphic = true; + item.useTime = 30; + item.useAnimation = 20; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 6; + item.melee = true; + item.value = 50000; + item.rare = 9; + item.UseSound = SoundID.Item11; + item.autoReuse = true; + item.shoot = 306; + item.shootSpeed = 9f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Eater of World"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Eater of World"); + Tooltip.SetDefault(""); + } -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) -{ - for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. - { - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); - } - return false; -} + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. + { + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); + } + return false; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "NightmareBar", 15); - recipe.AddIngredient(null, "PurpleQuartz", 6); - recipe.AddIngredient(ItemID.DemoniteBar, 25); - recipe.AddIngredient(null, "Doomstone", 6); - recipe.AddIngredient(null, "Phantaplasm", 10); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "NightmareBar", 15); + recipe.AddIngredient(null, "PurpleQuartz", 6); + recipe.AddIngredient(ItemID.DemoniteBar, 25); + recipe.AddIngredient(null, "Doomstone", 6); + recipe.AddIngredient(null, "Phantaplasm", 10); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/EbonstoneBathtub.cs b/Items/EbonstoneBathtub.cs index 28b7c68f..78b2eed0 100644 --- a/Items/EbonstoneBathtub.cs +++ b/Items/EbonstoneBathtub.cs @@ -19,27 +19,27 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("EbonstoneBathtub"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ebonstone Bathtub"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ebonstone Bathtub"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(61, 14); - recipe.AddIngredient(57, 1); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(61, 14); + recipe.AddIngredient(57, 1); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/EbonstoneBed.cs b/Items/EbonstoneBed.cs index f95291d2..515e35d6 100644 --- a/Items/EbonstoneBed.cs +++ b/Items/EbonstoneBed.cs @@ -19,28 +19,28 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("EbonstoneBed"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ebonstone Bed"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ebonstone Bed"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(61, 15); - recipe.AddIngredient(57, 1); - recipe.AddIngredient(ItemID.Silk, 5); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(61, 15); + recipe.AddIngredient(57, 1); + recipe.AddIngredient(ItemID.Silk, 5); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/EbonstoneBench.cs b/Items/EbonstoneBench.cs index c16d355e..c688c46d 100644 --- a/Items/EbonstoneBench.cs +++ b/Items/EbonstoneBench.cs @@ -19,27 +19,27 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("EbonstoneBench"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ebonstone Bench"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ebonstone Bench"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(61, 8); - recipe.AddIngredient(57, 1); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(61, 8); + recipe.AddIngredient(57, 1); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/EbonstoneBookcase.cs b/Items/EbonstoneBookcase.cs index f1ab437e..c9aa0a21 100644 --- a/Items/EbonstoneBookcase.cs +++ b/Items/EbonstoneBookcase.cs @@ -19,28 +19,28 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("EbonstoneBookcase"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ebonstone Bookcase"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ebonstone Bookcase"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(61, 20); - recipe.AddIngredient(57, 1); - recipe.AddIngredient(ItemID.Book, 10); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(61, 20); + recipe.AddIngredient(57, 1); + recipe.AddIngredient(ItemID.Book, 10); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/EbonstoneChair.cs b/Items/EbonstoneChair.cs index 1b104944..c4b6f950 100644 --- a/Items/EbonstoneChair.cs +++ b/Items/EbonstoneChair.cs @@ -19,27 +19,27 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("EbonstoneChair"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ebonstone Chair"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ebonstone Chair"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(61, 4); - recipe.AddIngredient(57, 1); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(61, 4); + recipe.AddIngredient(57, 1); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/EbonstoneChest.cs b/Items/EbonstoneChest.cs index a7dcf6e2..a1714386 100644 --- a/Items/EbonstoneChest.cs +++ b/Items/EbonstoneChest.cs @@ -19,36 +19,36 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("EbonstoneChest"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ebonstone Chest"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ebonstone Chest"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(61, 8); - recipe.AddIngredient(57, 1); - recipe.AddIngredient(ItemID.IronBar, 2); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(61, 8); + recipe.AddIngredient(57, 1); + recipe.AddIngredient(ItemID.IronBar, 2); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(61, 8); - recipe.AddIngredient(57, 1); - recipe.AddIngredient(ItemID.LeadBar, 2); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + recipe = new ModRecipe(mod); + recipe.AddIngredient(61, 8); + recipe.AddIngredient(57, 1); + recipe.AddIngredient(ItemID.LeadBar, 2); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/EbonstoneDoor.cs b/Items/EbonstoneDoor.cs index 039bd1f9..cb8bfba9 100644 --- a/Items/EbonstoneDoor.cs +++ b/Items/EbonstoneDoor.cs @@ -19,27 +19,27 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 10; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 150; item.createTile = mod.TileType("EbonstoneDoorClosed"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ebonstone Door"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ebonstone Door"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(61, 6); - recipe.AddIngredient(57, 1); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(61, 6); + recipe.AddIngredient(57, 1); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/EbonstoneDresser.cs b/Items/EbonstoneDresser.cs index 897b422b..89f0ddf3 100644 --- a/Items/EbonstoneDresser.cs +++ b/Items/EbonstoneDresser.cs @@ -19,27 +19,27 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("EbonstoneDresser"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ebonstone Dresser"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ebonstone Dresser"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(61, 16); - recipe.AddIngredient(57, 1); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(61, 16); + recipe.AddIngredient(57, 1); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/EbonstoneGrandfatherClock.cs b/Items/EbonstoneGrandfatherClock.cs index c1cea67d..a2f96f20 100644 --- a/Items/EbonstoneGrandfatherClock.cs +++ b/Items/EbonstoneGrandfatherClock.cs @@ -19,39 +19,39 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("EbonstoneGrandfatherClock"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ebonstone Grandfather Clock"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ebonstone Grandfather Clock"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(61, 10); - recipe.AddIngredient(ItemID.IronBar, 3); - recipe.AddIngredient(ItemID.Glass, 6); - recipe.AddIngredient(57, 1); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(61, 10); + recipe.AddIngredient(ItemID.IronBar, 3); + recipe.AddIngredient(ItemID.Glass, 6); + recipe.AddIngredient(57, 1); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(61, 10); - recipe.AddIngredient(ItemID.LeadBar, 3); - recipe.AddIngredient(ItemID.Glass, 6); - recipe.AddIngredient(57, 1); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + recipe = new ModRecipe(mod); + recipe.AddIngredient(61, 10); + recipe.AddIngredient(ItemID.LeadBar, 3); + recipe.AddIngredient(ItemID.Glass, 6); + recipe.AddIngredient(57, 1); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/EbonstonePiano.cs b/Items/EbonstonePiano.cs index 95b7248e..ec8460a5 100644 --- a/Items/EbonstonePiano.cs +++ b/Items/EbonstonePiano.cs @@ -19,28 +19,28 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("EbonstonePiano"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ebonstone Piano"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ebonstone Piano"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(61, 15); - recipe.AddIngredient(154, 15); - recipe.AddIngredient(57, 1); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(61, 15); + recipe.AddIngredient(154, 15); + recipe.AddIngredient(57, 1); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/EbonstonePlatform.cs b/Items/EbonstonePlatform.cs index ed58df2b..2763d6f0 100644 --- a/Items/EbonstonePlatform.cs +++ b/Items/EbonstonePlatform.cs @@ -19,26 +19,26 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("EbonstonePlatform"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ebonstone Platform"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ebonstone Platform"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(61, 1); - recipe.SetResult(this, 2); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(61, 1); + recipe.SetResult(this, 2); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/EbonstoneSink.cs b/Items/EbonstoneSink.cs index 0a280612..84b2f7da 100644 --- a/Items/EbonstoneSink.cs +++ b/Items/EbonstoneSink.cs @@ -19,28 +19,28 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("EbonstoneSink"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ebonstone Sink"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ebonstone Sink"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(61, 6); - recipe.AddIngredient(57, 1); - recipe.AddIngredient(206); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(61, 6); + recipe.AddIngredient(57, 1); + recipe.AddIngredient(206); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/EbonstoneTable.cs b/Items/EbonstoneTable.cs index 67f3669a..e086b6a3 100644 --- a/Items/EbonstoneTable.cs +++ b/Items/EbonstoneTable.cs @@ -19,27 +19,27 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("EbonstoneTable"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ebonstone Table"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ebonstone Table"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(61, 8); - recipe.AddIngredient(57, 1); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(61, 8); + recipe.AddIngredient(57, 1); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/EbonstoneWorkbench.cs b/Items/EbonstoneWorkbench.cs index e27cf9fd..1812a9c9 100644 --- a/Items/EbonstoneWorkbench.cs +++ b/Items/EbonstoneWorkbench.cs @@ -19,27 +19,27 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("EbonstoneWorkbench"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ebonstone Work Bench"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ebonstone Work Bench"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(61, 10); - recipe.AddIngredient(57, 1); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(61, 10); + recipe.AddIngredient(57, 1); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/EbonwoodArmchair.cs b/Items/EbonwoodArmchair.cs index 44e62bb8..bfc64cf7 100644 --- a/Items/EbonwoodArmchair.cs +++ b/Items/EbonwoodArmchair.cs @@ -4,40 +4,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class EbonwoodArmchair : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class EbonwoodArmchair : ModItem + { + public override void SetDefaults() + { - item.width = 42; - item.height = 32; - item.maxStack = 99; - item.value = 100; - item.rare = 1; - item.createTile = mod.TileType("EbonwoodArmchair"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - } + item.width = 42; + item.height = 32; + item.maxStack = 99; + item.value = 100; + item.rare = 1; + item.createTile = mod.TileType("EbonwoodArmchair"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ebonwood Armchair"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ebonwood Armchair"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Ebonwood, 15); - recipe.AddIngredient(ItemID.Silk, 6); - recipe.SetResult(this); - recipe.AddTile(106); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Ebonwood, 15); + recipe.AddIngredient(ItemID.Silk, 6); + recipe.SetResult(this); + recipe.AddTile(106); + recipe.AddRecipe(); + } + } +} diff --git a/Items/EbonwoodShield.cs b/Items/EbonwoodShield.cs index fe2e681d..2854b076 100644 --- a/Items/EbonwoodShield.cs +++ b/Items/EbonwoodShield.cs @@ -5,34 +5,36 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Shield)] -public class EbonwoodShield : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Shield)] + public class EbonwoodShield : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 24; - item.height = 24; - item.value = 110; - item.rare = 0; - item.accessory = true; - item.defense = 1; - } + item.width = 24; + item.height = 24; + item.value = 110; + item.rare = 0; + item.accessory = true; + item.defense = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ebonwood Shield"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ebonwood Shield"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Ebonwood, 15); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Ebonwood, 15); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } + } } -}} diff --git a/Items/EdgeofFrostKing.cs b/Items/EdgeofFrostKing.cs index f8710d04..72035a9f 100644 --- a/Items/EdgeofFrostKing.cs +++ b/Items/EdgeofFrostKing.cs @@ -4,36 +4,38 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { -public class EdgeofFrostKing : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class EdgeofFrostKing : ModItem + { + public override void SetDefaults() + { - item.damage = 94; - item.melee = true; - item.width = 40; - item.height = 40; - item.useTime = 25; - item.useAnimation = 20; - item.useStyle = 1; - item.knockBack = 6; - item.value = 10000; - item.rare = 9; - item.expert = true; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 94; + item.melee = true; + item.width = 40; + item.height = 40; + item.useTime = 25; + item.useAnimation = 20; + item.useStyle = 1; + item.knockBack = 6; + item.value = 10000; + item.rare = 9; + item.expert = true; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Edge of Frost King"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Edge of Frost King"); + Tooltip.SetDefault(""); + } - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(44, 60); - } -}} + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(44, 60); + } + } +} diff --git a/Items/Eggplant.cs b/Items/Eggplant.cs index f35c5982..d973b415 100644 --- a/Items/Eggplant.cs +++ b/Items/Eggplant.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Eggplant : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Eggplant : ModItem + { + public override void SetDefaults() + { - item.damage = 30; - item.melee = true; - item.width = 48; - item.height = 48; - item.useTime = 50; - item.useAnimation = 50; - item.useStyle = 1; - item.knockBack = 2; - item.value = 9500; - item.rare = 3; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 30; + item.melee = true; + item.width = 48; + item.height = 48; + item.useTime = 50; + item.useAnimation = 50; + item.useStyle = 1; + item.knockBack = 2; + item.value = 9500; + item.rare = 3; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Eggplant"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Eggplant"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/ElderObserverBanner.cs b/Items/ElderObserverBanner.cs index 960c2a8d..e4952e33 100644 --- a/Items/ElderObserverBanner.cs +++ b/Items/ElderObserverBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ElderObserverBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ElderObserverBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 55; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 55; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Elder Observer Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Elder Observer Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/ElectricSpear.cs b/Items/ElectricSpear.cs index 5432c5d6..1d0fc25a 100644 --- a/Items/ElectricSpear.cs +++ b/Items/ElectricSpear.cs @@ -4,35 +4,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ElectricSpear : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ElectricSpear : ModItem + { + public override void SetDefaults() + { - item.damage = 25; - item.width = 70; - item.height = 70; - item.noUseGraphic = true; - item.melee = true; - item.useTime = 25; - item.shoot = mod.ProjectileType("ElectricSpearPro"); - item.shootSpeed = 5f; - item.useAnimation = 30; + item.damage = 25; + item.width = 70; + item.height = 70; + item.noUseGraphic = true; + item.melee = true; + item.useTime = 25; + item.shoot = mod.ProjectileType("ElectricSpearPro"); + item.shootSpeed = 5f; + item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 4; - item.value = 12500; - item.rare = 3; - item.UseSound = SoundID.Item93; - item.autoReuse = false; - } + item.useStyle = 5; + item.knockBack = 4; + item.value = 12500; + item.rare = 3; + item.UseSound = SoundID.Item93; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Electric Spear"); - Tooltip.SetDefault("'Traitor!'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Electric Spear"); + Tooltip.SetDefault("'Traitor!'"); + } -}} + } +} diff --git a/Items/EmeraldBlade.cs b/Items/EmeraldBlade.cs index 7de16a25..ed2ffaa5 100644 --- a/Items/EmeraldBlade.cs +++ b/Items/EmeraldBlade.cs @@ -5,46 +5,48 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class EmeraldBlade : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class EmeraldBlade : ModItem + { + public override void SetDefaults() + { - item.damage = 16; - item.melee = true; - item.width = 46; - item.height = 48; - item.useTime = 25; - item.useAnimation = 25; - item.useStyle = 1; - item.knockBack = 3; - item.value = 6400; - item.rare = 2; - item.UseSound = SoundID.Item15; - item.autoReuse = true; - item.useTurn = true; - } + item.damage = 16; + item.melee = true; + item.width = 46; + item.height = 48; + item.useTime = 25; + item.useAnimation = 25; + item.useStyle = 1; + item.knockBack = 3; + item.value = 6400; + item.rare = 2; + item.UseSound = SoundID.Item15; + item.autoReuse = true; + item.useTurn = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Emerald Blade"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Emerald Blade"); + Tooltip.SetDefault(""); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 61); - } + public override void MeleeEffects(Player player, Rectangle hitbox) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 61); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Emerald, 12); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Emerald, 12); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/EmeraldDrill.cs b/Items/EmeraldDrill.cs index ef255a30..2f76a005 100644 --- a/Items/EmeraldDrill.cs +++ b/Items/EmeraldDrill.cs @@ -4,47 +4,49 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class EmeraldDrill : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.damage = 9; - item.melee = true; - item.width = 20; - item.height = 12; - item.useTime = 8; - item.useAnimation = 25; - item.channel = true; - item.noUseGraphic = true; - item.noMelee = true; - item.pick = 85; - item.useStyle = 5; - item.knockBack = 6; - item.value = Item.buyPrice(0, 0, 50, 0); - item.rare = 2; - item.UseSound = SoundID.Item23; - item.autoReuse = true; - item.shoot = mod.ProjectileType("EmeraldDrillPro"); - item.shootSpeed = 40f; - } + public class EmeraldDrill : ModItem + { + public override void SetDefaults() + { + + item.damage = 9; + item.melee = true; + item.width = 20; + item.height = 12; + item.useTime = 8; + item.useAnimation = 25; + item.channel = true; + item.noUseGraphic = true; + item.noMelee = true; + item.pick = 85; + item.useStyle = 5; + item.knockBack = 6; + item.value = Item.buyPrice(0, 0, 50, 0); + item.rare = 2; + item.UseSound = SoundID.Item23; + item.autoReuse = true; + item.shoot = mod.ProjectileType("EmeraldDrillPro"); + item.shootSpeed = 40f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Emerald Drill"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Emerald Drill"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Obsidian, 25); - recipe.AddIngredient(ItemID.MeteoriteBar, 16); - recipe.AddIngredient(ItemID.Emerald, 12); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Obsidian, 25); + recipe.AddIngredient(ItemID.MeteoriteBar, 16); + recipe.AddIngredient(ItemID.Emerald, 12); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/EmperorCrown.cs b/Items/EmperorCrown.cs index 7ff6737f..4adcd307 100644 --- a/Items/EmperorCrown.cs +++ b/Items/EmperorCrown.cs @@ -8,46 +8,46 @@ namespace Tremor.Items { - public class EmperorCrown: ModItem - { - - public override void SetDefaults() - { - - item.width = 26; - item.height = 28; - item.maxStack = 20; - item.value = 100; - item.rare = 11; - item.useAnimation = 15; - item.useTime = 15; - item.useStyle = 4; - item.consumable = true; - - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Emperor Crown"); - Tooltip.SetDefault("Summons the Dark Emperor"); - } - - - public override bool CanUseItem(Player player) - { - return NPC.downedMoonlord && !NPC.AnyNPCs(mod.NPCType("TheDarkEmperor")); - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.SlimeCrown, 1); - recipe.AddIngredient(null, "Doomstone", 9); - recipe.AddIngredient(null, "DarkMass", 3); - recipe.SetResult(this); - recipe.AddTile(26); - recipe.AddRecipe(); - } + public class EmperorCrown : ModItem + { + + public override void SetDefaults() + { + + item.width = 26; + item.height = 28; + item.maxStack = 20; + item.value = 100; + item.rare = 11; + item.useAnimation = 15; + item.useTime = 15; + item.useStyle = 4; + item.consumable = true; + + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Emperor Crown"); + Tooltip.SetDefault("Summons the Dark Emperor"); + } + + + public override bool CanUseItem(Player player) + { + return NPC.downedMoonlord && !NPC.AnyNPCs(mod.NPCType("TheDarkEmperor")); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.SlimeCrown, 1); + recipe.AddIngredient(null, "Doomstone", 9); + recipe.AddIngredient(null, "DarkMass", 3); + recipe.SetResult(this); + recipe.AddTile(26); + recipe.AddRecipe(); + } public override bool UseItem(Player player) { @@ -55,5 +55,5 @@ public override bool UseItem(Player player) Main.PlaySound(SoundID.Roar, player.position, 0); return true; } - } + } } diff --git a/Items/EnchantedBreastplate.cs b/Items/EnchantedBreastplate.cs index 342272bd..bda24625 100644 --- a/Items/EnchantedBreastplate.cs +++ b/Items/EnchantedBreastplate.cs @@ -6,8 +6,8 @@ using Terraria.ModLoader; namespace Tremor.Items -{ -[AutoloadEquip(EquipType.Body)] +{ + [AutoloadEquip(EquipType.Body)] public class EnchantedBreastplate : ModItem { public override void SetDefaults() @@ -22,17 +22,17 @@ public override void SetDefaults() item.defense = 7; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Enchanted Breastplate"); - Tooltip.SetDefault("Increases maximum mana by 20\nIncreases maximum health by 20"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Enchanted Breastplate"); + Tooltip.SetDefault("Increases maximum mana by 20\nIncreases maximum health by 20"); + } public override void UpdateEquip(Player player) { - player.statManaMax2 += 20; - player.statLifeMax2 += 20; + player.statManaMax2 += 20; + player.statLifeMax2 += 20; } } } diff --git a/Items/EnchantedGreaves.cs b/Items/EnchantedGreaves.cs index 0b896fd7..72aa6948 100644 --- a/Items/EnchantedGreaves.cs +++ b/Items/EnchantedGreaves.cs @@ -5,34 +5,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class EnchantedGreaves : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Legs)] + public class EnchantedGreaves : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 18; + item.width = 22; + item.height = 18; - item.value = 10000; - item.rare = 2; - item.defense = 5; - } + item.value = 10000; + item.rare = 2; + item.defense = 5; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Enchanted Greaves"); - Tooltip.SetDefault("Increases maximum mana by 20\nIncreases maximum health by 15"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Enchanted Greaves"); + Tooltip.SetDefault("Increases maximum mana by 20\nIncreases maximum health by 15"); + } - public override void UpdateEquip(Player player) - { - player.statManaMax2 += 20; - player.statLifeMax2 += 15; - } + public override void UpdateEquip(Player player) + { + player.statManaMax2 += 20; + player.statLifeMax2 += 15; + } -}} + } +} diff --git a/Items/EnchantedHealthBooster.cs b/Items/EnchantedHealthBooster.cs index fbc7cca3..2a18dd1a 100644 --- a/Items/EnchantedHealthBooster.cs +++ b/Items/EnchantedHealthBooster.cs @@ -5,28 +5,29 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class EnchantedHealthBooster : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class EnchantedHealthBooster : ModItem + { + public override void SetDefaults() + { - item.useAnimation = 15; - item.useTime = 15; - item.useStyle = 4; - item.width = 22; - item.UseSound = SoundID.Item43; - item.height = 18; - item.buffType = mod.BuffType("ExtendedHealthBooster"); - item.value = 5160000; - item.rare = 11; - } + item.useAnimation = 15; + item.useTime = 15; + item.useStyle = 4; + item.width = 22; + item.UseSound = SoundID.Item43; + item.height = 18; + item.buffType = mod.BuffType("ExtendedHealthBooster"); + item.value = 5160000; + item.rare = 11; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Enchanted Health Booster"); - Tooltip.SetDefault("Regenerates heatlh every 45 seconds"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Enchanted Health Booster"); + Tooltip.SetDefault("Regenerates heatlh every 45 seconds"); + } public override void UseStyle(Player player) @@ -36,16 +37,17 @@ public override void UseStyle(Player player) player.AddBuff(item.buffType, 2700, true); } } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "HealthBooster", 1); - recipe.AddIngredient(null, "GoldenClaw", 15); - recipe.AddIngredient(null, "StarBar", 1); - recipe.AddIngredient(null, "AngryShard", 1); - recipe.SetResult(this); - recipe.AddTile(null, "MagicWorkbenchTile"); - recipe.AddRecipe(); - } -}} + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "HealthBooster", 1); + recipe.AddIngredient(null, "GoldenClaw", 15); + recipe.AddIngredient(null, "StarBar", 1); + recipe.AddIngredient(null, "AngryShard", 1); + recipe.SetResult(this); + recipe.AddTile(null, "MagicWorkbenchTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/EnchantedHelmet.cs b/Items/EnchantedHelmet.cs index fe4afea9..5cdb7617 100644 --- a/Items/EnchantedHelmet.cs +++ b/Items/EnchantedHelmet.cs @@ -5,47 +5,50 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class EnchantedHelmet : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class EnchantedHelmet : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 24; - item.height = 24; + item.width = 24; + item.height = 24; - item.value = 10000; - item.rare = 2; - item.defense = 5; - } + item.value = 10000; + item.rare = 2; + item.defense = 5; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Enchanted Helmet"); - Tooltip.SetDefault("Increases maximum mana by 20\nIncreases maximum health by 15"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Enchanted Helmet"); + Tooltip.SetDefault("Increases maximum mana by 20\nIncreases maximum health by 15"); + } - public override void UpdateEquip(Player player) - { - player.statManaMax2 += 20; - player.statLifeMax2 += 15; - } + public override void UpdateEquip(Player player) + { + player.statManaMax2 += 20; + player.statLifeMax2 += 15; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == mod.ItemType("EnchantedBreastplate") && legs.type == mod.ItemType("EnchantedGreaves"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("EnchantedBreastplate") && legs.type == mod.ItemType("EnchantedGreaves"); + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "8% increased magic damage, increases power of enchanted weapons"; - player.magicDamage += 0.08f; - player.AddBuff(mod.BuffType("EnchantedBuff"), 2); - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "8% increased magic damage, increases power of enchanted weapons"; + player.magicDamage += 0.08f; + player.AddBuff(mod.BuffType("EnchantedBuff"), 2); + } -}} + } +} diff --git a/Items/EnchantedHourglass.cs b/Items/EnchantedHourglass.cs index d1f98d95..6f331c79 100644 --- a/Items/EnchantedHourglass.cs +++ b/Items/EnchantedHourglass.cs @@ -5,48 +5,49 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class EnchantedHourglass : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class EnchantedHourglass : ModItem + { + public override void SetDefaults() + { - item.melee = false; - item.magic = true; - item.width = 50; - item.height = 55; - item.useTime = 30; - item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 3; - item.value = 30000; - item.rare = 9; - item.expert = true; - item.UseSound = SoundID.Item4; - item.autoReuse = false; - } + item.melee = false; + item.magic = true; + item.width = 50; + item.height = 55; + item.useTime = 30; + item.useAnimation = 30; + item.useStyle = 5; + item.knockBack = 3; + item.value = 30000; + item.rare = 9; + item.expert = true; + item.UseSound = SoundID.Item4; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Enchanted Hourglass"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Enchanted Hourglass"); + Tooltip.SetDefault(""); + } - public override bool UseItem(Player player) - { - if (Main.player[Main.myPlayer].active && Main.player[Main.myPlayer].FindBuffIndex(mod.BuffType("HealthRecharging")) != -1) - { - item.mana = 0; - item.healLife = 0; - } - else - { - player.AddBuff(mod.BuffType("HealthRecharging"), 1200, true); - //item.mana = 50; - item.healLife = 30; - } - return false; - } -} + public override bool UseItem(Player player) + { + if (Main.player[Main.myPlayer].active && Main.player[Main.myPlayer].FindBuffIndex(mod.BuffType("HealthRecharging")) != -1) + { + item.mana = 0; + item.healLife = 0; + } + else + { + player.AddBuff(mod.BuffType("HealthRecharging"), 1200, true); + //item.mana = 50; + item.healLife = 30; + } + return false; + } + } } diff --git a/Items/EnchantedManaBooster.cs b/Items/EnchantedManaBooster.cs index 8b06e0b5..d983df11 100644 --- a/Items/EnchantedManaBooster.cs +++ b/Items/EnchantedManaBooster.cs @@ -5,28 +5,29 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class EnchantedManaBooster : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class EnchantedManaBooster : ModItem + { + public override void SetDefaults() + { - item.useAnimation = 15; - item.useTime = 15; - item.useStyle = 4; - item.width = 22; - item.UseSound = SoundID.Item43; - item.height = 18; - item.buffType = mod.BuffType("ExtendedManaBooster"); - item.value = 5160000; - item.rare = 11; - } + item.useAnimation = 15; + item.useTime = 15; + item.useStyle = 4; + item.width = 22; + item.UseSound = SoundID.Item43; + item.height = 18; + item.buffType = mod.BuffType("ExtendedManaBooster"); + item.value = 5160000; + item.rare = 11; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Enchanted Mana Booster"); - Tooltip.SetDefault("Regenerates mana every 45 seconds"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Enchanted Mana Booster"); + Tooltip.SetDefault("Regenerates mana every 45 seconds"); + } public override void UseStyle(Player player) @@ -36,16 +37,17 @@ public override void UseStyle(Player player) player.AddBuff(item.buffType, 2700, true); } } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ManaBooster", 1); - recipe.AddIngredient(null, "GoldenClaw", 15); - recipe.AddIngredient(null, "StarBar", 1); - recipe.AddIngredient(null, "AngryShard", 1); - recipe.SetResult(this); - recipe.AddTile(null, "MagicWorkbenchTile"); - recipe.AddRecipe(); - } -}} + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ManaBooster", 1); + recipe.AddIngredient(null, "GoldenClaw", 15); + recipe.AddIngredient(null, "StarBar", 1); + recipe.AddIngredient(null, "AngryShard", 1); + recipe.SetResult(this); + recipe.AddTile(null, "MagicWorkbenchTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/EnchantedShield.cs b/Items/EnchantedShield.cs index 15c7bf7c..46d92d64 100644 --- a/Items/EnchantedShield.cs +++ b/Items/EnchantedShield.cs @@ -5,33 +5,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Shield)] -public class EnchantedShield : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + [AutoloadEquip(EquipType.Shield)] + public class EnchantedShield : ModItem + { + public override void SetDefaults() + { - item.width = 24; - item.height = 30; - item.value = 15000; + item.width = 24; + item.height = 30; + item.value = 15000; - item.rare = 2; - item.accessory = true; - item.defense = 2; - } + item.rare = 2; + item.accessory = true; + item.defense = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Enchanted Shield"); - Tooltip.SetDefault("Increases maximum mana by 40\n10% decreased magic damage"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Enchanted Shield"); + Tooltip.SetDefault("Increases maximum mana by 40\n10% decreased magic damage"); + } - public override void UpdateEquip(Player player) - { - player.statManaMax2 += 40; - player.magicDamage -= 0.1f; - } -}} + public override void UpdateEquip(Player player) + { + player.statManaMax2 += 40; + player.magicDamage -= 0.1f; + } + } +} diff --git a/Items/EnchantmentSolution.cs b/Items/EnchantmentSolution.cs index 9546f1bb..b9f48a9d 100644 --- a/Items/EnchantmentSolution.cs +++ b/Items/EnchantmentSolution.cs @@ -6,58 +6,58 @@ namespace Tremor.Items { - public class EnchantmentSolution : ModItem - { - public override bool CanEquipAccessory(Player player, int slot) - { - for (int i = 0; i < player.armor.Length; i++) - { - MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - if (modPlayer.enchanted == true) - { - return false; - } - } - return true; - } - - public override void SetDefaults() - { - - item.width = 26; - item.height = 30; - - item.value = 250000; - item.rare = 5; - item.accessory = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Enchantment Solution"); - Tooltip.SetDefault("25% chance not to consume flask"); - } - - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Bottle, 5); - recipe.AddIngredient(ItemID.SoulofLight, 12); - recipe.AddIngredient(ItemID.BottledWater, 1); - recipe.AddIngredient(ItemID.ManaCrystal, 1); - recipe.AddIngredient(ItemID.LifeCrystal, 1); - recipe.AddIngredient(null, "BasicFlask", 15); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - player.AddBuff(mod.BuffType("EnchantmentSolution"), 2); - modPlayer.enchanted = true; - } - } + public class EnchantmentSolution : ModItem + { + public override bool CanEquipAccessory(Player player, int slot) + { + for (int i = 0; i < player.armor.Length; i++) + { + MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); + if (modPlayer.enchanted == true) + { + return false; + } + } + return true; + } + + public override void SetDefaults() + { + + item.width = 26; + item.height = 30; + + item.value = 250000; + item.rare = 5; + item.accessory = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Enchantment Solution"); + Tooltip.SetDefault("25% chance not to consume flask"); + } + + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Bottle, 5); + recipe.AddIngredient(ItemID.SoulofLight, 12); + recipe.AddIngredient(ItemID.BottledWater, 1); + recipe.AddIngredient(ItemID.ManaCrystal, 1); + recipe.AddIngredient(ItemID.LifeCrystal, 1); + recipe.AddIngredient(null, "BasicFlask", 15); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); + player.AddBuff(mod.BuffType("EnchantmentSolution"), 2); + modPlayer.enchanted = true; + } + } } diff --git a/Items/EndlessPileofsnowballs.cs b/Items/EndlessPileofsnowballs.cs index e2d55e01..7747ac27 100644 --- a/Items/EndlessPileofsnowballs.cs +++ b/Items/EndlessPileofsnowballs.cs @@ -4,45 +4,47 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class EndlessPileofsnowballs : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.useStyle = 1; + public class EndlessPileofsnowballs : ModItem + { + public override void SetDefaults() + { + item.useStyle = 1; - item.shootSpeed = 7f; - item.shoot = 166; - item.damage = 8; - item.width = 18; - item.height = 20; - item.maxStack = 1; - item.ammo = 949; - item.rare = 2; - item.consumable = false; - item.UseSound = SoundID.Item1; - item.useAnimation = 19; - item.useTime = 19; - item.noUseGraphic = true; - item.noMelee = true; - item.thrown = true; - item.knockBack = 5.75f; - } + item.shootSpeed = 7f; + item.shoot = 166; + item.damage = 8; + item.width = 18; + item.height = 20; + item.maxStack = 1; + item.ammo = 949; + item.rare = 2; + item.consumable = false; + item.UseSound = SoundID.Item1; + item.useAnimation = 19; + item.useTime = 19; + item.noUseGraphic = true; + item.noMelee = true; + item.thrown = true; + item.knockBack = 5.75f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Endless Pile of snowballs"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Endless Pile of snowballs"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Snowball, 3996); - recipe.SetResult(this); - recipe.AddTile(125); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Snowball, 3996); + recipe.SetResult(this); + recipe.AddTile(125); + recipe.AddRecipe(); + } -}} + } +} diff --git a/Items/EnforcerShield.cs b/Items/EnforcerShield.cs index ad8b4986..7f4cab5a 100644 --- a/Items/EnforcerShield.cs +++ b/Items/EnforcerShield.cs @@ -4,53 +4,55 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Shield)] -public class EnforcerShield : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Shield)] + public class EnforcerShield : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 36; - item.height = 42; - item.value = 3000000; - item.defense = 50; - item.rare = 11; - item.accessory = true; - } + item.width = 36; + item.height = 42; + item.value = 3000000; + item.defense = 50; + item.rare = 11; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Enforcer's Shield"); - Tooltip.SetDefault("Increases melee damage and speed as health lowers\nIncreased invincibility after taking damage"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Enforcer's Shield"); + Tooltip.SetDefault("Increases melee damage and speed as health lowers\nIncreased invincibility after taking damage"); + } - public override void UpdateAccessory(Player player, bool hideVisual) + public override void UpdateAccessory(Player player, bool hideVisual) - { - player.longInvince = true; - if(player.statLife <= (player.statLifeMax2 * 0.8f)) - { - player.meleeSpeed *= 1.2f; - player.meleeDamage *= 1.05f; - } - else if(player.statLife <= (player.statLifeMax2 * 0.6f)) - { - player.meleeSpeed *= 1.4f; - player.meleeDamage *= 1.1f; - } - else if(player.statLife <= (player.statLifeMax2 * 0.4f)) - { - player.meleeSpeed *= 1.6f; - player.meleeDamage *= 1.15f; - } - else if(player.statLife <= (player.statLifeMax2 * 0.2f)) { - player.meleeSpeed *= 1.8f; - player.meleeDamage *= 1.2f; + player.longInvince = true; + if (player.statLife <= (player.statLifeMax2 * 0.8f)) + { + player.meleeSpeed *= 1.2f; + player.meleeDamage *= 1.05f; + } + else if (player.statLife <= (player.statLifeMax2 * 0.6f)) + { + player.meleeSpeed *= 1.4f; + player.meleeDamage *= 1.1f; + } + else if (player.statLife <= (player.statLifeMax2 * 0.4f)) + { + player.meleeSpeed *= 1.6f; + player.meleeDamage *= 1.15f; + } + else if (player.statLife <= (player.statLifeMax2 * 0.2f)) + { + player.meleeSpeed *= 1.8f; + player.meleeDamage *= 1.2f; + } } - } -}} + } +} diff --git a/Items/EnragedBatBanner.cs b/Items/EnragedBatBanner.cs index 7c8e8324..5b9ebddc 100644 --- a/Items/EnragedBatBanner.cs +++ b/Items/EnragedBatBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class EnragedBatBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class EnragedBatBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 56; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 56; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Enraged Bat Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Enraged Bat Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/EssenseofJungle.cs b/Items/EssenseofJungle.cs index de7baac9..3af244cf 100644 --- a/Items/EssenseofJungle.cs +++ b/Items/EssenseofJungle.cs @@ -4,24 +4,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class EssenseofJungle : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class EssenseofJungle : ModItem + { + public override void SetDefaults() + { - item.width = 14; - item.height = 22; - item.maxStack = 99; - item.rare = 8; - item.value = Item.buyPrice(0, 5, 0, 0); + item.width = 14; + item.height = 22; + item.maxStack = 99; + item.rare = 8; + item.value = Item.buyPrice(0, 5, 0, 0); - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Essence of Jungle"); - Tooltip.SetDefault("'Plants fill you with determination.'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Essence of Jungle"); + Tooltip.SetDefault("'Plants fill you with determination.'"); + } -}} + } +} diff --git a/Items/EternalAgony.cs b/Items/EternalAgony.cs index a97ad4bc..cbe14ec4 100644 --- a/Items/EternalAgony.cs +++ b/Items/EternalAgony.cs @@ -7,47 +7,47 @@ namespace Tremor.Items { - public class EternalAgony : ModItem - { - public override void SetDefaults() - { + public class EternalAgony : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 10; - item.value = Item.sellPrice(2, 0, 0, 0); + item.width = 30; + item.height = 10; + item.value = Item.sellPrice(2, 0, 0, 0); - item.rare = 4; - item.noMelee = true; - item.useStyle = 5; - item.useAnimation = 40; - item.useTime = 40; - item.knockBack = 7.5F; - item.damage = 76; - item.scale = 1.1F; - item.noUseGraphic = true; - item.shoot = mod.ProjectileType("EternalAgonyPro"); - item.shootSpeed = 20.9F; - item.UseSound = SoundID.Item1; - item.melee = true; - item.channel = true; - } + item.rare = 4; + item.noMelee = true; + item.useStyle = 5; + item.useAnimation = 40; + item.useTime = 40; + item.knockBack = 7.5F; + item.damage = 76; + item.scale = 1.1F; + item.noUseGraphic = true; + item.shoot = mod.ProjectileType("EternalAgonyPro"); + item.shootSpeed = 20.9F; + item.UseSound = SoundID.Item1; + item.melee = true; + item.channel = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Eternal Agony"); - Tooltip.SetDefault("Inflicts Shadow Flames on foes"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Eternal Agony"); + Tooltip.SetDefault("Inflicts Shadow Flames on foes"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "DarkMatter", 50); - recipe.AddIngredient(ItemID.DarkShard, 1); - recipe.AddIngredient(ItemID.LightShard, 1); - recipe.SetResult(this); - recipe.AddTile(26); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "DarkMatter", 50); + recipe.AddIngredient(ItemID.DarkShard, 1); + recipe.AddIngredient(ItemID.LightShard, 1); + recipe.SetResult(this); + recipe.AddTile(26); + recipe.AddRecipe(); + } + } } diff --git a/Items/EtherealFeather.cs b/Items/EtherealFeather.cs index d3a504f1..013b17e2 100644 --- a/Items/EtherealFeather.cs +++ b/Items/EtherealFeather.cs @@ -4,29 +4,31 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class EtherealFeather : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class EtherealFeather : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 44; + item.width = 22; + item.height = 44; - item.value = 1000; - item.rare = 3; - item.accessory = true; - } + item.value = 1000; + item.rare = 3; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ethereal Feather"); - Tooltip.SetDefault("Allows you to fall slowly"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ethereal Feather"); + Tooltip.SetDefault("Allows you to fall slowly"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.slowFall = true; - } -}} + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.slowFall = true; + } + } +} diff --git a/Items/EverscreamMask.cs b/Items/EverscreamMask.cs index ea599df2..0d1da831 100644 --- a/Items/EverscreamMask.cs +++ b/Items/EverscreamMask.cs @@ -4,25 +4,28 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class EverscreamMask : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class EverscreamMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 30; - item.height = 32; - item.rare = 1; - item.vanity = true; - } + item.width = 30; + item.height = 32; + item.rare = 1; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Everscream Mask"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Everscream Mask"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/EvershinyBar.cs b/Items/EvershinyBar.cs index 81372790..d6c7795b 100644 --- a/Items/EvershinyBar.cs +++ b/Items/EvershinyBar.cs @@ -4,40 +4,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class EvershinyBar : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class EvershinyBar : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 999; - item.value = 10000; - item.rare = 8; - item.createTile = mod.TileType("EvershinyBar"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - } + item.width = 30; + item.height = 24; + item.maxStack = 999; + item.value = 10000; + item.rare = 8; + item.createTile = mod.TileType("EvershinyBar"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Evershining Bar"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Evershining Bar"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.HallowedBar, 1); - recipe.AddIngredient(ItemID.Ectoplasm, 2); - recipe.SetResult(this); - recipe.AddTile(133); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.HallowedBar, 1); + recipe.AddIngredient(ItemID.Ectoplasm, 2); + recipe.SetResult(this); + recipe.AddTile(133); + recipe.AddRecipe(); + } + } +} diff --git a/Items/EvilCornBag.cs b/Items/EvilCornBag.cs index 58454a66..8b91d433 100644 --- a/Items/EvilCornBag.cs +++ b/Items/EvilCornBag.cs @@ -4,70 +4,72 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class EvilCornBag : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class EvilCornBag : ModItem + { + public override void SetDefaults() + { - item.maxStack = 999; - item.consumable = true; - item.width = 24; - item.height = 24; + item.maxStack = 999; + item.consumable = true; + item.width = 24; + item.height = 24; - item.rare = 9; - item.expert = true; - bossBagNPC = mod.NPCType("EvilCorn"); - } + item.rare = 9; + item.expert = true; + bossBagNPC = mod.NPCType("EvilCorn"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Treasure Bag"); - Tooltip.SetDefault("Right click to open"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Treasure Bag"); + Tooltip.SetDefault("Right click to open"); + } - public override bool CanRightClick() - { - return true; - } + public override bool CanRightClick() + { + return true; + } - public override void OpenBossBag(Player player) - { - if(Main.rand.Next(7) == 0) - { - player.QuickSpawnItem(mod.ItemType("EvilCornMask")); - } - if(Main.rand.Next(10) == 0) - { - player.QuickSpawnItem(mod.ItemType("EvilCornTrophy")); - } - if(Main.rand.Next(1) == 0) - { - player.QuickSpawnItem(mod.ItemType("CornHeater")); - } - if(Main.rand.Next(2) == 0) - { - player.QuickSpawnItem(mod.ItemType("GrayKnightHelmet")); - } - if(Main.rand.Next(2) == 0) - { - player.QuickSpawnItem(mod.ItemType("GrayKnightBreastplate")); - } - if(Main.rand.Next(2) == 0) - { - player.QuickSpawnItem(mod.ItemType("KnightGreaves")); - } - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("CornSword")); - } - if(!Main.player[Main.myPlayer].HasItem(mod.ItemType("FarmerShovel"))) - { - player.QuickSpawnItem(mod.ItemType("FarmerShovel")); - } - player.QuickSpawnItem(mod.ItemType("Corn"), Main.rand.Next(25,48)); - player.QuickSpawnItem(mod.ItemType("CornJavelin"), Main.rand.Next(15, 45)); - } + public override void OpenBossBag(Player player) + { + if (Main.rand.Next(7) == 0) + { + player.QuickSpawnItem(mod.ItemType("EvilCornMask")); + } + if (Main.rand.Next(10) == 0) + { + player.QuickSpawnItem(mod.ItemType("EvilCornTrophy")); + } + if (Main.rand.Next(1) == 0) + { + player.QuickSpawnItem(mod.ItemType("CornHeater")); + } + if (Main.rand.Next(2) == 0) + { + player.QuickSpawnItem(mod.ItemType("GrayKnightHelmet")); + } + if (Main.rand.Next(2) == 0) + { + player.QuickSpawnItem(mod.ItemType("GrayKnightBreastplate")); + } + if (Main.rand.Next(2) == 0) + { + player.QuickSpawnItem(mod.ItemType("KnightGreaves")); + } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("CornSword")); + } + if (!Main.player[Main.myPlayer].HasItem(mod.ItemType("FarmerShovel"))) + { + player.QuickSpawnItem(mod.ItemType("FarmerShovel")); + } + player.QuickSpawnItem(mod.ItemType("Corn"), Main.rand.Next(25, 48)); + player.QuickSpawnItem(mod.ItemType("CornJavelin"), Main.rand.Next(15, 45)); + } -}} + } +} diff --git a/Items/EvilCornMask.cs b/Items/EvilCornMask.cs index b9aa226f..e021cd53 100644 --- a/Items/EvilCornMask.cs +++ b/Items/EvilCornMask.cs @@ -4,25 +4,28 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class EvilCornMask : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class EvilCornMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 30; - item.height = 22; - item.rare = 1; - item.vanity = true; - } + item.width = 30; + item.height = 22; + item.rare = 1; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Evil Corn Mask"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Evil Corn Mask"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/EvilCornMusicBox.cs b/Items/EvilCornMusicBox.cs index cf8a823a..79950c50 100644 --- a/Items/EvilCornMusicBox.cs +++ b/Items/EvilCornMusicBox.cs @@ -25,11 +25,11 @@ public override void SetDefaults() item.accessory = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Music Box (Evil Corn)"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Music Box (Evil Corn)"); + Tooltip.SetDefault(""); + } } } diff --git a/Items/EvilCornTrophy.cs b/Items/EvilCornTrophy.cs index bdf7271e..617d3bf8 100644 --- a/Items/EvilCornTrophy.cs +++ b/Items/EvilCornTrophy.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class EvilCornTrophy : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class EvilCornTrophy : ModItem + { + public override void SetDefaults() + { - item.width = 32; - item.height = 32; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 50000; - item.createTile = mod.TileType("EvilCornTrophy"); - item.placeStyle = 0; - } + item.width = 32; + item.height = 32; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 50000; + item.createTile = mod.TileType("EvilCornTrophy"); + item.placeStyle = 0; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Evil Corn Trophy"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Evil Corn Trophy"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/EvilCup.cs b/Items/EvilCup.cs index ae57c0b6..c4492985 100644 --- a/Items/EvilCup.cs +++ b/Items/EvilCup.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class EvilCup : ModItem +namespace Tremor.Items { + public class EvilCup : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 44; + item.width = 22; + item.height = 44; - item.value = 10000; - item.rare = 3; - item.maxStack = 1; - item.accessory = true; - } + item.value = 10000; + item.rare = 3; + item.maxStack = 1; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Evil Cup"); - Tooltip.SetDefault("Increases monsters spawn rate"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Evil Cup"); + Tooltip.SetDefault("Increases monsters spawn rate"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { -player.enemySpawns = true; - } -}} + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.enemySpawns = true; + } + } +} diff --git a/Items/EvolvedMusket.cs b/Items/EvolvedMusket.cs index 506d4b42..17a1415b 100644 --- a/Items/EvolvedMusket.cs +++ b/Items/EvolvedMusket.cs @@ -4,45 +4,47 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class EvolvedMusket : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.useStyle = 5; - item.autoReuse = true; - item.useAnimation = 36; - item.useTime = 36; - item.width = 44; - item.height = 14; - item.shoot = 10; - item.useAmmo = AmmoID.Bullet; - item.UseSound = SoundID.Item11; - item.damage = 333; - item.shootSpeed = 9f; - item.noMelee = true; - item.value = 100000; - item.knockBack = 5.25f; - item.rare = 11; - item.ranged = true; - item.crit = 7; - } + public class EvolvedMusket : ModItem + { + public override void SetDefaults() + { + item.useStyle = 5; + item.autoReuse = true; + item.useAnimation = 36; + item.useTime = 36; + + item.width = 44; + item.height = 14; + item.shoot = 10; + item.useAmmo = AmmoID.Bullet; + item.UseSound = SoundID.Item11; + item.damage = 333; + item.shootSpeed = 9f; + item.noMelee = true; + item.value = 100000; + item.knockBack = 5.25f; + item.rare = 11; + item.ranged = true; + item.crit = 7; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Evolved Musket"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Evolved Musket"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Musket, 1); - recipe.AddIngredient(null, "WhiteGoldBar", 12); - recipe.SetResult(this); - recipe.AddTile(null, "DivineForgeTile"); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Musket, 1); + recipe.AddIngredient(null, "WhiteGoldBar", 12); + recipe.SetResult(this); + recipe.AddTile(null, "DivineForgeTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/EvolvedUndertaker.cs b/Items/EvolvedUndertaker.cs index 00ffa664..9c6ce870 100644 --- a/Items/EvolvedUndertaker.cs +++ b/Items/EvolvedUndertaker.cs @@ -4,45 +4,47 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class EvolvedUndertaker : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.useStyle = 5; - item.autoReuse = true; - item.useAnimation = 36; - item.useTime = 36; - item.width = 44; - item.height = 14; - item.shoot = 10; - item.useAmmo = AmmoID.Bullet; - item.UseSound = SoundID.Item11; - item.damage = 344; - item.shootSpeed = 9f; - item.noMelee = true; - item.value = 100000; - item.knockBack = 5.25f; - item.rare = 11; - item.ranged = true; - item.crit = 7; - } + public class EvolvedUndertaker : ModItem + { + public override void SetDefaults() + { + item.useStyle = 5; + item.autoReuse = true; + item.useAnimation = 36; + item.useTime = 36; + + item.width = 44; + item.height = 14; + item.shoot = 10; + item.useAmmo = AmmoID.Bullet; + item.UseSound = SoundID.Item11; + item.damage = 344; + item.shootSpeed = 9f; + item.noMelee = true; + item.value = 100000; + item.knockBack = 5.25f; + item.rare = 11; + item.ranged = true; + item.crit = 7; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Evolved Undertaker"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Evolved Undertaker"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.TheUndertaker, 1); - recipe.AddIngredient(null, "WhiteGoldBar", 12); - recipe.SetResult(this); - recipe.AddTile(null, "DivineForgeTile"); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.TheUndertaker, 1); + recipe.AddIngredient(null, "WhiteGoldBar", 12); + recipe.SetResult(this); + recipe.AddTile(null, "DivineForgeTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/EvolvedZombieBanner.cs b/Items/EvolvedZombieBanner.cs index 5f86d8bc..eee20cb4 100644 --- a/Items/EvolvedZombieBanner.cs +++ b/Items/EvolvedZombieBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class EvolvedZombieBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class EvolvedZombieBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 57; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 57; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Evolved Zombie Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Evolved Zombie Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/ExecutionerAxe.cs b/Items/ExecutionerAxe.cs index 39e53e84..2c19265d 100644 --- a/Items/ExecutionerAxe.cs +++ b/Items/ExecutionerAxe.cs @@ -4,48 +4,50 @@ using Terraria.ModLoader; using Terraria.ID; -namespace Tremor.Items { -public class ExecutionerAxe : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ExecutionerAxe : ModItem + { + public override void SetDefaults() + { - item.damage = 245; - item.melee = true; - item.width = 66; - item.height = 66; - item.useTime = 45; - item.useAnimation = 45; - item.useStyle = 1; - item.knockBack = 25; - item.value = 12500; - item.rare = 11; - item.UseSound = SoundID.Item71; - item.autoReuse = false; - item.useTurn = false; - } + item.damage = 245; + item.melee = true; + item.width = 66; + item.height = 66; + item.useTime = 45; + item.useAnimation = 45; + item.useStyle = 1; + item.knockBack = 25; + item.value = 12500; + item.rare = 11; + item.UseSound = SoundID.Item71; + item.autoReuse = false; + item.useTurn = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Executioner Axe"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Executioner Axe"); + Tooltip.SetDefault(""); + } - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(39, 120); - } + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(39, 120); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "NightCore", 1); - recipe.AddIngredient(3467, 6); - recipe.AddIngredient(null, "MultidimensionalFragment", 8); - recipe.AddIngredient(null, "ConcentratedEther", 20); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "NightCore", 1); + recipe.AddIngredient(3467, 6); + recipe.AddIngredient(null, "MultidimensionalFragment", 8); + recipe.AddIngredient(null, "ConcentratedEther", 20); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } +} diff --git a/Items/ExtendedBoomFlask.cs b/Items/ExtendedBoomFlask.cs index 1fb152a9..dd6eed5b 100644 --- a/Items/ExtendedBoomFlask.cs +++ b/Items/ExtendedBoomFlask.cs @@ -9,57 +9,58 @@ namespace Tremor.Items { public class ExtendedBoomFlask : AlchemistItem - { - public override void SetDefaults() - { - item.crit = 4; - item.damage = 54; - //item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 40; - item.useAnimation = 40; - item.shoot = mod.ProjectileType("BoomFlaskPro"); - item.shootSpeed = 10f; - item.useStyle = 1; - item.knockBack = 1; - item.UseSound = SoundID.Item106; - item.value = 145; - item.rare = 2; - item.autoReuse = false; + { + public override void SetDefaults() + { + item.crit = 4; + item.damage = 54; + //item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 40; + item.useAnimation = 40; + item.shoot = mod.ProjectileType("BoomFlaskPro"); + item.shootSpeed = 10f; + item.useStyle = 1; + item.knockBack = 1; + item.UseSound = SoundID.Item106; + item.value = 145; + item.rare = 2; + item.autoReuse = false; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Extended Boom Flask"); - Tooltip.SetDefault("A vial of exploding chemicals"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Extended Boom Flask"); + Tooltip.SetDefault("A vial of exploding chemicals"); + } - public override void UpdateInventory(Player player) -{ -if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LongFuseBuff"))) -{ - item.shootSpeed = 11f; -} -else -{ - item.shootSpeed = 8f; -} -} + public override void UpdateInventory(Player player) + { + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LongFuseBuff"))) + { + item.shootSpeed = 11f; + } + else + { + item.shootSpeed = 8f; + } + } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BoomFlask", 25); - recipe.AddIngredient(1347, 1); - recipe.AddIngredient(ItemID.SoulofNight, 1); - recipe.AddIngredient(null, "GelCube", 1); + recipe.AddIngredient(null, "BoomFlask", 25); + recipe.AddIngredient(1347, 1); + recipe.AddIngredient(ItemID.SoulofNight, 1); + recipe.AddIngredient(null, "GelCube", 1); recipe.SetResult(this, 20); recipe.AddRecipe(); } -}} + } +} diff --git a/Items/ExtendedBurningFlask.cs b/Items/ExtendedBurningFlask.cs index b86e6b6f..2fc99a4b 100644 --- a/Items/ExtendedBurningFlask.cs +++ b/Items/ExtendedBurningFlask.cs @@ -9,83 +9,84 @@ namespace Tremor.Items { public class ExtendedBurningFlask : AlchemistItem - { + { - public override void SetDefaults() - { - item.crit = 4; - item.damage = 42; - //item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("ExtendedBurningFlaskPro"); - item.shootSpeed = 8f; - item.useStyle = 1; - item.knockBack = 1; - item.UseSound = SoundID.Item106; - item.value = 120; - item.rare = 1; - item.autoReuse = false; + public override void SetDefaults() + { + item.crit = 4; + item.damage = 42; + //item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("ExtendedBurningFlaskPro"); + item.shootSpeed = 8f; + item.useStyle = 1; + item.knockBack = 1; + item.UseSound = SoundID.Item106; + item.value = 120; + item.rare = 1; + item.autoReuse = false; - item.ammo = mod.ItemType("BoomFlask"); - } + item.ammo = mod.ItemType("BoomFlask"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Extended Burning Flask"); - Tooltip.SetDefault("Throws a flask that explodes into clouds\nClouds deal damage to enemies and burn them"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Extended Burning Flask"); + Tooltip.SetDefault("Throws a flask that explodes into clouds\nClouds deal damage to enemies and burn them"); + } - public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) - { - type = mod.ProjectileType("FieryCloudPro"); - } + public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) + { + type = mod.ProjectileType("FieryCloudPro"); + } + + public override void UpdateInventory(Player player) + { + MPlayer modPlayer = player.GetModPlayer(mod); + if (modPlayer.novaHelmet) + { + item.autoReuse = true; + } + if (!modPlayer.novaHelmet) + { + item.autoReuse = false; + } - public override void UpdateInventory(Player player) - { - MPlayer modPlayer = player.GetModPlayer(mod); - if (modPlayer.novaHelmet) - { - item.autoReuse = true; - } - if (!modPlayer.novaHelmet) - { - item.autoReuse = false; - } - - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) - { - item.shootSpeed = 11f; - } - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) - { - item.shootSpeed = 8f; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) - { - item.autoReuse = true; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) - { - item.autoReuse = false; - } - } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) + { + item.shootSpeed = 11f; + } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) + { + item.shootSpeed = 8f; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) + { + item.autoReuse = true; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) + { + item.autoReuse = false; + } + } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BurningFlask", 45); - recipe.AddIngredient(null, "FireFragment", 1); - recipe.AddIngredient(ItemID.SoulofLight, 1); - recipe.AddIngredient(null, "GelCube", 1); + recipe.AddIngredient(null, "BurningFlask", 45); + recipe.AddIngredient(null, "FireFragment", 1); + recipe.AddIngredient(ItemID.SoulofLight, 1); + recipe.AddIngredient(null, "GelCube", 1); recipe.SetResult(this, 30); recipe.AddRecipe(); } -}} + } +} diff --git a/Items/ExtendedFreezeFlask.cs b/Items/ExtendedFreezeFlask.cs index a2e3218b..310421c8 100644 --- a/Items/ExtendedFreezeFlask.cs +++ b/Items/ExtendedFreezeFlask.cs @@ -9,83 +9,84 @@ namespace Tremor.Items { public class ExtendedFreezeFlask : AlchemistItem - { + { - public override void SetDefaults() - { - item.crit = 4; - item.damage = 45; - //item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("ExtendedFreezeFlaskPro"); - item.shootSpeed = 8f; - item.useStyle = 1; - item.knockBack = 1; - item.UseSound = SoundID.Item106; - item.value = 120; - item.rare = 1; - item.autoReuse = false; + public override void SetDefaults() + { + item.crit = 4; + item.damage = 45; + //item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("ExtendedFreezeFlaskPro"); + item.shootSpeed = 8f; + item.useStyle = 1; + item.knockBack = 1; + item.UseSound = SoundID.Item106; + item.value = 120; + item.rare = 1; + item.autoReuse = false; - item.ammo = mod.ItemType("BoomFlask"); - } + item.ammo = mod.ItemType("BoomFlask"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Extended Freeze Flask"); - Tooltip.SetDefault("Throws a flask that explodes into clouds\nClouds deal damage to enemies and freeze them"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Extended Freeze Flask"); + Tooltip.SetDefault("Throws a flask that explodes into clouds\nClouds deal damage to enemies and freeze them"); + } - public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) - { - type = mod.ProjectileType("FrostCloudPro"); - } + public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) + { + type = mod.ProjectileType("FrostCloudPro"); + } - public override void UpdateInventory(Player player) - { + public override void UpdateInventory(Player player) + { MPlayer modPlayer = player.GetModPlayer(mod); - if (modPlayer.novaHelmet) - { - item.autoReuse = true; - } - if (!modPlayer.novaHelmet) - { - item.autoReuse = false; - } - - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) - { - item.shootSpeed = 11f; - } - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) - { - item.shootSpeed = 8f; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) - { - item.autoReuse = true; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) - { - item.autoReuse = false; - } - } + if (modPlayer.novaHelmet) + { + item.autoReuse = true; + } + if (!modPlayer.novaHelmet) + { + item.autoReuse = false; + } + + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) + { + item.shootSpeed = 11f; + } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) + { + item.shootSpeed = 8f; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) + { + item.autoReuse = true; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) + { + item.autoReuse = false; + } + } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "FreezeFlask", 45); - recipe.AddIngredient(null, "FrostCore", 1); - recipe.AddIngredient(ItemID.SoulofLight, 1); - recipe.AddIngredient(null, "GelCube", 1); + recipe.AddIngredient(null, "FreezeFlask", 45); + recipe.AddIngredient(null, "FrostCore", 1); + recipe.AddIngredient(ItemID.SoulofLight, 1); + recipe.AddIngredient(null, "GelCube", 1); recipe.SetResult(this, 30); recipe.AddRecipe(); } -}} + } +} diff --git a/Items/ExtraterrestrialRubies.cs b/Items/ExtraterrestrialRubies.cs index ba0f1f96..a968c4e7 100644 --- a/Items/ExtraterrestrialRubies.cs +++ b/Items/ExtraterrestrialRubies.cs @@ -5,31 +5,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ExtraterrestrialRubies:ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ExtraterrestrialRubies : ModItem + { + public override void SetDefaults() + { - item.accessory = true; - item.width = 22; - item.height = 18; - item.value = 10000000; - item.rare = 11; - } + item.accessory = true; + item.width = 22; + item.height = 18; + item.value = 10000000; + item.rare = 11; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Extraterrestrial Rubies"); - Tooltip.SetDefault("Increases maximum life by 100\nGreatly increases life regeneration"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Extraterrestrial Rubies"); + Tooltip.SetDefault("Increases maximum life by 100\nGreatly increases life regeneration"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.statLifeMax2 += 100; - player.lifeRegen = +20; - } + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.statLifeMax2 += 100; + player.lifeRegen = +20; + } - -}} + + } +} diff --git a/Items/EyeMonolith.cs b/Items/EyeMonolith.cs index edbdf0f2..c6c890ee 100644 --- a/Items/EyeMonolith.cs +++ b/Items/EyeMonolith.cs @@ -20,17 +20,17 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 3; + item.rare = 3; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("EyeMonolithTile"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Eye Monolith"); - Tooltip.SetDefault("15% increased minion damage if placed"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Eye Monolith"); + Tooltip.SetDefault("15% increased minion damage if placed"); + } } diff --git a/Items/EyeofInfinity.cs b/Items/EyeofInfinity.cs index b221d2cd..e1e9a503 100644 --- a/Items/EyeofInfinity.cs +++ b/Items/EyeofInfinity.cs @@ -4,33 +4,33 @@ namespace Tremor.Items { - public class EyeofInfinity : ModItem - { - public override void SetDefaults() - { + public class EyeofInfinity : ModItem + { + public override void SetDefaults() + { - item.damage = 68; - item.melee = true; - item.width = 42; - item.height = 42; - item.useTime = 16; - item.useAnimation = 16; - item.noMelee = true; - item.useStyle = 5; - item.knockBack = 6; - item.value = Item.buyPrice(0, 1, 50, 0); - item.rare = 8; - item.UseSound = SoundID.Item23; - item.autoReuse = true; - item.shoot = mod.ProjectileType("projEyeofInfinity"); - item.shootSpeed = 15f; - } + item.damage = 68; + item.melee = true; + item.width = 42; + item.height = 42; + item.useTime = 16; + item.useAnimation = 16; + item.noMelee = true; + item.useStyle = 5; + item.knockBack = 6; + item.value = Item.buyPrice(0, 1, 50, 0); + item.rare = 8; + item.UseSound = SoundID.Item23; + item.autoReuse = true; + item.shoot = mod.ProjectileType("projEyeofInfinity"); + item.shootSpeed = 15f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Eye of Infinity"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Eye of Infinity"); + Tooltip.SetDefault(""); + } - } + } } diff --git a/Items/EyeofOblivion.cs b/Items/EyeofOblivion.cs index f50124a6..074ee9ca 100644 --- a/Items/EyeofOblivion.cs +++ b/Items/EyeofOblivion.cs @@ -4,24 +4,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class EyeofOblivion : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class EyeofOblivion : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 16000; - item.rare = 11; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 16000; + item.rare = 11; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Eye of Oblivion"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Eye of Oblivion"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/Eyezor.cs b/Items/Eyezor.cs index 258269a9..1e631d01 100644 --- a/Items/Eyezor.cs +++ b/Items/Eyezor.cs @@ -3,36 +3,38 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { -//ported from my tAPI mod because I don't want to make more artwork -public class Eyezor : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + //ported from my tAPI mod because I don't want to make more artwork + public class Eyezor : ModItem + { + public override void SetDefaults() + { - item.damage = 37; - item.magic = true; - item.width = 20; - item.height = 12; - item.useTime = 6; - item.useAnimation = 20; - item.useStyle = 5; - item.knockBack = 6; - item.value = Item.buyPrice(0, 5, 0, 0); - item.rare = 5; - item.mana = 7; - item.useStyle = 5; - item.UseSound = SoundID.Item20; - item.noMelee = true; - item.autoReuse = true; - item.shoot = 606; - item.shootSpeed = 30f; - } + item.damage = 37; + item.magic = true; + item.width = 20; + item.height = 12; + item.useTime = 6; + item.useAnimation = 20; + item.useStyle = 5; + item.knockBack = 6; + item.value = Item.buyPrice(0, 5, 0, 0); + item.rare = 5; + item.mana = 7; + item.useStyle = 5; + item.UseSound = SoundID.Item20; + item.noMelee = true; + item.autoReuse = true; + item.shoot = 606; + item.shootSpeed = 30f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Eyezor"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Eyezor"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/FallenSnake.cs b/Items/FallenSnake.cs index 8e3989f9..b16b5e73 100644 --- a/Items/FallenSnake.cs +++ b/Items/FallenSnake.cs @@ -5,29 +5,30 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class FallenSnake : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.CloneDefaults(ItemID.ValkyrieYoyo); + public class FallenSnake : ModItem + { + public override void SetDefaults() + { + item.CloneDefaults(ItemID.ValkyrieYoyo); - item.damage = 180; - item.width = 30; - item.height = 26; + item.damage = 180; + item.width = 30; + item.height = 26; - item.shootSpeed = 25f; - item.shoot = mod.ProjectileType("FallenSnakePro"); - item.knockBack = 5; - item.value = 1000000; - item.rare = 11; - } + item.shootSpeed = 25f; + item.shoot = mod.ProjectileType("FallenSnakePro"); + item.knockBack = 5; + item.value = 1000000; + item.rare = 11; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("The Fallen Snake"); - Tooltip.SetDefault("Killed enemies drop more money"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("The Fallen Snake"); + Tooltip.SetDefault("Killed enemies drop more money"); + } -} + } } diff --git a/Items/FallenWarriorBanner.cs b/Items/FallenWarriorBanner.cs index 93a63e58..03cf55a4 100644 --- a/Items/FallenWarriorBanner.cs +++ b/Items/FallenWarriorBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class FallenWarriorBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class FallenWarriorBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 58; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 58; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Fallen Warrior Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Fallen Warrior Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/FarmerShovel.cs b/Items/FarmerShovel.cs index 31922dab..4a2deb07 100644 --- a/Items/FarmerShovel.cs +++ b/Items/FarmerShovel.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class FarmerShovel : ModItem +namespace Tremor.Items { + public class FarmerShovel : ModItem + { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Farmer's Shovel"); - Tooltip.SetDefault("''She wants to get it back..''\nAllows the Farmer to move in"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Farmer's Shovel"); + Tooltip.SetDefault("''She wants to get it back..''\nAllows the Farmer to move in"); + } - public override void SetDefaults() - { - item.damage = 8; - item.melee = true; - item.width = 42; - item.height = 42; - item.useTime = 17; - item.useAnimation = 17; - item.pick = 45; - item.useStyle = 1; - item.knockBack = 2; - item.value = 1000; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.useTurn = true; - item.autoReuse = true; - } -}} + public override void SetDefaults() + { + item.damage = 8; + item.melee = true; + item.width = 42; + item.height = 42; + item.useTime = 17; + item.useAnimation = 17; + item.pick = 45; + item.useStyle = 1; + item.knockBack = 2; + item.value = 1000; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.useTurn = true; + item.autoReuse = true; + } + } +} diff --git a/Items/FashionableHat.cs b/Items/FashionableHat.cs index 5bdc8cf7..ea2cb6de 100644 --- a/Items/FashionableHat.cs +++ b/Items/FashionableHat.cs @@ -5,26 +5,29 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class FashionableHat : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class FashionableHat : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width =30; - item.height = 22; - item.value = 80000; - item.rare = 11; - item.vanity = true; - } + item.width = 30; + item.height = 22; + item.value = 80000; + item.rare = 11; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Fashionable Hat"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Fashionable Hat"); + Tooltip.SetDefault(""); + } - -}} + + } +} diff --git a/Items/FatFlinxBanner.cs b/Items/FatFlinxBanner.cs index c8652eb0..789eab28 100644 --- a/Items/FatFlinxBanner.cs +++ b/Items/FatFlinxBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class FatFlinxBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class FatFlinxBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 59; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 59; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Fat Flinx Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Fat Flinx Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/FaultyRedSteelShield.cs b/Items/FaultyRedSteelShield.cs index 0e9591aa..52a1d646 100644 --- a/Items/FaultyRedSteelShield.cs +++ b/Items/FaultyRedSteelShield.cs @@ -4,24 +4,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class FaultyRedSteelShield : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class FaultyRedSteelShield : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 28; - item.maxStack = 99; - item.value = 50; - item.rare = 1; - } + item.width = 30; + item.height = 28; + item.maxStack = 99; + item.value = 50; + item.rare = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Faulty Red Steel Shield"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Faulty Red Steel Shield"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/FeatherStorm.cs b/Items/FeatherStorm.cs index 6fe1a3e5..1932a9ae 100644 --- a/Items/FeatherStorm.cs +++ b/Items/FeatherStorm.cs @@ -5,58 +5,60 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class FeatherStorm : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class FeatherStorm : ModItem + { + public override void SetDefaults() + { - item.damage = 22; - item.ranged = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 1; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("HarpyFeather"); - item.shootSpeed = 19f; - item.useStyle = 1; - item.knockBack = 4; - item.value = 32000; - item.rare = 3; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 22; + item.ranged = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 1; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("HarpyFeather"); + item.shootSpeed = 19f; + item.useStyle = 1; + item.knockBack = 4; + item.value = 32000; + item.rare = 3; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sharp Feathers"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sharp Feathers"); + Tooltip.SetDefault(""); + } -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) -{ - for (int i = 0; i < 1; ++i) - { - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 2, speedY - 2, type, damage, knockBack, Main.myPlayer); - } - return false; -} + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + for (int i = 0; i < 1; ++i) + { + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 2, speedY - 2, type, damage, knockBack, Main.myPlayer); + } + return false; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Feather, 15); - recipe.AddIngredient(ItemID.Cloud, 5); - recipe.AddIngredient(null, "AirFragment", 14); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Feather, 15); + recipe.AddIngredient(ItemID.Cloud, 5); + recipe.AddIngredient(null, "AirFragment", 14); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/FencingRapier.cs b/Items/FencingRapier.cs index 910cad97..dba13dd4 100644 --- a/Items/FencingRapier.cs +++ b/Items/FencingRapier.cs @@ -3,30 +3,32 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { -public class FencingRapier : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class FencingRapier : ModItem + { + public override void SetDefaults() + { - item.damage = 19; - item.melee = true; - item.width = 42; - item.height = 42; - item.useTime = 21; - item.useAnimation = 21; - item.useStyle = 3; - item.knockBack = 6; - item.value = 660; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 19; + item.melee = true; + item.width = 42; + item.height = 42; + item.useTime = 21; + item.useAnimation = 21; + item.useStyle = 3; + item.knockBack = 6; + item.value = 660; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Fencing Rapier"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Fencing Rapier"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/FiercePaw.cs b/Items/FiercePaw.cs index 1ab4f2fe..3ad10254 100644 --- a/Items/FiercePaw.cs +++ b/Items/FiercePaw.cs @@ -4,35 +4,37 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { -public class FiercePaw : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class FiercePaw : ModItem + { + public override void SetDefaults() + { - item.damage = 56; - item.melee = true; - item.width = 40; - item.height = 40; - item.useTime = 10; - item.useAnimation = 20; - item.useStyle = 1; - item.knockBack = 6; - item.value = 10000; - item.rare = 6; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 56; + item.melee = true; + item.width = 40; + item.height = 40; + item.useTime = 10; + item.useAnimation = 20; + item.useStyle = 1; + item.knockBack = 6; + item.value = 10000; + item.rare = 6; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Fierce Paw"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Fierce Paw"); + Tooltip.SetDefault(""); + } - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(120, 60); - } -}} + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(120, 60); + } + } +} diff --git a/Items/FieryKunai.cs b/Items/FieryKunai.cs index 6df0dbb7..7a07091d 100644 --- a/Items/FieryKunai.cs +++ b/Items/FieryKunai.cs @@ -5,45 +5,47 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class FieryKunai : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class FieryKunai : ModItem + { + public override void SetDefaults() + { - item.damage = 18; - item.height = 32; + item.damage = 18; + item.height = 32; - item.thrown = true; - item.width = 18; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.useTime = 18; - item.useAnimation = 18; - item.shoot = mod.ProjectileType("FieryKunai"); - item.shootSpeed = 16f; - item.useStyle = 1; - item.knockBack = 4; - item.value = 60; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.thrown = true; + item.width = 18; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.useTime = 18; + item.useAnimation = 18; + item.shoot = mod.ProjectileType("FieryKunai"); + item.shootSpeed = 16f; + item.useStyle = 1; + item.knockBack = 4; + item.value = 60; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Fiery Kunai"); - Tooltip.SetDefault("50% chance to set enemy on fire"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Fiery Kunai"); + Tooltip.SetDefault("50% chance to set enemy on fire"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Kunai", 50); - recipe.AddIngredient(null, "FireFragment"); - recipe.SetResult(this, 50); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Kunai", 50); + recipe.AddIngredient(null, "FireFragment"); + recipe.SetResult(this, 50); + recipe.AddRecipe(); + } + } +} diff --git a/Items/FireBeetleBanner.cs b/Items/FireBeetleBanner.cs index c78ba2fc..ab4afcad 100644 --- a/Items/FireBeetleBanner.cs +++ b/Items/FireBeetleBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class FireBeetleBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class FireBeetleBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 60; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 60; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Fire Beetle Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Fire Beetle Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/FireFragment.cs b/Items/FireFragment.cs index 6cef7414..8804b6d7 100644 --- a/Items/FireFragment.cs +++ b/Items/FireFragment.cs @@ -6,24 +6,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class FireFragment : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class FireFragment : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 100; - item.rare = 1; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 100; + item.rare = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Fire Fragment"); - Tooltip.SetDefault(""); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(8, 4)); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Fire Fragment"); + Tooltip.SetDefault(""); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(8, 4)); + } -}} + } +} diff --git a/Items/FirebenderTome.cs b/Items/FirebenderTome.cs index eb6b18b6..1c46d10a 100644 --- a/Items/FirebenderTome.cs +++ b/Items/FirebenderTome.cs @@ -5,33 +5,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class FirebenderTome : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class FirebenderTome : ModItem + { + public override void SetDefaults() + { - item.damage = 18; - item.magic = true; - item.width = 28; - item.height = 30; - item.useTime = 36; - item.useAnimation = 36; - item.shoot = 706; - item.shootSpeed = 7f; - item.mana = 10; - item.useStyle = 5; - item.knockBack = 3; - item.value = 10000; - item.rare = 2; - item.UseSound = SoundID.Item20; - item.autoReuse = true; - } + item.damage = 18; + item.magic = true; + item.width = 28; + item.height = 30; + item.useTime = 36; + item.useAnimation = 36; + item.shoot = 706; + item.shootSpeed = 7f; + item.mana = 10; + item.useStyle = 5; + item.knockBack = 3; + item.value = 10000; + item.rare = 2; + item.UseSound = SoundID.Item20; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Firebender Tome"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Firebender Tome"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/FlamesofDespair.cs b/Items/FlamesofDespair.cs index f24d6da8..85a0904b 100644 --- a/Items/FlamesofDespair.cs +++ b/Items/FlamesofDespair.cs @@ -6,39 +6,40 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class FlamesofDespair : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.width = 22; - item.height = 22; - item.damage = 152; - item.magic = true; - item.mana = 15; - item.value = 100000; - item.useTime = 38; - item.useAnimation = 38; - item.shoot = mod.ProjectileType("FlamesofDespairPro"); - item.shootSpeed = 30f; - item.useStyle = 5; - item.rare = 11; - item.UseSound = SoundID.Item117; - item.noMelee = true; - item.noUseGraphic = true; - item.knockBack = 3; - item.autoReuse = false; - - ItemID.Sets.ItemNoGravity[item.type] = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Flames of Despair"); - Tooltip.SetDefault("'Summons homing flames of oblivion'"); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(5, 4)); - } + public class FlamesofDespair : ModItem + { + public override void SetDefaults() + { + + item.width = 22; + item.height = 22; + item.damage = 152; + item.magic = true; + item.mana = 15; + item.value = 100000; + item.useTime = 38; + item.useAnimation = 38; + item.shoot = mod.ProjectileType("FlamesofDespairPro"); + item.shootSpeed = 30f; + item.useStyle = 5; + item.rare = 11; + item.UseSound = SoundID.Item117; + item.noMelee = true; + item.noUseGraphic = true; + item.knockBack = 3; + item.autoReuse = false; + + ItemID.Sets.ItemNoGravity[item.type] = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Flames of Despair"); + Tooltip.SetDefault("'Summons homing flames of oblivion'"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(5, 4)); + } public override Color? GetAlpha(Color lightColor) @@ -47,14 +48,15 @@ public override void SetStaticDefaults() } -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) -{ - for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. - { - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); - } - return false; + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. + { + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); + } + return false; + } + } } -}} diff --git a/Items/FlamingTooth.cs b/Items/FlamingTooth.cs index 26d23e64..3213a6c3 100644 --- a/Items/FlamingTooth.cs +++ b/Items/FlamingTooth.cs @@ -6,62 +6,64 @@ using Terraria.ModLoader; -namespace Tremor.Items { -public class FlamingTooth : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class FlamingTooth : ModItem + { + public override void SetDefaults() + { - item.damage = 18; - item.melee = true; - item.width = 42; - item.height = 46; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = 376; - item.shootSpeed = 6f; - item.useStyle = 1; - item.knockBack = 2; - item.value = 46000; - item.rare = 8; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 18; + item.melee = true; + item.width = 42; + item.height = 46; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = 376; + item.shootSpeed = 6f; + item.useStyle = 1; + item.knockBack = 2; + item.value = 46000; + item.rare = 8; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Flaming Tooth"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Flaming Tooth"); + Tooltip.SetDefault(""); + } - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(24, 60); - } + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(24, 60); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.GoldBroadsword, 1); - recipe.AddIngredient(null, "FireFragment", 8); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.GoldBroadsword, 1); + recipe.AddIngredient(null, "FireFragment", 8); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.PlatinumBroadsword, 1); - recipe.AddIngredient(null, "FireFragment", 8); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.PlatinumBroadsword, 1); + recipe.AddIngredient(null, "FireFragment", 8); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if(Main.rand.Next(1) == 0) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 6); - } - } -}} + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.Next(1) == 0) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 6); + } + } + } +} diff --git a/Items/FlaskCore.cs b/Items/FlaskCore.cs index ab55137c..3bfb66ae 100644 --- a/Items/FlaskCore.cs +++ b/Items/FlaskCore.cs @@ -6,44 +6,44 @@ namespace Tremor.Items { - public class FlaskCore : ModItem - { - public override bool CanEquipAccessory(Player player, int slot) - { - for (int i = 0; i < player.armor.Length; i++) - { - MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - if (modPlayer.core == true) - { - return false; - } - } - return true; - } + public class FlaskCore : ModItem + { + public override bool CanEquipAccessory(Player player, int slot) + { + for (int i = 0; i < player.armor.Length; i++) + { + MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); + if (modPlayer.core == true) + { + return false; + } + } + return true; + } - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 24; + item.width = 22; + item.height = 24; - item.value = 50000; - item.rare = 6; - item.accessory = true; - } + item.value = 50000; + item.rare = 6; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Flask Core"); - Tooltip.SetDefault("Flasks now have autoreuse"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Flask Core"); + Tooltip.SetDefault("Flasks now have autoreuse"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - player.AddBuff(mod.BuffType("FlaskCoreBuff"), 2); - modPlayer.core = true; - } - } + public override void UpdateAccessory(Player player, bool hideVisual) + { + MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); + player.AddBuff(mod.BuffType("FlaskCoreBuff"), 2); + modPlayer.core = true; + } + } } diff --git a/Items/FlayerBanner.cs b/Items/FlayerBanner.cs index ad0bec23..3ce0b40f 100644 --- a/Items/FlayerBanner.cs +++ b/Items/FlayerBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class FlayerBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class FlayerBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 61; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 61; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Flayer Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Flayer Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/FleshBreastplate.cs b/Items/FleshBreastplate.cs index d1e191f2..cc35e99c 100644 --- a/Items/FleshBreastplate.cs +++ b/Items/FleshBreastplate.cs @@ -5,43 +5,45 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class FleshBreastplate : ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 38; - item.height = 22; - - - item.value = 18000; - item.rare = 1; - item.defense = 7; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Flesh Breastplate"); - Tooltip.SetDefault("5% increased minion damage\nIncreases your max number of minions"); - } - - - public override void UpdateEquip(Player player) - { - player.maxMinions += 1; - player.minionDamage += 0.05f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "PieceofFlesh", 7); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } - -}} + [AutoloadEquip(EquipType.Body)] + public class FleshBreastplate : ModItem + { + + public override void SetDefaults() + { + + item.width = 38; + item.height = 22; + + + item.value = 18000; + item.rare = 1; + item.defense = 7; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Flesh Breastplate"); + Tooltip.SetDefault("5% increased minion damage\nIncreases your max number of minions"); + } + + + public override void UpdateEquip(Player player) + { + player.maxMinions += 1; + player.minionDamage += 0.05f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "PieceofFlesh", 7); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + + } +} diff --git a/Items/FleshGreaves.cs b/Items/FleshGreaves.cs index 25104883..361d4227 100644 --- a/Items/FleshGreaves.cs +++ b/Items/FleshGreaves.cs @@ -5,43 +5,46 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class FleshGreaves : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Legs)] + public class FleshGreaves : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 38; - item.height = 22; + item.width = 38; + item.height = 22; - item.value = 18000; - item.rare = 1; - item.defense = 7; - } + item.value = 18000; + item.rare = 1; + item.defense = 7; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Flesh Greaves"); - Tooltip.SetDefault("5% increased minion damage\nIncreases your max number of minions"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Flesh Greaves"); + Tooltip.SetDefault("5% increased minion damage\nIncreases your max number of minions"); + } - public override void UpdateEquip(Player player) - { - player.maxMinions += 1; - player.minionDamage += 0.05f; - } + public override void UpdateEquip(Player player) + { + player.maxMinions += 1; + player.minionDamage += 0.05f; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "PieceofFlesh", 6); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "PieceofFlesh", 6); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } -}} + } +} diff --git a/Items/FleshHeadgear.cs b/Items/FleshHeadgear.cs index 35660615..0f7ed545 100644 --- a/Items/FleshHeadgear.cs +++ b/Items/FleshHeadgear.cs @@ -5,58 +5,61 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class FleshHeadgear : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class FleshHeadgear : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 38; - item.height = 22; + item.width = 38; + item.height = 22; - item.value = 18000; - item.rare = 1; - item.defense = 7; - } + item.value = 18000; + item.rare = 1; + item.defense = 7; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Flesh Headgear"); - Tooltip.SetDefault("9% increased minion damage\nIncreases your max number of minions"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Flesh Headgear"); + Tooltip.SetDefault("9% increased minion damage\nIncreases your max number of minions"); + } - public override void UpdateEquip(Player player) - { - player.minionDamage += 0.09f; - } + public override void UpdateEquip(Player player) + { + player.minionDamage += 0.09f; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("FleshBreastplate") && legs.type == mod.ItemType("FleshGreaves"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("FleshBreastplate") && legs.type == mod.ItemType("FleshGreaves"); + } - public override void UpdateArmorSet(Player p) - { - p.setBonus = "Increases regeneration!"; - p.crimsonRegen = true; - } + public override void UpdateArmorSet(Player p) + { + p.setBonus = "Increases regeneration!"; + p.crimsonRegen = true; + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawShadow=true; + player.armorEffectDrawShadow = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "PieceofFlesh", 4); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "PieceofFlesh", 4); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } -}} + } +} diff --git a/Items/FleshHelmet.cs b/Items/FleshHelmet.cs index 7c520036..5cc03864 100644 --- a/Items/FleshHelmet.cs +++ b/Items/FleshHelmet.cs @@ -5,59 +5,62 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class FleshHelmet : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class FleshHelmet : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 38; - item.height = 22; + item.width = 38; + item.height = 22; - item.value = 18000; - item.rare = 1; - item.defense = 7; - } + item.value = 18000; + item.rare = 1; + item.defense = 7; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Flesh Helmet"); - Tooltip.SetDefault("5% increased minion damage\nIncreases your max number of minions"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Flesh Helmet"); + Tooltip.SetDefault("5% increased minion damage\nIncreases your max number of minions"); + } - public override void UpdateEquip(Player player) - { - player.maxMinions += 1; - player.minionDamage += 0.05f; - } + public override void UpdateEquip(Player player) + { + player.maxMinions += 1; + player.minionDamage += 0.05f; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("FleshBreastplate") && legs.type == mod.ItemType("FleshGreaves"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("FleshBreastplate") && legs.type == mod.ItemType("FleshGreaves"); + } - public override void UpdateArmorSet(Player p) - { - p.setBonus = "Increases regeneration!"; - p.crimsonRegen = true; - } + public override void UpdateArmorSet(Player p) + { + p.setBonus = "Increases regeneration!"; + p.crimsonRegen = true; + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawShadow=true; + player.armorEffectDrawShadow = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "PieceofFlesh", 4); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "PieceofFlesh", 4); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } -}} + } +} diff --git a/Items/FleshWings.cs b/Items/FleshWings.cs index 01e7e03d..e2d6edc5 100644 --- a/Items/FleshWings.cs +++ b/Items/FleshWings.cs @@ -5,57 +5,59 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Wings)] -public class FleshWings : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Wings)] + public class FleshWings : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 20; + item.width = 22; + item.height = 20; - item.value = 100000; - item.rare = 5; - item.accessory = true; - } + item.value = 100000; + item.rare = 5; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Flesh Wings"); - Tooltip.SetDefault("The wings of skin and teeth."); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Flesh Wings"); + Tooltip.SetDefault("The wings of skin and teeth."); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.wingTimeMax = 120; - } + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.wingTimeMax = 120; + } public override void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend) - { - ascentWhenFalling = 0.85f; - ascentWhenRising = 0.15f; - maxCanAscendMultiplier = 1f; - maxAscentMultiplier = 3f; - constantAscend = 0.135f; - } - - public override void HorizontalWingSpeeds(Player player, ref float speed, ref float acceleration) - { - speed = 6f; - acceleration *= 2.5f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "PieceofFlesh", 6); - recipe.AddIngredient(ItemID.SoulofFlight, 20); - recipe.AddTile(134); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + { + ascentWhenFalling = 0.85f; + ascentWhenRising = 0.15f; + maxCanAscendMultiplier = 1f; + maxAscentMultiplier = 3f; + constantAscend = 0.135f; + } + + public override void HorizontalWingSpeeds(Player player, ref float speed, ref float acceleration) + { + speed = 6f; + acceleration *= 2.5f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "PieceofFlesh", 6); + recipe.AddIngredient(ItemID.SoulofFlight, 20); + recipe.AddTile(134); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/FleshWorkstation.cs b/Items/FleshWorkstation.cs index 6d06ab44..d8128634 100644 --- a/Items/FleshWorkstation.cs +++ b/Items/FleshWorkstation.cs @@ -19,26 +19,26 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 200; item.createTile = mod.TileType("FleshWorkstationTile"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Flesh Workstation"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Flesh Workstation"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Wood, 15); - recipe.AddIngredient(null, "UntreatedFlesh", 10); - recipe.SetResult(this); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Wood, 15); + recipe.AddIngredient(null, "UntreatedFlesh", 10); + recipe.SetResult(this); + recipe.AddRecipe(); + } } } diff --git a/Items/FlowerofAntimony.cs b/Items/FlowerofAntimony.cs index a6be85fe..50b0d553 100644 --- a/Items/FlowerofAntimony.cs +++ b/Items/FlowerofAntimony.cs @@ -5,46 +5,48 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class FlowerofAntimony : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class FlowerofAntimony : ModItem + { + public override void SetDefaults() + { - item.damage = 60; - item.magic = true; - item.mana = 11; - item.width = 40; - item.height = 40; - item.useTime = 18; - item.useAnimation = 18; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 3; - item.value = 13800; - item.rare = 4; - item.UseSound = SoundID.Item43; - item.autoReuse = false; - Item.staff[item.type] = true; - item.shoot = mod.ProjectileType("FlowerofAntimony"); - item.shootSpeed = 15f; - } + item.damage = 60; + item.magic = true; + item.mana = 11; + item.width = 40; + item.height = 40; + item.useTime = 18; + item.useAnimation = 18; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 3; + item.value = 13800; + item.rare = 4; + item.UseSound = SoundID.Item43; + item.autoReuse = false; + Item.staff[item.type] = true; + item.shoot = mod.ProjectileType("FlowerofAntimony"); + item.shootSpeed = 15f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Flower of Antimony"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Flower of Antimony"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "RuneBar", 12); - recipe.AddIngredient(null, "Gloomstone", 15); - recipe.AddIngredient(null, "Jellyxir", 6); - recipe.SetResult(this); - recipe.AddTile(null, "AlchematorTile"); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "RuneBar", 12); + recipe.AddIngredient(null, "Gloomstone", 15); + recipe.AddIngredient(null, "Jellyxir", 6); + recipe.SetResult(this); + recipe.AddTile(null, "AlchematorTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/ForkFish.cs b/Items/ForkFish.cs index 4df57197..d69403d0 100644 --- a/Items/ForkFish.cs +++ b/Items/ForkFish.cs @@ -21,11 +21,11 @@ public override void SetDefaults() item.rare = -11; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Fork Fish"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Fork Fish"); + Tooltip.SetDefault(""); + } public override bool IsQuestFish() diff --git a/Items/FossilSugar.cs b/Items/FossilSugar.cs index 5114876d..333b1124 100644 --- a/Items/FossilSugar.cs +++ b/Items/FossilSugar.cs @@ -25,11 +25,11 @@ public override void SetDefaults() item.mountType = mod.MountType("Antlion"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Fossil Sugar"); - Tooltip.SetDefault("Summons a rideable Antlion mount"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Fossil Sugar"); + Tooltip.SetDefault("Summons a rideable Antlion mount"); + } } } diff --git a/Items/FreezeFlask.cs b/Items/FreezeFlask.cs index b9471f7d..4aedf960 100644 --- a/Items/FreezeFlask.cs +++ b/Items/FreezeFlask.cs @@ -9,73 +9,74 @@ namespace Tremor.Items { public class FreezeFlask : AlchemistItem - { + { - public override void SetDefaults() - { - item.crit = 4; - item.damage = 18; - //item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("FreezeFlaskPro"); - item.shootSpeed = 8f; - item.useStyle = 1; - item.knockBack = 1; - item.UseSound = SoundID.Item106; - item.value = 120; - item.rare = 1; - item.autoReuse = false; + public override void SetDefaults() + { + item.crit = 4; + item.damage = 18; + //item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("FreezeFlaskPro"); + item.shootSpeed = 8f; + item.useStyle = 1; + item.knockBack = 1; + item.UseSound = SoundID.Item106; + item.value = 120; + item.rare = 1; + item.autoReuse = false; - item.ammo = mod.ItemType("BoomFlask"); - } + item.ammo = mod.ItemType("BoomFlask"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Freeze Flask"); - Tooltip.SetDefault("Throws a flask that explodes into clouds\nClouds deal damage to enemies and freeze them"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Freeze Flask"); + Tooltip.SetDefault("Throws a flask that explodes into clouds\nClouds deal damage to enemies and freeze them"); + } - public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) - { - type = mod.ProjectileType("FrostCloudPro"); - } + public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) + { + type = mod.ProjectileType("FrostCloudPro"); + } - public override void UpdateInventory(Player player) - { - MPlayer modPlayer = player.GetModPlayer(mod); - if (modPlayer.novaHelmet) - { - item.autoReuse = true; - } - if (!modPlayer.novaHelmet) - { - item.autoReuse = false; - } - - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) - { - item.shootSpeed = 11f; - } - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) - { - item.shootSpeed = 8f; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) - { - item.autoReuse = true; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) - { - item.autoReuse = false; - } - } + public override void UpdateInventory(Player player) + { + MPlayer modPlayer = player.GetModPlayer(mod); + if (modPlayer.novaHelmet) + { + item.autoReuse = true; + } + if (!modPlayer.novaHelmet) + { + item.autoReuse = false; + } -}} + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) + { + item.shootSpeed = 11f; + } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) + { + item.shootSpeed = 8f; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) + { + item.autoReuse = true; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) + { + item.autoReuse = false; + } + } + + } +} diff --git a/Items/FrogMask.cs b/Items/FrogMask.cs index fcbdceb9..2f5b36ba 100644 --- a/Items/FrogMask.cs +++ b/Items/FrogMask.cs @@ -4,23 +4,26 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class FrogMask : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class FrogMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 20; - item.height = 24; - item.rare = 1; - item.vanity = true; - } + item.width = 20; + item.height = 24; + item.rare = 1; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Frog Mask"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Frog Mask"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/FrostBeetleBanner.cs b/Items/FrostBeetleBanner.cs index d8caf0a2..770d8526 100644 --- a/Items/FrostBeetleBanner.cs +++ b/Items/FrostBeetleBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class FrostBeetleBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class FrostBeetleBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 62; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 62; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Frost Beetle Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Frost Beetle Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/FrostCore.cs b/Items/FrostCore.cs index 21fd1dd4..ebf9acf3 100644 --- a/Items/FrostCore.cs +++ b/Items/FrostCore.cs @@ -6,31 +6,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class FrostCore : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class FrostCore : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 100; - item.rare = 1; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 100; + item.rare = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Frost Chunk"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Frost Chunk"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Icicle", 4); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Icicle", 4); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/FrostCrown.cs b/Items/FrostCrown.cs index 3aab7c28..c2244bb3 100644 --- a/Items/FrostCrown.cs +++ b/Items/FrostCrown.cs @@ -12,29 +12,29 @@ public class FrostCrown : ModItem public override void SetDefaults() { - item.width = 38; - item.height = 38; - item.maxStack = 20; - - item.rare = 6; - item.value = 25000; - item.useAnimation = 45; - item.useTime = 45; - item.useStyle = 4; - item.consumable = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Frost Crown"); - Tooltip.SetDefault("Summons the Frost King"); - } - - - public override bool CanUseItem(Player player) - { - return NPC.downedMechBossAny && !NPC.AnyNPCs(mod.NPCType("FrostKing")) && player.ZoneSnow; - } + item.width = 38; + item.height = 38; + item.maxStack = 20; + + item.rare = 6; + item.value = 25000; + item.useAnimation = 45; + item.useTime = 45; + item.useStyle = 4; + item.consumable = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Frost Crown"); + Tooltip.SetDefault("Summons the Frost King"); + } + + + public override bool CanUseItem(Player player) + { + return NPC.downedMechBossAny && !NPC.AnyNPCs(mod.NPCType("FrostKing")) && player.ZoneSnow; + } public override bool UseItem(Player player) { @@ -43,17 +43,17 @@ public override bool UseItem(Player player) return true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.GoldCrown, 1); - recipe.AddIngredient(ItemID.HallowedBar, 15); - recipe.AddIngredient(ItemID.SoulofNight, 18); - recipe.AddIngredient(ItemID.SoulofLight, 18); - recipe.AddIngredient(null, "FrostCore", 25); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.GoldCrown, 1); + recipe.AddIngredient(ItemID.HallowedBar, 15); + recipe.AddIngredient(ItemID.SoulofNight, 18); + recipe.AddIngredient(ItemID.SoulofLight, 18); + recipe.AddIngredient(null, "FrostCore", 25); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } } diff --git a/Items/FrostFreshness.cs b/Items/FrostFreshness.cs index eb1b2c35..a8a14c38 100644 --- a/Items/FrostFreshness.cs +++ b/Items/FrostFreshness.cs @@ -5,45 +5,47 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class FrostFreshness : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class FrostFreshness : ModItem + { + public override void SetDefaults() + { - item.damage = 15; - item.magic = true; - item.mana = 8; - item.width = 40; - item.height = 40; - item.useTime = 25; - item.useAnimation = 25; - item.useStyle = 5; - Item.staff[item.type] = true; - item.noMelee = true; - item.knockBack = 5; - item.value = 1500; - item.rare = 3; - item.UseSound = SoundID.Item20; - item.autoReuse = true; - item.shoot = 309; - item.shootSpeed = 8f; - } + item.damage = 15; + item.magic = true; + item.mana = 8; + item.width = 40; + item.height = 40; + item.useTime = 25; + item.useAnimation = 25; + item.useStyle = 5; + Item.staff[item.type] = true; + item.noMelee = true; + item.knockBack = 5; + item.value = 1500; + item.rare = 3; + item.UseSound = SoundID.Item20; + item.autoReuse = true; + item.shoot = 309; + item.shootSpeed = 8f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Frost Freshness"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Frost Freshness"); + Tooltip.SetDefault(""); + } -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) -{ - for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. - { - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); - } - return false; + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. + { + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); + } + return false; + } + } } -}} diff --git a/Items/FrostJavelin.cs b/Items/FrostJavelin.cs index 90f375a2..689a5b73 100644 --- a/Items/FrostJavelin.cs +++ b/Items/FrostJavelin.cs @@ -4,43 +4,45 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class FrostJavelin : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class FrostJavelin : ModItem + { + public override void SetDefaults() + { - item.damage = 12; - item.width = 14; - item.height = 84; - item.noUseGraphic = true; - item.thrown = true; - item.useTime = 30; - item.shoot = mod.ProjectileType("FrostJavelinPro"); - item.shootSpeed = 15f; - item.useAnimation = 30; - item.useStyle = 1; - item.knockBack = 4; - item.maxStack = 999; - item.consumable = true; - item.value = 10; - item.rare = 1; - item.UseSound = SoundID.Item5; - item.autoReuse = false; - } + item.damage = 12; + item.width = 14; + item.height = 84; + item.noUseGraphic = true; + item.thrown = true; + item.useTime = 30; + item.shoot = mod.ProjectileType("FrostJavelinPro"); + item.shootSpeed = 15f; + item.useAnimation = 30; + item.useStyle = 1; + item.knockBack = 4; + item.maxStack = 999; + item.consumable = true; + item.value = 10; + item.rare = 1; + item.UseSound = SoundID.Item5; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Frost Javelin"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Frost Javelin"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "FrostCore", 1); - recipe.SetResult(this, 25); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "FrostCore", 1); + recipe.SetResult(this, 25); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/FrostKingBag.cs b/Items/FrostKingBag.cs index 0597532c..d444638f 100644 --- a/Items/FrostKingBag.cs +++ b/Items/FrostKingBag.cs @@ -4,43 +4,45 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class FrostKingBag : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.maxStack = 999; - item.consumable = true; - item.width = 24; - item.height = 24; - - item.rare = 9; - item.expert = true; - bossBagNPC = mod.NPCType("FrostKing"); - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Treasure Bag"); - Tooltip.SetDefault("Right click to open"); - } - - - public override bool CanRightClick() - { - return true; - } - - public override void OpenBossBag(Player player) - { - if(Main.rand.Next(7) == 0) - { - player.QuickSpawnItem(mod.ItemType("FrostKingMask")); - } - player.QuickSpawnItem(mod.ItemType("EdgeofFrostKing")); - player.QuickSpawnItem(mod.ItemType("FrostoneOre"), Main.rand.Next(24,42)); - player.TryGettingDevArmor(); - } - -}} + public class FrostKingBag : ModItem + { + public override void SetDefaults() + { + + item.maxStack = 999; + item.consumable = true; + item.width = 24; + item.height = 24; + + item.rare = 9; + item.expert = true; + bossBagNPC = mod.NPCType("FrostKing"); + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Treasure Bag"); + Tooltip.SetDefault("Right click to open"); + } + + + public override bool CanRightClick() + { + return true; + } + + public override void OpenBossBag(Player player) + { + if (Main.rand.Next(7) == 0) + { + player.QuickSpawnItem(mod.ItemType("FrostKingMask")); + } + player.QuickSpawnItem(mod.ItemType("EdgeofFrostKing")); + player.QuickSpawnItem(mod.ItemType("FrostoneOre"), Main.rand.Next(24, 42)); + player.TryGettingDevArmor(); + } + + } +} diff --git a/Items/FrostKingMask.cs b/Items/FrostKingMask.cs index 4ba95f88..be716fe1 100644 --- a/Items/FrostKingMask.cs +++ b/Items/FrostKingMask.cs @@ -4,25 +4,28 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class FrostKingMask : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class FrostKingMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.rare = 1; - item.vanity = true; - } + item.width = 30; + item.height = 24; + item.rare = 1; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Frost King Mask"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Frost King Mask"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/FrostKingTrophy.cs b/Items/FrostKingTrophy.cs index 9511ee78..211fe168 100644 --- a/Items/FrostKingTrophy.cs +++ b/Items/FrostKingTrophy.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class FrostKingTrophy : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class FrostKingTrophy : ModItem + { + public override void SetDefaults() + { - item.width = 32; - item.height = 32; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 50000; - item.createTile = mod.TileType("FrostKingTrophy"); - item.placeStyle = 0; - } + item.width = 32; + item.height = 32; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 50000; + item.createTile = mod.TileType("FrostKingTrophy"); + item.placeStyle = 0; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Frost King Trophy"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Frost King Trophy"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/Frostammer.cs b/Items/Frostammer.cs index 47625d1a..e02a753c 100644 --- a/Items/Frostammer.cs +++ b/Items/Frostammer.cs @@ -18,8 +18,8 @@ public override void SetDefaults() item.height = 40; item.useTime = 20; item.useAnimation = 20; - item.hammer = 95; - item.useStyle = 1; + item.hammer = 95; + item.useStyle = 1; item.knockBack = 7; item.value = 1040; item.rare = 9; @@ -27,25 +27,25 @@ public override void SetDefaults() item.autoReuse = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Frostammer"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Frostammer"); + Tooltip.SetDefault(""); + } public override void AddRecipes() { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "FrostoneBar", 15); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this); - recipe.AddRecipe(); - } - - + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "FrostoneBar", 15); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this); + recipe.AddRecipe(); } + + } - - - +} + + + diff --git a/Items/FrostbiteChestplate.cs b/Items/FrostbiteChestplate.cs index b8d4379f..355ddc4d 100644 --- a/Items/FrostbiteChestplate.cs +++ b/Items/FrostbiteChestplate.cs @@ -5,34 +5,36 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class FrostbiteChestplate : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Body)] + public class FrostbiteChestplate : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 18; - item.value = 600; - item.rare = 1; - item.defense = 3; - } + item.width = 26; + item.height = 18; + item.value = 600; + item.rare = 1; + item.defense = 3; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Frostbite Chestplate"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Frostbite Chestplate"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.IceBlock, 75); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.IceBlock, 75); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/FrostbiteGreaves.cs b/Items/FrostbiteGreaves.cs index 0e7fb498..ba448b99 100644 --- a/Items/FrostbiteGreaves.cs +++ b/Items/FrostbiteGreaves.cs @@ -5,34 +5,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class FrostbiteGreaves : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Legs)] + public class FrostbiteGreaves : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 18; - item.value = 100; - item.rare = 1; - item.defense = 1; - } + item.width = 22; + item.height = 18; + item.value = 100; + item.rare = 1; + item.defense = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Frostbite Greaves"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Frostbite Greaves"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.IceBlock, 60); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.IceBlock, 60); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/FrostbiteHelmet.cs b/Items/FrostbiteHelmet.cs index 536a53c5..7d31c68e 100644 --- a/Items/FrostbiteHelmet.cs +++ b/Items/FrostbiteHelmet.cs @@ -5,54 +5,57 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class FrostbiteHelmet : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class FrostbiteHelmet : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 32; - item.height = 26; - item.value = 100; - item.rare = 1; - item.defense = 1; - } + item.width = 32; + item.height = 26; + item.value = 100; + item.rare = 1; + item.defense = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Frostbite Helmet"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Frostbite Helmet"); + Tooltip.SetDefault(""); + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("FrostbiteChestplate") && legs.type == mod.ItemType("FrostbiteGreaves"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("FrostbiteChestplate") && legs.type == mod.ItemType("FrostbiteGreaves"); + } - public override void UpdateArmorSet(Player p) - { + public override void UpdateArmorSet(Player p) + { p.setBonus = "Grants immunity to frozen effect and to ice breaking"; p.buffImmune[44] = true; p.iceSkate = true; p.statDefense += 2; p.moveSpeed -= 0.21f; - } + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawShadow=true; + player.armorEffectDrawShadow = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.IceBlock, 45); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.IceBlock, 45); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Frostbiter.cs b/Items/Frostbiter.cs index cc73d821..0b6f0555 100644 --- a/Items/Frostbiter.cs +++ b/Items/Frostbiter.cs @@ -5,77 +5,79 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Frostbiter : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Frostbiter : ModItem + { + public override void SetDefaults() + { - item.damage = 86; - item.magic = true; - item.mana = 6; - item.width = 40; - item.height = 40; - item.useTime = 10; - item.useAnimation = 9; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 3; - item.value = 128440; - item.rare = 8; - item.UseSound = SoundID.Item11; - item.autoReuse = true; - item.shoot = 118; - item.shootSpeed = 5f; - } + item.damage = 86; + item.magic = true; + item.mana = 6; + item.width = 40; + item.height = 40; + item.useTime = 10; + item.useAnimation = 9; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 3; + item.value = 128440; + item.rare = 8; + item.UseSound = SoundID.Item11; + item.autoReuse = true; + item.shoot = 118; + item.shootSpeed = 5f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Frostbiter"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Frostbiter"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "FrostoneBar", 20); - recipe.AddIngredient(ItemID.Ectoplasm, 12); - recipe.AddIngredient(ItemID.Lens, 5); - recipe.AddIngredient(ItemID.SoulofSight, 15); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "FrostoneBar", 20); + recipe.AddIngredient(ItemID.Ectoplasm, 12); + recipe.AddIngredient(ItemID.Lens, 5); + recipe.AddIngredient(ItemID.SoulofSight, 15); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - int ShotAmt = 2; - int spread = 5; - float spreadMult = 0.3f; + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + int ShotAmt = 2; + int spread = 5; + float spreadMult = 0.3f; Vector2 vector2 = new Vector2(); - - for(int i = 0; i < ShotAmt; i++) - { - float vX = 8*speedX+(float)Main.rand.Next(-spread,spread+1) * spreadMult; - float vY = 8*speedY+(float)Main.rand.Next(-spread,spread+1) * spreadMult; - - float angle = (float)Math.Atan(vY/vX); - vector2 = new Vector2(position.X+75f*(float)Math.Cos(angle), position.Y+75f*(float)Math.Sin(angle)); + + for (int i = 0; i < ShotAmt; i++) + { + float vX = 8 * speedX + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + float vY = 8 * speedY + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + + float angle = (float)Math.Atan(vY / vX); + vector2 = new Vector2(position.X + 75f * (float)Math.Cos(angle), position.Y + 75f * (float)Math.Sin(angle)); float mouseX = (float)Main.mouseX + Main.screenPosition.X; - if(mouseX < player.position.X) + if (mouseX < player.position.X) { - vector2 = new Vector2(position.X-75f*(float)Math.Cos(angle), position.Y-75f*(float)Math.Sin(angle)); + vector2 = new Vector2(position.X - 75f * (float)Math.Cos(angle), position.Y - 75f * (float)Math.Sin(angle)); } - Projectile.NewProjectile(vector2.X,vector2.Y,vX,vY,118,damage,knockBack,Main.myPlayer); + Projectile.NewProjectile(vector2.X, vector2.Y, vX, vY, 118, damage, knockBack, Main.myPlayer); + + - - - } - return false; - } -}} + } + return false; + } + } +} diff --git a/Items/FrostbittenBall.cs b/Items/FrostbittenBall.cs index ff757e4e..a41c7902 100644 --- a/Items/FrostbittenBall.cs +++ b/Items/FrostbittenBall.cs @@ -7,44 +7,44 @@ namespace Tremor.Items { - public class FrostbittenBall : ModItem - { - public override void SetDefaults() - { + public class FrostbittenBall : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 10; - item.value = Item.sellPrice(0, 1, 0, 0); - item.rare = 1; - item.noMelee = true; - item.useStyle = 5; - item.useAnimation = 40; - item.useTime = 40; - item.knockBack = 7.5F; - item.damage = 18; - item.scale = 1.1F; - item.noUseGraphic = true; - item.shoot = mod.ProjectileType("FrostbittenBallPro"); - item.shootSpeed = 15.9F; - item.UseSound = SoundID.Item1; - item.melee = true; - item.channel = true; - } + item.width = 30; + item.height = 10; + item.value = Item.sellPrice(0, 1, 0, 0); + item.rare = 1; + item.noMelee = true; + item.useStyle = 5; + item.useAnimation = 40; + item.useTime = 40; + item.knockBack = 7.5F; + item.damage = 18; + item.scale = 1.1F; + item.noUseGraphic = true; + item.shoot = mod.ProjectileType("FrostbittenBallPro"); + item.shootSpeed = 15.9F; + item.UseSound = SoundID.Item1; + item.melee = true; + item.channel = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Frostbitten Ball"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Frostbitten Ball"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "FrostCore", 20); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "FrostCore", 20); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } } diff --git a/Items/FrostoneBar.cs b/Items/FrostoneBar.cs index 999c6f9a..23bf631a 100644 --- a/Items/FrostoneBar.cs +++ b/Items/FrostoneBar.cs @@ -4,40 +4,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class FrostoneBar : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class FrostoneBar : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 2000; - item.rare = 7; - item.createTile = mod.TileType("FrostoneBarTile"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 2000; + item.rare = 7; + item.createTile = mod.TileType("FrostoneBarTile"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Frostone Bar"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Frostone Bar"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "FrostoneOre", 2); - recipe.AddIngredient(ItemID.Ectoplasm, 1); - recipe.SetResult(this); - recipe.AddTile(133); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "FrostoneOre", 2); + recipe.AddIngredient(ItemID.Ectoplasm, 1); + recipe.SetResult(this); + recipe.AddTile(133); + recipe.AddRecipe(); + } + } +} diff --git a/Items/FrostoneOre.cs b/Items/FrostoneOre.cs index f3ff06a7..f3a52a7d 100644 --- a/Items/FrostoneOre.cs +++ b/Items/FrostoneOre.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class FrostoneOre : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class FrostoneOre : ModItem + { + public override void SetDefaults() + { - item.width = 16; - item.height = 16; - item.maxStack = 999; - item.useTurn = true; - item.autoReuse = true; - item.rare = 7; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.createTile = mod.TileType("FrostoneOreTile"); - } + item.width = 16; + item.height = 16; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.rare = 7; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.createTile = mod.TileType("FrostoneOreTile"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Frostone Ore"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Frostone Ore"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/FrostsparkStompers.cs b/Items/FrostsparkStompers.cs index 70b18fe5..8a667c41 100644 --- a/Items/FrostsparkStompers.cs +++ b/Items/FrostsparkStompers.cs @@ -5,46 +5,48 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class FrostsparkStompers : ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 26; - item.height = 20; - item.value = 110000; - item.rare = 3; - - - item.accessory = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Frostspark Stompers"); - Tooltip.SetDefault("Increases movement speed by 10% and increases knockback effect\nAllows flight, super fast running, and extra mobility on ice"); - } - - - public override void UpdateAccessory(Player player, bool hideVisual) - - { - player.kbBuff = true; - player.accRunSpeed = 6.75f; - player.rocketBoots = 3; - player.moveSpeed += 0.1f; - player.iceSkate = true; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(1862, 1); - recipe.AddIngredient(null, "RockStompers", 1); - recipe.SetResult(this); - recipe.AddTile(114); - recipe.AddRecipe(); - } -}} + public class FrostsparkStompers : ModItem + { + + public override void SetDefaults() + { + + item.width = 26; + item.height = 20; + item.value = 110000; + item.rare = 3; + + + item.accessory = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Frostspark Stompers"); + Tooltip.SetDefault("Increases movement speed by 10% and increases knockback effect\nAllows flight, super fast running, and extra mobility on ice"); + } + + + public override void UpdateAccessory(Player player, bool hideVisual) + + { + player.kbBuff = true; + player.accRunSpeed = 6.75f; + player.rocketBoots = 3; + player.moveSpeed += 0.1f; + player.iceSkate = true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(1862, 1); + recipe.AddIngredient(null, "RockStompers", 1); + recipe.SetResult(this); + recipe.AddTile(114); + recipe.AddRecipe(); + } + } +} diff --git a/Items/FrozenTurtleShield.cs b/Items/FrozenTurtleShield.cs index 2c16c7ac..dfbed06f 100644 --- a/Items/FrozenTurtleShield.cs +++ b/Items/FrozenTurtleShield.cs @@ -5,62 +5,64 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Shield)] -public class FrozenTurtleShield : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Shield)] + public class FrozenTurtleShield : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 24; - item.height = 24; - item.value = 123110; - item.rare = 8; + item.width = 24; + item.height = 24; + item.value = 123110; + item.rare = 8; - item.accessory = true; - } + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Frozen Turtle Shield"); - Tooltip.SetDefault("The less health, the more defense\nGrants 25% damage reduction"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Frozen Turtle Shield"); + Tooltip.SetDefault("The less health, the more defense\nGrants 25% damage reduction"); + } - public override void UpdateAccessory(Player player, bool hideVisual) + public override void UpdateAccessory(Player player, bool hideVisual) - { - if (player.statLife < 25) - { - player.statDefense += 10; - } - if (player.statLife < 50) - { - player.AddBuff(BuffID.IceBarrier, 2); - } - if (player.statLife < 100) - { - player.statDefense += 8; - } - if (player.statLife < 200) - { - player.statDefense += 6; - } - if (player.statLife < 300) - { - player.statDefense += 3; - } - } + { + if (player.statLife < 25) + { + player.statDefense += 10; + } + if (player.statLife < 50) + { + player.AddBuff(BuffID.IceBarrier, 2); + } + if (player.statLife < 100) + { + player.statDefense += 8; + } + if (player.statLife < 200) + { + player.statDefense += 6; + } + if (player.statLife < 300) + { + player.statDefense += 3; + } + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "TurtleShield", 1); - recipe.AddIngredient(ItemID.FrozenTurtleShell, 1); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "TurtleShield", 1); + recipe.AddIngredient(ItemID.FrozenTurtleShell, 1); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/FungalTome.cs b/Items/FungalTome.cs index d769f5a2..1e902b37 100644 --- a/Items/FungalTome.cs +++ b/Items/FungalTome.cs @@ -5,45 +5,46 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class FungalTome : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class FungalTome : ModItem + { + public override void SetDefaults() + { - item.damage = 24; - item.melee = false; - item.magic = true; - item.width = 50; - item.height = 55; - item.useTime = 15; - item.mana = 7; - item.useAnimation = 15; - item.useStyle = 5; - item.shoot = 131; - item.shootSpeed = 20f; - item.knockBack = 4; - item.value = 50000; - item.rare = 3; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 24; + item.melee = false; + item.magic = true; + item.width = 50; + item.height = 55; + item.useTime = 15; + item.mana = 7; + item.useAnimation = 15; + item.useStyle = 5; + item.shoot = 131; + item.shootSpeed = 20f; + item.knockBack = 4; + item.value = 50000; + item.rare = 3; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Fungal Tome"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Fungal Tome"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Book, 1); - recipe.AddIngredient(ItemID.GlowingMushroom, 15); - recipe.SetResult(this); - recipe.AddTile(null, "MagicWorkbenchTile"); - recipe.AddRecipe(); - } -} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Book, 1); + recipe.AddIngredient(ItemID.GlowingMushroom, 15); + recipe.SetResult(this); + recipe.AddTile(null, "MagicWorkbenchTile"); + recipe.AddRecipe(); + } + } } diff --git a/Items/FungusBeetleBag.cs b/Items/FungusBeetleBag.cs index 7e5ca2e8..afed698b 100644 --- a/Items/FungusBeetleBag.cs +++ b/Items/FungusBeetleBag.cs @@ -4,43 +4,45 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class FungusBeetleBag : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.maxStack = 999; - item.consumable = true; - item.width = 24; - item.height = 24; - - item.rare = 9; - item.expert = true; - bossBagNPC = mod.NPCType("FungusBeetle"); - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Treasure Bag"); - Tooltip.SetDefault("Right click to open"); - } - - - public override bool CanRightClick() - { - return true; - } - - public override void OpenBossBag(Player player) - { - if(Main.rand.Next(7) == 0) - { - player.QuickSpawnItem(mod.ItemType("FungusBeetleMask")); - } - player.TryGettingDevArmor(); - player.QuickSpawnItem(mod.ItemType("GoldenGlowingRing")); - player.QuickSpawnItem(mod.ItemType("FungusElement"), Main.rand.Next(10,32)); - } - -}} + public class FungusBeetleBag : ModItem + { + public override void SetDefaults() + { + + item.maxStack = 999; + item.consumable = true; + item.width = 24; + item.height = 24; + + item.rare = 9; + item.expert = true; + bossBagNPC = mod.NPCType("FungusBeetle"); + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Treasure Bag"); + Tooltip.SetDefault("Right click to open"); + } + + + public override bool CanRightClick() + { + return true; + } + + public override void OpenBossBag(Player player) + { + if (Main.rand.Next(7) == 0) + { + player.QuickSpawnItem(mod.ItemType("FungusBeetleMask")); + } + player.TryGettingDevArmor(); + player.QuickSpawnItem(mod.ItemType("GoldenGlowingRing")); + player.QuickSpawnItem(mod.ItemType("FungusElement"), Main.rand.Next(10, 32)); + } + + } +} diff --git a/Items/FungusBeetleMask.cs b/Items/FungusBeetleMask.cs index a14164e6..fedbead0 100644 --- a/Items/FungusBeetleMask.cs +++ b/Items/FungusBeetleMask.cs @@ -4,25 +4,28 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class FungusBeetleMask : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class FungusBeetleMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 20; - item.height = 24; - item.rare = 1; - item.vanity = true; - } + item.width = 20; + item.height = 24; + item.rare = 1; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Fungus Beetle Mask"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Fungus Beetle Mask"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/FungusBeetleTrophy.cs b/Items/FungusBeetleTrophy.cs index 2571d2eb..f31203a3 100644 --- a/Items/FungusBeetleTrophy.cs +++ b/Items/FungusBeetleTrophy.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class FungusBeetleTrophy : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class FungusBeetleTrophy : ModItem + { + public override void SetDefaults() + { - item.width = 32; - item.height = 32; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 50000; - item.createTile = mod.TileType("FungusBeetleTrophy"); - item.placeStyle = 0; - } + item.width = 32; + item.height = 32; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 50000; + item.createTile = mod.TileType("FungusBeetleTrophy"); + item.placeStyle = 0; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Fungus Beetle Trophy"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Fungus Beetle Trophy"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/FungusBreastplate.cs b/Items/FungusBreastplate.cs index 55997534..981f76c9 100644 --- a/Items/FungusBreastplate.cs +++ b/Items/FungusBreastplate.cs @@ -6,8 +6,8 @@ using Terraria.ModLoader; namespace Tremor.Items -{ -[AutoloadEquip(EquipType.Body)] +{ + [AutoloadEquip(EquipType.Body)] public class FungusBreastplate : ModItem { @@ -22,40 +22,40 @@ public override void SetDefaults() item.defense = 8; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Fungus Breastplate"); - Tooltip.SetDefault("13% increased all damage"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Fungus Breastplate"); + Tooltip.SetDefault("13% increased all damage"); + } public override void UpdateEquip(Player player) { - player.meleeDamage += 0.13f; - player.magicDamage += 0.13f; - player.rangedDamage += 0.13f; - player.thrownDamage += 0.13f; - player.minionDamage += 0.13f; - player.GetModPlayer(mod).alchemistDamage += 0.13f; + player.meleeDamage += 0.13f; + player.magicDamage += 0.13f; + player.rangedDamage += 0.13f; + player.thrownDamage += 0.13f; + player.minionDamage += 0.13f; + player.GetModPlayer(mod).alchemistDamage += 0.13f; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "FungusElement", 18); - recipe.AddIngredient(ItemID.GlowingMushroom, 15); - recipe.AddIngredient(ItemID.GoldChainmail, 1); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - - recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "FungusElement", 18); - recipe.AddIngredient(ItemID.GlowingMushroom, 15); - recipe.AddIngredient(ItemID.PlatinumChainmail, 1); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "FungusElement", 18); + recipe.AddIngredient(ItemID.GlowingMushroom, 15); + recipe.AddIngredient(ItemID.GoldChainmail, 1); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + + recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "FungusElement", 18); + recipe.AddIngredient(ItemID.GlowingMushroom, 15); + recipe.AddIngredient(ItemID.PlatinumChainmail, 1); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } } } diff --git a/Items/FungusBroadsword.cs b/Items/FungusBroadsword.cs index 1aeb9695..7de01c6d 100644 --- a/Items/FungusBroadsword.cs +++ b/Items/FungusBroadsword.cs @@ -5,32 +5,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class FungusBroadsword : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.rare = 3; - item.UseSound = SoundID.Item1; + public class FungusBroadsword : ModItem + { + public override void SetDefaults() + { + item.rare = 3; + item.UseSound = SoundID.Item1; - item.useStyle = 1; - item.damage = 26; - item.useAnimation = 19; - item.useTime = 19; - item.width = 84; - item.height = 84; - item.shoot = 131; - item.shootSpeed = 15f; - item.knockBack = 3f; - item.melee = true; - item.value = Item.sellPrice(0, 0, 5, 0); - item.autoReuse = true; - } + item.useStyle = 1; + item.damage = 26; + item.useAnimation = 19; + item.useTime = 19; + item.width = 84; + item.height = 84; + item.shoot = 131; + item.shootSpeed = 15f; + item.knockBack = 3f; + item.melee = true; + item.value = Item.sellPrice(0, 0, 5, 0); + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Fungus Broadsword"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Fungus Broadsword"); + } public override void AddRecipes() @@ -43,7 +44,7 @@ public override void AddRecipes() recipe.SetResult(this); recipe.AddRecipe(); - recipe = new ModRecipe(mod); + recipe = new ModRecipe(mod); recipe.AddIngredient(null, "FungusElement", 12); recipe.AddIngredient(ItemID.GlowingMushroom, 9); recipe.AddIngredient(ItemID.PlatinumBroadsword, 1); @@ -51,4 +52,5 @@ public override void AddRecipes() recipe.SetResult(this); recipe.AddRecipe(); } -}} + } +} diff --git a/Items/FungusElement.cs b/Items/FungusElement.cs index 1de9f3c8..816c9ced 100644 --- a/Items/FungusElement.cs +++ b/Items/FungusElement.cs @@ -4,24 +4,26 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { -public class FungusElement : ModItem +namespace Tremor.Items { + public class FungusElement : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 14; - item.height = 22; - item.rare = 3; - item.maxStack = 999; - item.value = 100; - } + item.width = 14; + item.height = 22; + item.rare = 3; + item.maxStack = 999; + item.value = 100; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Fungus Element"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Fungus Element"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/FungusGreaves.cs b/Items/FungusGreaves.cs index 818ce989..d20e7979 100644 --- a/Items/FungusGreaves.cs +++ b/Items/FungusGreaves.cs @@ -5,7 +5,9 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] +namespace Tremor.Items +{ + [AutoloadEquip(EquipType.Legs)] public class FungusGreaves : ModItem { @@ -20,34 +22,34 @@ public override void SetDefaults() item.defense = 7; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Fungus Greaves"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Fungus Greaves"); + Tooltip.SetDefault(""); + } public override void UpdateEquip(Player player) { } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "FungusElement", 14); - recipe.AddIngredient(ItemID.GlowingMushroom, 12); - recipe.AddIngredient(ItemID.GoldGreaves, 1); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - - recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "FungusElement", 14); - recipe.AddIngredient(ItemID.GlowingMushroom, 12); - recipe.AddIngredient(ItemID.PlatinumGreaves, 1); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "FungusElement", 14); + recipe.AddIngredient(ItemID.GlowingMushroom, 12); + recipe.AddIngredient(ItemID.GoldGreaves, 1); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + + recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "FungusElement", 14); + recipe.AddIngredient(ItemID.GlowingMushroom, 12); + recipe.AddIngredient(ItemID.PlatinumGreaves, 1); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } } } diff --git a/Items/FungusHamaxe.cs b/Items/FungusHamaxe.cs index 1576dbc2..d9bd56df 100644 --- a/Items/FungusHamaxe.cs +++ b/Items/FungusHamaxe.cs @@ -4,33 +4,34 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class FungusHamaxe : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class FungusHamaxe : ModItem + { + public override void SetDefaults() + { - item.damage = 16; - item.melee = true; - item.width = 32; - item.height = 32; - item.useTime = 22; - item.useAnimation = 18; - item.axe = 13; - item.hammer = 75; - item.useStyle = 1; - item.knockBack = 2; - item.value = 1000; - item.rare = 3; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 16; + item.melee = true; + item.width = 32; + item.height = 32; + item.useTime = 22; + item.useAnimation = 18; + item.axe = 13; + item.hammer = 75; + item.useStyle = 1; + item.knockBack = 2; + item.value = 1000; + item.rare = 3; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Fungus Hamaxe"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Fungus Hamaxe"); + Tooltip.SetDefault(""); + } public override void AddRecipes() @@ -44,7 +45,7 @@ public override void AddRecipes() recipe.SetResult(this); recipe.AddRecipe(); - recipe = new ModRecipe(mod); + recipe = new ModRecipe(mod); recipe.AddIngredient(null, "FungusElement", 11); recipe.AddIngredient(ItemID.GlowingMushroom, 8); recipe.AddIngredient(ItemID.PlatinumAxe, 1); @@ -53,4 +54,5 @@ public override void AddRecipes() recipe.SetResult(this); recipe.AddRecipe(); } -}} + } +} diff --git a/Items/FungusHelmet.cs b/Items/FungusHelmet.cs index 4e9af8e1..89a7326b 100644 --- a/Items/FungusHelmet.cs +++ b/Items/FungusHelmet.cs @@ -7,7 +7,7 @@ namespace Tremor.Items { -[AutoloadEquip(EquipType.Head)] + [AutoloadEquip(EquipType.Head)] public class FungusHelmet : ModItem { @@ -22,11 +22,11 @@ public override void SetDefaults() item.defense = 7; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Fungus Helmet"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Fungus Helmet"); + Tooltip.SetDefault(""); + } public override void UpdateEquip(Player player) @@ -38,36 +38,36 @@ public override bool IsArmorSet(Item head, Item body, Item legs) return body.type == mod.ItemType("FungusBreastplate") && legs.type == mod.ItemType("FungusGreaves"); } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increases maximum health by 25 and grants Nature's Blessing"; - player.statLifeMax2 += 25; - player.AddBuff(165, 2); - } - + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increases maximum health by 25 and grants Nature's Blessing"; + player.statLifeMax2 += 25; + player.AddBuff(165, 2); + } + public override void ArmorSetShadows(Player player) { player.armorEffectDrawOutlines = true; //�।��� ����஢���� player.armorEffectDrawShadowLokis = true; //�����쪨� ⥭� } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "FungusElement", 16); - recipe.AddIngredient(ItemID.GlowingMushroom, 14); - recipe.AddIngredient(ItemID.GoldHelmet, 1); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "FungusElement", 16); + recipe.AddIngredient(ItemID.GlowingMushroom, 14); + recipe.AddIngredient(ItemID.GoldHelmet, 1); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "FungusElement", 16); - recipe.AddIngredient(ItemID.GlowingMushroom, 14); - recipe.AddIngredient(ItemID.PlatinumHelmet, 1); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } + recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "FungusElement", 16); + recipe.AddIngredient(ItemID.GlowingMushroom, 14); + recipe.AddIngredient(ItemID.PlatinumHelmet, 1); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } } } diff --git a/Items/FungusPickaxe.cs b/Items/FungusPickaxe.cs index 7e00e543..de394883 100644 --- a/Items/FungusPickaxe.cs +++ b/Items/FungusPickaxe.cs @@ -4,32 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class FungusPickaxe : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class FungusPickaxe : ModItem + { + public override void SetDefaults() + { - item.damage = 10; - item.melee = true; - item.width = 32; - item.height = 32; - item.useTime = 15; - item.useAnimation = 20; - item.pick = 85; - item.useStyle = 1; - item.knockBack = 2; - item.value = 1000; - item.rare = 3; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 10; + item.melee = true; + item.width = 32; + item.height = 32; + item.useTime = 15; + item.useAnimation = 20; + item.pick = 85; + item.useStyle = 1; + item.knockBack = 2; + item.value = 1000; + item.rare = 3; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Fungus Pickaxe"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Fungus Pickaxe"); + Tooltip.SetDefault(""); + } public override void AddRecipes() @@ -42,7 +43,7 @@ public override void AddRecipes() recipe.SetResult(this); recipe.AddRecipe(); - recipe = new ModRecipe(mod); + recipe = new ModRecipe(mod); recipe.AddIngredient(null, "FungusElement", 13); recipe.AddIngredient(ItemID.GlowingMushroom, 10); recipe.AddIngredient(ItemID.PlatinumPickaxe, 1); @@ -50,4 +51,5 @@ public override void AddRecipes() recipe.SetResult(this); recipe.AddRecipe(); } -}} + } +} diff --git a/Items/FungusSpear.cs b/Items/FungusSpear.cs index 358662ab..9ba181d7 100644 --- a/Items/FungusSpear.cs +++ b/Items/FungusSpear.cs @@ -4,53 +4,55 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class FungusSpear : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class FungusSpear : ModItem + { + public override void SetDefaults() + { - item.damage = 23; - item.width = 54; - item.height = 54; - item.noUseGraphic = true; - item.melee = true; - item.useTime = 30; - item.shoot = mod.ProjectileType("FungusSpear"); - item.shootSpeed = 3f; - item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 3; - item.value = 1000; - item.rare = 0; - item.UseSound = SoundID.Item1; - item.autoReuse = false; + item.damage = 23; + item.width = 54; + item.height = 54; + item.noUseGraphic = true; + item.melee = true; + item.useTime = 30; + item.shoot = mod.ProjectileType("FungusSpear"); + item.shootSpeed = 3f; + item.useAnimation = 30; + item.useStyle = 5; + item.knockBack = 3; + item.value = 1000; + item.rare = 0; + item.UseSound = SoundID.Item1; + item.autoReuse = false; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Fungus Spear"); - Tooltip.SetDefault("Has a chance to inflict confusion on enemies"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Fungus Spear"); + Tooltip.SetDefault("Has a chance to inflict confusion on enemies"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "FungusElement", 11); - recipe.AddIngredient(ItemID.GlowingMushroom, 10); - recipe.AddIngredient(null, "GoldSpear", 1); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "FungusElement", 11); + recipe.AddIngredient(ItemID.GlowingMushroom, 10); + recipe.AddIngredient(null, "GoldSpear", 1); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "FungusElement", 11); - recipe.AddIngredient(ItemID.GlowingMushroom, 10); - recipe.AddIngredient(null, "PlatinumSpear", 1); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "FungusElement", 11); + recipe.AddIngredient(ItemID.GlowingMushroom, 10); + recipe.AddIngredient(null, "PlatinumSpear", 1); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/FurCoat.cs b/Items/FurCoat.cs index 55094803..806a26d3 100644 --- a/Items/FurCoat.cs +++ b/Items/FurCoat.cs @@ -5,24 +5,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class FurCoat : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Body)] + public class FurCoat : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 30; - item.height = 34; - item.value = 600; - item.rare = 1; - } + item.width = 30; + item.height = 34; + item.value = 600; + item.rare = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Fur Coat"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Fur Coat"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/FurHat.cs b/Items/FurHat.cs index def43dab..efd89766 100644 --- a/Items/FurHat.cs +++ b/Items/FurHat.cs @@ -4,26 +4,29 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class FurHat : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class FurHat : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 20; - item.height = 22; - item.value = 10000; - item.rare = 2; - item.vanity = true; - } + item.width = 20; + item.height = 22; + item.value = 10000; + item.rare = 2; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Fur Hat"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Fur Hat"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/Galaxon.cs b/Items/Galaxon.cs index 84197669..f7f17d29 100644 --- a/Items/Galaxon.cs +++ b/Items/Galaxon.cs @@ -19,7 +19,7 @@ public override void SetDefaults() item.height = 30; item.useTime = 40; item.useAnimation = 40; - item.shoot = 632; //645 + item.shoot = 632; //645 item.useStyle = 5; item.noMelee = true; item.knockBack = 4f; @@ -31,84 +31,84 @@ public override void SetDefaults() item.shootSpeed = 25f; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Galaxon"); - Tooltip.SetDefault("Shoots a cosmic beam"); - } - - - public override void ModifyTooltips(System.Collections.Generic.List tooltips) - { - tooltips[0].overrideColor = new Color(238, 194, 73); - } - - - public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - int i = Main.myPlayer; - float num72 = item.shootSpeed; - int num73 = item.damage; - float num74 = item.knockBack; - num74 = player.GetWeaponKnockback(item, num74); - player.itemTime = item.useTime; - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default(Vector2)); - Vector2 vector3 = Main.MouseWorld - vector2; - float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (player.gravDir == -1f) - { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; - } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - float num81 = num80; - if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) - { - num78 = (float)player.direction; - num79 = 0f; - num80 = num72; - } - else - { - num80 = num72 / num80; - } - num78 *= num80; - num79 *= num80; - int num146 = 4; - if (Main.rand.Next(2) == 0) - { - num146++; - } - if (Main.rand.Next(4) == 0) - { - num146++; - } - if (Main.rand.Next(8) == 0) + public override void SetStaticDefaults() { - num146++; + DisplayName.SetDefault("Galaxon"); + Tooltip.SetDefault("Shoots a cosmic beam"); } - if (Main.rand.Next(16) == 0) + + + public override void ModifyTooltips(System.Collections.Generic.List tooltips) { - num146++; + tooltips[0].overrideColor = new Color(238, 194, 73); } - for (int num147 = 0; num147 < num146; num147++) + + + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - float num148 = num78; - float num149 = num79; - float num150 = 0.05f * (float)num147; - num148 += (float)Main.rand.Next(-35, 36) * num150; - num149 += (float)Main.rand.Next(-35, 36) * num150; - num80 = (float)Math.Sqrt((double)(num148 * num148 + num149 * num149)); - num80 = num72 / num80; - num148 *= num80; - num149 *= num80; - float x4 = vector2.X; - float y4 = vector2.Y; - Projectile.NewProjectile(x4, y4, num148, num149, mod.ProjectileType("GalaxonPro"), num73, num74, i, 0f, 0f); + int i = Main.myPlayer; + float num72 = item.shootSpeed; + int num73 = item.damage; + float num74 = item.knockBack; + num74 = player.GetWeaponKnockback(item, num74); + player.itemTime = item.useTime; + Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); + Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default(Vector2)); + Vector2 vector3 = Main.MouseWorld - vector2; + float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (player.gravDir == -1f) + { + num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + } + float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + float num81 = num80; + if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) + { + num78 = (float)player.direction; + num79 = 0f; + num80 = num72; + } + else + { + num80 = num72 / num80; + } + num78 *= num80; + num79 *= num80; + int num146 = 4; + if (Main.rand.Next(2) == 0) + { + num146++; + } + if (Main.rand.Next(4) == 0) + { + num146++; + } + if (Main.rand.Next(8) == 0) + { + num146++; + } + if (Main.rand.Next(16) == 0) + { + num146++; + } + for (int num147 = 0; num147 < num146; num147++) + { + float num148 = num78; + float num149 = num79; + float num150 = 0.05f * (float)num147; + num148 += (float)Main.rand.Next(-35, 36) * num150; + num149 += (float)Main.rand.Next(-35, 36) * num150; + num80 = (float)Math.Sqrt((double)(num148 * num148 + num149 * num149)); + num80 = num72 / num80; + num148 *= num80; + num149 *= num80; + float x4 = vector2.X; + float y4 = vector2.Y; + Projectile.NewProjectile(x4, y4, num148, num149, mod.ProjectileType("GalaxonPro"), num73, num74, i, 0f, 0f); + } + return false; } - return false; - } public override Vector2? HoldoutOffset() { @@ -116,17 +116,17 @@ public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 po } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "NightmareBar", 16); - recipe.AddIngredient(null, "CollapsiumBar", 16); - recipe.AddIngredient(null, "Blasticyde", 16); - recipe.AddIngredient(null, "HuskofDusk", 16); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "NightmareBar", 16); + recipe.AddIngredient(null, "CollapsiumBar", 16); + recipe.AddIngredient(null, "Blasticyde", 16); + recipe.AddIngredient(null, "HuskofDusk", 16); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } } } diff --git a/Items/GarnetGlove.cs b/Items/GarnetGlove.cs index f2c012ef..a3bc8118 100644 --- a/Items/GarnetGlove.cs +++ b/Items/GarnetGlove.cs @@ -5,46 +5,48 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class GarnetGlove : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class GarnetGlove : ModItem + { + public override void SetDefaults() + { - item.damage = 26; - item.thrown = true; - item.width = 40; - item.height = 20; - item.noUseGraphic = true; - item.useTime = 30; + item.damage = 26; + item.thrown = true; + item.width = 40; + item.height = 20; + item.noUseGraphic = true; + item.useTime = 30; - item.useAnimation = 20; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 6; - item.value = 10000; - item.rare = 3; - item.UseSound = SoundID.Item45; - item.autoReuse = false; - item.shoot = mod.ProjectileType("GarnetGlovePro"); - item.shootSpeed = 9f; - } + item.useAnimation = 20; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 6; + item.value = 10000; + item.rare = 3; + item.UseSound = SoundID.Item45; + item.autoReuse = false; + item.shoot = mod.ProjectileType("GarnetGlovePro"); + item.shootSpeed = 9f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Garnet Glove"); - Tooltip.SetDefault("'Made of love'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Garnet Glove"); + Tooltip.SetDefault("'Made of love'"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.MeteoriteBar, 15); - recipe.AddIngredient(ItemID.Ruby, 13); - recipe.AddIngredient(ItemID.Sapphire, 13); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.MeteoriteBar, 15); + recipe.AddIngredient(ItemID.Ruby, 13); + recipe.AddIngredient(ItemID.Sapphire, 13); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/GehennaStaff.cs b/Items/GehennaStaff.cs index 16d0862a..94b3d890 100644 --- a/Items/GehennaStaff.cs +++ b/Items/GehennaStaff.cs @@ -5,36 +5,37 @@ using Terraria.ID; using Microsoft.Xna.Framework; -namespace Tremor.Items { -public class GehennaStaff : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class GehennaStaff : ModItem + { + public override void SetDefaults() + { - item.damage = 455; - item.magic = true; - item.mana = 15; - item.width = 46; - item.height = 48; - item.useTime = 45; - item.useAnimation = 45; - item.useStyle = 1; - item.knockBack = 3; - item.shoot = mod.ProjectileType("InfernoRift"); - item.shootSpeed = 12f; - item.value = 600000; - item.rare = 0; - item.UseSound = SoundID.Item44; - item.autoReuse = false; - item.useTurn = false; + item.damage = 455; + item.magic = true; + item.mana = 15; + item.width = 46; + item.height = 48; + item.useTime = 45; + item.useAnimation = 45; + item.useStyle = 1; + item.knockBack = 3; + item.shoot = mod.ProjectileType("InfernoRift"); + item.shootSpeed = 12f; + item.value = 600000; + item.rare = 0; + item.UseSound = SoundID.Item44; + item.autoReuse = false; + item.useTurn = false; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gehenna Staff"); - Tooltip.SetDefault("Summons a controllable inferno rift that rapidly shoots molten bolts at nearby enemies"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gehenna Staff"); + Tooltip.SetDefault("Summons a controllable inferno rift that rapidly shoots molten bolts at nearby enemies"); + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) @@ -47,4 +48,5 @@ public override void ModifyTooltips(System.Collections.Generic.List { tooltips[0].overrideColor = new Color(238, 194, 73); } -}} + } +} diff --git a/Items/GelCube.cs b/Items/GelCube.cs index 427793f6..ea8a3612 100644 --- a/Items/GelCube.cs +++ b/Items/GelCube.cs @@ -4,35 +4,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class GelCube : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 60; - item.rare = 1; - - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gel Cube"); - Tooltip.SetDefault("Alchemically important ingredient"); - } - - - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Gel, 5); - recipe.SetResult(this); - recipe.AddTile(13); - recipe.AddRecipe(); - } - -}} + public class GelCube : ModItem + { + public override void SetDefaults() + { + + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 60; + item.rare = 1; + + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gel Cube"); + Tooltip.SetDefault("Alchemically important ingredient"); + } + + + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Gel, 5); + recipe.SetResult(this); + recipe.AddTile(13); + recipe.AddRecipe(); + } + + } +} diff --git a/Items/GeneralSnowmanBanner.cs b/Items/GeneralSnowmanBanner.cs index 9989f401..ee883ada 100644 --- a/Items/GeneralSnowmanBanner.cs +++ b/Items/GeneralSnowmanBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class GeneralSnowmanBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class GeneralSnowmanBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 63; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 63; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("General Snowman Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("General Snowman Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/GenieLamp.cs b/Items/GenieLamp.cs index ae4201a4..adc53afc 100644 --- a/Items/GenieLamp.cs +++ b/Items/GenieLamp.cs @@ -4,37 +4,37 @@ namespace Tremor.Items { - public class GenieLamp : ModItem - { - public override void SetDefaults() - { + public class GenieLamp : ModItem + { + public override void SetDefaults() + { - item.width = 38; - item.height = 20; - item.useTime = 20; - item.useAnimation = 20; - item.useStyle = 4; - item.value = 40000; - item.rare = 2; - item.UseSound = SoundID.Item8; - item.autoReuse = false; - } + item.width = 38; + item.height = 20; + item.useTime = 20; + item.useAnimation = 20; + item.useStyle = 4; + item.value = 40000; + item.rare = 2; + item.UseSound = SoundID.Item8; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Genie Lamp"); - Tooltip.SetDefault("Summons a Genie"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Genie Lamp"); + Tooltip.SetDefault("Summons a Genie"); + } - public override bool UseItem(Player player) - { - player.AddBuff(mod.BuffType("petGenie"), 2); - for (int i = 0; i < Main.projectile.Length; i++) - if (Main.projectile[i].type == mod.ProjectileType("projGenie") && Main.projectile[i].owner == item.owner) - Main.projectile[i].Center = Main.player[item.owner].Center; - return true; - } - } + public override bool UseItem(Player player) + { + player.AddBuff(mod.BuffType("petGenie"), 2); + for (int i = 0; i < Main.projectile.Length; i++) + if (Main.projectile[i].type == mod.ProjectileType("projGenie") && Main.projectile[i].owner == item.owner) + Main.projectile[i].Center = Main.player[item.owner].Center; + return true; + } + } } diff --git a/Items/GhostKnightBanner.cs b/Items/GhostKnightBanner.cs index 8bb3de51..5b494fd3 100644 --- a/Items/GhostKnightBanner.cs +++ b/Items/GhostKnightBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class GhostKnightBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class GhostKnightBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 64; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 64; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ghost Knight Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ghost Knight Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/GhostlyHowl.cs b/Items/GhostlyHowl.cs index 2b6f5107..feb4d65c 100644 --- a/Items/GhostlyHowl.cs +++ b/Items/GhostlyHowl.cs @@ -5,114 +5,116 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class GhostlyHowl : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.damage = 260; - item.width = 18; - item.height = 56; - item.ranged = true; - item.useTime = 30; - item.shoot = 1; - item.shootSpeed = 12f; - - item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 5; - item.value = 25000; - item.useAmmo = AmmoID.Arrow; - item.rare = 11; - item.UseSound = SoundID.Item5; - item.autoReuse = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ghostly Howl"); - Tooltip.SetDefault("Shoots the ghostly arrows"); - } + public class GhostlyHowl : ModItem + { + public override void SetDefaults() + { + item.damage = 260; + item.width = 18; + item.height = 56; + item.ranged = true; + item.useTime = 30; + item.shoot = 1; + item.shootSpeed = 12f; - - public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - int i = Main.myPlayer; - float num72 = item.shootSpeed; - int num73 = item.damage; - float num74 = item.knockBack; - num74 = player.GetWeaponKnockback(item, num74); - player.itemTime = item.useTime; - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default(Vector2)); - Vector2 vector3 = Main.MouseWorld - vector2; - float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (player.gravDir == -1f) - { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + item.useAnimation = 30; + item.useStyle = 5; + item.knockBack = 5; + item.value = 25000; + item.useAmmo = AmmoID.Arrow; + item.rare = 11; + item.UseSound = SoundID.Item5; + item.autoReuse = true; } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - float num81 = num80; - if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) - { - num78 = (float)player.direction; - num79 = 0f; - num80 = num72; - } - else - { - num80 = num72 / num80; - } - num78 *= num80; - num79 *= num80; - int num146 = 4; - if (Main.rand.Next(2) == 0) - { - num146++; - } - if (Main.rand.Next(4) == 0) - { - num146++; - } - if (Main.rand.Next(8) == 0) + + public override void SetStaticDefaults() { - num146++; + DisplayName.SetDefault("Ghostly Howl"); + Tooltip.SetDefault("Shoots the ghostly arrows"); } - if (Main.rand.Next(16) == 0) + + + + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - num146++; + int i = Main.myPlayer; + float num72 = item.shootSpeed; + int num73 = item.damage; + float num74 = item.knockBack; + num74 = player.GetWeaponKnockback(item, num74); + player.itemTime = item.useTime; + Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); + Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default(Vector2)); + Vector2 vector3 = Main.MouseWorld - vector2; + float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (player.gravDir == -1f) + { + num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + } + float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + float num81 = num80; + if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) + { + num78 = (float)player.direction; + num79 = 0f; + num80 = num72; + } + else + { + num80 = num72 / num80; + } + num78 *= num80; + num79 *= num80; + int num146 = 4; + if (Main.rand.Next(2) == 0) + { + num146++; + } + if (Main.rand.Next(4) == 0) + { + num146++; + } + if (Main.rand.Next(8) == 0) + { + num146++; + } + if (Main.rand.Next(16) == 0) + { + num146++; + } + for (int num147 = 0; num147 < num146; num147++) + { + float num148 = num78; + float num149 = num79; + float num150 = 0.05f * (float)num147; + num148 += (float)Main.rand.Next(-35, 36) * num150; + num149 += (float)Main.rand.Next(-35, 36) * num150; + num80 = (float)Math.Sqrt((double)(num148 * num148 + num149 * num149)); + num80 = num72 / num80; + num148 *= num80; + num149 *= num80; + float x4 = vector2.X; + float y4 = vector2.Y; + Projectile.NewProjectile(x4, y4, num148, num149, mod.ProjectileType("GhostlyArrow"), num73, num74, i, 0f, 0f); + } + return false; } - for (int num147 = 0; num147 < num146; num147++) + + public override void AddRecipes() { - float num148 = num78; - float num149 = num79; - float num150 = 0.05f * (float)num147; - num148 += (float)Main.rand.Next(-35, 36) * num150; - num149 += (float)Main.rand.Next(-35, 36) * num150; - num80 = (float)Math.Sqrt((double)(num148 * num148 + num149 * num149)); - num80 = num72 / num80; - num148 *= num80; - num149 *= num80; - float x4 = vector2.X; - float y4 = vector2.Y; - Projectile.NewProjectile(x4, y4, num148, num149, mod.ProjectileType("GhostlyArrow"), num73, num74, i, 0f, 0f); + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(3467, 10); + recipe.AddIngredient(null, "VoidBar", 10); + recipe.AddIngredient(null, "Catalyst", 15); + recipe.AddIngredient(null, "PhantomSoul", 50); + recipe.AddIngredient(null, "TearsofDeath", 8); + recipe.AddTile(412); + recipe.SetResult(this); + recipe.AddRecipe(); } - return false; } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(3467, 10); - recipe.AddIngredient(null, "VoidBar", 10); - recipe.AddIngredient(null, "Catalyst", 15); - recipe.AddIngredient(null, "PhantomSoul", 50); - recipe.AddIngredient(null, "TearsofDeath", 8); - recipe.AddTile(412); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} +} diff --git a/Items/GiantCrabBanner.cs b/Items/GiantCrabBanner.cs index bc8a6712..127c7375 100644 --- a/Items/GiantCrabBanner.cs +++ b/Items/GiantCrabBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class GiantCrabBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class GiantCrabBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 32; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 32; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Giant Crab Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Giant Crab Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/GiantCricketBanner.cs b/Items/GiantCricketBanner.cs index 2941cef6..bab33b86 100644 --- a/Items/GiantCricketBanner.cs +++ b/Items/GiantCricketBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class GiantCricketBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class GiantCricketBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 101; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 101; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Giant Cricket Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Giant Cricket Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/GiantGastropodBanner.cs b/Items/GiantGastropodBanner.cs index ac1a90f3..4d9f119c 100644 --- a/Items/GiantGastropodBanner.cs +++ b/Items/GiantGastropodBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class GiantGastropodBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class GiantGastropodBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 65; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 65; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Giant Gastropod Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Giant Gastropod Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/GiantMeteorHeadBanner.cs b/Items/GiantMeteorHeadBanner.cs index 7a55eb1f..3bdf48d1 100644 --- a/Items/GiantMeteorHeadBanner.cs +++ b/Items/GiantMeteorHeadBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class GiantMeteorHeadBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class GiantMeteorHeadBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 66; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 66; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Giant Meteor Head Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Giant Meteor Head Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/GiantShell.cs b/Items/GiantShell.cs index 2d41e944..60bf663a 100644 --- a/Items/GiantShell.cs +++ b/Items/GiantShell.cs @@ -4,24 +4,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class GiantShell : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class GiantShell : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 25000; - item.rare = 8; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 25000; + item.rare = 8; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Giant Shell"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Giant Shell"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/GlassDoor.cs b/Items/GlassDoor.cs index a8181275..9600c432 100644 --- a/Items/GlassDoor.cs +++ b/Items/GlassDoor.cs @@ -4,7 +4,8 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { +namespace Tremor.Items +{ public class GlassDoor : ModItem { @@ -23,20 +24,20 @@ public override void SetDefaults() item.createTile = mod.TileType("GlassDoorClosed"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Glass Door"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Glass Door"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Wood, 4); - recipe.AddIngredient(ItemID.Glass, 3); - recipe.SetResult(this); - recipe.AddTile(106); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Wood, 4); + recipe.AddIngredient(ItemID.Glass, 3); + recipe.SetResult(this); + recipe.AddTile(106); + recipe.AddRecipe(); + } } } diff --git a/Items/GlassFish.cs b/Items/GlassFish.cs index 4ec75ce0..e77ba642 100644 --- a/Items/GlassFish.cs +++ b/Items/GlassFish.cs @@ -21,11 +21,11 @@ public override void SetDefaults() item.rare = -11; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Glass Fish"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Glass Fish"); + Tooltip.SetDefault(""); + } public override bool IsQuestFish() diff --git a/Items/GlassPotion.cs b/Items/GlassPotion.cs index ea3fbdfd..9116b5cc 100644 --- a/Items/GlassPotion.cs +++ b/Items/GlassPotion.cs @@ -3,47 +3,49 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class GlassPotion : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.width = 38; - item.height = 32; - item.maxStack = 20; - - item.rare = 11; - item.useAnimation = 15; - item.useTime = 15; - item.useStyle = 2; - item.UseSound = SoundID.Item3; - item.consumable = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Glass Potion"); - Tooltip.SetDefault("Increases all damage by three times but reduces defense to zero"); - } - - - public override bool UseItem(Player player) - { - player.AddBuff(mod.BuffType("FragileCondition"), 14400); - return true; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.BottledWater, 1); - recipe.AddIngredient(null, "AtisBlood", 1); - recipe.AddIngredient(null, "AlienTongue", 1); - recipe.AddIngredient(null, "SpiderMeat", 1); - recipe.AddTile(null, "AlchemyStationTile"); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + + public class GlassPotion : ModItem + { + public override void SetDefaults() + { + + item.width = 38; + item.height = 32; + item.maxStack = 20; + + item.rare = 11; + item.useAnimation = 15; + item.useTime = 15; + item.useStyle = 2; + item.UseSound = SoundID.Item3; + item.consumable = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Glass Potion"); + Tooltip.SetDefault("Increases all damage by three times but reduces defense to zero"); + } + + + public override bool UseItem(Player player) + { + player.AddBuff(mod.BuffType("FragileCondition"), 14400); + return true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.BottledWater, 1); + recipe.AddIngredient(null, "AtisBlood", 1); + recipe.AddIngredient(null, "AlienTongue", 1); + recipe.AddIngredient(null, "SpiderMeat", 1); + recipe.AddTile(null, "AlchemyStationTile"); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/GlobalItems.cs b/Items/GlobalItems.cs index 94fb0f14..412aaf2f 100644 --- a/Items/GlobalItems.cs +++ b/Items/GlobalItems.cs @@ -51,7 +51,7 @@ public override void OpenVanillaBag(string context, Player player, int arg) if (context == "bossBag" && arg == ItemID.MoonLordBossBag && Main.rand.Next(1) == 0) { - player.QuickSpawnItem(mod.ItemType("MultidimensionalFragment"), Main.rand.Next(6,12)); + player.QuickSpawnItem(mod.ItemType("MultidimensionalFragment"), Main.rand.Next(6, 12)); } if (context == "bossBag" && arg == ItemID.SkeletronBossBag && Main.rand.Next(1) == 0) @@ -70,7 +70,7 @@ public override void OpenVanillaBag(string context, Player player, int arg) } -// Dev. Items + // Dev. Items if (Main.hardMode && context == "bossBag" && Main.rand.Next(30) == 0) { diff --git a/Items/GloomTome.cs b/Items/GloomTome.cs index f25ab831..8d31ac50 100644 --- a/Items/GloomTome.cs +++ b/Items/GloomTome.cs @@ -5,33 +5,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class GloomTome : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class GloomTome : ModItem + { + public override void SetDefaults() + { - item.damage = 23; - item.magic = true; - item.width = 28; - item.height = 30; - item.useTime = 14; - item.useAnimation = 14; - item.shoot = mod.ProjectileType("GloomSphere"); - item.shootSpeed = 16f; - item.mana = 12; - item.useStyle = 5; - item.knockBack = 3; - item.value = 5025; - item.rare = 3; - item.UseSound = SoundID.Item21; - item.autoReuse = true; - } + item.damage = 23; + item.magic = true; + item.width = 28; + item.height = 30; + item.useTime = 14; + item.useAnimation = 14; + item.shoot = mod.ProjectileType("GloomSphere"); + item.shootSpeed = 16f; + item.mana = 12; + item.useStyle = 5; + item.knockBack = 3; + item.value = 5025; + item.rare = 3; + item.UseSound = SoundID.Item21; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gloom Tome"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gloom Tome"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/Gloomstone.cs b/Items/Gloomstone.cs index 207bf6b5..77f55136 100644 --- a/Items/Gloomstone.cs +++ b/Items/Gloomstone.cs @@ -15,30 +15,31 @@ public override void SetDefaults() item.height = 12; item.maxStack = 999; item.useTurn = true; - item.value = 100; + item.value = 100; item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.rare = 3; + item.rare = 3; item.useStyle = 1; item.consumable = true; item.createTile = mod.TileType("GloomstoneTile"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gloomstone"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gloomstone"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GloomstoneWall", 4); - recipe.SetResult(this, 1); - recipe.AddTile(17); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GloomstoneWall", 4); + recipe.SetResult(this, 1); + recipe.AddTile(17); + recipe.AddRecipe(); + } + } +} diff --git a/Items/GloomstoneBathtub.cs b/Items/GloomstoneBathtub.cs index 566a7262..5651db29 100644 --- a/Items/GloomstoneBathtub.cs +++ b/Items/GloomstoneBathtub.cs @@ -19,26 +19,26 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("GloomstoneBathtub"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gloomstone Bathtub"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gloomstone Bathtub"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Gloomstone", 14); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Gloomstone", 14); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/GloomstoneBed.cs b/Items/GloomstoneBed.cs index f6e1447b..e6436836 100644 --- a/Items/GloomstoneBed.cs +++ b/Items/GloomstoneBed.cs @@ -19,27 +19,27 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("GloomstoneBed"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gloomstone Bed"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gloomstone Bed"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Gloomstone", 15); - recipe.AddIngredient(ItemID.Silk, 5); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Gloomstone", 15); + recipe.AddIngredient(ItemID.Silk, 5); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/GloomstoneBench.cs b/Items/GloomstoneBench.cs index fd6868fe..8a8787db 100644 --- a/Items/GloomstoneBench.cs +++ b/Items/GloomstoneBench.cs @@ -19,26 +19,26 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("GloomstoneBench"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gloomstone Bench"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gloomstone Bench"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Gloomstone", 8); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Gloomstone", 8); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/GloomstoneBookcase.cs b/Items/GloomstoneBookcase.cs index 95a89f20..cc7fed70 100644 --- a/Items/GloomstoneBookcase.cs +++ b/Items/GloomstoneBookcase.cs @@ -19,17 +19,17 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("GloomstoneBookcase"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gloomstone Bookcase"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gloomstone Bookcase"); + Tooltip.SetDefault(""); + } } } diff --git a/Items/GloomstoneBrick.cs b/Items/GloomstoneBrick.cs index f9d4f74d..c4d2937b 100644 --- a/Items/GloomstoneBrick.cs +++ b/Items/GloomstoneBrick.cs @@ -15,36 +15,37 @@ public override void SetDefaults() item.height = 12; item.maxStack = 999; item.useTurn = true; - item.value = 100; + item.value = 100; item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.rare = 3; + item.rare = 3; item.useStyle = 1; item.consumable = true; item.createTile = mod.TileType("GloomstoneBrickTile"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gloomstone Brick"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gloomstone Brick"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GloomstoneBrickWall", 4); - recipe.SetResult(this, 1); - recipe.AddTile(17); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GloomstoneBrickWall", 4); + recipe.SetResult(this, 1); + recipe.AddTile(17); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Gloomstone", 1); - recipe.SetResult(this, 1); - recipe.AddTile(17); - recipe.AddRecipe(); - } -}} + recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Gloomstone", 1); + recipe.SetResult(this, 1); + recipe.AddTile(17); + recipe.AddRecipe(); + } + } +} diff --git a/Items/GloomstoneBrickWall.cs b/Items/GloomstoneBrickWall.cs index 19245ab8..6a7d6bd7 100644 --- a/Items/GloomstoneBrickWall.cs +++ b/Items/GloomstoneBrickWall.cs @@ -4,38 +4,40 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class GloomstoneBrickWall : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class GloomstoneBrickWall : ModItem + { + public override void SetDefaults() + { - item.width = 12; - item.height = 12; - item.maxStack = 999; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 7; - item.useStyle = 1; - item.rare = 3; - item.consumable = true; - item.createWall = mod.WallType("GloomstoneBrickWall"); - } + item.width = 12; + item.height = 12; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 7; + item.useStyle = 1; + item.rare = 3; + item.consumable = true; + item.createWall = mod.WallType("GloomstoneBrickWall"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gloomstone Brick Wall"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gloomstone Brick Wall"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GloomstoneBrick", 1); - recipe.SetResult(this, 4); - recipe.AddTile(17); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GloomstoneBrick", 1); + recipe.SetResult(this, 4); + recipe.AddTile(17); + recipe.AddRecipe(); + } + } +} diff --git a/Items/GloomstoneCandelabra.cs b/Items/GloomstoneCandelabra.cs index 93466fd9..38cb7441 100644 --- a/Items/GloomstoneCandelabra.cs +++ b/Items/GloomstoneCandelabra.cs @@ -19,27 +19,27 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("GloomstoneCandelabra"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gloomstone Candelabra"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gloomstone Candelabra"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Gloomstone", 5); - recipe.AddIngredient(ItemID.Torch, 3); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Gloomstone", 5); + recipe.AddIngredient(ItemID.Torch, 3); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/GloomstoneCandle.cs b/Items/GloomstoneCandle.cs index cfb4671e..518abea3 100644 --- a/Items/GloomstoneCandle.cs +++ b/Items/GloomstoneCandle.cs @@ -19,27 +19,27 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("GloomstoneCandle"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gloomstone Candle"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gloomstone Candle"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Gloomstone", 4); - recipe.AddIngredient(ItemID.Torch, 1); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Gloomstone", 4); + recipe.AddIngredient(ItemID.Torch, 1); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/GloomstoneChair.cs b/Items/GloomstoneChair.cs index ac9b9ebc..b3f8ccfb 100644 --- a/Items/GloomstoneChair.cs +++ b/Items/GloomstoneChair.cs @@ -19,26 +19,26 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("GloomstoneChair"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gloomstone Chair"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gloomstone Chair"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Gloomstone", 4); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Gloomstone", 4); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/GloomstoneChandelier.cs b/Items/GloomstoneChandelier.cs index a08fc6d5..ef34df7e 100644 --- a/Items/GloomstoneChandelier.cs +++ b/Items/GloomstoneChandelier.cs @@ -19,28 +19,28 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("GloomstoneChandelier"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gloomstone Chandelier"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gloomstone Chandelier"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Gloomstone", 4); - recipe.AddIngredient(ItemID.Torch, 4); - recipe.AddIngredient(ItemID.Chain, 1); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Gloomstone", 4); + recipe.AddIngredient(ItemID.Torch, 4); + recipe.AddIngredient(ItemID.Chain, 1); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/GloomstoneChest.cs b/Items/GloomstoneChest.cs index 209cf937..535aff19 100644 --- a/Items/GloomstoneChest.cs +++ b/Items/GloomstoneChest.cs @@ -19,34 +19,34 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("GloomstoneChest"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gloomstone Chest"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gloomstone Chest"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Gloomstone", 8); - recipe.AddIngredient(ItemID.IronBar, 2); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Gloomstone", 8); + recipe.AddIngredient(ItemID.IronBar, 2); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Gloomstone", 8); - recipe.AddIngredient(ItemID.LeadBar, 2); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Gloomstone", 8); + recipe.AddIngredient(ItemID.LeadBar, 2); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/GloomstoneDoor.cs b/Items/GloomstoneDoor.cs index d8cb279b..385821e7 100644 --- a/Items/GloomstoneDoor.cs +++ b/Items/GloomstoneDoor.cs @@ -19,26 +19,26 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 10; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 150; item.createTile = mod.TileType("GloomstoneDoorClosed"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gloomstone Door"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gloomstone Door"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Gloomstone", 6); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Gloomstone", 6); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/GloomstoneDresser.cs b/Items/GloomstoneDresser.cs index 5e01ad9e..e9623e6c 100644 --- a/Items/GloomstoneDresser.cs +++ b/Items/GloomstoneDresser.cs @@ -19,26 +19,26 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("GloomstoneDresser"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gloomstone Dresser"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gloomstone Dresser"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Gloomstone", 16); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Gloomstone", 16); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/GloomstoneGrandfatherClock.cs b/Items/GloomstoneGrandfatherClock.cs index 7f7df7f2..699acb9a 100644 --- a/Items/GloomstoneGrandfatherClock.cs +++ b/Items/GloomstoneGrandfatherClock.cs @@ -19,37 +19,37 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("GloomstoneGrandfatherClock"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gloomstone Grandfather Clock"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gloomstone Grandfather Clock"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.IronBar, 3); - recipe.AddIngredient(ItemID.Glass, 6); - recipe.AddIngredient(null, "Gloomstone", 10); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.IronBar, 3); + recipe.AddIngredient(ItemID.Glass, 6); + recipe.AddIngredient(null, "Gloomstone", 10); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.LeadBar, 3); - recipe.AddIngredient(ItemID.Glass, 6); - recipe.AddIngredient(null, "Gloomstone", 10); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.LeadBar, 3); + recipe.AddIngredient(ItemID.Glass, 6); + recipe.AddIngredient(null, "Gloomstone", 10); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/GloomstoneLamp.cs b/Items/GloomstoneLamp.cs index 370411f9..230edae1 100644 --- a/Items/GloomstoneLamp.cs +++ b/Items/GloomstoneLamp.cs @@ -19,27 +19,27 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("GloomstoneLamp"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gloomstone Lamp"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gloomstone Lamp"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Gloomstone", 3); - recipe.AddIngredient(ItemID.Torch, 1); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Gloomstone", 3); + recipe.AddIngredient(ItemID.Torch, 1); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/GloomstoneLantern.cs b/Items/GloomstoneLantern.cs index d510db9d..8a28f1e9 100644 --- a/Items/GloomstoneLantern.cs +++ b/Items/GloomstoneLantern.cs @@ -19,27 +19,27 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("GloomstoneLantern"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gloomstone Lantern"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gloomstone Lantern"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Gloomstone", 6); - recipe.AddIngredient(ItemID.Torch, 1); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Gloomstone", 6); + recipe.AddIngredient(ItemID.Torch, 1); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/GloomstonePiano.cs b/Items/GloomstonePiano.cs index 8376b1d0..116a7269 100644 --- a/Items/GloomstonePiano.cs +++ b/Items/GloomstonePiano.cs @@ -19,28 +19,28 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("GloomstonePiano"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gloomstone Piano"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gloomstone Piano"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(154, 4); - recipe.AddIngredient(null, "Gloomstone", 15); - recipe.AddIngredient(149); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(154, 4); + recipe.AddIngredient(null, "Gloomstone", 15); + recipe.AddIngredient(149); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/GloomstonePlatform.cs b/Items/GloomstonePlatform.cs index 2e428360..0fffae4d 100644 --- a/Items/GloomstonePlatform.cs +++ b/Items/GloomstonePlatform.cs @@ -19,26 +19,26 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("GloomstonePlatform"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gloomstone Platform"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gloomstone Platform"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Gloomstone", 1); - recipe.SetResult(this, 2); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Gloomstone", 1); + recipe.SetResult(this, 2); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/GloomstoneSink.cs b/Items/GloomstoneSink.cs index 3190dadb..e25a9e4b 100644 --- a/Items/GloomstoneSink.cs +++ b/Items/GloomstoneSink.cs @@ -19,27 +19,27 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("GloomstoneSink"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gloomstone Sink"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gloomstone Sink"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Gloomstone", 6); - recipe.AddIngredient(206); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Gloomstone", 6); + recipe.AddIngredient(206); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/GloomstoneTable.cs b/Items/GloomstoneTable.cs index 2f46ac90..c816b38f 100644 --- a/Items/GloomstoneTable.cs +++ b/Items/GloomstoneTable.cs @@ -19,26 +19,26 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("GloomstoneTable"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gloomstone Table"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gloomstone Table"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Gloomstone", 8); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Gloomstone", 8); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/GloomstoneWall.cs b/Items/GloomstoneWall.cs index 660cecb8..695c7df3 100644 --- a/Items/GloomstoneWall.cs +++ b/Items/GloomstoneWall.cs @@ -4,38 +4,40 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class GloomstoneWall : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class GloomstoneWall : ModItem + { + public override void SetDefaults() + { - item.width = 12; - item.height = 12; - item.maxStack = 999; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 7; - item.useStyle = 1; - item.rare = 3; - item.consumable = true; - item.createWall = mod.WallType("GloomstoneWall"); - } + item.width = 12; + item.height = 12; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 7; + item.useStyle = 1; + item.rare = 3; + item.consumable = true; + item.createWall = mod.WallType("GloomstoneWall"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gloomstone Wall"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gloomstone Wall"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Gloomstone", 1); - recipe.SetResult(this, 4); - recipe.AddTile(17); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Gloomstone", 1); + recipe.SetResult(this, 4); + recipe.AddTile(17); + recipe.AddRecipe(); + } + } +} diff --git a/Items/GloomstoneWorkbench.cs b/Items/GloomstoneWorkbench.cs index 9903cbde..2fe53f32 100644 --- a/Items/GloomstoneWorkbench.cs +++ b/Items/GloomstoneWorkbench.cs @@ -19,26 +19,26 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("GloomstoneWorkbench"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gloomstone Work Bench"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gloomstone Work Bench"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Gloomstone", 10); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Gloomstone", 10); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/GlorianaWrath.cs b/Items/GlorianaWrath.cs index 36a43e17..ddd00c7b 100644 --- a/Items/GlorianaWrath.cs +++ b/Items/GlorianaWrath.cs @@ -4,34 +4,36 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { -public class GlorianaWrath : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class GlorianaWrath : ModItem + { + public override void SetDefaults() + { - item.damage = 54; - item.melee = true; - item.width = 40; - item.height = 40; + item.damage = 54; + item.melee = true; + item.width = 40; + item.height = 40; - item.useTime = 20; - item.useAnimation = 20; - item.useStyle = 1; - item.knockBack = 6; - item.value = 20000; - item.rare = 9; - item.expert = true; - item.shoot = 10; - item.shootSpeed = 16f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.useTime = 20; + item.useAnimation = 20; + item.useStyle = 1; + item.knockBack = 6; + item.value = 20000; + item.rare = 9; + item.expert = true; + item.shoot = 10; + item.shootSpeed = 16f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gloriana Wrath"); - Tooltip.SetDefault("Cleanses infected areas."); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gloriana Wrath"); + Tooltip.SetDefault("Cleanses infected areas."); + } -}} + } +} diff --git a/Items/GlowingRod.cs b/Items/GlowingRod.cs index 65367361..01b2fb9f 100644 --- a/Items/GlowingRod.cs +++ b/Items/GlowingRod.cs @@ -5,87 +5,89 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class GlowingRod : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class GlowingRod : ModItem + { + public override void SetDefaults() + { - item.damage = 20; - item.magic = true; - item.mana = 11; - item.width = 40; - item.height = 40; - item.useTime = 18; - item.useAnimation = 18; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 3; - item.value = 13800; - item.rare = 4; - item.UseSound = SoundID.Item43; - item.autoReuse = false; - Item.staff[item.type] = true; - item.shoot = mod.ProjectileType("ZootalooRodPro"); - item.shootSpeed = 15f; - } + item.damage = 20; + item.magic = true; + item.mana = 11; + item.width = 40; + item.height = 40; + item.useTime = 18; + item.useAnimation = 18; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 3; + item.value = 13800; + item.rare = 4; + item.UseSound = SoundID.Item43; + item.autoReuse = false; + Item.staff[item.type] = true; + item.shoot = mod.ProjectileType("ZootalooRodPro"); + item.shootSpeed = 15f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Glowing Rod"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Glowing Rod"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.AmethystStaff, 1); - recipe.AddIngredient(null, "LightBulb", 8); - recipe.AddIngredient(null, "RockHorn", 3); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.AmethystStaff, 1); + recipe.AddIngredient(null, "LightBulb", 8); + recipe.AddIngredient(null, "RockHorn", 3); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.TopazStaff, 1); - recipe.AddIngredient(null, "LightBulb", 8); - recipe.AddIngredient(null, "RockHorn", 3); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.TopazStaff, 1); + recipe.AddIngredient(null, "LightBulb", 8); + recipe.AddIngredient(null, "RockHorn", 3); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.SapphireStaff, 1); - recipe.AddIngredient(null, "LightBulb", 8); - recipe.AddIngredient(null, "RockHorn", 3); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.SapphireStaff, 1); + recipe.AddIngredient(null, "LightBulb", 8); + recipe.AddIngredient(null, "RockHorn", 3); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.EmeraldStaff, 1); - recipe.AddIngredient(null, "LightBulb", 8); - recipe.AddIngredient(null, "RockHorn", 3); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.EmeraldStaff, 1); + recipe.AddIngredient(null, "LightBulb", 8); + recipe.AddIngredient(null, "RockHorn", 3); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.DiamondStaff, 1); - recipe.AddIngredient(null, "LightBulb", 8); - recipe.AddIngredient(null, "RockHorn", 3); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.DiamondStaff, 1); + recipe.AddIngredient(null, "LightBulb", 8); + recipe.AddIngredient(null, "RockHorn", 3); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.RubyStaff, 1); - recipe.AddIngredient(null, "LightBulb", 8); - recipe.AddIngredient(null, "RockHorn", 3); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - - } -}} + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.RubyStaff, 1); + recipe.AddIngredient(null, "LightBulb", 8); + recipe.AddIngredient(null, "RockHorn", 3); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + + } + } +} diff --git a/Items/GoldFlask.cs b/Items/GoldFlask.cs index f629d34e..63434b79 100644 --- a/Items/GoldFlask.cs +++ b/Items/GoldFlask.cs @@ -9,73 +9,74 @@ namespace Tremor.Items { public class GoldFlask : AlchemistItem - { + { - public override void SetDefaults() - { - item.crit = 4; - item.damage = 22; - //item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("GoldFlaskPro"); - item.shootSpeed = 8f; - item.useStyle = 1; - item.knockBack = 1; - item.UseSound = SoundID.Item106; - item.value = 150; - item.rare = 1; - item.autoReuse = false; + public override void SetDefaults() + { + item.crit = 4; + item.damage = 22; + //item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("GoldFlaskPro"); + item.shootSpeed = 8f; + item.useStyle = 1; + item.knockBack = 1; + item.UseSound = SoundID.Item106; + item.value = 150; + item.rare = 1; + item.autoReuse = false; - item.ammo = mod.ItemType("BoomFlask"); - } + item.ammo = mod.ItemType("BoomFlask"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gold Flask"); - Tooltip.SetDefault("Throws a flask that explodes into clouds\nClouds increase the amount of coins that drop from monsters"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gold Flask"); + Tooltip.SetDefault("Throws a flask that explodes into clouds\nClouds increase the amount of coins that drop from monsters"); + } - public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) - { - type = mod.ProjectileType("GoldenCloudPro"); - } + public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) + { + type = mod.ProjectileType("GoldenCloudPro"); + } - public override void UpdateInventory(Player player) - { - MPlayer modPlayer = player.GetModPlayer(mod); - if (modPlayer.novaHelmet) - { - item.autoReuse = true; - } - if (!modPlayer.novaHelmet) - { - item.autoReuse = false; - } - - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) - { - item.shootSpeed = 11f; - } - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) - { - item.shootSpeed = 8f; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) - { - item.autoReuse = true; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) - { - item.autoReuse = false; - } - } + public override void UpdateInventory(Player player) + { + MPlayer modPlayer = player.GetModPlayer(mod); + if (modPlayer.novaHelmet) + { + item.autoReuse = true; + } + if (!modPlayer.novaHelmet) + { + item.autoReuse = false; + } -}} + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) + { + item.shootSpeed = 11f; + } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) + { + item.shootSpeed = 8f; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) + { + item.autoReuse = true; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) + { + item.autoReuse = false; + } + } + + } +} diff --git a/Items/GoldGlobe.cs b/Items/GoldGlobe.cs index c457077e..8564a50a 100644 --- a/Items/GoldGlobe.cs +++ b/Items/GoldGlobe.cs @@ -4,40 +4,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class GoldGlobe : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class GoldGlobe : ModItem + { + public override void SetDefaults() + { - item.width = 32; - item.height = 48; - item.maxStack = 99; - item.value = 100; - item.rare = 1; - item.createTile = mod.TileType("GoldGlobe"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - } + item.width = 32; + item.height = 48; + item.maxStack = 99; + item.value = 100; + item.rare = 1; + item.createTile = mod.TileType("GoldGlobe"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gold Globe"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gold Globe"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Wood, 15); - recipe.AddIngredient(ItemID.GoldBar, 5); - recipe.SetResult(this); - recipe.AddTile(106); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Wood, 15); + recipe.AddIngredient(ItemID.GoldBar, 5); + recipe.SetResult(this); + recipe.AddTile(106); + recipe.AddRecipe(); + } + } +} diff --git a/Items/GoldKunai.cs b/Items/GoldKunai.cs index 35d53a74..9319b392 100644 --- a/Items/GoldKunai.cs +++ b/Items/GoldKunai.cs @@ -5,44 +5,46 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class GoldKunai : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class GoldKunai : ModItem + { + public override void SetDefaults() + { - item.damage = 18; - item.height = 32; - item.thrown = true; - item.width = 18; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.useTime = 18; - item.useAnimation = 18; - item.shoot = mod.ProjectileType("GoldKunai"); - item.shootSpeed = 16f; - item.useStyle = 1; - item.knockBack = 4; - item.value = 60; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 18; + item.height = 32; + item.thrown = true; + item.width = 18; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.useTime = 18; + item.useAnimation = 18; + item.shoot = mod.ProjectileType("GoldKunai"); + item.shootSpeed = 16f; + item.useStyle = 1; + item.knockBack = 4; + item.value = 60; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gold Kunai"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gold Kunai"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Kunai", 50); - recipe.AddIngredient(ItemID.GoldBar, 3); - recipe.SetResult(this, 50); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Kunai", 50); + recipe.AddIngredient(ItemID.GoldBar, 3); + recipe.SetResult(this, 50); + recipe.AddRecipe(); + } + } +} diff --git a/Items/GoldShield.cs b/Items/GoldShield.cs index e9e7c42b..3df2a580 100644 --- a/Items/GoldShield.cs +++ b/Items/GoldShield.cs @@ -5,37 +5,39 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Shield)] -public class GoldShield : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + [AutoloadEquip(EquipType.Shield)] + public class GoldShield : ModItem + { + public override void SetDefaults() + { - item.width = 26; - item.height = 26; - item.value = 110; - item.rare = 0; - item.accessory = true; - item.defense = 4; - } + item.width = 26; + item.height = 26; + item.value = 110; + item.rare = 0; + item.accessory = true; + item.defense = 4; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gold Shield"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gold Shield"); + Tooltip.SetDefault(""); + } - public override void UpdateEquip(Player player) - { - player.moveSpeed -= 0.40f; - } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.GoldBar, 15); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void UpdateEquip(Player player) + { + player.moveSpeed -= 0.40f; + } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.GoldBar, 15); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/GoldSpear.cs b/Items/GoldSpear.cs index 2f7da653..c2e4aa4e 100644 --- a/Items/GoldSpear.cs +++ b/Items/GoldSpear.cs @@ -4,42 +4,44 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class GoldSpear : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class GoldSpear : ModItem + { + public override void SetDefaults() + { - item.damage = 14; - item.width = 14; - item.height = 84; - item.noUseGraphic = true; - item.melee = true; - item.useTime = 30; - item.shoot = mod.ProjectileType("GoldSpearPro"); - item.shootSpeed = 3f; - item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 4; - item.value = 1000; - item.rare = 0; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 14; + item.width = 14; + item.height = 84; + item.noUseGraphic = true; + item.melee = true; + item.useTime = 30; + item.shoot = mod.ProjectileType("GoldSpearPro"); + item.shootSpeed = 3f; + item.useAnimation = 30; + item.useStyle = 5; + item.knockBack = 4; + item.value = 1000; + item.rare = 0; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gold Spear"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gold Spear"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.GoldBar, 9); - recipe.AddTile(16); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.GoldBar, 9); + recipe.AddTile(16); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/GoldenClaw.cs b/Items/GoldenClaw.cs index f4154deb..869689cb 100644 --- a/Items/GoldenClaw.cs +++ b/Items/GoldenClaw.cs @@ -4,23 +4,25 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class GoldenClaw : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class GoldenClaw : ModItem + { + public override void SetDefaults() + { - item.width = 14; - item.height = 22; - item.maxStack = 999; - item.rare = 11; - item.value = Item.buyPrice(0, 3, 0, 0); - } + item.width = 14; + item.height = 22; + item.maxStack = 999; + item.rare = 11; + item.value = Item.buyPrice(0, 3, 0, 0); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Golden Claw"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Golden Claw"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/GoldenCube.cs b/Items/GoldenCube.cs index 403c3afe..00e8ad9b 100644 --- a/Items/GoldenCube.cs +++ b/Items/GoldenCube.cs @@ -13,18 +13,18 @@ public override void SetDefaults() { item.CloneDefaults(ItemID.Carrot); - item.useTime = 25; - item.useAnimation = 25; + item.useTime = 25; + item.useAnimation = 25; item.shoot = mod.ProjectileType("GoldenWhalePro"); item.buffType = mod.BuffType("GoldenWhale"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Golden Cube"); - Tooltip.SetDefault("Summons an golden whale"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Golden Cube"); + Tooltip.SetDefault("Summons an golden whale"); + } public override void UseStyle(Player player) diff --git a/Items/GoldenDust.cs b/Items/GoldenDust.cs index 86da3798..bc5627ef 100644 --- a/Items/GoldenDust.cs +++ b/Items/GoldenDust.cs @@ -6,41 +6,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class GoldenDust : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class GoldenDust : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 36; - item.value = 12500; - item.rare = 5; - item.accessory = true; - } + item.width = 22; + item.height = 36; + item.value = 12500; + item.rare = 5; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Golden Dust"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Golden Dust"); + Tooltip.SetDefault(""); + } -public override void UpdateAccessory(Player player, bool hideVisual) -{ - if(Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y) > 1f && !player.rocketFrame) // Makes sure the player is actually moving - { - for (int k = 0; k < 2; k++) - { - int index= Dust.NewDust(new Vector2(player.position.X - player.velocity.X * 2f, player.position.Y - 2f - player.velocity.Y * 2f), player.width, player.height, 228, 0f, 0f, 100, default(Color), 2f); - Main.dust[index].noGravity = true; - Main.dust[index].noLight = true; - Dust dust = Main.dust[index]; - dust.velocity.X = dust.velocity.X - player.velocity.X * 0.5f; - dust.velocity.Y = dust.velocity.Y - player.velocity.Y * 0.5f; - } - } -} + public override void UpdateAccessory(Player player, bool hideVisual) + { + if (Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y) > 1f && !player.rocketFrame) // Makes sure the player is actually moving + { + for (int k = 0; k < 2; k++) + { + int index = Dust.NewDust(new Vector2(player.position.X - player.velocity.X * 2f, player.position.Y - 2f - player.velocity.Y * 2f), player.width, player.height, 228, 0f, 0f, 100, default(Color), 2f); + Main.dust[index].noGravity = true; + Main.dust[index].noLight = true; + Dust dust = Main.dust[index]; + dust.velocity.X = dust.velocity.X - player.velocity.X * 0.5f; + dust.velocity.Y = dust.velocity.Y - player.velocity.Y * 0.5f; + } + } + } public override void AddRecipes() { @@ -52,4 +53,5 @@ public override void AddRecipes() recipe.AddRecipe(); } -}} + } +} diff --git a/Items/GoldenGlowingRing.cs b/Items/GoldenGlowingRing.cs index 85c97b63..7a2d8555 100644 --- a/Items/GoldenGlowingRing.cs +++ b/Items/GoldenGlowingRing.cs @@ -5,31 +5,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class GoldenGlowingRing : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class GoldenGlowingRing : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 44; + item.width = 22; + item.height = 44; - item.value = 10000; - item.rare = 11; - item.expert = true; - item.accessory = true; - } + item.value = 10000; + item.rare = 11; + item.expert = true; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Golden Glowing Ring"); - Tooltip.SetDefault("Summons two blades to protect you\nBlue has a chance to inflict confusion on enemy, yellow can inflict midas."); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Golden Glowing Ring"); + Tooltip.SetDefault("Summons two blades to protect you\nBlue has a chance to inflict confusion on enemy, yellow can inflict midas."); + } - public override void UpdateEquip(Player player) - { - player.AddBuff(mod.BuffType("GoldenGlowingRingBuff"), 2); - } -}} + public override void UpdateEquip(Player player) + { + player.AddBuff(mod.BuffType("GoldenGlowingRingBuff"), 2); + } + } +} diff --git a/Items/GoldenHat.cs b/Items/GoldenHat.cs index 9a54a183..d7021997 100644 --- a/Items/GoldenHat.cs +++ b/Items/GoldenHat.cs @@ -5,49 +5,52 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class GoldenHat : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class GoldenHat : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 22; + item.width = 26; + item.height = 22; - item.value = 30000; - item.rare = 2; - item.defense = 3; - } + item.value = 30000; + item.rare = 2; + item.defense = 3; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Golden Hat"); - Tooltip.SetDefault("5% decreased magic damage\nIncreases magic critical strike chance by 6%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Golden Hat"); + Tooltip.SetDefault("5% decreased magic damage\nIncreases magic critical strike chance by 6%"); + } - public override void UpdateEquip(Player player) - { - player.magicDamage -= 0.05f; - player.magicCrit += 6; - } + public override void UpdateEquip(Player player) + { + player.magicDamage -= 0.05f; + player.magicCrit += 6; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == mod.ItemType("GoldenRobe"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("GoldenRobe"); + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increases maximum mana by 40"; - player.statManaMax2 += 40; - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increases maximum mana by 40"; + player.statManaMax2 += 40; + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawOutlines=true; + player.armorEffectDrawOutlines = true; } -}} + } +} diff --git a/Items/GoldenMace.cs b/Items/GoldenMace.cs index e351a235..d669894f 100644 --- a/Items/GoldenMace.cs +++ b/Items/GoldenMace.cs @@ -5,41 +5,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class GoldenMace : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.damage = 34; - item.melee = true; - item.width = 50; - item.height = 52; - item.useTime = 25; - item.useAnimation = 25; - item.useStyle = 1; - item.shoot = mod.ProjectileType("GoldenMacePro"); - item.shootSpeed = 10f; - item.knockBack = 4; - item.value = 80000; - item.rare = 4; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Golden Mace"); - Tooltip.SetDefault(""); - } - - - - public override void MeleeEffects(Player player, Rectangle hitbox) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 246); - } - - -} + public class GoldenMace : ModItem + { + public override void SetDefaults() + { + + item.damage = 34; + item.melee = true; + item.width = 50; + item.height = 52; + item.useTime = 25; + item.useAnimation = 25; + item.useStyle = 1; + item.shoot = mod.ProjectileType("GoldenMacePro"); + item.shootSpeed = 10f; + item.knockBack = 4; + item.value = 80000; + item.rare = 4; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Golden Mace"); + Tooltip.SetDefault(""); + } + + + + public override void MeleeEffects(Player player, Rectangle hitbox) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 246); + } + + + } } diff --git a/Items/GoldenRobe.cs b/Items/GoldenRobe.cs index 4e5c1a55..9ffaae5d 100644 --- a/Items/GoldenRobe.cs +++ b/Items/GoldenRobe.cs @@ -5,33 +5,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class GoldenRobe : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Body)] + public class GoldenRobe : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 250; + item.width = 250; - item.height = 28; - item.value = 35000; - item.rare = 2; - item.defense = 6; - } + item.height = 28; + item.value = 35000; + item.rare = 2; + item.defense = 6; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Golden Robe"); - Tooltip.SetDefault("5% decreased magic damage\nIncreases maximum mana by 40"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Golden Robe"); + Tooltip.SetDefault("5% decreased magic damage\nIncreases maximum mana by 40"); + } - public override void UpdateEquip(Player player) - { - player.magicDamage -= 0.05f; - player.statManaMax2 += 40; - } -}} + public override void UpdateEquip(Player player) + { + player.magicDamage -= 0.05f; + player.statManaMax2 += 40; + } + } +} diff --git a/Items/GoldenStar.cs b/Items/GoldenStar.cs index 625ea910..76235fed 100644 --- a/Items/GoldenStar.cs +++ b/Items/GoldenStar.cs @@ -5,49 +5,51 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class GoldenStar : ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 36; - item.height = 38; - item.value = 12500; - - - item.rare = 9; - item.expert = true; - item.accessory = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Golden Star"); - Tooltip.SetDefault("The less health, the more alchemical damage\n'Rare alchemical artifact'"); - } - - - public override void UpdateAccessory(Player player, bool hideVisual) - - { - if (player.statLife < 50) - { - player.GetModPlayer(mod).alchemistDamage += 0.35f; - } - if (player.statLife < 100) - { - player.GetModPlayer(mod).alchemistDamage += 0.25f; - } - if (player.statLife < 200) - { - player.GetModPlayer(mod).alchemistDamage += 0.15f; - } - if (player.statLife < 300) - { - player.GetModPlayer(mod).alchemistDamage += 0.05f; - } - } - -}} + public class GoldenStar : ModItem + { + + public override void SetDefaults() + { + + item.width = 36; + item.height = 38; + item.value = 12500; + + + item.rare = 9; + item.expert = true; + item.accessory = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Golden Star"); + Tooltip.SetDefault("The less health, the more alchemical damage\n'Rare alchemical artifact'"); + } + + + public override void UpdateAccessory(Player player, bool hideVisual) + + { + if (player.statLife < 50) + { + player.GetModPlayer(mod).alchemistDamage += 0.35f; + } + if (player.statLife < 100) + { + player.GetModPlayer(mod).alchemistDamage += 0.25f; + } + if (player.statLife < 200) + { + player.GetModPlayer(mod).alchemistDamage += 0.15f; + } + if (player.statLife < 300) + { + player.GetModPlayer(mod).alchemistDamage += 0.05f; + } + } + + } +} diff --git a/Items/GoldenThrowingAxe.cs b/Items/GoldenThrowingAxe.cs index f6011ab2..4d254bc2 100644 --- a/Items/GoldenThrowingAxe.cs +++ b/Items/GoldenThrowingAxe.cs @@ -5,35 +5,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class GoldenThrowingAxe : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class GoldenThrowingAxe : ModItem + { + public override void SetDefaults() + { - item.damage = 30; - item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("GoldenThrowingAxePro"); - item.shootSpeed = 15f; - item.useStyle = 1; - item.knockBack = 4; - item.value = 100; - item.rare = 0; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 30; + item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("GoldenThrowingAxePro"); + item.shootSpeed = 15f; + item.useStyle = 1; + item.knockBack = 4; + item.value = 100; + item.rare = 0; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Golden Throwing Axe"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Golden Throwing Axe"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/GoldfishStaff.cs b/Items/GoldfishStaff.cs index d0d3cc20..42c2b745 100644 --- a/Items/GoldfishStaff.cs +++ b/Items/GoldfishStaff.cs @@ -5,37 +5,38 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class GoldfishStaff : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.CloneDefaults(ItemID.Starfury); + public class GoldfishStaff : ModItem + { + public override void SetDefaults() + { + item.CloneDefaults(ItemID.Starfury); - item.damage = 10; - item.melee = false; - item.magic = true; - item.width = 50; - item.height = 55; - item.useTime = 20; - item.mana = 9; + item.damage = 10; + item.melee = false; + item.magic = true; + item.width = 50; + item.height = 55; + item.useTime = 20; + item.mana = 9; - item.useAnimation = 50; - item.useStyle = 5; - item.shootSpeed = 10f; - Item.staff[item.type] = true; - item.knockBack = 3; - item.value = 10000; - item.rare = 2; - item.UseSound = SoundID.Item9; - item.autoReuse = true; - } + item.useAnimation = 50; + item.useStyle = 5; + item.shootSpeed = 10f; + Item.staff[item.type] = true; + item.knockBack = 3; + item.value = 10000; + item.rare = 2; + item.UseSound = SoundID.Item9; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Goldfish Staff"); - Tooltip.SetDefault("Causes goldfishes to fall from the sky"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Goldfish Staff"); + Tooltip.SetDefault("Causes goldfishes to fall from the sky"); + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) @@ -50,7 +51,7 @@ public override void AddRecipes() recipe.AddIngredient(ItemID.Wood, 16); recipe.AddIngredient(ItemID.IronBar, 6); recipe.AddIngredient(ItemID.Goldfish, 3); - recipe.AddTile(18); + recipe.AddTile(18); recipe.SetResult(this); recipe.AddRecipe(); @@ -59,9 +60,9 @@ public override void AddRecipes() recipe.AddIngredient(ItemID.Wood, 16); recipe.AddIngredient(ItemID.LeadBar, 6); recipe.AddIngredient(ItemID.Goldfish, 3); - recipe.AddTile(18); + recipe.AddTile(18); recipe.SetResult(this); recipe.AddRecipe(); } -} + } } diff --git a/Items/GolemCore.cs b/Items/GolemCore.cs index 52c6cdfb..3b640a1b 100644 --- a/Items/GolemCore.cs +++ b/Items/GolemCore.cs @@ -6,27 +6,29 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class GolemCore : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class GolemCore : ModItem + { + public override void SetDefaults() + { - item.width = 20; - item.height = 20; + item.width = 20; + item.height = 20; - item.value = 100000; - item.rare = 8; - ItemID.Sets.ItemNoGravity[item.type] = true; + item.value = 100000; + item.rare = 8; + ItemID.Sets.ItemNoGravity[item.type] = true; ItemID.Sets.AnimatesAsSoul[item.type] = true; ItemID.Sets.ItemIconPulse[item.type] = true; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Golem Core"); - Tooltip.SetDefault("The ancient and mysterious mechanism"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Golem Core"); + Tooltip.SetDefault("The ancient and mysterious mechanism"); + } -}} + } +} diff --git a/Items/GraniteBeetleBanner.cs b/Items/GraniteBeetleBanner.cs index 618795af..3b3e9e95 100644 --- a/Items/GraniteBeetleBanner.cs +++ b/Items/GraniteBeetleBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class GraniteBeetleBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class GraniteBeetleBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 67; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 67; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Granite Beetle Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Granite Beetle Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/GraniteBowmanBanner.cs b/Items/GraniteBowmanBanner.cs index 535b60e8..4827c603 100644 --- a/Items/GraniteBowmanBanner.cs +++ b/Items/GraniteBowmanBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class GraniteBowmanBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class GraniteBowmanBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 68; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 68; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Granite Bowman Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Granite Bowman Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/GraniteChestplate.cs b/Items/GraniteChestplate.cs index 709605f9..3ecc0f9d 100644 --- a/Items/GraniteChestplate.cs +++ b/Items/GraniteChestplate.cs @@ -5,36 +5,38 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class GraniteChestplate : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Body)] + public class GraniteChestplate : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 18; - item.value = 2500; - item.rare = 1; - item.defense = 3; - } + item.width = 26; + item.height = 18; + item.value = 2500; + item.rare = 1; + item.defense = 3; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Granite Chestplate"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Granite Chestplate"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.GraniteBlock, 75); - recipe.AddIngredient(null, "StoneofLife", 1); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.GraniteBlock, 75); + recipe.AddIngredient(null, "StoneofLife", 1); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } -}} + } +} diff --git a/Items/GraniteGreaves.cs b/Items/GraniteGreaves.cs index 986e4a0c..c2615e14 100644 --- a/Items/GraniteGreaves.cs +++ b/Items/GraniteGreaves.cs @@ -5,34 +5,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class GraniteGreaves : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Legs)] + public class GraniteGreaves : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 18; - item.value = 2500; - item.rare = 1; - item.defense = 2; - } + item.width = 22; + item.height = 18; + item.value = 2500; + item.rare = 1; + item.defense = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Granite Greaves"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Granite Greaves"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.GraniteBlock, 45); - recipe.AddIngredient(null, "StoneofLife", 1); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.GraniteBlock, 45); + recipe.AddIngredient(null, "StoneofLife", 1); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/GraniteHelmet.cs b/Items/GraniteHelmet.cs index c42bb3bd..4c111f1e 100644 --- a/Items/GraniteHelmet.cs +++ b/Items/GraniteHelmet.cs @@ -5,51 +5,54 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class GraniteHelmet : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class GraniteHelmet : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 18; - item.height = 18; - item.value = 2500; - item.rare = 1; - item.defense = 2; - } + item.width = 18; + item.height = 18; + item.value = 2500; + item.rare = 1; + item.defense = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Granite Helmet"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Granite Helmet"); + Tooltip.SetDefault(""); + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("GraniteChestplate") && legs.type == mod.ItemType("GraniteGreaves"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("GraniteChestplate") && legs.type == mod.ItemType("GraniteGreaves"); + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increases maximum defense by 3"; -player.statDefense += 3; - player.moveSpeed -= 0.20f; - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increases maximum defense by 3"; + player.statDefense += 3; + player.moveSpeed -= 0.20f; + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawShadowSubtle=true; + player.armorEffectDrawShadowSubtle = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.GraniteBlock, 30); - recipe.AddIngredient(null, "StoneofLife", 1); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.GraniteBlock, 30); + recipe.AddIngredient(null, "StoneofLife", 1); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/GraniteMusicBox.cs b/Items/GraniteMusicBox.cs index 1e934756..a3a944ce 100644 --- a/Items/GraniteMusicBox.cs +++ b/Items/GraniteMusicBox.cs @@ -25,11 +25,11 @@ public override void SetDefaults() item.accessory = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Music Box (Granite)"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Music Box (Granite)"); + Tooltip.SetDefault(""); + } } } diff --git a/Items/GrassGlavie.cs b/Items/GrassGlavie.cs index 4db49f7c..ff902076 100644 --- a/Items/GrassGlavie.cs +++ b/Items/GrassGlavie.cs @@ -4,45 +4,47 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class GrassGlavie: ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class GrassGlavie : ModItem + { + public override void SetDefaults() + { - item.damage = 19; - item.width = 14; - item.height = 84; - item.noUseGraphic = true; - item.melee = true; - item.useTime = 30; - item.shoot = mod.ProjectileType("GrassGlaviePro"); - item.shootSpeed = 3f; - item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 4; - item.value = 900; - item.rare = 2; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 19; + item.width = 14; + item.height = 84; + item.noUseGraphic = true; + item.melee = true; + item.useTime = 30; + item.shoot = mod.ProjectileType("GrassGlaviePro"); + item.shootSpeed = 3f; + item.useAnimation = 30; + item.useStyle = 5; + item.knockBack = 4; + item.value = 900; + item.rare = 2; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Grass Glaive"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Grass Glaive"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.RichMahogany, 16); - recipe.AddIngredient(ItemID.Stinger, 1); - recipe.AddIngredient(ItemID.Vine, 1); - recipe.AddIngredient(ItemID.JungleSpores, 5); - recipe.AddTile(16); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.RichMahogany, 16); + recipe.AddIngredient(ItemID.Stinger, 1); + recipe.AddIngredient(ItemID.Vine, 1); + recipe.AddIngredient(ItemID.JungleSpores, 5); + recipe.AddTile(16); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/GrayKnightBreastplate.cs b/Items/GrayKnightBreastplate.cs index af3f1e8a..74adfb9f 100644 --- a/Items/GrayKnightBreastplate.cs +++ b/Items/GrayKnightBreastplate.cs @@ -6,8 +6,8 @@ using Terraria.ModLoader; namespace Tremor.Items -{ -[AutoloadEquip(EquipType.Body)] +{ + [AutoloadEquip(EquipType.Body)] public class GrayKnightBreastplate : ModItem { public override void SetDefaults() @@ -21,11 +21,11 @@ public override void SetDefaults() item.vanity = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gray Knight Breastplate"); - Tooltip.SetDefault("Can be colored with gems"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gray Knight Breastplate"); + Tooltip.SetDefault("Can be colored with gems"); + } } } diff --git a/Items/GrayKnightHelmet.cs b/Items/GrayKnightHelmet.cs index 8b3f8ae9..87f80851 100644 --- a/Items/GrayKnightHelmet.cs +++ b/Items/GrayKnightHelmet.cs @@ -7,7 +7,7 @@ namespace Tremor.Items { -[AutoloadEquip(EquipType.Head)] + [AutoloadEquip(EquipType.Head)] public class GrayKnightHelmet : ModItem { public override void SetDefaults() @@ -21,11 +21,11 @@ public override void SetDefaults() item.vanity = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gray Knight Helmet"); - Tooltip.SetDefault("Can be colored with gems"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gray Knight Helmet"); + Tooltip.SetDefault("Can be colored with gems"); + } } } diff --git a/Items/GreatAnvil.cs b/Items/GreatAnvil.cs index 74200cc8..0002bc9d 100644 --- a/Items/GreatAnvil.cs +++ b/Items/GreatAnvil.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class GreatAnvil : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class GreatAnvil : ModItem + { + public override void SetDefaults() + { - item.width = 50; - item.height = 26; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; + item.width = 50; + item.height = 26; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 150; - item.createTile = mod.TileType("GreatAnvilTile"); - } + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 150; + item.createTile = mod.TileType("GreatAnvilTile"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Great Anvil"); - Tooltip.SetDefault("Allows to produce heavy weapons"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Great Anvil"); + Tooltip.SetDefault("Allows to produce heavy weapons"); + } -}} + } +} diff --git a/Items/GreenChristmasStocking.cs b/Items/GreenChristmasStocking.cs index 80f5d59f..bfe53e12 100644 --- a/Items/GreenChristmasStocking.cs +++ b/Items/GreenChristmasStocking.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class GreenChristmasStocking : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class GreenChristmasStocking : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 26; - item.maxStack = 99; - item.rare = 1; - item.createTile = mod.TileType("GreenChristmasStocking"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.value = 100; - item.consumable = true; - } + item.width = 22; + item.height = 26; + item.maxStack = 99; + item.rare = 1; + item.createTile = mod.TileType("GreenChristmasStocking"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.value = 100; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Green Christmas Stocking"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Green Christmas Stocking"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/GreenClaw.cs b/Items/GreenClaw.cs index 3d9b305f..7db0596f 100644 --- a/Items/GreenClaw.cs +++ b/Items/GreenClaw.cs @@ -3,31 +3,33 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { -public class GreenClaw : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class GreenClaw : ModItem + { + public override void SetDefaults() + { - item.useStyle = 3; - item.useTurn = false; - item.useAnimation = 12; - item.useTime = 12; - item.width = 24; - item.height = 28; - item.damage = 19; - item.knockBack = 4f; - item.scale = 0.9f; - item.UseSound = SoundID.Item1; - item.useTurn = true; - item.value = 8400; - item.melee = true; - } + item.useStyle = 3; + item.useTurn = false; + item.useAnimation = 12; + item.useTime = 12; + item.width = 24; + item.height = 28; + item.damage = 19; + item.knockBack = 4f; + item.scale = 0.9f; + item.UseSound = SoundID.Item1; + item.useTurn = true; + item.value = 8400; + item.melee = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Green Claw"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Green Claw"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/GreenCrossguardPhasesaber.cs b/Items/GreenCrossguardPhasesaber.cs index 0b9ab3b9..91a9542e 100644 --- a/Items/GreenCrossguardPhasesaber.cs +++ b/Items/GreenCrossguardPhasesaber.cs @@ -5,48 +5,50 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class GreenCrossguardPhasesaber : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class GreenCrossguardPhasesaber : ModItem + { + public override void SetDefaults() + { - item.damage = 71; - item.melee = true; - item.width = 46; - item.height = 48; - item.useTime = 25; - item.useAnimation = 25; - item.useStyle = 1; - item.knockBack = 3; - item.value = 54000; - item.rare = 5; - item.UseSound = SoundID.Item15; - item.autoReuse = true; - item.useTurn = true; - } + item.damage = 71; + item.melee = true; + item.width = 46; + item.height = 48; + item.useTime = 25; + item.useAnimation = 25; + item.useStyle = 1; + item.knockBack = 3; + item.value = 54000; + item.rare = 5; + item.UseSound = SoundID.Item15; + item.autoReuse = true; + item.useTurn = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Green Crossguard Phasesaber"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Green Crossguard Phasesaber"); + Tooltip.SetDefault(""); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 61); - } + public override void MeleeEffects(Player player, Rectangle hitbox) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 61); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(3766); - recipe.AddIngredient(ItemID.SoulofMight, 8); - recipe.AddIngredient(null, "SoulofMind", 8); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(3766); + recipe.AddIngredient(ItemID.SoulofMight, 8); + recipe.AddIngredient(null, "SoulofMind", 8); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/GreenKnightBreastplate.cs b/Items/GreenKnightBreastplate.cs index d213d72a..a1f026e4 100644 --- a/Items/GreenKnightBreastplate.cs +++ b/Items/GreenKnightBreastplate.cs @@ -6,8 +6,8 @@ using Terraria.ModLoader; namespace Tremor.Items -{ -[AutoloadEquip(EquipType.Body)] +{ + [AutoloadEquip(EquipType.Body)] public class GreenKnightBreastplate : ModItem { @@ -21,21 +21,21 @@ public override void SetDefaults() item.vanity = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Green Knight Breastplate"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Green Knight Breastplate"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GrayKnightBreastplate", 3); - recipe.AddIngredient(ItemID.Emerald, 1); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GrayKnightBreastplate", 3); + recipe.AddIngredient(ItemID.Emerald, 1); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } } } diff --git a/Items/GreenKnightHelmet.cs b/Items/GreenKnightHelmet.cs index 1bdaf9f7..c4657d1f 100644 --- a/Items/GreenKnightHelmet.cs +++ b/Items/GreenKnightHelmet.cs @@ -7,7 +7,7 @@ namespace Tremor.Items { -[AutoloadEquip(EquipType.Head)] + [AutoloadEquip(EquipType.Head)] public class GreenKnightHelmet : ModItem { @@ -21,21 +21,21 @@ public override void SetDefaults() item.vanity = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Green Knight Helmet"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Green Knight Helmet"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GrayKnightHelmet", 3); - recipe.AddIngredient(ItemID.Emerald, 1); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GrayKnightHelmet", 3); + recipe.AddIngredient(ItemID.Emerald, 1); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } } } diff --git a/Items/GreenPuzzleFragment.cs b/Items/GreenPuzzleFragment.cs index f8c27cd3..549e7661 100644 --- a/Items/GreenPuzzleFragment.cs +++ b/Items/GreenPuzzleFragment.cs @@ -4,24 +4,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class GreenPuzzleFragment : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class GreenPuzzleFragment : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 10000; - item.rare = 3; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 10000; + item.rare = 3; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Green Puzzle Fragment"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Green Puzzle Fragment"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/GrossBow.cs b/Items/GrossBow.cs index 312941f1..3a53ddc5 100644 --- a/Items/GrossBow.cs +++ b/Items/GrossBow.cs @@ -5,34 +5,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class GrossBow : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class GrossBow : ModItem + { + public override void SetDefaults() + { - item.damage = 23; - item.width = 18; - item.height = 56; - item.ranged = true; - item.useTime = 30; - item.shoot = 1; - item.shootSpeed = 12f; - item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 5; - item.value = 25000; - item.useAmmo = AmmoID.Arrow; - item.rare = 3; - item.UseSound = SoundID.Item5; - item.autoReuse = true; - } + item.damage = 23; + item.width = 18; + item.height = 56; + item.ranged = true; + item.useTime = 30; + item.shoot = 1; + item.shootSpeed = 12f; + item.useAnimation = 30; + item.useStyle = 5; + item.knockBack = 5; + item.value = 25000; + item.useAmmo = AmmoID.Arrow; + item.rare = 3; + item.UseSound = SoundID.Item5; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gross Bow"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gross Bow"); + Tooltip.SetDefault(""); + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) @@ -41,22 +42,23 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX return base.Shoot(player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.DemoniteBar, 5); - recipe.AddIngredient(null, "DrippingRoot", 12); - recipe.AddIngredient(ItemID.Lens, 6); - recipe.AddTile(16); - recipe.SetResult(this); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.DemoniteBar, 5); + recipe.AddIngredient(null, "DrippingRoot", 12); + recipe.AddIngredient(ItemID.Lens, 6); + recipe.AddTile(16); + recipe.SetResult(this); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.CrimtaneBar, 5); - recipe.AddIngredient(null, "DrippingRoot", 12); - recipe.AddIngredient(ItemID.Lens, 6); - recipe.AddTile(16); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.CrimtaneBar, 5); + recipe.AddIngredient(null, "DrippingRoot", 12); + recipe.AddIngredient(ItemID.Lens, 6); + recipe.AddTile(16); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/GuardianBreastplate.cs b/Items/GuardianBreastplate.cs index 0f7d1a2f..526dc784 100644 --- a/Items/GuardianBreastplate.cs +++ b/Items/GuardianBreastplate.cs @@ -7,36 +7,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class GuardianBreastplate : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Body)] + public class GuardianBreastplate : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.defense = 60; - item.width = 22; - item.height = 30; - item.value = 25000; - item.rare = 10; - } + item.defense = 60; + item.width = 22; + item.height = 30; + item.value = 25000; + item.rare = 10; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Guardian Breastplate"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Guardian Breastplate"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "AncientArmorPlate", 20); - recipe.AddIngredient(null, "Squorb", 1); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "AncientArmorPlate", 20); + recipe.AddIngredient(null, "Squorb", 1); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } } diff --git a/Items/GuardianGreaves.cs b/Items/GuardianGreaves.cs index ec95b365..b6bb1b87 100644 --- a/Items/GuardianGreaves.cs +++ b/Items/GuardianGreaves.cs @@ -7,36 +7,38 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class GuardianGreaves : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Legs)] + public class GuardianGreaves : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.defense = 50; - item.width = 22; - item.height = 18; - item.value = 25000; - item.rare = 10; - } + item.defense = 50; + item.width = 22; + item.height = 18; + item.value = 25000; + item.rare = 10; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Guardian Greaves"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Guardian Greaves"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "AncientArmorPlate", 16); - recipe.AddIngredient(null, "Squorb", 1); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "AncientArmorPlate", 16); + recipe.AddIngredient(null, "Squorb", 1); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } } diff --git a/Items/GuardianHammer.cs b/Items/GuardianHammer.cs index 9bd84e89..e21fec3d 100644 --- a/Items/GuardianHammer.cs +++ b/Items/GuardianHammer.cs @@ -5,46 +5,47 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class GuardianHammer : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.noMelee = true; - item.useStyle = 1; + public class GuardianHammer : ModItem + { + public override void SetDefaults() + { + item.noMelee = true; + item.useStyle = 1; - item.shootSpeed = 14f; - item.shoot = mod.ProjectileType("GuardianHammerPro"); - item.damage = 125; - item.knockBack = 9f; - item.width = 14; - item.height = 28; - item.UseSound = SoundID.Item1; - item.useAnimation = 15; - item.useTime = 15; - item.noUseGraphic = true; - item.rare = 11; - item.value = Item.sellPrice(0, 20, 0, 0); - item.melee = true; - } + item.shootSpeed = 14f; + item.shoot = mod.ProjectileType("GuardianHammerPro"); + item.damage = 125; + item.knockBack = 9f; + item.width = 14; + item.height = 28; + item.UseSound = SoundID.Item1; + item.useAnimation = 15; + item.useTime = 15; + item.noUseGraphic = true; + item.rare = 11; + item.value = Item.sellPrice(0, 20, 0, 0); + item.melee = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Guardian Hammer"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Guardian Hammer"); + Tooltip.SetDefault(""); + } -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) -{ - for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. - { - Projectile.NewProjectile(position.X, position.Y, speedX + 3, speedY + 3, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 3, speedY - 3, type, damage, knockBack, Main.myPlayer); - } - return false; -} + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. + { + Projectile.NewProjectile(position.X, position.Y, speedX + 3, speedY + 3, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 3, speedY - 3, type, damage, knockBack, Main.myPlayer); + } + return false; + } public override void AddRecipes() { @@ -55,4 +56,5 @@ public override void AddRecipes() recipe.SetResult(this); recipe.AddRecipe(); } -}} + } +} diff --git a/Items/GuardianHelmet.cs b/Items/GuardianHelmet.cs index 0218295e..cd86b550 100644 --- a/Items/GuardianHelmet.cs +++ b/Items/GuardianHelmet.cs @@ -7,52 +7,54 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class GuardianHelmet : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class GuardianHelmet : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.defense = 50; - item.width = 26; - item.height = 32; - item.value = 25000; - item.rare = 10; - } + item.defense = 50; + item.width = 26; + item.height = 32; + item.value = 25000; + item.rare = 10; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Guardian Helmet"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Guardian Helmet"); + Tooltip.SetDefault(""); + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == mod.ItemType("GuardianBreastplate") && legs.type == mod.ItemType("GuardianGreaves"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("GuardianBreastplate") && legs.type == mod.ItemType("GuardianGreaves"); + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Decreases movement speed"; - player.moveSpeed -= 0.3f; - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Decreases movement speed"; + player.moveSpeed -= 0.3f; + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawShadowLokis = true; + player.armorEffectDrawShadowLokis = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "AncientArmorPlate", 12); - recipe.AddIngredient(null, "Squorb", 1); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "AncientArmorPlate", 12); + recipe.AddIngredient(null, "Squorb", 1); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } } diff --git a/Items/GunslingerFocus.cs b/Items/GunslingerFocus.cs index 07644c38..a36dc24b 100644 --- a/Items/GunslingerFocus.cs +++ b/Items/GunslingerFocus.cs @@ -6,44 +6,46 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class GunslingerFocus : ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 22; - item.height = 22; - - - item.rare = 2; - item.accessory = true; - item.value = 50000; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gunslinger Focus"); - Tooltip.SetDefault("6% increased ranged damage\nIncreases ranged critical strike chance by 12"); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 4)); - } - - - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.rangedDamage += 0.06f; - player.rangedCrit += 12; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GunslingerSpark"); - recipe.AddIngredient(null, "FireFragment", 1); - recipe.AddIngredient(ItemID.Topaz, 16); - recipe.SetResult(this); - recipe.AddTile(null, "AltarofEnchantmentsTile"); - recipe.AddRecipe(); - } -}} + public class GunslingerFocus : ModItem + { + + public override void SetDefaults() + { + + item.width = 22; + item.height = 22; + + + item.rare = 2; + item.accessory = true; + item.value = 50000; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gunslinger Focus"); + Tooltip.SetDefault("6% increased ranged damage\nIncreases ranged critical strike chance by 12"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 4)); + } + + + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.rangedDamage += 0.06f; + player.rangedCrit += 12; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GunslingerSpark"); + recipe.AddIngredient(null, "FireFragment", 1); + recipe.AddIngredient(ItemID.Topaz, 16); + recipe.SetResult(this); + recipe.AddTile(null, "AltarofEnchantmentsTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/GunslingerSoul.cs b/Items/GunslingerSoul.cs index 83260dd0..8177cdf3 100644 --- a/Items/GunslingerSoul.cs +++ b/Items/GunslingerSoul.cs @@ -6,43 +6,45 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class GunslingerSoul : ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 22; - item.height = 22; - - - item.rare = 3; - item.accessory = true; - item.value = 100000; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gunslinger Soul"); - Tooltip.SetDefault("10% increased ranged damage\nIncreases ranged critical strike chance by 15"); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 6)); - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.rangedDamage += 0.1f; - player.rangedCrit += 15; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GunslingerFocus"); - recipe.AddIngredient(null, "Opal", 3); - recipe.AddIngredient(ItemID.RangerEmblem, 1); - recipe.SetResult(this); - recipe.AddTile(null, "AltarofEnchantmentsTile"); - recipe.AddRecipe(); - } -}} + public class GunslingerSoul : ModItem + { + + public override void SetDefaults() + { + + item.width = 22; + item.height = 22; + + + item.rare = 3; + item.accessory = true; + item.value = 100000; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gunslinger Soul"); + Tooltip.SetDefault("10% increased ranged damage\nIncreases ranged critical strike chance by 15"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 6)); + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.rangedDamage += 0.1f; + player.rangedCrit += 15; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GunslingerFocus"); + recipe.AddIngredient(null, "Opal", 3); + recipe.AddIngredient(ItemID.RangerEmblem, 1); + recipe.SetResult(this); + recipe.AddTile(null, "AltarofEnchantmentsTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/GunslingerSpark.cs b/Items/GunslingerSpark.cs index f33ec249..434723da 100644 --- a/Items/GunslingerSpark.cs +++ b/Items/GunslingerSpark.cs @@ -6,41 +6,43 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class GunslingerSpark : ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 22; - item.height = 22; - - - item.rare = 1; - item.accessory = true; - item.value = 20000; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gunslinger Spark"); - Tooltip.SetDefault("3% increased ranged damage\nIncreases ranged critical strike chance by 8"); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 4)); - } - - - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.rangedDamage += 0.03f; - player.rangedCrit += 8; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "AdventurerSpark"); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public class GunslingerSpark : ModItem + { + + public override void SetDefaults() + { + + item.width = 22; + item.height = 22; + + + item.rare = 1; + item.accessory = true; + item.value = 20000; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gunslinger Spark"); + Tooltip.SetDefault("3% increased ranged damage\nIncreases ranged critical strike chance by 8"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 4)); + } + + + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.rangedDamage += 0.03f; + player.rangedCrit += 8; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "AdventurerSpark"); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Gurumaster.cs b/Items/Gurumaster.cs index 0f4ff478..0c3921e8 100644 --- a/Items/Gurumaster.cs +++ b/Items/Gurumaster.cs @@ -5,37 +5,39 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Gurumaster : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Gurumaster : ModItem + { + public override void SetDefaults() + { - item.damage = 240; - item.width = 58; - item.height = 30; - item.ranged = true; - item.useTime = 35; - item.shoot = mod.ProjectileType("Gurumaster"); - item.shootSpeed = 15f; - item.useAnimation = 35; - item.useStyle = 5; - item.knockBack = 4; - item.value = 1000000; - item.rare = 11; - item.UseSound = SoundID.Item36; - item.autoReuse = false; - } + item.damage = 240; + item.width = 58; + item.height = 30; + item.ranged = true; + item.useTime = 35; + item.shoot = mod.ProjectileType("Gurumaster"); + item.shootSpeed = 15f; + item.useAnimation = 35; + item.useStyle = 5; + item.knockBack = 4; + item.value = 1000000; + item.rare = 11; + item.UseSound = SoundID.Item36; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gurumaster"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gurumaster"); + Tooltip.SetDefault(""); + } - public override Vector2? HoldoutOffset() - { - return new Vector2(-10, -4); - } -}} + public override Vector2? HoldoutOffset() + { + return new Vector2(-10, -4); + } + } +} diff --git a/Items/HadesBreastplate.cs b/Items/HadesBreastplate.cs index 7cd92852..e660e248 100644 --- a/Items/HadesBreastplate.cs +++ b/Items/HadesBreastplate.cs @@ -8,61 +8,61 @@ using Microsoft.Xna.Framework; namespace Tremor.Items -{ -[AutoloadEquip(EquipType.Body)] - public class HadesBreastplate : ModItem - { +{ + [AutoloadEquip(EquipType.Body)] + public class HadesBreastplate : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 30; - item.height = 18; + item.width = 30; + item.height = 18; - item.value = 600; - item.rare = 250000; - item.defense = 56; - } + item.value = 600; + item.rare = 250000; + item.defense = 56; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Hades Breastplate"); - Tooltip.SetDefault("Increases maximum life by 50\nIncreases defense when under 100 health\n45% increased all damage"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Hades Breastplate"); + Tooltip.SetDefault("Increases maximum life by 50\nIncreases defense when under 100 health\n45% increased all damage"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "InfernoSoul", 10); - recipe.AddIngredient(null, "MagmoniumBreastplate", 1); - recipe.AddIngredient(null, "FireFragment", 19); - recipe.AddIngredient(null, "Phantaplasm", 13); - recipe.AddIngredient(ItemID.LivingFireBlock, 12); - recipe.SetResult(this); - recipe.AddTile(null, "StarvilTile"); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "InfernoSoul", 10); + recipe.AddIngredient(null, "MagmoniumBreastplate", 1); + recipe.AddIngredient(null, "FireFragment", 19); + recipe.AddIngredient(null, "Phantaplasm", 13); + recipe.AddIngredient(ItemID.LivingFireBlock, 12); + recipe.SetResult(this); + recipe.AddTile(null, "StarvilTile"); + recipe.AddRecipe(); + } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) - { - tooltips[0].overrideColor = new Color(238, 194, 73); - } + public override void ModifyTooltips(System.Collections.Generic.List tooltips) + { + tooltips[0].overrideColor = new Color(238, 194, 73); + } - public override void UpdateEquip(Player player) - { - player.statLifeMax2 += 50; + public override void UpdateEquip(Player player) + { + player.statLifeMax2 += 50; - if (player.statLife < 100) - { - player.statDefense += 35; - } - player.meleeDamage += 0.45f; - player.thrownDamage += 0.45f; - player.rangedDamage += 0.45f; - player.magicDamage += 0.45f; - player.minionDamage += 0.45f; - player.GetModPlayer(mod).alchemistDamage += 0.45f; - } - } + if (player.statLife < 100) + { + player.statDefense += 35; + } + player.meleeDamage += 0.45f; + player.thrownDamage += 0.45f; + player.rangedDamage += 0.45f; + player.magicDamage += 0.45f; + player.minionDamage += 0.45f; + player.GetModPlayer(mod).alchemistDamage += 0.45f; + } + } } diff --git a/Items/HadesGreaves.cs b/Items/HadesGreaves.cs index e8867202..b02ba61c 100644 --- a/Items/HadesGreaves.cs +++ b/Items/HadesGreaves.cs @@ -8,52 +8,52 @@ namespace Tremor.Items { -[AutoloadEquip(EquipType.Legs)] - public class HadesGreaves : ModItem - { - - - public override void SetDefaults() - { - - item.width = 22; - item.height = 18; - item.value = 500; - - item.rare = 250000; - item.defense = 42; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Hades Greaves"); - Tooltip.SetDefault("Increases movement speed\nAllows to dash\nDouble tap a direction\nAllows you to walk on liquids"); - } - - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "InfernoSoul", 7); - recipe.AddIngredient(null, "MagmoniumGreaves", 1); - recipe.AddIngredient(null, "FireFragment", 17); - recipe.AddIngredient(null, "Phantaplasm", 10); - recipe.AddIngredient(ItemID.LivingFireBlock, 8); - recipe.SetResult(this); - recipe.AddTile(null, "StarvilTile"); - recipe.AddRecipe(); - } - - public override void ModifyTooltips(System.Collections.Generic.List tooltips) - { - tooltips[0].overrideColor = new Color(238, 194, 73); - } - - public override void UpdateEquip(Player player) - { - player.moveSpeed += 0.8f; - player.dash = 1; - player.waterWalk = true; - } - } + [AutoloadEquip(EquipType.Legs)] + public class HadesGreaves : ModItem + { + + + public override void SetDefaults() + { + + item.width = 22; + item.height = 18; + item.value = 500; + + item.rare = 250000; + item.defense = 42; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Hades Greaves"); + Tooltip.SetDefault("Increases movement speed\nAllows to dash\nDouble tap a direction\nAllows you to walk on liquids"); + } + + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "InfernoSoul", 7); + recipe.AddIngredient(null, "MagmoniumGreaves", 1); + recipe.AddIngredient(null, "FireFragment", 17); + recipe.AddIngredient(null, "Phantaplasm", 10); + recipe.AddIngredient(ItemID.LivingFireBlock, 8); + recipe.SetResult(this); + recipe.AddTile(null, "StarvilTile"); + recipe.AddRecipe(); + } + + public override void ModifyTooltips(System.Collections.Generic.List tooltips) + { + tooltips[0].overrideColor = new Color(238, 194, 73); + } + + public override void UpdateEquip(Player player) + { + player.moveSpeed += 0.8f; + player.dash = 1; + player.waterWalk = true; + } + } } diff --git a/Items/HadesHelmet.cs b/Items/HadesHelmet.cs index 352843d7..3c408032 100644 --- a/Items/HadesHelmet.cs +++ b/Items/HadesHelmet.cs @@ -8,50 +8,50 @@ namespace Tremor.Items { -[AutoloadEquip(EquipType.Head)] - public class HadesHelmet : ModItem - { + [AutoloadEquip(EquipType.Head)] + public class HadesHelmet : ModItem + { - public override void SetDefaults() - { - item.width = 20; - item.height = 20; - item.value = 400; - item.rare = 250000; - item.defense = 35; - } + public override void SetDefaults() + { + item.width = 20; + item.height = 20; + item.value = 400; + item.rare = 250000; + item.defense = 35; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Hades Helmet"); - Tooltip.SetDefault("Melee attacks inflict fire damage\n30% decreased mana cost\nIncreases maximum life by 150"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Hades Helmet"); + Tooltip.SetDefault("Melee attacks inflict fire damage\n30% decreased mana cost\nIncreases maximum life by 150"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "InfernoSoul", 5); - recipe.AddIngredient(null, "MagmoniumHelmet", 1); - recipe.AddIngredient(null, "FireFragment", 15); - recipe.AddIngredient(null, "Phantaplasm", 8); - recipe.AddIngredient(ItemID.LivingFireBlock, 6); - recipe.SetResult(this); - recipe.AddTile(null, "StarvilTile"); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "InfernoSoul", 5); + recipe.AddIngredient(null, "MagmoniumHelmet", 1); + recipe.AddIngredient(null, "FireFragment", 15); + recipe.AddIngredient(null, "Phantaplasm", 8); + recipe.AddIngredient(ItemID.LivingFireBlock, 6); + recipe.SetResult(this); + recipe.AddTile(null, "StarvilTile"); + recipe.AddRecipe(); + } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) - { - tooltips[0].overrideColor = new Color(238, 194, 73); - } + public override void ModifyTooltips(System.Collections.Generic.List tooltips) + { + tooltips[0].overrideColor = new Color(238, 194, 73); + } - public override void UpdateEquip(Player player) - { - player.magmaStone = true; - player.manaCost -= 0.3f; - player.statLifeMax2 += 150; - } + public override void UpdateEquip(Player player) + { + player.magmaStone = true; + player.manaCost -= 0.3f; + player.statLifeMax2 += 150; + } public override void ArmorSetShadows(Player player) { @@ -60,28 +60,28 @@ public override void ArmorSetShadows(Player player) player.armorEffectDrawShadowLokis = true; } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == mod.ItemType("HadesBreastplate") && legs.type == mod.ItemType("HadesGreaves"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("HadesBreastplate") && legs.type == mod.ItemType("HadesGreaves"); + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Summons a molten watcher to protect you"; - player.AddBuff(mod.BuffType("MoltenWatcherBuff"), 2); + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Summons a molten watcher to protect you"; + player.AddBuff(mod.BuffType("MoltenWatcherBuff"), 2); - if(Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y) > 1f && !player.rocketFrame) // Makes sure the player is actually moving - { - for (int k = 0; k < 2; k++) - { - int index= Dust.NewDust(new Vector2(player.position.X - player.velocity.X * 2f, player.position.Y - 2f - player.velocity.Y * 2f), player.width, player.height, 6, 0f, 0f, 100, default(Color), 2f); - Main.dust[index].noGravity = true; - Main.dust[index].noLight = true; - Dust dust = Main.dust[index]; - dust.velocity.X = dust.velocity.X - player.velocity.X * 0.5f; - dust.velocity.Y = dust.velocity.Y - player.velocity.Y * 0.5f; - } - } - } - } + if (Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y) > 1f && !player.rocketFrame) // Makes sure the player is actually moving + { + for (int k = 0; k < 2; k++) + { + int index = Dust.NewDust(new Vector2(player.position.X - player.velocity.X * 2f, player.position.Y - 2f - player.velocity.Y * 2f), player.width, player.height, 6, 0f, 0f, 100, default(Color), 2f); + Main.dust[index].noGravity = true; + Main.dust[index].noLight = true; + Dust dust = Main.dust[index]; + dust.velocity.X = dust.velocity.X - player.velocity.X * 0.5f; + dust.velocity.Y = dust.velocity.Y - player.velocity.Y * 0.5f; + } + } + } + } } diff --git a/Items/HallowSlimerBanner.cs b/Items/HallowSlimerBanner.cs index dbb70e72..824651c8 100644 --- a/Items/HallowSlimerBanner.cs +++ b/Items/HallowSlimerBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class HallowSlimerBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class HallowSlimerBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 11; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 11; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Hallow Slimer Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Hallow Slimer Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/HallowedHat.cs b/Items/HallowedHat.cs index ce7a2678..9cdd8e61 100644 --- a/Items/HallowedHat.cs +++ b/Items/HallowedHat.cs @@ -5,57 +5,60 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class HallowedHat : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class HallowedHat : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 24; - item.height = 24; + item.width = 24; + item.height = 24; - item.value = 400; - item.rare = 4; - item.defense = 9; - } + item.value = 400; + item.rare = 4; + item.defense = 9; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Hallowed Hat"); - Tooltip.SetDefault("Increases minion damage by 25%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Hallowed Hat"); + Tooltip.SetDefault("Increases minion damage by 25%"); + } - public override void UpdateEquip(Player player) - { - player.minionDamage += 0.25f; - } + public override void UpdateEquip(Player player) + { + player.minionDamage += 0.25f; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == 551 && legs.type == 552; - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == 551 && legs.type == 552; + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increases your max number of minions"; - player.maxMinions += 3; - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increases your max number of minions"; + player.maxMinions += 3; + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawOutlines=true; + player.armorEffectDrawOutlines = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.HallowedBar, 12); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.HallowedBar, 12); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/HallowedHeader.cs b/Items/HallowedHeader.cs index 9e7477b0..a0e45749 100644 --- a/Items/HallowedHeader.cs +++ b/Items/HallowedHeader.cs @@ -5,57 +5,60 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class HallowedHeader : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class HallowedHeader : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 24; - item.height = 24; + item.width = 24; + item.height = 24; - item.value = 400; - item.rare = 4; - item.defense = 9; - } + item.value = 400; + item.rare = 4; + item.defense = 9; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Hallowed Header"); - Tooltip.SetDefault("Increases thrown damage by 26%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Hallowed Header"); + Tooltip.SetDefault("Increases thrown damage by 26%"); + } - public override void UpdateEquip(Player player) - { - player.thrownDamage += 0.26f; - } + public override void UpdateEquip(Player player) + { + player.thrownDamage += 0.26f; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == 551 && legs.type == 552; - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == 551 && legs.type == 552; + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increases thrown weapon velocity"; - player.thrownVelocity +=0.25f; - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increases thrown weapon velocity"; + player.thrownVelocity += 0.25f; + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawOutlines=true; + player.armorEffectDrawOutlines = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.HallowedBar, 12); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.HallowedBar, 12); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/HallowedSpray.cs b/Items/HallowedSpray.cs index 38f42f94..d45dd967 100644 --- a/Items/HallowedSpray.cs +++ b/Items/HallowedSpray.cs @@ -5,44 +5,46 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class HallowedSpray : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class HallowedSpray : ModItem + { + public override void SetDefaults() + { - item.damage = 56; - item.magic = true; - item.width = 28; - item.height = 30; - item.useTime = 10; - item.useAnimation = 30; - item.shoot = mod.ProjectileType("HallowedSprayPro"); - item.shootSpeed = 7.5f; - item.mana = 6; - item.noMelee = true; - item.useStyle = 5; - item.knockBack = 3; - item.value = 99999; - item.rare = 5; - item.UseSound = SoundID.Item21; - item.autoReuse = true; - } + item.damage = 56; + item.magic = true; + item.width = 28; + item.height = 30; + item.useTime = 10; + item.useAnimation = 30; + item.shoot = mod.ProjectileType("HallowedSprayPro"); + item.shootSpeed = 7.5f; + item.mana = 6; + item.noMelee = true; + item.useStyle = 5; + item.knockBack = 3; + item.value = 99999; + item.rare = 5; + item.UseSound = SoundID.Item21; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Hallowed Spray"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Hallowed Spray"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.SpellTome, 1); - recipe.AddIngredient(ItemID.HallowedBar, 12); - recipe.SetResult(this); - recipe.AddTile(101); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.SpellTome, 1); + recipe.AddIngredient(ItemID.HallowedBar, 12); + recipe.SetResult(this); + recipe.AddTile(101); + recipe.AddRecipe(); + } + } +} diff --git a/Items/HallowedVisage.cs b/Items/HallowedVisage.cs index d95cbd24..892c2ff1 100644 --- a/Items/HallowedVisage.cs +++ b/Items/HallowedVisage.cs @@ -7,56 +7,56 @@ namespace Tremor.Items { -[AutoloadEquip(EquipType.Head)] - public class HallowedVisage : ModItem - { - - public override void SetDefaults() - { - - item.width = 26; - item.height = 20; - - item.value = 50000; - item.rare = 5; - item.defense = 10; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Hallowed Visage"); - Tooltip.SetDefault("Increases alchemic damage by 27%"); - } - - - public override void UpdateEquip(Player player) - { - player.GetModPlayer(mod).alchemistDamage += 0.27f; - } - - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == 551 && legs.type == 552; - } - - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increases alchemic critical chance by 23%"; - player.GetModPlayer(mod).alchemistCrit += 23; - } - - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawOutlines = true; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.HallowedBar, 12); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } - } + [AutoloadEquip(EquipType.Head)] + public class HallowedVisage : ModItem + { + + public override void SetDefaults() + { + + item.width = 26; + item.height = 20; + + item.value = 50000; + item.rare = 5; + item.defense = 10; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Hallowed Visage"); + Tooltip.SetDefault("Increases alchemic damage by 27%"); + } + + + public override void UpdateEquip(Player player) + { + player.GetModPlayer(mod).alchemistDamage += 0.27f; + } + + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == 551 && legs.type == 552; + } + + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increases alchemic critical chance by 23%"; + player.GetModPlayer(mod).alchemistCrit += 23; + } + + public override void ArmorSetShadows(Player player) + { + player.armorEffectDrawOutlines = true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.HallowedBar, 12); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } } diff --git a/Items/HallowerBanner.cs b/Items/HallowerBanner.cs index ecbac24f..09c40cb3 100644 --- a/Items/HallowerBanner.cs +++ b/Items/HallowerBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class HallowerBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class HallowerBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 69; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 69; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Hallower Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Hallower Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/HandCannon.cs b/Items/HandCannon.cs index 070ac0f8..a4eda308 100644 --- a/Items/HandCannon.cs +++ b/Items/HandCannon.cs @@ -5,34 +5,36 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class HandCannon : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class HandCannon : ModItem + { + public override void SetDefaults() + { - item.damage = 60; - item.ranged = true; - item.width = 58; - item.height = 30; - item.useTime = 40; - item.useAnimation = 40; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 6; - item.value = 50000; - item.rare = 5; - item.UseSound = SoundID.Item11; - item.autoReuse = true; - item.shoot = 162; - item.shootSpeed = 15f; - //item.useAmmo = 14; - } + item.damage = 60; + item.ranged = true; + item.width = 58; + item.height = 30; + item.useTime = 40; + item.useAnimation = 40; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 6; + item.value = 50000; + item.rare = 5; + item.UseSound = SoundID.Item11; + item.autoReuse = true; + item.shoot = 162; + item.shootSpeed = 15f; + //item.useAmmo = 14; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Hand Cannon"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Hand Cannon"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/HappyTotemMask.cs b/Items/HappyTotemMask.cs index 7c835848..df204353 100644 --- a/Items/HappyTotemMask.cs +++ b/Items/HappyTotemMask.cs @@ -4,25 +4,28 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class HappyTotemMask : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class HappyTotemMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 36; - item.height = 24; - item.rare = 1; - item.vanity = true; - } + item.width = 36; + item.height = 24; + item.rare = 1; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Happy Totem Mask"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Happy Totem Mask"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/HardArmor.cs b/Items/HardArmor.cs index 792e1aad..77c1c1b5 100644 --- a/Items/HardArmor.cs +++ b/Items/HardArmor.cs @@ -5,26 +5,27 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class HardArmor : ModItem +namespace Tremor.Items { + public class HardArmor : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 34; - item.height = 34; - item.value = 150000; - item.rare = 3; - item.defense = 8; - item.accessory = true; - } + item.width = 34; + item.height = 34; + item.value = 150000; + item.rare = 3; + item.defense = 8; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Hard Armor"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Hard Armor"); + Tooltip.SetDefault(""); + } public override void AddRecipes() { @@ -34,6 +35,7 @@ public override void AddRecipes() recipe.AddTile(114); recipe.SetResult(this); recipe.AddRecipe(); - } + } -}} + } +} diff --git a/Items/HardBulwark.cs b/Items/HardBulwark.cs index 6b89954e..e01e2208 100644 --- a/Items/HardBulwark.cs +++ b/Items/HardBulwark.cs @@ -5,34 +5,36 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class HardBulwark : ModItem +namespace Tremor.Items { + public class HardBulwark : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 34; - item.height = 34; - item.value = 120000; - item.rare = 2; - item.defense = 5; - item.accessory = true; - } + item.width = 34; + item.height = 34; + item.value = 120000; + item.rare = 2; + item.defense = 5; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Hard Bulwark"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Hard Bulwark"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Shackle, 5); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Shackle, 5); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/HardCometiteBar.cs b/Items/HardCometiteBar.cs index 9f8b566f..1254aa9b 100644 --- a/Items/HardCometiteBar.cs +++ b/Items/HardCometiteBar.cs @@ -4,39 +4,41 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class HardCometiteBar : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class HardCometiteBar : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 17500; - item.rare = 11; - item.createTile = mod.TileType("HardCometiteBarTile"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 17500; + item.rare = 11; + item.createTile = mod.TileType("HardCometiteBarTile"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Hardened Cometite Bar"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Hardened Cometite Bar"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "HardCometiteOre", 8); - recipe.AddIngredient(null, "ChargedCrystal", 1); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "HardCometiteOre", 8); + recipe.AddIngredient(null, "ChargedCrystal", 1); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } +} diff --git a/Items/HardCometiteOre.cs b/Items/HardCometiteOre.cs index bcf07a58..00dbd1f3 100644 --- a/Items/HardCometiteOre.cs +++ b/Items/HardCometiteOre.cs @@ -12,24 +12,24 @@ public override void SetDefaults() { item.width = 12; - item.value = 10000; + item.value = 10000; item.height = 12; item.maxStack = 999; item.useTurn = true; item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.rare = 11; + item.rare = 11; item.useStyle = 1; item.consumable = true; item.createTile = mod.TileType("HardCometiteOreTile"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Hardened Cometite Ore"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Hardened Cometite Ore"); + Tooltip.SetDefault(""); + } } } diff --git a/Items/HarpyChestplate.cs b/Items/HarpyChestplate.cs index ea94475c..3f76e1f8 100644 --- a/Items/HarpyChestplate.cs +++ b/Items/HarpyChestplate.cs @@ -5,40 +5,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class HarpyChestplate : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + [AutoloadEquip(EquipType.Body)] + public class HarpyChestplate : ModItem + { + public override void SetDefaults() + { - item.width = 26; - item.height = 18; - item.value = 100; + item.width = 26; + item.height = 18; + item.value = 100; - item.rare = 2; - item.defense = 5; - } + item.rare = 2; + item.defense = 5; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Harpy Chestplate"); - Tooltip.SetDefault("Increases jump height"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Harpy Chestplate"); + Tooltip.SetDefault("Increases jump height"); + } - public override void UpdateEquip(Player player) - { - player.jumpBoost = true; - } + public override void UpdateEquip(Player player) + { + player.jumpBoost = true; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Silk, 10); - recipe.AddIngredient(ItemID.Feather, 13); - recipe.SetResult(this); - recipe.AddTile(86); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Silk, 10); + recipe.AddIngredient(ItemID.Feather, 13); + recipe.SetResult(this); + recipe.AddTile(86); + recipe.AddRecipe(); + } + } +} diff --git a/Items/HarpyHelmet.cs b/Items/HarpyHelmet.cs index bf5e7d1c..f1685d75 100644 --- a/Items/HarpyHelmet.cs +++ b/Items/HarpyHelmet.cs @@ -5,53 +5,56 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class HarpyHelmet : ModItem +namespace Tremor.Items { - - - public override void SetDefaults() - { - - item.width = 24; - item.height = 26; - - item.value = 100; - item.rare = 2; - item.defense = 3; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Harpy Helmet"); - Tooltip.SetDefault("10% increased melee damage"); - } - - - public override void UpdateEquip(Player player) - { - player.meleeDamage += 0.1f; - } - - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == mod.ItemType("HarpyChestplate") && legs.type == mod.ItemType("HarpyLeggings"); - } - - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Allows you to fall slowly"; - player.slowFall = true; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Silk, 8); - recipe.AddIngredient(ItemID.Feather, 4); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } - -}} + [AutoloadEquip(EquipType.Head)] + public class HarpyHelmet : ModItem + { + + + public override void SetDefaults() + { + + item.width = 24; + item.height = 26; + + item.value = 100; + item.rare = 2; + item.defense = 3; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Harpy Helmet"); + Tooltip.SetDefault("10% increased melee damage"); + } + + + public override void UpdateEquip(Player player) + { + player.meleeDamage += 0.1f; + } + + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("HarpyChestplate") && legs.type == mod.ItemType("HarpyLeggings"); + } + + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Allows you to fall slowly"; + player.slowFall = true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Silk, 8); + recipe.AddIngredient(ItemID.Feather, 4); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } + + } +} diff --git a/Items/HarpyHood.cs b/Items/HarpyHood.cs index dfe3a5af..4a8991a9 100644 --- a/Items/HarpyHood.cs +++ b/Items/HarpyHood.cs @@ -5,53 +5,56 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class HarpyHood : ModItem +namespace Tremor.Items { - - - public override void SetDefaults() - { - - item.width = 24; - item.height = 26; - - item.value = 100; - item.rare = 2; - item.defense = 3; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Harpy Hood"); - Tooltip.SetDefault("10% increased magic damage"); - } - - - public override void UpdateEquip(Player player) - { - player.magicDamage += 0.1f; - } - - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == mod.ItemType("HarpyChestplate") && legs.type == mod.ItemType("HarpyLeggings"); - } - - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Allows you to fall slowly"; - player.slowFall = true; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Silk, 8); - recipe.AddIngredient(ItemID.Feather, 4); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } - -}} + [AutoloadEquip(EquipType.Head)] + public class HarpyHood : ModItem + { + + + public override void SetDefaults() + { + + item.width = 24; + item.height = 26; + + item.value = 100; + item.rare = 2; + item.defense = 3; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Harpy Hood"); + Tooltip.SetDefault("10% increased magic damage"); + } + + + public override void UpdateEquip(Player player) + { + player.magicDamage += 0.1f; + } + + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("HarpyChestplate") && legs.type == mod.ItemType("HarpyLeggings"); + } + + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Allows you to fall slowly"; + player.slowFall = true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Silk, 8); + recipe.AddIngredient(ItemID.Feather, 4); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } + + } +} diff --git a/Items/HarpyLeggings.cs b/Items/HarpyLeggings.cs index f1319636..efbff641 100644 --- a/Items/HarpyLeggings.cs +++ b/Items/HarpyLeggings.cs @@ -5,43 +5,46 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class HarpyLeggings : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Legs)] + public class HarpyLeggings : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 18; - item.value = 180; + item.width = 22; + item.height = 18; + item.value = 180; - item.rare = 1; - item.defense = 4; - } + item.rare = 1; + item.defense = 4; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Harpy Leggings"); - Tooltip.SetDefault("10% increased movement speed"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Harpy Leggings"); + Tooltip.SetDefault("10% increased movement speed"); + } - public override void UpdateEquip(Player player) - { - player.moveSpeed += 0.10f; - } + public override void UpdateEquip(Player player) + { + player.moveSpeed += 0.10f; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Silk, 10); - recipe.AddIngredient(ItemID.Feather, 6); - recipe.SetResult(this); - recipe.AddTile(86); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Silk, 10); + recipe.AddIngredient(ItemID.Feather, 6); + recipe.SetResult(this); + recipe.AddTile(86); + recipe.AddRecipe(); + } -}} + } +} diff --git a/Items/HarpyMask.cs b/Items/HarpyMask.cs index 97c1892e..422fc21f 100644 --- a/Items/HarpyMask.cs +++ b/Items/HarpyMask.cs @@ -5,53 +5,56 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class HarpyMask : ModItem +namespace Tremor.Items { - - - public override void SetDefaults() - { - - item.width = 24; - item.height = 26; - - item.value = 100; - item.rare = 2; - item.defense = 3; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Harpy Mask"); - Tooltip.SetDefault("10% increased ranged damage"); - } - - - public override void UpdateEquip(Player player) - { - player.rangedDamage += 0.1f; - } - - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == mod.ItemType("HarpyChestplate") && legs.type == mod.ItemType("HarpyLeggings"); - } - - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Allows you to fall slowly"; - player.slowFall = true; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Silk, 8); - recipe.AddIngredient(ItemID.Feather, 4); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } - -}} + [AutoloadEquip(EquipType.Head)] + public class HarpyMask : ModItem + { + + + public override void SetDefaults() + { + + item.width = 24; + item.height = 26; + + item.value = 100; + item.rare = 2; + item.defense = 3; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Harpy Mask"); + Tooltip.SetDefault("10% increased ranged damage"); + } + + + public override void UpdateEquip(Player player) + { + player.rangedDamage += 0.1f; + } + + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("HarpyChestplate") && legs.type == mod.ItemType("HarpyLeggings"); + } + + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Allows you to fall slowly"; + player.slowFall = true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Silk, 8); + recipe.AddIngredient(ItemID.Feather, 4); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } + + } +} diff --git a/Items/HarpyWarriorBanner.cs b/Items/HarpyWarriorBanner.cs index d9ab6e2d..6259b320 100644 --- a/Items/HarpyWarriorBanner.cs +++ b/Items/HarpyWarriorBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class HarpyWarriorBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class HarpyWarriorBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 70; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 70; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Harpy Warrior Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Harpy Warrior Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/HarvesterScythe.cs b/Items/HarvesterScythe.cs index 576dfb07..7453b2df 100644 --- a/Items/HarvesterScythe.cs +++ b/Items/HarvesterScythe.cs @@ -4,38 +4,40 @@ using Terraria.ModLoader; using Terraria.ID; -namespace Tremor.Items { -public class HarvesterScythe : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class HarvesterScythe : ModItem + { + public override void SetDefaults() + { - item.damage = 30; - item.melee = true; - item.width = 66; - item.height = 50; - item.useTime = 24; - item.useAnimation = 24; - item.useStyle = 1; - item.knockBack = 3; - item.value = 35400; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 30; + item.melee = true; + item.width = 66; + item.height = 50; + item.useTime = 24; + item.useAnimation = 24; + item.useStyle = 1; + item.knockBack = 3; + item.value = 35400; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Harvester Scythe"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Harvester Scythe"); + Tooltip.SetDefault(""); + } - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) - { - int newLife = Main.rand.Next(damage/4) + 3; - Main.player[item.owner].statLife += newLife; - Main.player[item.owner].HealEffect(newLife); - } + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + { + int newLife = Main.rand.Next(damage / 4) + 3; + Main.player[item.owner].statLife += newLife; + Main.player[item.owner].HealEffect(newLife); + } -}} + } +} diff --git a/Items/HazardousChemicals.cs b/Items/HazardousChemicals.cs index eb10995e..92f824cb 100644 --- a/Items/HazardousChemicals.cs +++ b/Items/HazardousChemicals.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class HazardousChemicals : ModItem +namespace Tremor.Items { + public class HazardousChemicals : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 44; + item.width = 22; + item.height = 44; - item.value = 10000; - item.rare = 3; - item.maxStack = 1; - item.accessory = true; - } + item.value = 10000; + item.rare = 3; + item.maxStack = 1; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Hazardous Chemicals"); - Tooltip.SetDefault("Increases alchemic damage by 5%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Hazardous Chemicals"); + Tooltip.SetDefault("Increases alchemic damage by 5%"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.GetModPlayer(mod).alchemistDamage += 0.05f; - } -}} + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.GetModPlayer(mod).alchemistDamage += 0.05f; + } + } +} diff --git a/Items/HeadlessZombieBanner.cs b/Items/HeadlessZombieBanner.cs index c8518345..ef4258b0 100644 --- a/Items/HeadlessZombieBanner.cs +++ b/Items/HeadlessZombieBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class HeadlessZombieBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class HeadlessZombieBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 33; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 33; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Headless Zombie Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Headless Zombie Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/HealthBooster.cs b/Items/HealthBooster.cs index f586b0a8..b23e1d66 100644 --- a/Items/HealthBooster.cs +++ b/Items/HealthBooster.cs @@ -5,28 +5,29 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class HealthBooster : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class HealthBooster : ModItem + { + public override void SetDefaults() + { - item.useAnimation = 15; - item.useTime = 15; - item.useStyle = 4; - item.width = 22; - item.UseSound = SoundID.Item43; - item.height = 18; - item.buffType = mod.BuffType("HealthBooster"); - item.value = 5160000; - item.rare = 11; - } + item.useAnimation = 15; + item.useTime = 15; + item.useStyle = 4; + item.width = 22; + item.UseSound = SoundID.Item43; + item.height = 18; + item.buffType = mod.BuffType("HealthBooster"); + item.value = 5160000; + item.rare = 11; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Health Booster"); - Tooltip.SetDefault("Regenerates health every minute"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Health Booster"); + Tooltip.SetDefault("Regenerates health every minute"); + } public override void UseStyle(Player player) @@ -36,5 +37,6 @@ public override void UseStyle(Player player) player.AddBuff(item.buffType, 3600, true); } } - -}} + + } +} diff --git a/Items/HealthStimPack.cs b/Items/HealthStimPack.cs index 9c1181ca..c910a04f 100644 --- a/Items/HealthStimPack.cs +++ b/Items/HealthStimPack.cs @@ -3,47 +3,49 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class HealthStimPack : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.width = 36; - item.height = 36; - item.maxStack = 999; - item.rare = 11; - item.useAnimation = 15; - item.useTime = 15; - item.useStyle = 2; - item.UseSound = SoundID.Item3; - item.consumable = true; - } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Health Stim Pack"); - Tooltip.SetDefault("Restores 50 health\nHas no cooldown"); - } + public class HealthStimPack : ModItem + { + public override void SetDefaults() + { + item.width = 36; + item.height = 36; + item.maxStack = 999; + item.rare = 11; + item.useAnimation = 15; + item.useTime = 15; + item.useStyle = 2; + item.UseSound = SoundID.Item3; + item.consumable = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Health Stim Pack"); + Tooltip.SetDefault("Restores 50 health\nHas no cooldown"); + } - public override bool UseItem(Player player) - { + public override bool UseItem(Player player) + { Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 3); Main.player[Main.myPlayer].HealEffect(50); player.statLife += 50; return true; - } + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BrassBar", 2); - recipe.AddIngredient(ItemID.SuperHealingPotion); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddIngredient(null, "NightmareBar", 5); - recipe.SetResult(this); - recipe.AddTile(13); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "BrassBar", 2); + recipe.AddIngredient(ItemID.SuperHealingPotion); + recipe.AddIngredient(ItemID.BottledWater); + recipe.AddIngredient(null, "NightmareBar", 5); + recipe.SetResult(this); + recipe.AddTile(13); + recipe.AddRecipe(); + } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/Items/HealthSupportFlask.cs b/Items/HealthSupportFlask.cs index 0143d50b..545c340a 100644 --- a/Items/HealthSupportFlask.cs +++ b/Items/HealthSupportFlask.cs @@ -8,71 +8,72 @@ namespace Tremor.Items { public class HealthSupportFlask : ModItem - { + { - public override void SetDefaults() - { - item.crit = 4; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("HealthSupportFlaskPro"); - item.shootSpeed = 8f; - item.useStyle = 1; - item.knockBack = 1; - item.UseSound = SoundID.Item106; - item.value = 200; - item.rare = 2; - item.autoReuse = false; + public override void SetDefaults() + { + item.crit = 4; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("HealthSupportFlaskPro"); + item.shootSpeed = 8f; + item.useStyle = 1; + item.knockBack = 1; + item.UseSound = SoundID.Item106; + item.value = 200; + item.rare = 2; + item.autoReuse = false; - item.ammo = mod.ItemType("BoomFlask"); - } + item.ammo = mod.ItemType("BoomFlask"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Healing Support Flask"); - Tooltip.SetDefault("Throws a flask that explodes into clouds\nClouds heal your allies"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Healing Support Flask"); + Tooltip.SetDefault("Throws a flask that explodes into clouds\nClouds heal your allies"); + } - public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) - { - type = mod.ProjectileType("HealthSupportCloudPro"); - } - - public override void UpdateInventory(Player player) - { - MPlayer modPlayer = player.GetModPlayer(mod); - if (modPlayer.novaHelmet) - { - item.autoReuse = true; - } - if (!modPlayer.novaHelmet) - { - item.autoReuse = false; - } - - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) - { - item.shootSpeed = 11f; - } - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) - { - item.shootSpeed = 8f; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) - { - item.autoReuse = true; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) - { - item.autoReuse = false; - } - } + public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) + { + type = mod.ProjectileType("HealthSupportCloudPro"); + } -}} + public override void UpdateInventory(Player player) + { + MPlayer modPlayer = player.GetModPlayer(mod); + if (modPlayer.novaHelmet) + { + item.autoReuse = true; + } + if (!modPlayer.novaHelmet) + { + item.autoReuse = false; + } + + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) + { + item.shootSpeed = 11f; + } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) + { + item.shootSpeed = 8f; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) + { + item.autoReuse = true; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) + { + item.autoReuse = false; + } + } + + } +} diff --git a/Items/HeartAmulet.cs b/Items/HeartAmulet.cs index 0f7ca77f..c6939f1e 100644 --- a/Items/HeartAmulet.cs +++ b/Items/HeartAmulet.cs @@ -7,30 +7,30 @@ namespace Tremor.Items { - public class HeartAmulet : ModItem - { - public override void SetDefaults() - { + public class HeartAmulet : ModItem + { + public override void SetDefaults() + { - item.width = 36; - item.height = 44; - item.value = 1000; - item.rare = 4; + item.width = 36; + item.height = 44; + item.value = 1000; + item.rare = 4; - item.accessory = true; - } + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Heart Amulet"); - Tooltip.SetDefault("You respawn with 80% of maximum health after death"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Heart Amulet"); + Tooltip.SetDefault("You respawn with 80% of maximum health after death"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - TremorPlayer modPlayer = (TremorPlayer)player.GetModPlayer(mod, "TremorPlayer"); - modPlayer.heartAmulet = true; - } - } + public override void UpdateAccessory(Player player, bool hideVisual) + { + TremorPlayer modPlayer = (TremorPlayer)player.GetModPlayer(mod, "TremorPlayer"); + modPlayer.heartAmulet = true; + } + } } diff --git a/Items/HeartMagnet.cs b/Items/HeartMagnet.cs index 25c565d7..98001db0 100644 --- a/Items/HeartMagnet.cs +++ b/Items/HeartMagnet.cs @@ -4,29 +4,31 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class HeartMagnet : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class HeartMagnet : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 44; + item.width = 22; + item.height = 44; - item.value = 12000; - item.rare = 3; - item.accessory = true; - } + item.value = 12000; + item.rare = 3; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Heart Magnet"); - Tooltip.SetDefault("Increased heart pickup range"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Heart Magnet"); + Tooltip.SetDefault("Increased heart pickup range"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.lifeMagnet = true; - } -}} + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.lifeMagnet = true; + } + } +} diff --git a/Items/HeartofAtis.cs b/Items/HeartofAtis.cs index 46f5bdd6..f9ba3308 100644 --- a/Items/HeartofAtis.cs +++ b/Items/HeartofAtis.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class HeartofAtis : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class HeartofAtis : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 44; + item.width = 22; + item.height = 44; - item.value = 1200; - item.rare = 2; - item.accessory = true; - item.defense = 3; - } + item.value = 1200; + item.rare = 2; + item.accessory = true; + item.defense = 3; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Heart of Atis"); - Tooltip.SetDefault("Increases life regeneration"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Heart of Atis"); + Tooltip.SetDefault("Increases life regeneration"); + } public override void UpdateAccessory(Player player, bool hideVisual) - { - player.lifeRegen +=1; - } -}} + { + player.lifeRegen += 1; + } + } +} diff --git a/Items/HeatCore.cs b/Items/HeatCore.cs index 146a867c..ae882a79 100644 --- a/Items/HeatCore.cs +++ b/Items/HeatCore.cs @@ -7,76 +7,76 @@ namespace Tremor.Items { - public class HeatCore : ModItem - { - const int ShootType = ProjectileID.HeatRay; // Тип выÑтрела - const float ShootRange = 600.0f; // ДальноÑÑ‚ÑŒ выÑтрела - const float ShootKN = 1.0f; // ОтбраÑывание - const int ShootRate = 40; // ЧаÑтота выÑтрела (60 - 1 Ñекунда) - const int ShootCount = 2; // Лазеров за выÑтрел - const float ShootSpeed = 30f; // СкороÑÑ‚ÑŒ выÑтрела (Ð´Ð»Ñ Ð»Ð°Ð·ÐµÑ€Ð° - дальноÑÑ‚ÑŒ) - const int spread = 45; // Ð Ð°Ð·Ð±Ñ€Ð¾Ñ - const float spreadMult = 0.045f; // Модификатор разброÑа + public class HeatCore : ModItem + { + const int ShootType = ProjectileID.HeatRay; // Тип выÑтрела + const float ShootRange = 600.0f; // ДальноÑÑ‚ÑŒ выÑтрела + const float ShootKN = 1.0f; // ОтбраÑывание + const int ShootRate = 40; // ЧаÑтота выÑтрела (60 - 1 Ñекунда) + const int ShootCount = 2; // Лазеров за выÑтрел + const float ShootSpeed = 30f; // СкороÑÑ‚ÑŒ выÑтрела (Ð´Ð»Ñ Ð»Ð°Ð·ÐµÑ€Ð° - дальноÑÑ‚ÑŒ) + const int spread = 45; // Ð Ð°Ð·Ð±Ñ€Ð¾Ñ + const float spreadMult = 0.045f; // Модификатор разброÑа - int TimeToShoot = ShootRate; + int TimeToShoot = ShootRate; - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 36; - item.height = 36; + item.width = 36; + item.height = 36; - item.value = 240000; - item.rare = 9; - item.expert = true; - item.accessory = true; - } + item.value = 240000; + item.rare = 9; + item.expert = true; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Heat Core"); - Tooltip.SetDefault("Shoots rays at nearby enemies"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Heat Core"); + Tooltip.SetDefault("Shoots rays at nearby enemies"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - if (--TimeToShoot <= 0) - { - TimeToShoot = ShootRate; - int Target = GetTarget(); - if (Target != -1) Shoot(Target, GetDamage()); - } - } - -int GetTarget() - { - int Target = -1; - for(int k = 0; k < Main.npc.Length; k++) - { - if (Main.npc[k].active && Main.npc[k].lifeMax > 5 && !Main.npc[k].dontTakeDamage && !Main.npc[k].friendly && Main.npc[k].Distance(Main.player[item.owner].Center) <= ShootRange && Collision.CanHitLine(Main.player[item.owner].Center, 4, 4, Main.npc[k].Center, 4, 4)) - { - Target = k; - break; - } - } - return Target; - } + public override void UpdateAccessory(Player player, bool hideVisual) + { + if (--TimeToShoot <= 0) + { + TimeToShoot = ShootRate; + int Target = GetTarget(); + if (Target != -1) Shoot(Target, GetDamage()); + } + } - int GetDamage() - { - return (10 * ((int)Main.player[item.owner].magicDamage + (int)Main.player[item.owner].meleeDamage + (int)Main.player[item.owner].minionDamage + (int)Main.player[item.owner].rangedDamage + (int)Main.player[item.owner].thrownDamage)) + 15; - } + int GetTarget() + { + int Target = -1; + for (int k = 0; k < Main.npc.Length; k++) + { + if (Main.npc[k].active && Main.npc[k].lifeMax > 5 && !Main.npc[k].dontTakeDamage && !Main.npc[k].friendly && Main.npc[k].Distance(Main.player[item.owner].Center) <= ShootRange && Collision.CanHitLine(Main.player[item.owner].Center, 4, 4, Main.npc[k].Center, 4, 4)) + { + Target = k; + break; + } + } + return Target; + } - void Shoot(int Target, int Damage) - { - Vector2 velocity = Helper.VelocityToPoint(Main.player[item.owner].Center, Main.npc[Target].Center, ShootSpeed); - for (int l = 0; l < ShootCount; l++) - { - velocity.X = velocity.X + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - velocity.Y = velocity.Y + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - int i = Projectile.NewProjectile(Main.player[item.owner].Center.X, Main.player[item.owner].Center.Y, velocity.X, velocity.Y, ShootType, Damage, ShootKN, item.owner); - } - } - } + int GetDamage() + { + return (10 * ((int)Main.player[item.owner].magicDamage + (int)Main.player[item.owner].meleeDamage + (int)Main.player[item.owner].minionDamage + (int)Main.player[item.owner].rangedDamage + (int)Main.player[item.owner].thrownDamage)) + 15; + } + + void Shoot(int Target, int Damage) + { + Vector2 velocity = Helper.VelocityToPoint(Main.player[item.owner].Center, Main.npc[Target].Center, ShootSpeed); + for (int l = 0; l < ShootCount; l++) + { + velocity.X = velocity.X + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.Y = velocity.Y + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + int i = Projectile.NewProjectile(Main.player[item.owner].Center.X, Main.player[item.owner].Center.Y, velocity.X, velocity.Y, ShootType, Damage, ShootKN, item.owner); + } + } + } } diff --git a/Items/HeaterOfWorldsBag.cs b/Items/HeaterOfWorldsBag.cs index 49f5fb17..ad220152 100644 --- a/Items/HeaterOfWorldsBag.cs +++ b/Items/HeaterOfWorldsBag.cs @@ -4,42 +4,44 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class HeaterOfWorldsBag : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.maxStack = 999; - item.consumable = true; - item.width = 24; - item.height = 24; - - item.rare = 9; - item.expert = true; - bossBagNPC = mod.NPCType("HeaterOfWorldsHead"); - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Treasure Bag"); - Tooltip.SetDefault("Right click to open"); - } - - - public override bool CanRightClick() - { - return true; - } - - public override void OpenBossBag(Player player) - { - if(Main.rand.Next(7) == 0) - { - player.QuickSpawnItem(mod.ItemType("HeaterOfWorldsMask")); - } - player.QuickSpawnItem(mod.ItemType("MoltenParts")); - player.QuickSpawnItem(mod.ItemType("InfernalShield")); - } - -}} + public class HeaterOfWorldsBag : ModItem + { + public override void SetDefaults() + { + + item.maxStack = 999; + item.consumable = true; + item.width = 24; + item.height = 24; + + item.rare = 9; + item.expert = true; + bossBagNPC = mod.NPCType("HeaterOfWorldsHead"); + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Treasure Bag"); + Tooltip.SetDefault("Right click to open"); + } + + + public override bool CanRightClick() + { + return true; + } + + public override void OpenBossBag(Player player) + { + if (Main.rand.Next(7) == 0) + { + player.QuickSpawnItem(mod.ItemType("HeaterOfWorldsMask")); + } + player.QuickSpawnItem(mod.ItemType("MoltenParts")); + player.QuickSpawnItem(mod.ItemType("InfernalShield")); + } + + } +} diff --git a/Items/HeaterOfWorldsMask.cs b/Items/HeaterOfWorldsMask.cs index 6ea7c4aa..68656259 100644 --- a/Items/HeaterOfWorldsMask.cs +++ b/Items/HeaterOfWorldsMask.cs @@ -4,25 +4,28 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class HeaterOfWorldsMask : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class HeaterOfWorldsMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 32; - item.rare = 1; - item.vanity = true; - } + item.width = 26; + item.height = 32; + item.rare = 1; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Heater of Worlds Mask"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Heater of Worlds Mask"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/HeaterOfWorldsTrophy.cs b/Items/HeaterOfWorldsTrophy.cs index c8f83161..2f26be46 100644 --- a/Items/HeaterOfWorldsTrophy.cs +++ b/Items/HeaterOfWorldsTrophy.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class HeaterOfWorldsTrophy : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class HeaterOfWorldsTrophy : ModItem + { + public override void SetDefaults() + { - item.width = 32; - item.height = 32; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 50000; - item.createTile = mod.TileType("HeaterOfWorldsTrophy"); - item.placeStyle = 0; - } + item.width = 32; + item.height = 32; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 50000; + item.createTile = mod.TileType("HeaterOfWorldsTrophy"); + item.placeStyle = 0; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Heater of Worlds Trophy"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Heater of Worlds Trophy"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/HeavenBreastplate.cs b/Items/HeavenBreastplate.cs index a4d7b571..d8a8e2dc 100644 --- a/Items/HeavenBreastplate.cs +++ b/Items/HeavenBreastplate.cs @@ -5,32 +5,34 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class HeavenBreastplate : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Body)] + public class HeavenBreastplate : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 18; + item.width = 26; + item.height = 18; - item.value = 6000; - item.rare = 3; - item.defense = 7; - } + item.value = 6000; + item.rare = 3; + item.defense = 7; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Heaven Breastplate"); - Tooltip.SetDefault("12% increased ranged damage"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Heaven Breastplate"); + Tooltip.SetDefault("12% increased ranged damage"); + } - public override void UpdateEquip(Player player) - { - player.rangedDamage += 0.12f; - } + public override void UpdateEquip(Player player) + { + player.rangedDamage += 0.12f; + } -}} + } +} diff --git a/Items/HeavenHelmet.cs b/Items/HeavenHelmet.cs index e2f65673..f292c7b8 100644 --- a/Items/HeavenHelmet.cs +++ b/Items/HeavenHelmet.cs @@ -5,65 +5,68 @@ using Terraria.ModLoader; using Microsoft.Xna.Framework; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class HeavenHelmet : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class HeavenHelmet : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 32; - item.height = 26; + item.width = 32; + item.height = 26; - item.value = 6000; - item.rare = 3; - item.defense = 6; - } + item.value = 6000; + item.rare = 3; + item.defense = 6; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Heaven Helmet"); - Tooltip.SetDefault("Increases ranged critical strike chance by 12"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Heaven Helmet"); + Tooltip.SetDefault("Increases ranged critical strike chance by 12"); + } - public override void UpdateEquip(Player player) - { - player.rangedCrit += 12; - } + public override void UpdateEquip(Player player) + { + player.rangedCrit += 12; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("HeavenBreastplate") && legs.type == mod.ItemType("HeavenLeggings"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("HeavenBreastplate") && legs.type == mod.ItemType("HeavenLeggings"); + } - public override void UpdateArmorSet(Player p) - { - p.setBonus = "Grants immunity to most debuffs"; - p.buffImmune[44] = true; //Frostburn - p.buffImmune[46] = true; //Chilled - p.buffImmune[47] = true; //Frozen - p.buffImmune[20] = true; //Poisoned - p.buffImmune[22] = true; //Darkness - p.buffImmune[24] = true; //Fire - p.buffImmune[23] = true; //Cursed - p.buffImmune[30] = true; //Bleeding - p.buffImmune[31] = true; //Confused - p.buffImmune[32] = true; //Slowed - p.buffImmune[33] = true; //Weak - p.buffImmune[35] = true; //Silenced - p.buffImmune[36] = true; //Broken Armor - p.buffImmune[69] = true; //Ichor - p.buffImmune[70] = true; //Venom - p.buffImmune[80] = true; //Black Out - } + public override void UpdateArmorSet(Player p) + { + p.setBonus = "Grants immunity to most debuffs"; + p.buffImmune[44] = true; //Frostburn + p.buffImmune[46] = true; //Chilled + p.buffImmune[47] = true; //Frozen + p.buffImmune[20] = true; //Poisoned + p.buffImmune[22] = true; //Darkness + p.buffImmune[24] = true; //Fire + p.buffImmune[23] = true; //Cursed + p.buffImmune[30] = true; //Bleeding + p.buffImmune[31] = true; //Confused + p.buffImmune[32] = true; //Slowed + p.buffImmune[33] = true; //Weak + p.buffImmune[35] = true; //Silenced + p.buffImmune[36] = true; //Broken Armor + p.buffImmune[69] = true; //Ichor + p.buffImmune[70] = true; //Venom + p.buffImmune[80] = true; //Black Out + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawShadowSubtle=true; + player.armorEffectDrawShadowSubtle = true; } -}} + } +} diff --git a/Items/HeavenLeggings.cs b/Items/HeavenLeggings.cs index b16d36a7..7ca2fd9e 100644 --- a/Items/HeavenLeggings.cs +++ b/Items/HeavenLeggings.cs @@ -4,31 +4,34 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class HeavenLeggings : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Legs)] + public class HeavenLeggings : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 18; - item.value = 6000; + item.width = 22; + item.height = 18; + item.value = 6000; - item.rare = 3; - item.defense = 5; - } + item.rare = 3; + item.defense = 5; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Heaven Leggings"); - Tooltip.SetDefault("15% decreased movement speed"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Heaven Leggings"); + Tooltip.SetDefault("15% decreased movement speed"); + } - public override void UpdateEquip(Player player) - { - player.moveSpeed -= 0.15f; - } -}} + public override void UpdateEquip(Player player) + { + player.moveSpeed -= 0.15f; + } + } +} diff --git a/Items/HeavyBeamCannon.cs b/Items/HeavyBeamCannon.cs index dc1900eb..714ee81e 100644 --- a/Items/HeavyBeamCannon.cs +++ b/Items/HeavyBeamCannon.cs @@ -24,7 +24,7 @@ public override void SetDefaults() item.knockBack = 4f; item.value = Item.sellPrice(0, 10, 0, 0); item.rare = 7; - item.channel = true; + item.channel = true; item.UseSound = SoundID.Item12; item.autoReuse = false; @@ -32,18 +32,18 @@ public override void SetDefaults() item.shoot = mod.ProjectileType("ExampleLaser"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Heavy Beam Cannon"); - Tooltip.SetDefault("Fires a constant powerful beam"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Heavy Beam Cannon"); + Tooltip.SetDefault("Fires a constant powerful beam"); + } - public override Vector2? HoldoutOffset() - { - return new Vector2(0, -1); - } + public override Vector2? HoldoutOffset() + { + return new Vector2(0, -1); + } } } diff --git a/Items/HeavyNecklace.cs b/Items/HeavyNecklace.cs index b5dd1410..dfc2e150 100644 --- a/Items/HeavyNecklace.cs +++ b/Items/HeavyNecklace.cs @@ -5,35 +5,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class HeavyNecklace : ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 30; - item.height = 34; - item.value = 100000; - item.rare = 2; - - item.accessory = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Heavy Necklace"); - Tooltip.SetDefault("5% increased all damage"); - } - - - public override void UpdateAccessory(Player player, bool hideVisual) - - { - player.meleeDamage += 0.05f; - player.rangedDamage += 0.05f; - player.magicDamage += 0.05f; - player.minionDamage += 0.05f; - player.thrownDamage += 0.05f; - } -}} + public class HeavyNecklace : ModItem + { + + public override void SetDefaults() + { + + item.width = 30; + item.height = 34; + item.value = 100000; + item.rare = 2; + + item.accessory = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Heavy Necklace"); + Tooltip.SetDefault("5% increased all damage"); + } + + + public override void UpdateAccessory(Player player, bool hideVisual) + + { + player.meleeDamage += 0.05f; + player.rangedDamage += 0.05f; + player.magicDamage += 0.05f; + player.minionDamage += 0.05f; + player.thrownDamage += 0.05f; + } + } +} diff --git a/Items/HeavyZombieBanner.cs b/Items/HeavyZombieBanner.cs index 862db203..d7ddf11c 100644 --- a/Items/HeavyZombieBanner.cs +++ b/Items/HeavyZombieBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class HeavyZombieBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class HeavyZombieBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 34; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 34; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Heavy Zombie Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Heavy Zombie Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/HellStorm.cs b/Items/HellStorm.cs index 2b291cf1..ab066f47 100644 --- a/Items/HellStorm.cs +++ b/Items/HellStorm.cs @@ -7,50 +7,50 @@ namespace Tremor.Items { - public class HellStorm : ModItem - { - public override void SetDefaults() - { - - item.damage = 220; - item.ranged = true; - item.width = 32; - item.height = 78; - item.useTime = 20; - item.useAnimation = 20; - item.useStyle = 5; - item.noMelee = true; - item.noUseGraphic = true; - item.channel = true; - item.knockBack = 5f; - item.value = 10000000; - item.rare = 0; - item.autoReuse = true; - item.shoot = mod.ProjectileType("HellStormProj"); - item.shootSpeed = 20f; - - - item.useAmmo = AmmoID.Arrow; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Hell Storm"); - Tooltip.SetDefault("Shoots out homing hell arrows\nThe amount of arrows shot increases when used for longer time"); - } - - - public override void ModifyTooltips(System.Collections.Generic.List tooltips) - { - tooltips[0].overrideColor = new Color(238, 194, 73); - } -/* - public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("HellStormProj"), damage, knockBack, player.whoAmI, 0.0f, 0.0f); - return false; - } -*/ + public class HellStorm : ModItem + { + public override void SetDefaults() + { + + item.damage = 220; + item.ranged = true; + item.width = 32; + item.height = 78; + item.useTime = 20; + item.useAnimation = 20; + item.useStyle = 5; + item.noMelee = true; + item.noUseGraphic = true; + item.channel = true; + item.knockBack = 5f; + item.value = 10000000; + item.rare = 0; + item.autoReuse = true; + item.shoot = mod.ProjectileType("HellStormProj"); + item.shootSpeed = 20f; + + + item.useAmmo = AmmoID.Arrow; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Hell Storm"); + Tooltip.SetDefault("Shoots out homing hell arrows\nThe amount of arrows shot increases when used for longer time"); + } + + + public override void ModifyTooltips(System.Collections.Generic.List tooltips) + { + tooltips[0].overrideColor = new Color(238, 194, 73); + } + /* + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ProjectileType("HellStormProj"), damage, knockBack, player.whoAmI, 0.0f, 0.0f); + return false; + } + */ public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { @@ -58,5 +58,5 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX return base.Shoot(player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack); } - } + } } diff --git a/Items/HeroPotion.cs b/Items/HeroPotion.cs index 37e81729..cb776cb8 100644 --- a/Items/HeroPotion.cs +++ b/Items/HeroPotion.cs @@ -6,58 +6,60 @@ using Microsoft.Xna.Framework; using System.Collections.Generic; -namespace Tremor.Items { - -public class HeroPotion : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.width = 38; - item.height = 32; - item.maxStack = 20; - item.rare = 0; - item.useAnimation = 15; - item.useTime = 15; - item.useStyle = 2; - item.UseSound = SoundID.Item3; - item.consumable = true; - } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Hero Potion"); - Tooltip.SetDefault("Grants 10000 defense\nGrants immunity to all debuffs\nIncreases movement speed\nMakes you priority target for enemies\n'Feel like a real hero! At least for 15 seconds.'"); - } + public class HeroPotion : ModItem + { + public override void SetDefaults() + { + item.width = 38; + item.height = 32; + item.maxStack = 20; + item.rare = 0; + item.useAnimation = 15; + item.useTime = 15; + item.useStyle = 2; + item.UseSound = SoundID.Item3; + item.consumable = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Hero Potion"); + Tooltip.SetDefault("Grants 10000 defense\nGrants immunity to all debuffs\nIncreases movement speed\nMakes you priority target for enemies\n'Feel like a real hero! At least for 15 seconds.'"); + } + + public override bool UseItem(Player player) + { + player.AddBuff(mod.BuffType("HeroBuff"), 900); + return true; + } - public override bool UseItem(Player player) - { - player.AddBuff(mod.BuffType("HeroBuff"), 900); - return true; - } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) - { - tooltips[0].overrideColor = new Color(238, 194, 73); - } + { + tooltips[0].overrideColor = new Color(238, 194, 73); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.BottledWater, 1); - recipe.AddIngredient(null, "MultidimensionalFragment", 10); - recipe.AddIngredient(null, "NightmareOre", 25); - recipe.AddIngredient(ItemID.RegenerationPotion, 5); - recipe.AddIngredient(ItemID.IronskinPotion, 5); - recipe.AddIngredient(ItemID.SwiftnessPotion, 5); - recipe.AddIngredient(ItemID.ObsidianSkinPotion, 5); - recipe.AddIngredient(3456, 5); - recipe.AddIngredient(3457, 5); - recipe.AddIngredient(3458, 5); - recipe.AddIngredient(3459, 5); - recipe.AddIngredient(null, "TrueEssense", 1); - recipe.AddTile(null, "AlchemyStationTile"); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.BottledWater, 1); + recipe.AddIngredient(null, "MultidimensionalFragment", 10); + recipe.AddIngredient(null, "NightmareOre", 25); + recipe.AddIngredient(ItemID.RegenerationPotion, 5); + recipe.AddIngredient(ItemID.IronskinPotion, 5); + recipe.AddIngredient(ItemID.SwiftnessPotion, 5); + recipe.AddIngredient(ItemID.ObsidianSkinPotion, 5); + recipe.AddIngredient(3456, 5); + recipe.AddIngredient(3457, 5); + recipe.AddIngredient(3458, 5); + recipe.AddIngredient(3459, 5); + recipe.AddIngredient(null, "TrueEssense", 1); + recipe.AddTile(null, "AlchemyStationTile"); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/HeroShield.cs b/Items/HeroShield.cs index 31e444a8..9abdb4ed 100644 --- a/Items/HeroShield.cs +++ b/Items/HeroShield.cs @@ -5,58 +5,60 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Shield)] -public class HeroShield : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Shield)] + public class HeroShield : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 26; - item.value = 15000; - item.rare = 8; - item.accessory = true; - item.defense = 8; - } + item.width = 26; + item.height = 26; + item.value = 15000; + item.rare = 8; + item.accessory = true; + item.defense = 8; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Hero Shield"); - Tooltip.SetDefault("Grants immunity to most debuffs\nGrants immunity to knockback and fire blocks\nProlonged after hit invicibility"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Hero Shield"); + Tooltip.SetDefault("Grants immunity to most debuffs\nGrants immunity to knockback and fire blocks\nProlonged after hit invicibility"); + } - public override void UpdateEquip(Player p) - { - p.noKnockback = true; -//p.paladinBuff = true; - p.fireWalk = true; - p.longInvince = true; - p.buffImmune[44] = true; //Frostburn - p.buffImmune[46] = true; //Chilled - p.buffImmune[47] = true; //Frozen - p.buffImmune[20] = true; //Poisoned - p.buffImmune[22] = true; //Darkness - p.buffImmune[24] = true; //Fire - p.buffImmune[23] = true; //Cursed - p.buffImmune[30] = true; //Bleeding - p.buffImmune[31] = true; //Confused - p.buffImmune[32] = true; //Slowed - p.buffImmune[33] = true; //Weak - p.buffImmune[35] = true; //Silenced - p.buffImmune[36] = true; //Broken Armor - p.buffImmune[69] = true; //Ichor - p.buffImmune[70] = true; //Venom - p.buffImmune[80] = true; //Black Out - } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "HolyShield", 1); - recipe.AddIngredient(ItemID.AnkhShield, 1); - recipe.SetResult(this); - recipe.AddTile(114); - recipe.AddRecipe(); - } -}} + public override void UpdateEquip(Player p) + { + p.noKnockback = true; + //p.paladinBuff = true; + p.fireWalk = true; + p.longInvince = true; + p.buffImmune[44] = true; //Frostburn + p.buffImmune[46] = true; //Chilled + p.buffImmune[47] = true; //Frozen + p.buffImmune[20] = true; //Poisoned + p.buffImmune[22] = true; //Darkness + p.buffImmune[24] = true; //Fire + p.buffImmune[23] = true; //Cursed + p.buffImmune[30] = true; //Bleeding + p.buffImmune[31] = true; //Confused + p.buffImmune[32] = true; //Slowed + p.buffImmune[33] = true; //Weak + p.buffImmune[35] = true; //Silenced + p.buffImmune[36] = true; //Broken Armor + p.buffImmune[69] = true; //Ichor + p.buffImmune[70] = true; //Venom + p.buffImmune[80] = true; //Black Out + } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "HolyShield", 1); + recipe.AddIngredient(ItemID.AnkhShield, 1); + recipe.SetResult(this); + recipe.AddTile(114); + recipe.AddRecipe(); + } + } +} diff --git a/Items/HiveHeadZombieBanner.cs b/Items/HiveHeadZombieBanner.cs index 2d2a7e73..36ab663a 100644 --- a/Items/HiveHeadZombieBanner.cs +++ b/Items/HiveHeadZombieBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class HiveHeadZombieBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class HiveHeadZombieBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 35; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 35; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Hivehead Zombie Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Hivehead Zombie Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/HolyDust.cs b/Items/HolyDust.cs index f47cdb0f..8b94752d 100644 --- a/Items/HolyDust.cs +++ b/Items/HolyDust.cs @@ -6,41 +6,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class HolyDust : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class HolyDust : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 36; - item.value = 12500; - item.rare = 5; - item.accessory = true; - } + item.width = 22; + item.height = 36; + item.value = 12500; + item.rare = 5; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Holy Dust"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Holy Dust"); + Tooltip.SetDefault(""); + } -public override void UpdateAccessory(Player player, bool hideVisual) -{ - if(Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y) > 1f && !player.rocketFrame) // Makes sure the player is actually moving - { - for (int k = 0; k < 2; k++) - { - int index= Dust.NewDust(new Vector2(player.position.X - player.velocity.X * 2f, player.position.Y - 2f - player.velocity.Y * 2f), player.width, player.height, 57, 0f, 0f, 100, default(Color), 2f); - Main.dust[index].noGravity = true; - Main.dust[index].noLight = true; - Dust dust = Main.dust[index]; - dust.velocity.X = dust.velocity.X - player.velocity.X * 0.5f; - dust.velocity.Y = dust.velocity.Y - player.velocity.Y * 0.5f; - } - } -} + public override void UpdateAccessory(Player player, bool hideVisual) + { + if (Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y) > 1f && !player.rocketFrame) // Makes sure the player is actually moving + { + for (int k = 0; k < 2; k++) + { + int index = Dust.NewDust(new Vector2(player.position.X - player.velocity.X * 2f, player.position.Y - 2f - player.velocity.Y * 2f), player.width, player.height, 57, 0f, 0f, 100, default(Color), 2f); + Main.dust[index].noGravity = true; + Main.dust[index].noLight = true; + Dust dust = Main.dust[index]; + dust.velocity.X = dust.velocity.X - player.velocity.X * 0.5f; + dust.velocity.Y = dust.velocity.Y - player.velocity.Y * 0.5f; + } + } + } public override void AddRecipes() { @@ -52,4 +53,5 @@ public override void AddRecipes() recipe.AddRecipe(); } -}} + } +} diff --git a/Items/HolyJavelin.cs b/Items/HolyJavelin.cs index c380c6f0..1145949d 100644 --- a/Items/HolyJavelin.cs +++ b/Items/HolyJavelin.cs @@ -5,44 +5,46 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class HolyJavelin : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class HolyJavelin : ModItem + { + public override void SetDefaults() + { - item.damage = 57; - item.thrown = true; - item.width = 18; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 38; - item.useTime = 32; - item.useAnimation = 32; - item.shoot = mod.ProjectileType("HolyJavelinPro"); - item.shootSpeed = 16f; - item.useStyle = 1; - item.knockBack = 4; - item.value = 60; - item.rare = 5; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 57; + item.thrown = true; + item.width = 18; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 38; + item.useTime = 32; + item.useAnimation = 32; + item.shoot = mod.ProjectileType("HolyJavelinPro"); + item.shootSpeed = 16f; + item.useStyle = 1; + item.knockBack = 4; + item.value = 60; + item.rare = 5; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Holy Javelin"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Holy Javelin"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.HallowedBar, 1); - recipe.SetResult(this, 50); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.HallowedBar, 1); + recipe.SetResult(this, 50); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/HolyShield.cs b/Items/HolyShield.cs index 8e259328..b68cc9ce 100644 --- a/Items/HolyShield.cs +++ b/Items/HolyShield.cs @@ -5,39 +5,41 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Shield)] -public class HolyShield : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + [AutoloadEquip(EquipType.Shield)] + public class HolyShield : ModItem + { + public override void SetDefaults() + { - item.width = 26; - item.height = 26; - item.value = 12000; + item.width = 26; + item.height = 26; + item.value = 12000; - item.rare = 7; - item.accessory = true; - item.defense = 6; - } + item.rare = 7; + item.accessory = true; + item.defense = 6; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Holy Shield"); - Tooltip.SetDefault("Prolonged after hit invincibility"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Holy Shield"); + Tooltip.SetDefault("Prolonged after hit invincibility"); + } - public override void UpdateEquip(Player player) - { - player.longInvince = true; - } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.PaladinsShield, 1); - recipe.AddIngredient(ItemID.CrossNecklace, 1); - recipe.SetResult(this); - recipe.AddTile(114); - recipe.AddRecipe(); - } -}} + public override void UpdateEquip(Player player) + { + player.longInvince = true; + } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.PaladinsShield, 1); + recipe.AddIngredient(ItemID.CrossNecklace, 1); + recipe.SetResult(this); + recipe.AddTile(114); + recipe.AddRecipe(); + } + } +} diff --git a/Items/HonestBlade.cs b/Items/HonestBlade.cs index a1fb45bb..1d5761cb 100644 --- a/Items/HonestBlade.cs +++ b/Items/HonestBlade.cs @@ -7,48 +7,50 @@ using Microsoft.Xna.Framework; using Terraria.DataStructures; -namespace Tremor.Items { -public class HonestBlade : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class HonestBlade : ModItem + { + public override void SetDefaults() + { - item.damage = 140; - item.melee = true; - item.width = 32; - item.height = 32; - item.useTime = 11; - item.useAnimation = 9; - item.useStyle = 3; - item.knockBack = 2; - item.value = 400000; - item.rare = 0; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 140; + item.melee = true; + item.width = 32; + item.height = 32; + item.useTime = 11; + item.useAnimation = 9; + item.useStyle = 3; + item.knockBack = 2; + item.value = 400000; + item.rare = 0; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Honest Blade"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Honest Blade"); + Tooltip.SetDefault(""); + } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) - { - tooltips[0].overrideColor = new Color(238, 194, 73); - } + public override void ModifyTooltips(System.Collections.Generic.List tooltips) + { + tooltips[0].overrideColor = new Color(238, 194, 73); + } - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(24, 60); - } + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(24, 60); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if(Main.rand.Next(3) == 0) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 6); - } - } -}} + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.Next(3) == 0) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 6); + } + } + } +} diff --git a/Items/HopeMask.cs b/Items/HopeMask.cs index 77053dd8..a11d77c1 100644 --- a/Items/HopeMask.cs +++ b/Items/HopeMask.cs @@ -4,25 +4,28 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class HopeMask : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class HopeMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 30; - item.height = 30; - item.rare = 1; - item.vanity = true; - } + item.width = 30; + item.height = 30; + item.rare = 1; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Hope Mask"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Hope Mask"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/HornedWarHammer.cs b/Items/HornedWarHammer.cs index 479bda1b..d1986c1f 100644 --- a/Items/HornedWarHammer.cs +++ b/Items/HornedWarHammer.cs @@ -14,16 +14,16 @@ public override void SetDefaults() item.CloneDefaults(ItemID.Arkhalis); item.damage = 350; - item.knockBack = 4; - item.rare = 11; + item.knockBack = 4; + item.rare = 11; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Horned War Hammer"); - Tooltip.SetDefault("Forged from lightning"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Horned War Hammer"); + Tooltip.SetDefault("Forged from lightning"); + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) diff --git a/Items/HorrificKnife.cs b/Items/HorrificKnife.cs index fcedba4c..036bfcb6 100644 --- a/Items/HorrificKnife.cs +++ b/Items/HorrificKnife.cs @@ -5,46 +5,48 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class HorrificKnife : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class HorrificKnife : ModItem + { + public override void SetDefaults() + { - item.damage = 80; - item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("HorrificKnifePro"); - item.shootSpeed = 22f; - item.useStyle = 1; - item.knockBack = 4; - item.value = 7; - item.rare = 11; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 80; + item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("HorrificKnifePro"); + item.shootSpeed = 22f; + item.useStyle = 1; + item.knockBack = 4; + item.value = 7; + item.rare = 11; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Horrific Knife"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Horrific Knife"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.ThrowingKnife, 50); - recipe.AddIngredient(null, "ConcentratedEther", 1); - recipe.AddIngredient(null, "NightmareBar", 1); - recipe.SetResult(this, 50); - recipe.AddTile(412); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.ThrowingKnife, 50); + recipe.AddIngredient(null, "ConcentratedEther", 1); + recipe.AddIngredient(null, "NightmareBar", 1); + recipe.SetResult(this, 50); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } +} diff --git a/Items/HorseMask.cs b/Items/HorseMask.cs index 1a7cb958..21f09474 100644 --- a/Items/HorseMask.cs +++ b/Items/HorseMask.cs @@ -5,33 +5,36 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class HorseMask : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class HorseMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 24; - item.rare = 1; - } + item.width = 26; + item.height = 24; + item.rare = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Horse Mask"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Horse Mask"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Leather, 8); - recipe.SetResult(this); - recipe.AddTile(86); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Leather, 8); + recipe.SetResult(this); + recipe.AddTile(86); + recipe.AddRecipe(); + } -}} + } +} diff --git a/Items/HostBanner.cs b/Items/HostBanner.cs index e27991ed..b34d82a7 100644 --- a/Items/HostBanner.cs +++ b/Items/HostBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class HostBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class HostBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 71; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 71; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Host Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Host Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/HummerBreastplate.cs b/Items/HummerBreastplate.cs index 842cbff5..8b0a7869 100644 --- a/Items/HummerBreastplate.cs +++ b/Items/HummerBreastplate.cs @@ -5,31 +5,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class HummerBreastplate : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + [AutoloadEquip(EquipType.Body)] + public class HummerBreastplate : ModItem + { + public override void SetDefaults() + { - item.width = 34; - item.height = 18; - item.rare = 9; - } + item.width = 34; + item.height = 18; + item.rare = 9; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Hummer's Breastplate"); - Tooltip.SetDefault("'Great for impersonating devs!'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Hummer's Breastplate"); + Tooltip.SetDefault("'Great for impersonating devs!'"); + } - public override void UpdateEquip(Player player) - { - if(player.name == "Hummer") - { - player.lifeRegen = +999; - } - } -}} + public override void UpdateEquip(Player player) + { + if (player.name == "Hummer") + { + player.lifeRegen = +999; + } + } + } +} diff --git a/Items/HummerGreaves.cs b/Items/HummerGreaves.cs index 81a3516d..6e75c1b6 100644 --- a/Items/HummerGreaves.cs +++ b/Items/HummerGreaves.cs @@ -5,24 +5,27 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class HummerGreaves : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Legs)] + public class HummerGreaves : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; + item.width = 22; - item.height = 18; - item.rare = 9; - } + item.height = 18; + item.rare = 9; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Hummer's Greaves"); - Tooltip.SetDefault("'Great for impersonating devs!'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Hummer's Greaves"); + Tooltip.SetDefault("'Great for impersonating devs!'"); + } -}} + } +} diff --git a/Items/HummerHelmet.cs b/Items/HummerHelmet.cs index dcd64ab1..80270ff8 100644 --- a/Items/HummerHelmet.cs +++ b/Items/HummerHelmet.cs @@ -5,24 +5,27 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class HummerHelmet : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class HummerHelmet : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 24; + item.width = 24; - item.height = 26; - item.rare = 9; - } + item.height = 26; + item.rare = 9; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Hummer's Helmet"); - Tooltip.SetDefault("'Great for impersonating devs!'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Hummer's Helmet"); + Tooltip.SetDefault("'Great for impersonating devs!'"); + } -}} + } +} diff --git a/Items/HungryStaff.cs b/Items/HungryStaff.cs index 7d551bb5..3d3cc2fb 100644 --- a/Items/HungryStaff.cs +++ b/Items/HungryStaff.cs @@ -18,7 +18,7 @@ public override void SetDefaults() item.height = 28; item.useTime = 36; - item.channel = true; + item.channel = true; item.useAnimation = 36; item.useStyle = 1; item.noMelee = true; @@ -32,39 +32,39 @@ public override void SetDefaults() item.buffTime = 3600; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Hungry Staff"); - Tooltip.SetDefault("Summons a hungry to fight for you."); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Hungry Staff"); + Tooltip.SetDefault("Summons a hungry to fight for you."); + } public override bool AltFunctionUse(Player player) { return true; } - + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { return player.altFunctionUse != 2; } - + public override bool UseItem(Player player) { - if(player.altFunctionUse == 2) + if (player.altFunctionUse == 2) { player.MinionNPCTargetAim(); } return base.UseItem(player); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "PieceofFlesh", 9); - recipe.AddTile(16); - recipe.SetResult(this); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "PieceofFlesh", 9); + recipe.AddTile(16); + recipe.SetResult(this); + recipe.AddRecipe(); + } } } diff --git a/Items/HunterRevolver.cs b/Items/HunterRevolver.cs index 55a171e1..f2bcc7a7 100644 --- a/Items/HunterRevolver.cs +++ b/Items/HunterRevolver.cs @@ -5,46 +5,48 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class HunterRevolver : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class HunterRevolver : ModItem + { + public override void SetDefaults() + { - item.damage = 26; - item.ranged = true; - item.width = 40; - item.height = 20; - item.useTime = 32; - item.useAnimation = 32; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 7; - item.value = 10000; - item.rare = 1; - item.UseSound = SoundID.Item36; - item.autoReuse = false; - item.shoot = 10; - item.shootSpeed = 5f; - item.useAmmo = AmmoID.Bullet; - } + item.damage = 26; + item.ranged = true; + item.width = 40; + item.height = 20; + item.useTime = 32; + item.useAnimation = 32; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 7; + item.value = 10000; + item.rare = 1; + item.UseSound = SoundID.Item36; + item.autoReuse = false; + item.shoot = 10; + item.shootSpeed = 5f; + item.useAmmo = AmmoID.Bullet; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Hunter Revolver"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Hunter Revolver"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.FlintlockPistol, 1); - recipe.AddIngredient(ItemID.DynastyWood, 15); - recipe.AddIngredient(ItemID.TungstenBar, 8); - recipe.AddIngredient(ItemID.SilverBar, 8); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.FlintlockPistol, 1); + recipe.AddIngredient(ItemID.DynastyWood, 15); + recipe.AddIngredient(ItemID.TungstenBar, 8); + recipe.AddIngredient(ItemID.SilverBar, 8); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/HuntingBow.cs b/Items/HuntingBow.cs index 4d7b9efe..0867ac8b 100644 --- a/Items/HuntingBow.cs +++ b/Items/HuntingBow.cs @@ -4,44 +4,46 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class HuntingBow : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class HuntingBow : ModItem + { + public override void SetDefaults() + { - item.damage = 16; - item.width = 18; - item.noMelee = true; - item.height = 56; - item.ranged = true; - item.useTime = 30; - item.shoot = 1; - item.shootSpeed = 12f; - item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 5; - item.value = 2500; - item.useAmmo = AmmoID.Arrow; - item.rare = 1; - item.UseSound = SoundID.Item5; - item.autoReuse = true; - } + item.damage = 16; + item.width = 18; + item.noMelee = true; + item.height = 56; + item.ranged = true; + item.useTime = 30; + item.shoot = 1; + item.shootSpeed = 12f; + item.useAnimation = 30; + item.useStyle = 5; + item.knockBack = 5; + item.value = 2500; + item.useAmmo = AmmoID.Arrow; + item.rare = 1; + item.UseSound = SoundID.Item5; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Hunting Bow"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Hunting Bow"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "WolfPelt", 12); - recipe.AddIngredient(ItemID.BorealWood, 30); - recipe.AddIngredient(null, "AlphaClaw", 1); - recipe.AddTile(18); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "WolfPelt", 12); + recipe.AddIngredient(ItemID.BorealWood, 30); + recipe.AddIngredient(null, "AlphaClaw", 1); + recipe.AddTile(18); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/HuntingSpear.cs b/Items/HuntingSpear.cs index 1a98d2fa..73e81f0f 100644 --- a/Items/HuntingSpear.cs +++ b/Items/HuntingSpear.cs @@ -4,44 +4,46 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class HuntingSpear : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class HuntingSpear : ModItem + { + public override void SetDefaults() + { - item.damage = 18; - item.width = 14; - item.height = 84; - item.noUseGraphic = true; - item.melee = true; - item.useTime = 30; - item.shoot = mod.ProjectileType("HuntingSpearPro"); - item.shootSpeed = 3f; - item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 4; - item.value = 900; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 18; + item.width = 14; + item.height = 84; + item.noUseGraphic = true; + item.melee = true; + item.useTime = 30; + item.shoot = mod.ProjectileType("HuntingSpearPro"); + item.shootSpeed = 3f; + item.useAnimation = 30; + item.useStyle = 5; + item.knockBack = 4; + item.value = 900; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Hunting Spear"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Hunting Spear"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "WolfPelt", 5); - recipe.AddIngredient(ItemID.BorealWood, 20); - recipe.AddIngredient(null, "AlphaClaw", 2); - recipe.AddTile(18); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "WolfPelt", 5); + recipe.AddIngredient(ItemID.BorealWood, 20); + recipe.AddIngredient(null, "AlphaClaw", 2); + recipe.AddTile(18); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Hurricane.cs b/Items/Hurricane.cs index 2db5c6b5..52493b32 100644 --- a/Items/Hurricane.cs +++ b/Items/Hurricane.cs @@ -5,34 +5,36 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Hurricane : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Hurricane : ModItem + { + public override void SetDefaults() + { - item.damage = 38; + item.damage = 38; - item.magic = true; - item.width = 28; - item.height = 30; - item.useTime = 36; - item.useAnimation = 36; - item.shoot = 704; - item.shootSpeed = 11f; - item.mana = 14; - item.useStyle = 5; - item.knockBack = 3; - item.value = 40000; - item.rare = 5; - item.UseSound = SoundID.Item20; - item.autoReuse = true; - } + item.magic = true; + item.width = 28; + item.height = 30; + item.useTime = 36; + item.useAnimation = 36; + item.shoot = 704; + item.shootSpeed = 11f; + item.mana = 14; + item.useStyle = 5; + item.knockBack = 3; + item.value = 40000; + item.rare = 5; + item.UseSound = SoundID.Item20; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("The Hurricane"); - Tooltip.SetDefault("Summons a sand whirlwing which moves only on ground"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("The Hurricane"); + Tooltip.SetDefault("Summons a sand whirlwing which moves only on ground"); + } -}} + } +} diff --git a/Items/HuskofDusk.cs b/Items/HuskofDusk.cs index dd6bb673..f4cac721 100644 --- a/Items/HuskofDusk.cs +++ b/Items/HuskofDusk.cs @@ -6,25 +6,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class HuskofDusk : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class HuskofDusk : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 22; - item.maxStack = 999; - item.value = 200; - item.rare = 11; + item.width = 22; + item.height = 22; + item.maxStack = 999; + item.value = 200; + item.rare = 11; ItemID.Sets.ItemIconPulse[item.type] = true; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Husk of Dusk"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Husk of Dusk"); + Tooltip.SetDefault(""); + } public override Color? GetAlpha(Color lightColor) @@ -32,4 +33,5 @@ public override void SetStaticDefaults() return Color.Purple; } -}} + } +} diff --git a/Items/HuskyStaff.cs b/Items/HuskyStaff.cs index ae613844..4e790b63 100644 --- a/Items/HuskyStaff.cs +++ b/Items/HuskyStaff.cs @@ -29,43 +29,43 @@ public override void SetDefaults() item.shootSpeed = 1f; item.buffType = mod.BuffType("HuskyBuff"); item.buffTime = 3600; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Husky Staff"); - Tooltip.SetDefault("Summons a husky to fight for you."); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Husky Staff"); + Tooltip.SetDefault("Summons a husky to fight for you."); + } public override bool AltFunctionUse(Player player) { return true; } - + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { return player.altFunctionUse != 2; } - + public override bool UseItem(Player player) { - if(player.altFunctionUse == 2) + if (player.altFunctionUse == 2) { player.MinionNPCTargetAim(); } return base.UseItem(player); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.BorealWood, 25); - recipe.AddIngredient(null, "WolfPelt", 7); - recipe.AddIngredient(null, "AlphaClaw", 2); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.BorealWood, 25); + recipe.AddIngredient(null, "WolfPelt", 7); + recipe.AddIngredient(null, "AlphaClaw", 2); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } } } diff --git a/Items/IceBlazerBanner.cs b/Items/IceBlazerBanner.cs index 26c29273..36ef3fe6 100644 --- a/Items/IceBlazerBanner.cs +++ b/Items/IceBlazerBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class IceBlazerBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class IceBlazerBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 72; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 72; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ice Blazer Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ice Blazer Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/IceBullet.cs b/Items/IceBullet.cs index 07764eb1..ac5052b7 100644 --- a/Items/IceBullet.cs +++ b/Items/IceBullet.cs @@ -27,11 +27,11 @@ public override void SetDefaults() item.ammo = AmmoID.Bullet; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ice Bullet"); - Tooltip.SetDefault("25% chance to inflict frostburn"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ice Bullet"); + Tooltip.SetDefault("25% chance to inflict frostburn"); + } public override void AddRecipes() diff --git a/Items/IceDrill.cs b/Items/IceDrill.cs index cbc8a4c1..29db8b78 100644 --- a/Items/IceDrill.cs +++ b/Items/IceDrill.cs @@ -4,47 +4,49 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class IceDrill : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.damage = 32; - item.melee = true; - item.width = 20; - item.height = 12; - item.useTime = 5; - item.useAnimation = 25; - item.channel = true; - item.noUseGraphic = true; - item.noMelee = true; - item.pick = 200; - item.axe = 24; - item.tileBoost++; - item.useStyle = 5; - item.knockBack = 6; - item.value = Item.buyPrice(0, 20, 0, 0); - item.rare = 7; - item.UseSound = SoundID.Item23; - item.autoReuse = true; - item.shoot = mod.ProjectileType("IceDrillPro"); - item.shootSpeed = 40f; - } + public class IceDrill : ModItem + { + public override void SetDefaults() + { + + item.damage = 32; + item.melee = true; + item.width = 20; + item.height = 12; + item.useTime = 5; + item.useAnimation = 25; + item.channel = true; + item.noUseGraphic = true; + item.noMelee = true; + item.pick = 200; + item.axe = 24; + item.tileBoost++; + item.useStyle = 5; + item.knockBack = 6; + item.value = Item.buyPrice(0, 20, 0, 0); + item.rare = 7; + item.UseSound = SoundID.Item23; + item.autoReuse = true; + item.shoot = mod.ProjectileType("IceDrillPro"); + item.shootSpeed = 40f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ice Drill"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ice Drill"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "FrostoneBar", 12); - recipe.AddTile(134); - recipe.SetResult(this); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "FrostoneBar", 12); + recipe.AddTile(134); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } -}} diff --git a/Items/IceHammer.cs b/Items/IceHammer.cs index fc2f87fd..98a10547 100644 --- a/Items/IceHammer.cs +++ b/Items/IceHammer.cs @@ -4,40 +4,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class IceHammer : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class IceHammer : ModItem + { + public override void SetDefaults() + { - item.damage = 72; - item.melee = true; - item.width = 36; - item.height = 36; - item.useTime = 5; - item.useAnimation = 16; - item.hammer = 100; - item.useStyle = 1; - item.knockBack = 5; - item.value = 200000; - item.rare = 7; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 72; + item.melee = true; + item.width = 36; + item.height = 36; + item.useTime = 5; + item.useAnimation = 16; + item.hammer = 100; + item.useStyle = 1; + item.knockBack = 5; + item.value = 200000; + item.rare = 7; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ice Hammer"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ice Hammer"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "FrostoneBar", 10); - recipe.AddTile(134); - recipe.SetResult(this); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "FrostoneBar", 10); + recipe.AddTile(134); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } -}} diff --git a/Items/IcePickaxe.cs b/Items/IcePickaxe.cs index f84f21e0..41b5098a 100644 --- a/Items/IcePickaxe.cs +++ b/Items/IcePickaxe.cs @@ -4,41 +4,43 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class IcePickaxe : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class IcePickaxe : ModItem + { + public override void SetDefaults() + { - item.damage = 32; - item.melee = true; - item.width = 36; - item.height = 36; - item.useTime = 5; - item.useAnimation = 16; - item.pick = 200; - item.axe = 24; - item.useStyle = 1; - item.knockBack = 5; - item.value = 200000; - item.rare = 7; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 32; + item.melee = true; + item.width = 36; + item.height = 36; + item.useTime = 5; + item.useAnimation = 16; + item.pick = 200; + item.axe = 24; + item.useStyle = 1; + item.knockBack = 5; + item.value = 200000; + item.rare = 7; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ice Pickaxe"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ice Pickaxe"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "FrostoneBar", 12); - recipe.AddTile(134); - recipe.SetResult(this); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "FrostoneBar", 12); + recipe.AddTile(134); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } -}} diff --git a/Items/IceQueenMask.cs b/Items/IceQueenMask.cs index dd2f2611..3adaf042 100644 --- a/Items/IceQueenMask.cs +++ b/Items/IceQueenMask.cs @@ -4,25 +4,28 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class IceQueenMask : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class IceQueenMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 20; - item.height = 24; - item.rare = 1; - item.vanity = true; - } + item.width = 20; + item.height = 24; + item.rare = 1; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ice Queen Mask"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ice Queen Mask"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/IceSoul.cs b/Items/IceSoul.cs index eed22b66..716714f7 100644 --- a/Items/IceSoul.cs +++ b/Items/IceSoul.cs @@ -8,30 +8,30 @@ namespace Tremor.Items { -public class IceSoul : ModItem -{ + public class IceSoul : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 22; + item.width = 22; + item.height = 22; - item.rare = 11; - item.maxStack = 999; - ItemID.Sets.ItemNoGravity[item.type] = true; - } + item.rare = 11; + item.maxStack = 999; + ItemID.Sets.ItemNoGravity[item.type] = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Frost Essence"); - Tooltip.SetDefault("Essence of ice creatures"); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(5, 4)); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Frost Essence"); + Tooltip.SetDefault("Essence of ice creatures"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(5, 4)); + } public override Color? GetAlpha(Color lightColor) { return Color.White; } - } + } } diff --git a/Items/IchorBreath.cs b/Items/IchorBreath.cs index fcb4a15e..7051cbb0 100644 --- a/Items/IchorBreath.cs +++ b/Items/IchorBreath.cs @@ -5,45 +5,47 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class IchorBreath : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class IchorBreath : ModItem + { + public override void SetDefaults() + { - item.damage = 55; - item.thrown = true; - item.width = 18; - item.height = 18; - item.useTime = 14; - item.maxStack = 999; - item.useAnimation = 14; - item.shoot = mod.ProjectileType("IchorBreathPro"); - item.shootSpeed = 8f; - item.useStyle = 1; - item.knockBack = 3; - item.value = 155; - item.rare = 5; - item.consumable = true; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 55; + item.thrown = true; + item.width = 18; + item.height = 18; + item.useTime = 14; + item.maxStack = 999; + item.useAnimation = 14; + item.shoot = mod.ProjectileType("IchorBreathPro"); + item.shootSpeed = 8f; + item.useStyle = 1; + item.knockBack = 3; + item.value = 155; + item.rare = 5; + item.consumable = true; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ichor Breath"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ichor Breath"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "DragonBreath", 25); - recipe.AddIngredient(ItemID.Ichor, 3); - recipe.SetResult(this, 25); - recipe.AddTile(134); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "DragonBreath", 25); + recipe.AddIngredient(ItemID.Ichor, 3); + recipe.SetResult(this, 25); + recipe.AddTile(134); + recipe.AddRecipe(); - } -}} + } + } +} diff --git a/Items/IchorKnife.cs b/Items/IchorKnife.cs index 24d8326e..66c5d83e 100644 --- a/Items/IchorKnife.cs +++ b/Items/IchorKnife.cs @@ -5,53 +5,55 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class IchorKnife : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class IchorKnife : ModItem + { + public override void SetDefaults() + { - item.damage = 23; - item.melee = true; - item.width = 32; - item.height = 32; - item.useTime = 11; - item.useAnimation = 9; - item.useStyle = 3; - item.knockBack = 2; - item.value = 2800; - item.rare = 4; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 23; + item.melee = true; + item.width = 32; + item.height = 32; + item.useTime = 11; + item.useAnimation = 9; + item.useStyle = 3; + item.knockBack = 2; + item.value = 2800; + item.rare = 4; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ichor Knife"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ichor Knife"); + Tooltip.SetDefault(""); + } - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(69, 60); - } + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(69, 60); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "RipperKnife"); - recipe.AddIngredient(ItemID.Ichor, 20); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "RipperKnife"); + recipe.AddIngredient(ItemID.Ichor, 20); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if(Main.rand.Next(3) == 0) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 57); - } - } -}} + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.Next(3) == 0) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 57); + } + } + } +} diff --git a/Items/Igniter.cs b/Items/Igniter.cs index 52a2b355..49b43aee 100644 --- a/Items/Igniter.cs +++ b/Items/Igniter.cs @@ -5,47 +5,49 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Igniter : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Igniter : ModItem + { + public override void SetDefaults() + { - item.mana = 9; - item.UseSound = SoundID.Item105; - item.useStyle = 5; - item.damage = 40; - item.useTime = 25; - item.useAnimation = 25; - item.width = 36; - item.height = 40; - item.shoot = mod.ProjectileType("Igniter"); - item.shootSpeed = 13f; - item.knockBack = 4.4f; - Item.staff[item.type] = true; - item.magic = true; - item.autoReuse = true; - item.value = Item.sellPrice(0, 4, 0, 0); - item.rare = 5; - item.noMelee = true; - } + item.mana = 9; + item.UseSound = SoundID.Item105; + item.useStyle = 5; + item.damage = 40; + item.useTime = 25; + item.useAnimation = 25; + item.width = 36; + item.height = 40; + item.shoot = mod.ProjectileType("Igniter"); + item.shootSpeed = 13f; + item.knockBack = 4.4f; + Item.staff[item.type] = true; + item.magic = true; + item.autoReuse = true; + item.value = Item.sellPrice(0, 4, 0, 0); + item.rare = 5; + item.noMelee = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Igniter"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Igniter"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.SoulofLight, 15); - recipe.AddIngredient(ItemID.SoulofNight, 15); - recipe.AddIngredient(null, "FireFragment", 9); - recipe.AddIngredient(2701, 25); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.SoulofLight, 15); + recipe.AddIngredient(ItemID.SoulofNight, 15); + recipe.AddIngredient(null, "FireFragment", 9); + recipe.AddIngredient(2701, 25); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Incinerator.cs b/Items/Incinerator.cs index 5c6d243c..bae71473 100644 --- a/Items/Incinerator.cs +++ b/Items/Incinerator.cs @@ -5,77 +5,79 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class Incinerator : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.damage = 82; - item.mana = 12; - item.width = 20; - item.height = 12; - item.magic = true; - item.useTime = 27; - item.useAnimation = 27; - item.useStyle = 5; - item.knockBack = 6; - item.value = Item.buyPrice(0, 6, 0, 0); - item.rare = 8; - item.crit = 3; - item.useStyle = 5; - item.UseSound = SoundID.Item36; - item.noMelee = true; - item.autoReuse = true; - item.shoot = 260; - item.shootSpeed = 10f; - } + public class Incinerator : ModItem + { + public override void SetDefaults() + { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Incinerator"); - Tooltip.SetDefault(""); - } + item.damage = 82; + item.mana = 12; + item.width = 20; + item.height = 12; + item.magic = true; + item.useTime = 27; + item.useAnimation = 27; + item.useStyle = 5; + item.knockBack = 6; + item.value = Item.buyPrice(0, 6, 0, 0); + item.rare = 8; + item.crit = 3; + item.useStyle = 5; + item.UseSound = SoundID.Item36; + item.noMelee = true; + item.autoReuse = true; + item.shoot = 260; + item.shootSpeed = 10f; + } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Incinerator"); + Tooltip.SetDefault(""); + } -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) -{ - for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. - { - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 2, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 2, type, damage, knockBack, Main.myPlayer); - } - return false; -} - public override bool ConsumeAmmo(Player p) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. + { + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 2, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 2, type, damage, knockBack, Main.myPlayer); + } + return false; + } + + public override bool ConsumeAmmo(Player p) { return Main.rand.Next(2) == 0; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GolemCore", 1); - recipe.AddIngredient(ItemID.HeatRay, 1); - recipe.AddIngredient(ItemID.SoulofMight, 16); - recipe.AddIngredient(ItemID.SoulofFright, 16); - recipe.AddIngredient(ItemID.SoulofSight, 16); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GolemCore", 1); + recipe.AddIngredient(ItemID.HeatRay, 1); + recipe.AddIngredient(ItemID.SoulofMight, 16); + recipe.AddIngredient(ItemID.SoulofFright, 16); + recipe.AddIngredient(ItemID.SoulofSight, 16); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GolemCore", 1); - recipe.AddIngredient(ItemID.HeatRay, 1); - recipe.AddIngredient(null, "SoulofMind", 16); - recipe.AddIngredient(ItemID.SoulofFright, 16); - recipe.AddIngredient(ItemID.SoulofSight, 16); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GolemCore", 1); + recipe.AddIngredient(ItemID.HeatRay, 1); + recipe.AddIngredient(null, "SoulofMind", 16); + recipe.AddIngredient(ItemID.SoulofFright, 16); + recipe.AddIngredient(ItemID.SoulofSight, 16); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/IndifferentTotemMask.cs b/Items/IndifferentTotemMask.cs index c64139c3..0cdb4f84 100644 --- a/Items/IndifferentTotemMask.cs +++ b/Items/IndifferentTotemMask.cs @@ -4,25 +4,28 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class IndifferentTotemMask : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class IndifferentTotemMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 32; - item.height = 24; - item.rare = 1; - item.vanity = true; - } + item.width = 32; + item.height = 24; + item.rare = 1; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Indifferent Totem Mask"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Indifferent Totem Mask"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/Infector.cs b/Items/Infector.cs index ac8c2cca..19a67912 100644 --- a/Items/Infector.cs +++ b/Items/Infector.cs @@ -5,46 +5,48 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Infector : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Infector : ModItem + { + public override void SetDefaults() + { - item.damage = 12; - item.magic = true; - item.mana = 9; - item.width = 40; - item.height = 40; + item.damage = 12; + item.magic = true; + item.mana = 9; + item.width = 40; + item.height = 40; - item.useTime = 25; - item.useAnimation = 25; - item.useStyle = 5; - Item.staff[item.type] = true; - item.noMelee = true; - item.knockBack = 5; - item.value = 1500; - item.rare = 3; - item.UseSound = SoundID.Item20; - item.autoReuse = true; - item.shoot = 568; - item.shootSpeed = 9f; - } + item.useTime = 25; + item.useAnimation = 25; + item.useStyle = 5; + Item.staff[item.type] = true; + item.noMelee = true; + item.knockBack = 5; + item.value = 1500; + item.rare = 3; + item.UseSound = SoundID.Item20; + item.autoReuse = true; + item.shoot = 568; + item.shootSpeed = 9f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Infector"); - Tooltip.SetDefault("Casts spores to infect your enemies!"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Infector"); + Tooltip.SetDefault("Casts spores to infect your enemies!"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.RichMahogany, 18); - recipe.AddIngredient(ItemID.Vine, 1); - recipe.AddIngredient(ItemID.JungleSpores, 12); - recipe.AddTile(16); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.RichMahogany, 18); + recipe.AddIngredient(ItemID.Vine, 1); + recipe.AddIngredient(ItemID.JungleSpores, 12); + recipe.AddTile(16); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/InfernalShield.cs b/Items/InfernalShield.cs index 6c11d56e..696f7842 100644 --- a/Items/InfernalShield.cs +++ b/Items/InfernalShield.cs @@ -9,79 +9,79 @@ namespace Tremor.Items { -[AutoloadEquip(EquipType.Shield)] - public class InfernalShield : ModItem - { - const int ShootType = 376; // ��� ����५� - const float ShootRange = 600.0f; // ���쭮��� ����५� - const float ShootKN = 1.0f; // ����뢠��� - const int ShootRate = 60; // ����� ����५� (60 - 1 ᥪ㭤�) - const int ShootCount = 3; // ����஢ �� ����५ - const float ShootSpeed = 15f; // ������� ����५� (��� ����� - ���쭮���) - const int spread = 45; // ������ - const float spreadMult = 0.045f; // ����䨪��� ࠧ��� + [AutoloadEquip(EquipType.Shield)] + public class InfernalShield : ModItem + { + const int ShootType = 376; // ��� ����५� + const float ShootRange = 600.0f; // ���쭮��� ����५� + const float ShootKN = 1.0f; // ����뢠��� + const int ShootRate = 60; // ����� ����५� (60 - 1 ᥪ㭤�) + const int ShootCount = 3; // ����஢ �� ����५ + const float ShootSpeed = 15f; // ������� ����५� (��� ����� - ���쭮���) + const int spread = 45; // ������ + const float spreadMult = 0.045f; // ����䨪��� ࠧ��� - int TimeToShoot = ShootRate; + int TimeToShoot = ShootRate; - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 36; - item.height = 36; + item.width = 36; + item.height = 36; - item.value = 45000; - item.rare = 9; - item.expert = true; - item.accessory = true; - } + item.value = 45000; + item.rare = 9; + item.expert = true; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Infernal Shield"); - Tooltip.SetDefault("Casts fireballs at nearby enemies"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Infernal Shield"); + Tooltip.SetDefault("Casts fireballs at nearby enemies"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { + public override void UpdateAccessory(Player player, bool hideVisual) + { - if (--TimeToShoot <= 0) - { - TimeToShoot = ShootRate; - int Target = GetTarget(); - if (Target != -1) Shoot(Target, GetDamage()); - } - } - - int GetTarget() - { - int Target = -1; - for(int k = 0; k < Main.npc.Length; k++) - { - if (Main.npc[k].active && Main.npc[k].lifeMax > 5 && !Main.npc[k].dontTakeDamage && !Main.npc[k].friendly && Main.npc[k].Distance(Main.player[item.owner].Center) <= ShootRange && Collision.CanHitLine(Main.player[item.owner].Center, 4, 4, Main.npc[k].Center, 4, 4)) - { - Target = k; - break; - } - } - return Target; - } + if (--TimeToShoot <= 0) + { + TimeToShoot = ShootRate; + int Target = GetTarget(); + if (Target != -1) Shoot(Target, GetDamage()); + } + } - int GetDamage() - { - return (10 * ((int)Main.player[item.owner].magicDamage + (int)Main.player[item.owner].meleeDamage + (int)Main.player[item.owner].minionDamage + (int)Main.player[item.owner].rangedDamage + (int)Main.player[item.owner].thrownDamage)) + 15; - } + int GetTarget() + { + int Target = -1; + for (int k = 0; k < Main.npc.Length; k++) + { + if (Main.npc[k].active && Main.npc[k].lifeMax > 5 && !Main.npc[k].dontTakeDamage && !Main.npc[k].friendly && Main.npc[k].Distance(Main.player[item.owner].Center) <= ShootRange && Collision.CanHitLine(Main.player[item.owner].Center, 4, 4, Main.npc[k].Center, 4, 4)) + { + Target = k; + break; + } + } + return Target; + } - void Shoot(int Target, int Damage) - { - Vector2 velocity = Helper.VelocityToPoint(Main.player[item.owner].Center, Main.npc[Target].Center, ShootSpeed); - for (int l = 0; l < ShootCount; l++) - { - velocity.X = velocity.X + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - velocity.Y = velocity.Y + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - int i = Projectile.NewProjectile(Main.player[item.owner].Center.X, Main.player[item.owner].Center.Y, velocity.X, velocity.Y, ShootType, Damage, ShootKN, item.owner); - } - } - } + int GetDamage() + { + return (10 * ((int)Main.player[item.owner].magicDamage + (int)Main.player[item.owner].meleeDamage + (int)Main.player[item.owner].minionDamage + (int)Main.player[item.owner].rangedDamage + (int)Main.player[item.owner].thrownDamage)) + 15; + } + + void Shoot(int Target, int Damage) + { + Vector2 velocity = Helper.VelocityToPoint(Main.player[item.owner].Center, Main.npc[Target].Center, ShootSpeed); + for (int l = 0; l < ShootCount; l++) + { + velocity.X = velocity.X + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.Y = velocity.Y + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + int i = Projectile.NewProjectile(Main.player[item.owner].Center.X, Main.player[item.owner].Center.Y, velocity.X, velocity.Y, ShootType, Damage, ShootKN, item.owner); + } + } + } } diff --git a/Items/Infernality.cs b/Items/Infernality.cs index 09f03d08..5265b10d 100644 --- a/Items/Infernality.cs +++ b/Items/Infernality.cs @@ -5,55 +5,57 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Infernality : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.damage = 20; - item.melee = true; - item.width = 40; - item.height = 40; - - item.useTime = 25; - item.useAnimation = 10; - item.useStyle = 1; - item.knockBack = 2; - item.value = 25025; - item.rare = 4; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Infernality"); - Tooltip.SetDefault("'For the glory of Satan of course!'"); - } - - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.HellstoneBar, 10); - recipe.AddIngredient(null, "PhantomSoul", 5); - recipe.AddIngredient(null, "DemonBlood", 12); - recipe.AddTile(null, "DevilForge"); - recipe.SetResult(this); - recipe.AddRecipe(); - } - - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if(Main.rand.Next(2) == 0) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 6); - } - } - - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(24, 1000); - } -}} + public class Infernality : ModItem + { + public override void SetDefaults() + { + + item.damage = 20; + item.melee = true; + item.width = 40; + item.height = 40; + + item.useTime = 25; + item.useAnimation = 10; + item.useStyle = 1; + item.knockBack = 2; + item.value = 25025; + item.rare = 4; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Infernality"); + Tooltip.SetDefault("'For the glory of Satan of course!'"); + } + + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.HellstoneBar, 10); + recipe.AddIngredient(null, "PhantomSoul", 5); + recipe.AddIngredient(null, "DemonBlood", 12); + recipe.AddTile(null, "DevilForge"); + recipe.SetResult(this); + recipe.AddRecipe(); + } + + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.Next(2) == 0) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 6); + } + } + + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(24, 1000); + } + } +} diff --git a/Items/Inferno.cs b/Items/Inferno.cs index 5efd0492..c378620c 100644 --- a/Items/Inferno.cs +++ b/Items/Inferno.cs @@ -5,38 +5,40 @@ using Terraria.ID; using Microsoft.Xna.Framework; -namespace Tremor.Items { -public class Inferno : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Inferno : ModItem + { + public override void SetDefaults() + { - item.damage = 520; - item.width = 62; - item.height = 62; - item.noUseGraphic = true; - item.melee = true; - item.useTime = 20; - item.shoot = mod.ProjectileType("InfernoPro"); - item.shootSpeed = 12f; - item.useAnimation = 20; - item.useStyle = 5; - item.knockBack = 4; - item.value = 600000; - item.rare = 0; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 520; + item.width = 62; + item.height = 62; + item.noUseGraphic = true; + item.melee = true; + item.useTime = 20; + item.shoot = mod.ProjectileType("InfernoPro"); + item.shootSpeed = 12f; + item.useAnimation = 20; + item.useStyle = 5; + item.knockBack = 4; + item.value = 600000; + item.rare = 0; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Inferno"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Inferno"); + Tooltip.SetDefault(""); + } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) - { - tooltips[0].overrideColor = new Color(238, 194, 73); - } -}} + public override void ModifyTooltips(System.Collections.Generic.List tooltips) + { + tooltips[0].overrideColor = new Color(238, 194, 73); + } + } +} diff --git a/Items/InfernoSkull.cs b/Items/InfernoSkull.cs index 35a05e5d..ec7cc653 100644 --- a/Items/InfernoSkull.cs +++ b/Items/InfernoSkull.cs @@ -7,54 +7,54 @@ namespace Tremor.Items { - public class InfernoSkull: ModItem - { + public class InfernoSkull : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 28; - item.maxStack = 20; - item.value = 100; - item.rare = 0; - item.useAnimation = 15; - item.useTime = 15; - item.useStyle = 4; - item.consumable = true; + item.width = 26; + item.height = 28; + item.maxStack = 20; + item.value = 100; + item.rare = 0; + item.useAnimation = 15; + item.useTime = 15; + item.useStyle = 4; + item.consumable = true; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Inferno Skull"); - Tooltip.SetDefault("Summons the Andas"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Inferno Skull"); + Tooltip.SetDefault("Summons the Andas"); + } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) - { - tooltips[0].overrideColor = new Color(238, 194, 73); - } + public override void ModifyTooltips(System.Collections.Generic.List tooltips) + { + tooltips[0].overrideColor = new Color(238, 194, 73); + } - public override bool CanUseItem(Player player) - { - return player.position.Y / 16f > Main.maxTilesY - 200 && TremorWorld.downedTrinity && !NPC.AnyNPCs(mod.NPCType("Andas")); - } + public override bool CanUseItem(Player player) + { + return player.position.Y / 16f > Main.maxTilesY - 200 && TremorWorld.downedTrinity && !NPC.AnyNPCs(mod.NPCType("Andas")); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "AngeliteBar", 10); - recipe.AddIngredient(null, "CollapsiumBar", 10); - recipe.AddIngredient(null, "FireFragment", 12); - recipe.AddIngredient(ItemID.HellstoneBar, 6); - recipe.AddIngredient(ItemID.Bone, 25); - recipe.AddIngredient(ItemID.SoulofNight, 8); - recipe.SetResult(this); - recipe.AddTile(null, "StarvilTile"); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "AngeliteBar", 10); + recipe.AddIngredient(null, "CollapsiumBar", 10); + recipe.AddIngredient(null, "FireFragment", 12); + recipe.AddIngredient(ItemID.HellstoneBar, 6); + recipe.AddIngredient(ItemID.Bone, 25); + recipe.AddIngredient(ItemID.SoulofNight, 8); + recipe.SetResult(this); + recipe.AddTile(null, "StarvilTile"); + recipe.AddRecipe(); + } public override bool UseItem(Player player) { @@ -62,5 +62,5 @@ public override bool UseItem(Player player) Main.PlaySound(SoundID.Roar, player.position, 0); return true; } - } + } } diff --git a/Items/InfernoSoul.cs b/Items/InfernoSoul.cs index 09feecf9..bb75681a 100644 --- a/Items/InfernoSoul.cs +++ b/Items/InfernoSoul.cs @@ -8,31 +8,31 @@ namespace Tremor.Items { - public class InfernoSoul : ModItem - { - public override void SetDefaults() - { + public class InfernoSoul : ModItem + { + public override void SetDefaults() + { - item.width = 26; - item.height = 38; - item.value = 10000; - item.rare = 0; - item.maxStack = 999; - ItemID.Sets.ItemIconPulse[item.type] = true; - ItemID.Sets.ItemNoGravity[item.type] = true; - } + item.width = 26; + item.height = 38; + item.value = 10000; + item.rare = 0; + item.maxStack = 999; + ItemID.Sets.ItemIconPulse[item.type] = true; + ItemID.Sets.ItemNoGravity[item.type] = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Inferno Soul"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Inferno Soul"); + Tooltip.SetDefault(""); + } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) - { - tooltips[0].overrideColor = new Color(238, 194, 73); - } + public override void ModifyTooltips(System.Collections.Generic.List tooltips) + { + tooltips[0].overrideColor = new Color(238, 194, 73); + } - } + } } diff --git a/Items/Infusion.cs b/Items/Infusion.cs index 3d79af00..61ce8a84 100644 --- a/Items/Infusion.cs +++ b/Items/Infusion.cs @@ -6,30 +6,30 @@ namespace Tremor.Items { - public class Infusion : ModItem - { - public override void SetDefaults() - { + public class Infusion : ModItem + { + public override void SetDefaults() + { - item.rare = 11; - item.maxStack = 1; - item.useAnimation = 20; - item.useTime = 20; - item.useStyle = 2; - item.potion = true; - item.healLife = 100; + item.rare = 11; + item.maxStack = 1; + item.useAnimation = 20; + item.useTime = 20; + item.useStyle = 2; + item.potion = true; + item.healLife = 100; - item.UseSound = SoundID.Item3; - item.value = 1000000; - item.autoReuse = false; - } + item.UseSound = SoundID.Item3; + item.value = 1000000; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Infusion"); - Tooltip.SetDefault("Eternal potion"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Infusion"); + Tooltip.SetDefault("Eternal potion"); + } - } + } } diff --git a/Items/InspirationPotion.cs b/Items/InspirationPotion.cs index f44e32b8..e1ba4f1f 100644 --- a/Items/InspirationPotion.cs +++ b/Items/InspirationPotion.cs @@ -4,47 +4,49 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class InspirationPotion : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.width = 38; - item.height = 32; - item.maxStack = 20; - - item.rare = 3; - item.useAnimation = 15; - item.useTime = 15; - item.useStyle = 2; - item.UseSound = SoundID.Item3; - item.consumable = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Inspiration Potion"); - Tooltip.SetDefault("Increases maximum mana"); - } - - - public override bool UseItem(Player player) - { - player.AddBuff(mod.BuffType("MaximumCharge"), 14400); - return true; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.BottledWater, 1); - recipe.AddIngredient(314, 1); - recipe.AddIngredient(313, 1); - recipe.AddIngredient(null, "ManaFruit", 6); - recipe.AddTile(13); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + + public class InspirationPotion : ModItem + { + public override void SetDefaults() + { + + item.width = 38; + item.height = 32; + item.maxStack = 20; + + item.rare = 3; + item.useAnimation = 15; + item.useTime = 15; + item.useStyle = 2; + item.UseSound = SoundID.Item3; + item.consumable = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Inspiration Potion"); + Tooltip.SetDefault("Increases maximum mana"); + } + + + public override bool UseItem(Player player) + { + player.AddBuff(mod.BuffType("MaximumCharge"), 14400); + return true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.BottledWater, 1); + recipe.AddIngredient(314, 1); + recipe.AddIngredient(313, 1); + recipe.AddIngredient(null, "ManaFruit", 6); + recipe.AddTile(13); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/InvaderStaff.cs b/Items/InvaderStaff.cs index 4aa6b923..30c07c95 100644 --- a/Items/InvaderStaff.cs +++ b/Items/InvaderStaff.cs @@ -31,11 +31,11 @@ public override void SetDefaults() item.buffTime = 3600; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Invader Staff"); - Tooltip.SetDefault("Summons a strange invader from space to fight for you."); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Invader Staff"); + Tooltip.SetDefault("Summons a strange invader from space to fight for you."); + } } } diff --git a/Items/InvarAxe.cs b/Items/InvarAxe.cs index a2db398f..9def7424 100644 --- a/Items/InvarAxe.cs +++ b/Items/InvarAxe.cs @@ -4,41 +4,43 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class InvarAxe : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class InvarAxe : ModItem + { + public override void SetDefaults() + { - item.damage = 5; - item.melee = true; - item.width = 36; - item.height = 36; - item.useTime = 20; - item.useAnimation = 20; - item.axe = 9; - item.useStyle = 1; - item.knockBack = 3; - item.value = 100; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 5; + item.melee = true; + item.width = 36; + item.height = 36; + item.useTime = 20; + item.useAnimation = 20; + item.axe = 9; + item.useStyle = 1; + item.knockBack = 3; + item.value = 100; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Invar Axe"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Invar Axe"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "InvarBar", 9); - recipe.AddIngredient(ItemID.Wood, 3); - recipe.AddTile(16); - recipe.SetResult(this); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "InvarBar", 9); + recipe.AddIngredient(ItemID.Wood, 3); + recipe.AddTile(16); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } -}} diff --git a/Items/InvarBar.cs b/Items/InvarBar.cs index 362e39a3..cc66f739 100644 --- a/Items/InvarBar.cs +++ b/Items/InvarBar.cs @@ -4,44 +4,46 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class InvarBar : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class InvarBar : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 300; - item.rare = 1; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 300; + item.rare = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Invar Bar"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Invar Bar"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "OldInvarPlate"); - recipe.SetResult(this, 4); - recipe.AddTile(17); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "OldInvarPlate"); + recipe.SetResult(this, 4); + recipe.AddTile(17); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BrokenInvarShield"); - recipe.SetResult(this, 3); - recipe.AddTile(17); - recipe.AddRecipe(); + recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "BrokenInvarShield"); + recipe.SetResult(this, 3); + recipe.AddTile(17); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "MeltedInvarSword"); - recipe.SetResult(this, 2); - recipe.AddTile(17); - recipe.AddRecipe(); - } -}} + recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "MeltedInvarSword"); + recipe.SetResult(this, 2); + recipe.AddTile(17); + recipe.AddRecipe(); + } + } +} diff --git a/Items/InvarBow.cs b/Items/InvarBow.cs index 7128ee85..aaa56101 100644 --- a/Items/InvarBow.cs +++ b/Items/InvarBow.cs @@ -4,43 +4,45 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class InvarBow : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class InvarBow : ModItem + { + public override void SetDefaults() + { - item.damage = 9; - item.width = 16; - item.height = 32; - item.useTime = 30; - item.ranged = true; - item.shoot = 1; - item.shootSpeed = 12f; - item.useAnimation =28; - item.useStyle = 5; - item.useTime = 28; - item.knockBack = 5; - item.value = 250; - item.useAmmo = AmmoID.Arrow; - item.rare = 1; - item.UseSound = SoundID.Item5; - item.autoReuse = false; - } + item.damage = 9; + item.width = 16; + item.height = 32; + item.useTime = 30; + item.ranged = true; + item.shoot = 1; + item.shootSpeed = 12f; + item.useAnimation = 28; + item.useStyle = 5; + item.useTime = 28; + item.knockBack = 5; + item.value = 250; + item.useAmmo = AmmoID.Arrow; + item.rare = 1; + item.UseSound = SoundID.Item5; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Invar Bow"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Invar Bow"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "InvarBar", 7); - recipe.AddTile(16); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "InvarBar", 7); + recipe.AddTile(16); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/InvarBreastplate.cs b/Items/InvarBreastplate.cs index 157b8172..4feea207 100644 --- a/Items/InvarBreastplate.cs +++ b/Items/InvarBreastplate.cs @@ -5,34 +5,36 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class InvarBreastplate : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Body)] + public class InvarBreastplate : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 18; - item.value = 600; - item.rare = 1; - item.defense = 3; - } + item.width = 26; + item.height = 18; + item.value = 600; + item.rare = 1; + item.defense = 3; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Invar Breastplate"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Invar Breastplate"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "InvarBar", 18); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "InvarBar", 18); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/InvarBroadsword.cs b/Items/InvarBroadsword.cs index 5ecfaecd..77c153b7 100644 --- a/Items/InvarBroadsword.cs +++ b/Items/InvarBroadsword.cs @@ -4,39 +4,41 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class InvarBroadsword : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class InvarBroadsword : ModItem + { + public override void SetDefaults() + { - item.damage = 11; - item.melee = true; - item.width = 36; - item.height = 36; - item.useTime = 21; - item.useAnimation = 20; - item.useStyle = 1; - item.knockBack = 3; - item.value = 100; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 11; + item.melee = true; + item.width = 36; + item.height = 36; + item.useTime = 21; + item.useAnimation = 20; + item.useStyle = 1; + item.knockBack = 3; + item.value = 100; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Invar Broadsword"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Invar Broadsword"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "InvarBar", 9); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "InvarBar", 9); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } } -}} diff --git a/Items/InvarGreaves.cs b/Items/InvarGreaves.cs index 01704995..b029d04f 100644 --- a/Items/InvarGreaves.cs +++ b/Items/InvarGreaves.cs @@ -4,34 +4,37 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class InvarGreaves : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Legs)] + public class InvarGreaves : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 18; - item.value = 500; - item.rare = 1; - item.defense = 2; - } + item.width = 22; + item.height = 18; + item.value = 500; + item.rare = 1; + item.defense = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Invar Greaves"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Invar Greaves"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "InvarBar", 12); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "InvarBar", 12); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/InvarHammer.cs b/Items/InvarHammer.cs index bff8769a..ce1228ee 100644 --- a/Items/InvarHammer.cs +++ b/Items/InvarHammer.cs @@ -4,41 +4,43 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class InvarHammer : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class InvarHammer : ModItem + { + public override void SetDefaults() + { - item.damage = 7; - item.melee = true; - item.width = 36; - item.height = 36; - item.useTime = 20; - item.useAnimation = 20; - item.hammer = 40; - item.useStyle = 1; - item.knockBack = 3; - item.value = 100; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 7; + item.melee = true; + item.width = 36; + item.height = 36; + item.useTime = 20; + item.useAnimation = 20; + item.hammer = 40; + item.useStyle = 1; + item.knockBack = 3; + item.value = 100; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Invar Hammer"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Invar Hammer"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "InvarBar", 10); - recipe.AddIngredient(ItemID.Wood, 3); - recipe.AddTile(16); - recipe.SetResult(this); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "InvarBar", 10); + recipe.AddIngredient(ItemID.Wood, 3); + recipe.AddTile(16); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } -}} diff --git a/Items/InvarHat.cs b/Items/InvarHat.cs index 94781e97..71681286 100644 --- a/Items/InvarHat.cs +++ b/Items/InvarHat.cs @@ -4,46 +4,49 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class InvarHat : ModItem +namespace Tremor.Items { - - - - public override void SetDefaults() - { - - item.width = 32; - item.height = 26; - item.value = 400; - - item.rare = 1; - item.defense = 2; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Invar Hat"); - Tooltip.SetDefault("10% increased melee speed"); - } - - - public override void UpdateEquip(Player player) - { - player.meleeSpeed += 0.1f; - } - - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("InvarBreastplate") && legs.type == mod.ItemType("InvarGreaves"); - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "InvarBar", 8); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + [AutoloadEquip(EquipType.Head)] + public class InvarHat : ModItem + { + + + + public override void SetDefaults() + { + + item.width = 32; + item.height = 26; + item.value = 400; + + item.rare = 1; + item.defense = 2; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Invar Hat"); + Tooltip.SetDefault("10% increased melee speed"); + } + + + public override void UpdateEquip(Player player) + { + player.meleeSpeed += 0.1f; + } + + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("InvarBreastplate") && legs.type == mod.ItemType("InvarGreaves"); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "InvarBar", 8); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/InvarHeadgear.cs b/Items/InvarHeadgear.cs index c3e23e3b..4426827a 100644 --- a/Items/InvarHeadgear.cs +++ b/Items/InvarHeadgear.cs @@ -4,51 +4,54 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class InvarHeadgear : ModItem +namespace Tremor.Items { - - - - public override void SetDefaults() - { - - item.width = 32; - item.height = 26; - item.value = 400; - - item.rare = 1; - item.defense = 1; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Invar Headgear"); - Tooltip.SetDefault("6% increased melee damage"); - } - - - public override void UpdateEquip(Player player) - { - player.meleeDamage += 0.06f; - } - - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("InvarBreastplate") && legs.type == mod.ItemType("InvarGreaves"); - } - - public override void UpdateArmorSet(Player player) - { - player.setBonus = "6% increased melee crit"; - player.meleeCrit += 6; - } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "InvarBar", 8); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + [AutoloadEquip(EquipType.Head)] + public class InvarHeadgear : ModItem + { + + + + public override void SetDefaults() + { + + item.width = 32; + item.height = 26; + item.value = 400; + + item.rare = 1; + item.defense = 1; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Invar Headgear"); + Tooltip.SetDefault("6% increased melee damage"); + } + + + public override void UpdateEquip(Player player) + { + player.meleeDamage += 0.06f; + } + + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("InvarBreastplate") && legs.type == mod.ItemType("InvarGreaves"); + } + + public override void UpdateArmorSet(Player player) + { + player.setBonus = "6% increased melee crit"; + player.meleeCrit += 6; + } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "InvarBar", 8); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/InvarHelmet.cs b/Items/InvarHelmet.cs index 2271d638..3072905c 100644 --- a/Items/InvarHelmet.cs +++ b/Items/InvarHelmet.cs @@ -4,40 +4,43 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class InvarHelmet : ModItem +namespace Tremor.Items { - - - - public override void SetDefaults() - { - - item.width = 32; - item.height = 26; - item.value = 400; - item.rare = 1; - item.defense = 3; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Invar Helmet"); - Tooltip.SetDefault(""); - } - - - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("InvarBreastplate") && legs.type == mod.ItemType("InvarGreaves"); - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "InvarBar", 8); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + [AutoloadEquip(EquipType.Head)] + public class InvarHelmet : ModItem + { + + + + public override void SetDefaults() + { + + item.width = 32; + item.height = 26; + item.value = 400; + item.rare = 1; + item.defense = 3; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Invar Helmet"); + Tooltip.SetDefault(""); + } + + + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("InvarBreastplate") && legs.type == mod.ItemType("InvarGreaves"); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "InvarBar", 8); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/InvarPickaxe.cs b/Items/InvarPickaxe.cs index f5468d17..e1680ef9 100644 --- a/Items/InvarPickaxe.cs +++ b/Items/InvarPickaxe.cs @@ -4,41 +4,43 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class InvarPickaxe : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class InvarPickaxe : ModItem + { + public override void SetDefaults() + { - item.damage = 6; - item.melee = true; - item.width = 36; - item.height = 36; - item.useTime = 20; - item.useAnimation = 20; - item.pick = 45; - item.useStyle = 1; - item.knockBack = 3; - item.value = 100; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 6; + item.melee = true; + item.width = 36; + item.height = 36; + item.useTime = 20; + item.useAnimation = 20; + item.pick = 45; + item.useStyle = 1; + item.knockBack = 3; + item.value = 100; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Invar Pickaxe"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Invar Pickaxe"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "InvarBar", 12); - recipe.AddIngredient(ItemID.Wood, 3); - recipe.AddTile(16); - recipe.SetResult(this); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "InvarBar", 12); + recipe.AddIngredient(ItemID.Wood, 3); + recipe.AddTile(16); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } -}} diff --git a/Items/IonBlaster.cs b/Items/IonBlaster.cs index 083bbbed..b9ed61d0 100644 --- a/Items/IonBlaster.cs +++ b/Items/IonBlaster.cs @@ -5,32 +5,34 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class IonBlaster : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class IonBlaster : ModItem + { + public override void SetDefaults() + { - item.damage = 20; - item.ranged = true; - item.width = 68; - item.height = 28; - item.useTime = 30; - item.useAnimation = 30; - item.shoot = 440; - item.shootSpeed = 14f; - item.useStyle = 5; - item.knockBack = 4; - item.value = 20000; - item.rare = 2; - item.UseSound = SoundID.Item12; - item.autoReuse = true; - } + item.damage = 20; + item.ranged = true; + item.width = 68; + item.height = 28; + item.useTime = 30; + item.useAnimation = 30; + item.shoot = 440; + item.shootSpeed = 14f; + item.useStyle = 5; + item.knockBack = 4; + item.value = 20000; + item.rare = 2; + item.UseSound = SoundID.Item12; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ion Blaster"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ion Blaster"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/IronGiantBanner.cs b/Items/IronGiantBanner.cs index 26e5c9b8..5dabecc7 100644 --- a/Items/IronGiantBanner.cs +++ b/Items/IronGiantBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class IronGiantBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class IronGiantBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 73; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 73; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Iron Giant Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Iron Giant Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/IronShield.cs b/Items/IronShield.cs index 1fd82ecd..5975d008 100644 --- a/Items/IronShield.cs +++ b/Items/IronShield.cs @@ -5,37 +5,39 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Shield)] -public class IronShield : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + [AutoloadEquip(EquipType.Shield)] + public class IronShield : ModItem + { + public override void SetDefaults() + { - item.width = 28; - item.height = 28; - item.value = 110; - item.rare = 0; - item.accessory = true; - item.defense = 3; - } + item.width = 28; + item.height = 28; + item.value = 110; + item.rare = 0; + item.accessory = true; + item.defense = 3; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Iron Shield"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Iron Shield"); + Tooltip.SetDefault(""); + } - public override void UpdateEquip(Player player) - { - player.moveSpeed -= 0.20f; - } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.IronBar, 15); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void UpdateEquip(Player player) + { + player.moveSpeed -= 0.20f; + } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.IronBar, 15); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/IronSpear.cs b/Items/IronSpear.cs index 80ee42b2..a21cb776 100644 --- a/Items/IronSpear.cs +++ b/Items/IronSpear.cs @@ -4,42 +4,44 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class IronSpear : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class IronSpear : ModItem + { + public override void SetDefaults() + { - item.damage = 11; - item.width = 14; - item.height = 84; - item.noUseGraphic = true; - item.melee = true; - item.useTime = 30; - item.shoot = mod.ProjectileType("IronSpearPro"); - item.shootSpeed = 3f; - item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 4; - item.value = 1000; - item.rare = 0; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 11; + item.width = 14; + item.height = 84; + item.noUseGraphic = true; + item.melee = true; + item.useTime = 30; + item.shoot = mod.ProjectileType("IronSpearPro"); + item.shootSpeed = 3f; + item.useAnimation = 30; + item.useStyle = 5; + item.knockBack = 4; + item.value = 1000; + item.rare = 0; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Iron Spear"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Iron Spear"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.IronBar, 9); - recipe.AddTile(16); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.IronBar, 9); + recipe.AddTile(16); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/JavaHood.cs b/Items/JavaHood.cs index 075b7a60..78267972 100644 --- a/Items/JavaHood.cs +++ b/Items/JavaHood.cs @@ -7,7 +7,7 @@ namespace Tremor.Items { -[AutoloadEquip(EquipType.Head)] + [AutoloadEquip(EquipType.Head)] public class JavaHood : ModItem { @@ -22,11 +22,11 @@ public override void SetDefaults() item.vanity = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Java Hood"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Java Hood"); + Tooltip.SetDefault(""); + } } } diff --git a/Items/JavaRobe.cs b/Items/JavaRobe.cs index f8ddcb8f..50c5d124 100644 --- a/Items/JavaRobe.cs +++ b/Items/JavaRobe.cs @@ -6,8 +6,8 @@ using Terraria.ModLoader; namespace Tremor.Items -{ -[AutoloadEquip(EquipType.Body)] +{ + [AutoloadEquip(EquipType.Body)] public class JavaRobe : ModItem { @@ -22,11 +22,11 @@ public override void SetDefaults() item.vanity = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Java Robe"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Java Robe"); + Tooltip.SetDefault(""); + } } } diff --git a/Items/JawFish.cs b/Items/JawFish.cs index ea77347f..aed8e9bf 100644 --- a/Items/JawFish.cs +++ b/Items/JawFish.cs @@ -21,11 +21,11 @@ public override void SetDefaults() item.rare = -11; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Jaw Fish"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Jaw Fish"); + Tooltip.SetDefault(""); + } public override bool IsQuestFish() diff --git a/Items/JellyfishStaff.cs b/Items/JellyfishStaff.cs index 89676350..4779c60e 100644 --- a/Items/JellyfishStaff.cs +++ b/Items/JellyfishStaff.cs @@ -31,26 +31,26 @@ public override void SetDefaults() item.buffTime = 3600; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Jellyfish Staff"); - Tooltip.SetDefault("Summons a jellyfish to fight for you."); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Jellyfish Staff"); + Tooltip.SetDefault("Summons a jellyfish to fight for you."); + } public override bool AltFunctionUse(Player player) { return true; } - + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { return player.altFunctionUse != 2; } - + public override bool UseItem(Player player) { - if(player.altFunctionUse == 2) + if (player.altFunctionUse == 2) { player.MinionNPCTargetAim(); } diff --git a/Items/Jellyxir.cs b/Items/Jellyxir.cs index 634487ca..838b2869 100644 --- a/Items/Jellyxir.cs +++ b/Items/Jellyxir.cs @@ -4,32 +4,34 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Jellyxir : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Jellyxir : ModItem + { + public override void SetDefaults() + { - item.width = 14; - item.height = 22; - item.maxStack = 999; - item.rare = 5; - item.value = Item.buyPrice(0, 0, 3, 0); - } + item.width = 14; + item.height = 22; + item.maxStack = 999; + item.rare = 5; + item.value = Item.buyPrice(0, 0, 3, 0); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Jellyxir"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Jellyxir"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.BottledWater, 1); - recipe.SetResult(this); - recipe.AddTile(null, "AlchematorTile"); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.BottledWater, 1); + recipe.SetResult(this); + recipe.AddTile(null, "AlchematorTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/JungleAlloy.cs b/Items/JungleAlloy.cs index 7778d8fb..24454a76 100644 --- a/Items/JungleAlloy.cs +++ b/Items/JungleAlloy.cs @@ -4,22 +4,24 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class JungleAlloy : ModItem +namespace Tremor.Items { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Jungle Alloy"); - Tooltip.SetDefault("''Forge Master will be interested in this''\n'Allows Forge Master to move in'"); - } + public class JungleAlloy : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Jungle Alloy"); + Tooltip.SetDefault("''Forge Master will be interested in this''\n'Allows Forge Master to move in'"); + } - public override void SetDefaults() - { - item.width = 28; - item.height = 30; - item.maxStack = 99; - item.value = 2500; - item.rare = 3; - } + public override void SetDefaults() + { + item.width = 28; + item.height = 30; + item.maxStack = 99; + item.value = 2500; + item.rare = 3; + } -}} + } +} diff --git a/Items/JungleWrath.cs b/Items/JungleWrath.cs index ac9ad629..cb7bd480 100644 --- a/Items/JungleWrath.cs +++ b/Items/JungleWrath.cs @@ -4,41 +4,43 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class JungleWrath : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class JungleWrath : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 44; + item.width = 22; + item.height = 44; - item.value = 10000; - item.rare = 3; - item.accessory = true; - } + item.value = 10000; + item.rare = 3; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Jungle Wrath"); - Tooltip.SetDefault("6% increased magic and minion damage"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Jungle Wrath"); + Tooltip.SetDefault("6% increased magic and minion damage"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.magicDamage += 0.06f; - player.minionDamage += 0.06f; - } + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.magicDamage += 0.06f; + player.minionDamage += 0.06f; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "JungleAlloy", 1); - recipe.AddIngredient(ItemID.JungleSpores, 16); - recipe.AddIngredient(ItemID.Stinger, 6); - recipe.SetResult(this); - recipe.AddTile(null, "GreatAnvilTile"); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "JungleAlloy", 1); + recipe.AddIngredient(ItemID.JungleSpores, 16); + recipe.AddIngredient(ItemID.Stinger, 6); + recipe.SetResult(this); + recipe.AddTile(null, "GreatAnvilTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/KeyFish.cs b/Items/KeyFish.cs index 5a598072..9ada9bf7 100644 --- a/Items/KeyFish.cs +++ b/Items/KeyFish.cs @@ -21,11 +21,11 @@ public override void SetDefaults() item.rare = -11; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Key Fish"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Key Fish"); + Tooltip.SetDefault(""); + } public override bool IsQuestFish() diff --git a/Items/KeyKnife.cs b/Items/KeyKnife.cs index 98d02657..ddb68267 100644 --- a/Items/KeyKnife.cs +++ b/Items/KeyKnife.cs @@ -5,33 +5,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class KeyKnife : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class KeyKnife : ModItem + { + public override void SetDefaults() + { - item.damage = 26; - item.melee = true; - item.width = 50; - item.height = 50; - item.scale = 1.3f; - item.useTime = 14; - item.useAnimation = 14; - item.useStyle = 1; - item.knockBack = 2; + item.damage = 26; + item.melee = true; + item.width = 50; + item.height = 50; + item.scale = 1.3f; + item.useTime = 14; + item.useAnimation = 14; + item.useStyle = 1; + item.knockBack = 2; - item.value = 150000; - item.rare = 3; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.value = 150000; + item.rare = 3; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Key Knife"); - Tooltip.SetDefault("'Half key, half knife, completely awe.. oh.'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Key Knife"); + Tooltip.SetDefault("'Half key, half knife, completely awe.. oh.'"); + } -}} + } +} diff --git a/Items/KeyMold.cs b/Items/KeyMold.cs index 06ae21c3..a89c992a 100644 --- a/Items/KeyMold.cs +++ b/Items/KeyMold.cs @@ -6,23 +6,25 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class KeyMold : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class KeyMold : ModItem + { + public override void SetDefaults() + { - item.width = 28; - item.height = 40; - item.maxStack = 99; - item.value = 300000; - item.rare = 5; - } + item.width = 28; + item.height = 40; + item.maxStack = 99; + item.value = 300000; + item.rare = 5; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Key Mold"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Key Mold"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/KeyofOcean.cs b/Items/KeyofOcean.cs index 6e7d1d1c..a40a8cba 100644 --- a/Items/KeyofOcean.cs +++ b/Items/KeyofOcean.cs @@ -6,34 +6,36 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class KeyofOcean : ModItem +namespace Tremor.Items { + public class KeyofOcean : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.maxStack = 99; - item.height = 26; + item.width = 26; + item.maxStack = 99; + item.height = 26; - item.rare = 0; - } + item.rare = 0; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Key of Ocean"); - Tooltip.SetDefault("'Charged with the essence of ocean'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Key of Ocean"); + Tooltip.SetDefault("'Charged with the essence of ocean'"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.GoldenKey, 1); - recipe.AddIngredient(null, "SeaFragment", 12); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.GoldenKey, 1); + recipe.AddIngredient(null, "SeaFragment", 12); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/KeyofSands.cs b/Items/KeyofSands.cs index c403abc9..dc88c2e0 100644 --- a/Items/KeyofSands.cs +++ b/Items/KeyofSands.cs @@ -6,35 +6,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class KeyofSands : ModItem +namespace Tremor.Items { + public class KeyofSands : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.maxStack = 99; - item.height = 26; + item.width = 26; + item.maxStack = 99; + item.height = 26; - item.rare = 0; - } + item.rare = 0; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Key of Sands"); - Tooltip.SetDefault("'Charged with the essence of sands'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Key of Sands"); + Tooltip.SetDefault("'Charged with the essence of sands'"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.GoldenKey, 1); - recipe.AddIngredient(3783, 6); - recipe.AddIngredient(ItemID.SandBlock, 10); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.GoldenKey, 1); + recipe.AddIngredient(3783, 6); + recipe.AddIngredient(ItemID.SandBlock, 10); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/KeyofTwilight.cs b/Items/KeyofTwilight.cs index 783f7bf2..69a2aece 100644 --- a/Items/KeyofTwilight.cs +++ b/Items/KeyofTwilight.cs @@ -6,38 +6,40 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class KeyofTwilight : ModItem +namespace Tremor.Items { + public class KeyofTwilight : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.maxStack = 99; - item.height = 26; + item.width = 26; + item.maxStack = 99; + item.height = 26; - item.rare = 0; - } + item.rare = 0; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Key of Jungles"); - Tooltip.SetDefault("'Charged with the essence of jungle grass'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Key of Jungles"); + Tooltip.SetDefault("'Charged with the essence of jungle grass'"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.GoldenKey, 1); - recipe.AddIngredient(ItemID.SoulofLight, 6); - recipe.AddIngredient(ItemID.SoulofNight, 6); - recipe.AddIngredient(ItemID.Vine, 2); - recipe.AddIngredient(ItemID.Stinger, 1); - recipe.AddIngredient(ItemID.JungleSpores, 3); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.GoldenKey, 1); + recipe.AddIngredient(ItemID.SoulofLight, 6); + recipe.AddIngredient(ItemID.SoulofNight, 6); + recipe.AddIngredient(ItemID.Vine, 2); + recipe.AddIngredient(ItemID.Stinger, 1); + recipe.AddIngredient(ItemID.JungleSpores, 3); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/KingPants.cs b/Items/KingPants.cs index 646d1adc..d7f40c76 100644 --- a/Items/KingPants.cs +++ b/Items/KingPants.cs @@ -5,24 +5,27 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class KingPants : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Legs)] + public class KingPants : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 18; - item.value = 20000; - item.rare = 2; - } + item.width = 22; + item.height = 18; + item.value = 20000; + item.rare = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("King Pants"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("King Pants"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/KingSuit.cs b/Items/KingSuit.cs index ad26203a..916edb3d 100644 --- a/Items/KingSuit.cs +++ b/Items/KingSuit.cs @@ -6,8 +6,8 @@ using Terraria.ModLoader; namespace Tremor.Items -{ -[AutoloadEquip(EquipType.Body)] +{ + [AutoloadEquip(EquipType.Body)] public class KingSuit : ModItem { @@ -22,11 +22,11 @@ public override void SetDefaults() item.vanity = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("King Suit"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("King Suit"); + Tooltip.SetDefault(""); + } } } diff --git a/Items/Knife.cs b/Items/Knife.cs index ac7f1df1..e4ddfb1f 100644 --- a/Items/Knife.cs +++ b/Items/Knife.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Knife : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Knife : ModItem + { + public override void SetDefaults() + { - item.damage = 18; - item.melee = true; - item.width = 42; - item.height = 42; - item.useTime = 21; - item.useAnimation = 21; - item.useStyle = 1; - item.knockBack = 5; - item.value = 10000; - item.rare = 2; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 18; + item.melee = true; + item.width = 42; + item.height = 42; + item.useTime = 21; + item.useAnimation = 21; + item.useStyle = 1; + item.knockBack = 5; + item.value = 10000; + item.rare = 2; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Knife"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Knife"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/KnightGreaves.cs b/Items/KnightGreaves.cs index 96533e29..cf07be74 100644 --- a/Items/KnightGreaves.cs +++ b/Items/KnightGreaves.cs @@ -5,24 +5,27 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class KnightGreaves : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Legs)] + public class KnightGreaves : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 18; - item.value = 10000; - item.rare = 2; - } + item.width = 22; + item.height = 18; + item.value = 10000; + item.rare = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Knight Greaves"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Knight Greaves"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/KnightHelmet.cs b/Items/KnightHelmet.cs index c2a5351d..bb295325 100644 --- a/Items/KnightHelmet.cs +++ b/Items/KnightHelmet.cs @@ -5,25 +5,28 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class KnightHelmet : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class KnightHelmet : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 24; - item.value = 2500; - item.rare = 1; - item.defense = 3; - } + item.width = 26; + item.height = 24; + item.value = 2500; + item.rare = 1; + item.defense = 3; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Knight Helmet"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Knight Helmet"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/Kunai.cs b/Items/Kunai.cs index 56806943..903423a7 100644 --- a/Items/Kunai.cs +++ b/Items/Kunai.cs @@ -5,50 +5,52 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Kunai : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Kunai : ModItem + { + public override void SetDefaults() + { - item.damage = 14; - item.height = 32; - item.thrown = true; - item.width = 18; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.useTime = 19; - item.useAnimation = 19; - item.shoot = mod.ProjectileType("Kunai"); - item.shootSpeed = 15f; - item.useStyle = 1; - item.knockBack = 4; - item.value = 60; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 14; + item.height = 32; + item.thrown = true; + item.width = 18; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.useTime = 19; + item.useAnimation = 19; + item.shoot = mod.ProjectileType("Kunai"); + item.shootSpeed = 15f; + item.useStyle = 1; + item.knockBack = 4; + item.value = 60; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Kunai"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Kunai"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Wood, 3); - recipe.AddIngredient(ItemID.IronBar, 4); - recipe.SetResult(this, 50); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Wood, 3); + recipe.AddIngredient(ItemID.IronBar, 4); + recipe.SetResult(this, 50); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Wood, 3); - recipe.AddIngredient(ItemID.LeadBar, 4); - recipe.SetResult(this, 50); - recipe.AddRecipe(); - } -}} + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Wood, 3); + recipe.AddIngredient(ItemID.LeadBar, 4); + recipe.SetResult(this, 50); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Ladder.cs b/Items/Ladder.cs index 5d6380e4..4436a1b8 100644 --- a/Items/Ladder.cs +++ b/Items/Ladder.cs @@ -4,39 +4,41 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Ladder : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Ladder : ModItem + { + public override void SetDefaults() + { - item.width = 16; - item.height = 16; - item.maxStack = 999; - item.value = 100; - item.rare = 1; - item.createTile = mod.TileType("Ladder"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - } + item.width = 16; + item.height = 16; + item.maxStack = 999; + item.value = 100; + item.rare = 1; + item.createTile = mod.TileType("Ladder"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ladder"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ladder"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Wood, 1); - recipe.SetResult(this, 2); - recipe.AddTile(106); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Wood, 1); + recipe.SetResult(this, 2); + recipe.AddTile(106); + recipe.AddRecipe(); + } + } +} diff --git a/Items/LapisLazuli.cs b/Items/LapisLazuli.cs index c5a13109..0d41cdfc 100644 --- a/Items/LapisLazuli.cs +++ b/Items/LapisLazuli.cs @@ -4,24 +4,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class LapisLazuli : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class LapisLazuli : ModItem + { + public override void SetDefaults() + { - item.width = 14; - item.height = 22; - item.maxStack = 999; - item.rare = 11; + item.width = 14; + item.height = 22; + item.maxStack = 999; + item.rare = 11; - item.value = Item.buyPrice(0, 10, 0, 0); - } + item.value = Item.buyPrice(0, 10, 0, 0); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Lapis Lazuli"); - Tooltip.SetDefault("'Ocean gem.'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Lapis Lazuli"); + Tooltip.SetDefault("'Ocean gem.'"); + } -}} + } +} diff --git a/Items/LasCannon.cs b/Items/LasCannon.cs index f5e864b1..30d8c464 100644 --- a/Items/LasCannon.cs +++ b/Items/LasCannon.cs @@ -5,38 +5,39 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class LasCannon : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.damage = 500; - item.ranged = true; - item.expert = true; - item.melee = false; - item.width = 90; - item.height = 36; - item.useTime = 60; - item.useAnimation = 60; - item.useAmmo = AmmoID.Bullet; - item.useStyle = 5; - item.shootSpeed = 20f; - item.knockBack = 15; - item.value = 1000000; - item.rare = 10; - item.shoot = 440; - item.shootSpeed = 10f; - item.UseSound = SoundID.Item40; - item.autoReuse = true; - - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Las Cannon"); - Tooltip.SetDefault("Uses bullets as ammo"); - } + public class LasCannon : ModItem + { + public override void SetDefaults() + { + + item.damage = 500; + item.ranged = true; + item.expert = true; + item.melee = false; + item.width = 90; + item.height = 36; + item.useTime = 60; + item.useAnimation = 60; + item.useAmmo = AmmoID.Bullet; + item.useStyle = 5; + item.shootSpeed = 20f; + item.knockBack = 15; + item.value = 1000000; + item.rare = 10; + item.shoot = 440; + item.shootSpeed = 10f; + item.UseSound = SoundID.Item40; + item.autoReuse = true; + + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Las Cannon"); + Tooltip.SetDefault("Uses bullets as ammo"); + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) @@ -45,10 +46,10 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX return base.Shoot(player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack); } - public override Vector2? HoldoutOffset() - { - return new Vector2(-20, 0); - } + public override Vector2? HoldoutOffset() + { + return new Vector2(-20, 0); + } -} + } } diff --git a/Items/LaurelWreath.cs b/Items/LaurelWreath.cs index 33626453..bff530c9 100644 --- a/Items/LaurelWreath.cs +++ b/Items/LaurelWreath.cs @@ -5,38 +5,41 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class LaurelWreath : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class LaurelWreath : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; + item.width = 26; - item.height = 24; - item.rare = 2; - } + item.height = 24; + item.rare = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Laurel Wreath"); - Tooltip.SetDefault("'The latest fashion trend'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Laurel Wreath"); + Tooltip.SetDefault("'The latest fashion trend'"); + } -public override void DrawHair(ref bool drawHair, ref bool drawAltHair) -{ - drawHair = true; -} + public override void DrawHair(ref bool drawHair, ref bool drawAltHair) + { + drawHair = true; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Vine, 3); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Vine, 3); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } + } +} diff --git a/Items/LeadShield.cs b/Items/LeadShield.cs index d4619c35..5d91a445 100644 --- a/Items/LeadShield.cs +++ b/Items/LeadShield.cs @@ -5,38 +5,40 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Shield)] -public class LeadShield : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Shield)] + public class LeadShield : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 30; - item.value = 110; - item.rare = 0; - item.accessory = true; - item.defense = 3; - } + item.width = 26; + item.height = 30; + item.value = 110; + item.rare = 0; + item.accessory = true; + item.defense = 3; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Lead Shield"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Lead Shield"); + Tooltip.SetDefault(""); + } - public override void UpdateEquip(Player player) - { - player.moveSpeed -= 0.20f; - } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.LeadBar, 15); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void UpdateEquip(Player player) + { + player.moveSpeed -= 0.20f; + } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.LeadBar, 15); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/LeadSpear.cs b/Items/LeadSpear.cs index 974c9201..0e76d8c0 100644 --- a/Items/LeadSpear.cs +++ b/Items/LeadSpear.cs @@ -4,42 +4,44 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class LeadSpear : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class LeadSpear : ModItem + { + public override void SetDefaults() + { - item.damage = 12; - item.width = 14; - item.height = 84; - item.noUseGraphic = true; - item.melee = true; - item.useTime = 30; - item.shoot = mod.ProjectileType("LeadSpearPro"); - item.shootSpeed = 3f; - item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 4; - item.value = 1000; - item.rare = 0; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 12; + item.width = 14; + item.height = 84; + item.noUseGraphic = true; + item.melee = true; + item.useTime = 30; + item.shoot = mod.ProjectileType("LeadSpearPro"); + item.shootSpeed = 3f; + item.useAnimation = 30; + item.useStyle = 5; + item.knockBack = 4; + item.value = 1000; + item.rare = 0; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Lead Spear"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Lead Spear"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.LeadBar, 9); - recipe.AddTile(16); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.LeadBar, 9); + recipe.AddTile(16); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/LeafBall.cs b/Items/LeafBall.cs index 7d39bf69..548ed2bc 100644 --- a/Items/LeafBall.cs +++ b/Items/LeafBall.cs @@ -7,47 +7,47 @@ namespace Tremor.Items { - public class LeafBall : ModItem - { - public override void SetDefaults() - { + public class LeafBall : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 10; + item.width = 30; + item.height = 10; - item.value = Item.sellPrice(0, 0, 25, 0); - item.rare = 2; - item.noMelee = true; - item.useStyle = 5; - item.useAnimation = 40; - item.useTime = 40; - item.knockBack = 7.5F; - item.damage = 16; - item.scale = 1.1F; - item.noUseGraphic = true; - item.shoot = mod.ProjectileType("LeafBallPro"); - item.shootSpeed = 15.9F; - item.UseSound = SoundID.Item1; - item.melee = true; - item.channel = true; - } + item.value = Item.sellPrice(0, 0, 25, 0); + item.rare = 2; + item.noMelee = true; + item.useStyle = 5; + item.useAnimation = 40; + item.useTime = 40; + item.knockBack = 7.5F; + item.damage = 16; + item.scale = 1.1F; + item.noUseGraphic = true; + item.shoot = mod.ProjectileType("LeafBallPro"); + item.shootSpeed = 15.9F; + item.UseSound = SoundID.Item1; + item.melee = true; + item.channel = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Leaf Ball"); - Tooltip.SetDefault("'Flail from grass and leaves'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Leaf Ball"); + Tooltip.SetDefault("'Flail from grass and leaves'"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.RichMahogany, 15); - recipe.AddIngredient(ItemID.Vine, 1); - recipe.AddIngredient(ItemID.Stinger, 3); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.RichMahogany, 15); + recipe.AddIngredient(ItemID.Vine, 1); + recipe.AddIngredient(ItemID.Stinger, 3); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } } diff --git a/Items/LeatherGreaves.cs b/Items/LeatherGreaves.cs index 9ad3e93c..ca0eb698 100644 --- a/Items/LeatherGreaves.cs +++ b/Items/LeatherGreaves.cs @@ -6,27 +6,30 @@ using Terraria.ModLoader; using Microsoft.Xna.Framework; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class LeatherGreaves : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Legs)] + public class LeatherGreaves : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 18; - item.height = 20; - item.value = 200; - item.rare = 1; - item.defense = 1; - } + item.width = 18; + item.height = 20; + item.value = 200; + item.rare = 1; + item.defense = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Leather Greaves"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Leather Greaves"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/LeatherHat.cs b/Items/LeatherHat.cs index 60db7d12..50dfd7c3 100644 --- a/Items/LeatherHat.cs +++ b/Items/LeatherHat.cs @@ -6,27 +6,30 @@ using Terraria.ModLoader; using Microsoft.Xna.Framework; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class LeatherHat : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class LeatherHat : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 18; - item.height = 20; - item.value = 200; - item.rare = 1; - item.defense = 1; - } + item.width = 18; + item.height = 20; + item.value = 200; + item.rare = 1; + item.defense = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Leather Hat"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Leather Hat"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/LeatherShirt.cs b/Items/LeatherShirt.cs index 16c5b0d8..9e761aac 100644 --- a/Items/LeatherShirt.cs +++ b/Items/LeatherShirt.cs @@ -6,26 +6,28 @@ using Terraria.ModLoader; using Microsoft.Xna.Framework; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class LeatherShirt : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Body)] + public class LeatherShirt : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 30; - item.height = 18; - item.value = 200; - item.rare = 1; - item.defense = 1; - } + item.width = 30; + item.height = 18; + item.value = 200; + item.rare = 1; + item.defense = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Leather Shirt"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Leather Shirt"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/LeechingSeed.cs b/Items/LeechingSeed.cs index 107ebef6..92ec5baa 100644 --- a/Items/LeechingSeed.cs +++ b/Items/LeechingSeed.cs @@ -4,29 +4,31 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class LeechingSeed : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class LeechingSeed : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 44; + item.width = 22; + item.height = 44; - item.value = 45000; - item.rare = 6; - item.accessory = true; - } + item.value = 45000; + item.rare = 6; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Leeching Seed"); - Tooltip.SetDefault("Maximum life increased by 50"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Leeching Seed"); + Tooltip.SetDefault("Maximum life increased by 50"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.statLifeMax2 += 50; - } -}} + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.statLifeMax2 += 50; + } + } +} diff --git a/Items/LeopardHat.cs b/Items/LeopardHat.cs index 8894bf38..81dc82b6 100644 --- a/Items/LeopardHat.cs +++ b/Items/LeopardHat.cs @@ -5,36 +5,39 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class LeopardHat : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class LeopardHat : ModItem + { - public override void SetDefaults() - { - - item.width =30; - item.height = 22; - item.value = 100000; - item.rare = 11; - item.vanity = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Leopard Hat"); - Tooltip.SetDefault(""); - } - - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "FashionableHat"); - recipe.AddIngredient(2282); - recipe.SetResult(this); - recipe.AddTile(86); - recipe.AddRecipe(); - } - -}} + public override void SetDefaults() + { + + item.width = 30; + item.height = 22; + item.value = 100000; + item.rare = 11; + item.vanity = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Leopard Hat"); + Tooltip.SetDefault(""); + } + + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "FashionableHat"); + recipe.AddIngredient(2282); + recipe.SetResult(this); + recipe.AddTile(86); + recipe.AddRecipe(); + } + + } +} diff --git a/Items/LeprechaunBanner.cs b/Items/LeprechaunBanner.cs index 26690b50..90accbe3 100644 --- a/Items/LeprechaunBanner.cs +++ b/Items/LeprechaunBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class LeprechaunBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class LeprechaunBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 74; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 74; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Leprechaun Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Leprechaun Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/LesserHealingFlack.cs b/Items/LesserHealingFlack.cs index 6bbeee55..eaf9543a 100644 --- a/Items/LesserHealingFlack.cs +++ b/Items/LesserHealingFlack.cs @@ -9,82 +9,83 @@ namespace Tremor.Items { public class LesserHealingFlack : AlchemistItem - { + { - public override void SetDefaults() - { - item.crit = 4; - item.damage = 11; - //item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("LesserHealingFlackPro"); - item.shootSpeed = 8f; - item.useStyle = 1; - item.knockBack = 1; - item.UseSound = SoundID.Item106; - item.value = 70; - item.rare = 1; - item.autoReuse = false; + public override void SetDefaults() + { + item.crit = 4; + item.damage = 11; + //item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("LesserHealingFlackPro"); + item.shootSpeed = 8f; + item.useStyle = 1; + item.knockBack = 1; + item.UseSound = SoundID.Item106; + item.value = 70; + item.rare = 1; + item.autoReuse = false; - item.ammo = mod.ItemType("BoomFlask"); - } + item.ammo = mod.ItemType("BoomFlask"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Lesser Healing Flask"); - Tooltip.SetDefault("Throws a flask that explodes into clouds\nClouds deal damage to enemies and heal player hit enemy"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Lesser Healing Flask"); + Tooltip.SetDefault("Throws a flask that explodes into clouds\nClouds deal damage to enemies and heal player hit enemy"); + } - public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) - { - type = mod.ProjectileType("HealingCloudPro"); - } + public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) + { + type = mod.ProjectileType("HealingCloudPro"); + } + + public override void UpdateInventory(Player player) + { + MPlayer modPlayer = player.GetModPlayer(mod); + if (modPlayer.novaHelmet) + { + item.autoReuse = true; + } + if (!modPlayer.novaHelmet) + { + item.autoReuse = false; + } - public override void UpdateInventory(Player player) - { - MPlayer modPlayer = player.GetModPlayer(mod); - if (modPlayer.novaHelmet) - { - item.autoReuse = true; - } - if (!modPlayer.novaHelmet) - { - item.autoReuse = false; - } - - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) - { - item.shootSpeed = 11f; - } - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) - { - item.shootSpeed = 8f; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) - { - item.autoReuse = true; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) - { - item.autoReuse = false; - } - } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) + { + item.shootSpeed = 11f; + } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) + { + item.shootSpeed = 8f; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) + { + item.autoReuse = true; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) + { + item.autoReuse = false; + } + } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.Bottle, 1); - recipe.AddIngredient(null, "AtisBlood", 1); - recipe.AddIngredient(null, "GelCube", 1); + recipe.AddIngredient(null, "AtisBlood", 1); + recipe.AddIngredient(null, "GelCube", 1); recipe.SetResult(this, 50); recipe.AddRecipe(); } -}} + } +} diff --git a/Items/LesserManaFlask.cs b/Items/LesserManaFlask.cs index 085b0b56..4f169fb9 100644 --- a/Items/LesserManaFlask.cs +++ b/Items/LesserManaFlask.cs @@ -9,82 +9,83 @@ namespace Tremor.Items { public class LesserManaFlask : AlchemistItem - { + { - public override void SetDefaults() - { - item.crit = 4; - item.damage = 11; - //item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("LesserManaFlaskPro"); - item.shootSpeed = 8f; - item.useStyle = 1; - item.knockBack = 1; - item.UseSound = SoundID.Item106; - item.value = 70; - item.rare = 1; - item.autoReuse = false; + public override void SetDefaults() + { + item.crit = 4; + item.damage = 11; + //item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("LesserManaFlaskPro"); + item.shootSpeed = 8f; + item.useStyle = 1; + item.knockBack = 1; + item.UseSound = SoundID.Item106; + item.value = 70; + item.rare = 1; + item.autoReuse = false; - item.ammo = mod.ItemType("BoomFlask"); - } + item.ammo = mod.ItemType("BoomFlask"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Lesser Mana Flask"); - Tooltip.SetDefault("Throws a flask that explodes into clouds\nClouds deal damage to enemies and restore mana"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Lesser Mana Flask"); + Tooltip.SetDefault("Throws a flask that explodes into clouds\nClouds deal damage to enemies and restore mana"); + } - public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) - { - type = mod.ProjectileType("ManaCloudPro"); - } + public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) + { + type = mod.ProjectileType("ManaCloudPro"); + } + + public override void UpdateInventory(Player player) + { + MPlayer modPlayer = player.GetModPlayer(mod); + if (modPlayer.novaHelmet) + { + item.autoReuse = true; + } + if (!modPlayer.novaHelmet) + { + item.autoReuse = false; + } - public override void UpdateInventory(Player player) - { - MPlayer modPlayer = player.GetModPlayer(mod); - if (modPlayer.novaHelmet) - { - item.autoReuse = true; - } - if (!modPlayer.novaHelmet) - { - item.autoReuse = false; - } - - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) - { - item.shootSpeed = 11f; - } - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) - { - item.shootSpeed = 8f; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) - { - item.autoReuse = true; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) - { - item.autoReuse = false; - } - } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) + { + item.shootSpeed = 11f; + } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) + { + item.shootSpeed = 8f; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) + { + item.autoReuse = true; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) + { + item.autoReuse = false; + } + } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.Bottle, 1); - recipe.AddIngredient(null, "ManaFruit", 1); - recipe.AddIngredient(null, "GelCube", 1); + recipe.AddIngredient(null, "ManaFruit", 1); + recipe.AddIngredient(null, "GelCube", 1); recipe.SetResult(this, 50); recipe.AddRecipe(); } -}} + } +} diff --git a/Items/LesserPoisonFlask.cs b/Items/LesserPoisonFlask.cs index ed10d592..816e5ce2 100644 --- a/Items/LesserPoisonFlask.cs +++ b/Items/LesserPoisonFlask.cs @@ -9,82 +9,83 @@ namespace Tremor.Items { public class LesserPoisonFlask : AlchemistItem - { + { - public override void SetDefaults() - { - item.crit = 4; - item.damage = 10; - //item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("LesserPoisonFlaskPro"); - item.shootSpeed = 8f; - item.useStyle = 1; - item.knockBack = 1; - item.UseSound = SoundID.Item106; - item.value = 70; - item.rare = 1; - item.autoReuse = false; + public override void SetDefaults() + { + item.crit = 4; + item.damage = 10; + //item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("LesserPoisonFlaskPro"); + item.shootSpeed = 8f; + item.useStyle = 1; + item.knockBack = 1; + item.UseSound = SoundID.Item106; + item.value = 70; + item.rare = 1; + item.autoReuse = false; - item.ammo = mod.ItemType("BoomFlask"); - } + item.ammo = mod.ItemType("BoomFlask"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Lesser Poison Flask"); - Tooltip.SetDefault("Throws a flask that explodes into poison clouds\nClouds deal damage to enemies and poisons them"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Lesser Poison Flask"); + Tooltip.SetDefault("Throws a flask that explodes into poison clouds\nClouds deal damage to enemies and poisons them"); + } - public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) - { - type = mod.ProjectileType("PoisonCloudPro"); - } + public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) + { + type = mod.ProjectileType("PoisonCloudPro"); + } + + public override void UpdateInventory(Player player) + { + MPlayer modPlayer = player.GetModPlayer(mod); + if (modPlayer.novaHelmet) + { + item.autoReuse = true; + } + if (!modPlayer.novaHelmet) + { + item.autoReuse = false; + } - public override void UpdateInventory(Player player) - { - MPlayer modPlayer = player.GetModPlayer(mod); - if (modPlayer.novaHelmet) - { - item.autoReuse = true; - } - if (!modPlayer.novaHelmet) - { - item.autoReuse = false; - } - - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) - { - item.shootSpeed = 11f; - } - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) - { - item.shootSpeed = 8f; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) - { - item.autoReuse = true; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) - { - item.autoReuse = false; - } - } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) + { + item.shootSpeed = 11f; + } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) + { + item.shootSpeed = 8f; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) + { + item.autoReuse = true; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) + { + item.autoReuse = false; + } + } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.Bottle, 1); - recipe.AddIngredient(ItemID.Stinger, 2); - recipe.AddIngredient(null, "GelCube", 2); + recipe.AddIngredient(ItemID.Stinger, 2); + recipe.AddIngredient(null, "GelCube", 2); recipe.SetResult(this, 45); recipe.AddRecipe(); } -}} + } +} diff --git a/Items/LesserVenomFlask.cs b/Items/LesserVenomFlask.cs index fa490b54..dd63715c 100644 --- a/Items/LesserVenomFlask.cs +++ b/Items/LesserVenomFlask.cs @@ -9,82 +9,83 @@ namespace Tremor.Items { public class LesserVenomFlask : AlchemistItem - { + { - public override void SetDefaults() - { - item.crit = 4; - item.damage = 22; - //item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("LesserVenomFlaskPro"); - item.shootSpeed = 8f; - item.useStyle = 1; - item.knockBack = 1; - item.UseSound = SoundID.Item106; - item.value = 150; - item.rare = 1; - item.autoReuse = false; + public override void SetDefaults() + { + item.crit = 4; + item.damage = 22; + //item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("LesserVenomFlaskPro"); + item.shootSpeed = 8f; + item.useStyle = 1; + item.knockBack = 1; + item.UseSound = SoundID.Item106; + item.value = 150; + item.rare = 1; + item.autoReuse = false; - item.ammo = mod.ItemType("BoomFlask"); - } + item.ammo = mod.ItemType("BoomFlask"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Lesser Venom Flask"); - Tooltip.SetDefault("Throws a flask that explodes into venom clouds\nClouds deal damage to enemies and poison them"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Lesser Venom Flask"); + Tooltip.SetDefault("Throws a flask that explodes into venom clouds\nClouds deal damage to enemies and poison them"); + } - public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) - { - type = mod.ProjectileType("PurpleCloudPro"); - } + public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) + { + type = mod.ProjectileType("PurpleCloudPro"); + } + + public override void UpdateInventory(Player player) + { + MPlayer modPlayer = player.GetModPlayer(mod); + if (modPlayer.novaHelmet) + { + item.autoReuse = true; + } + if (!modPlayer.novaHelmet) + { + item.autoReuse = false; + } - public override void UpdateInventory(Player player) - { - MPlayer modPlayer = player.GetModPlayer(mod); - if (modPlayer.novaHelmet) - { - item.autoReuse = true; - } - if (!modPlayer.novaHelmet) - { - item.autoReuse = false; - } - - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) - { - item.shootSpeed = 11f; - } - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) - { - item.shootSpeed = 8f; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) - { - item.autoReuse = true; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) - { - item.autoReuse = false; - } - } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) + { + item.shootSpeed = 11f; + } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) + { + item.shootSpeed = 8f; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) + { + item.autoReuse = true; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) + { + item.autoReuse = false; + } + } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.Bottle, 1); - recipe.AddIngredient(ItemID.SpiderFang, 1); - recipe.AddIngredient(null, "GelCube", 3); + recipe.AddIngredient(ItemID.SpiderFang, 1); + recipe.AddIngredient(null, "GelCube", 3); recipe.SetResult(this, 40); recipe.AddRecipe(); } -}} + } +} diff --git a/Items/LifeMachine.cs b/Items/LifeMachine.cs index 858abab4..c88b2922 100644 --- a/Items/LifeMachine.cs +++ b/Items/LifeMachine.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class LifeMachine : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class LifeMachine : ModItem + { + public override void SetDefaults() + { - item.width = 50; - item.height = 26; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; + item.width = 50; + item.height = 26; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 250000; - item.createTile = mod.TileType("LifeMachineTile"); - } + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 250000; + item.createTile = mod.TileType("LifeMachineTile"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Life Machine"); - Tooltip.SetDefault("Increases maximum health of the player standing near"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Life Machine"); + Tooltip.SetDefault("Increases maximum health of the player standing near"); + } -}} + } +} diff --git a/Items/LightBulb.cs b/Items/LightBulb.cs index fadc4bda..d248eadd 100644 --- a/Items/LightBulb.cs +++ b/Items/LightBulb.cs @@ -4,23 +4,25 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class LightBulb : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class LightBulb : ModItem + { + public override void SetDefaults() + { - item.width = 14; - item.height = 22; - item.maxStack = 999; - item.rare = 3; - item.value = Item.buyPrice(0, 0, 10, 0); - } + item.width = 14; + item.height = 22; + item.maxStack = 999; + item.rare = 3; + item.value = Item.buyPrice(0, 0, 10, 0); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Light Bulb"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Light Bulb"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/LightningOrb.cs b/Items/LightningOrb.cs index 69040628..323e7a44 100644 --- a/Items/LightningOrb.cs +++ b/Items/LightningOrb.cs @@ -6,57 +6,57 @@ namespace Tremor.Items { - public class LightningOrb : ModItem - { - public override void SetDefaults() - { + public class LightningOrb : ModItem + { + public override void SetDefaults() + { - item.damage = 50; - item.magic = true; - item.width = 10; - item.height = 10; + item.damage = 50; + item.magic = true; + item.width = 10; + item.height = 10; - item.useTime = 60; - item.useAnimation = 60; - item.useStyle = 5; - item.UseSound = SoundID.Item81; - item.noMelee = true; - item.knockBack = 1; - item.value = 10000; - item.rare = 5; - item.autoReuse = false; - item.shoot = 580; - item.shootSpeed = 7f; - item.mana = 30; - } + item.useTime = 60; + item.useAnimation = 60; + item.useStyle = 5; + item.UseSound = SoundID.Item81; + item.noMelee = true; + item.knockBack = 1; + item.value = 10000; + item.rare = 5; + item.autoReuse = false; + item.shoot = 580; + item.shootSpeed = 7f; + item.mana = 30; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Lightning Orb"); - Tooltip.SetDefault("Creates a divine lightning"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Lightning Orb"); + Tooltip.SetDefault("Creates a divine lightning"); + } - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - Vector2 vector82 = -Main.player[Main.myPlayer].Center + Main.MouseWorld; - float ai = Main.rand.Next(100); - Vector2 vector83 = Vector2.Normalize(vector82) * item.shootSpeed; - Projectile.NewProjectile(player.Center.X, player.Center.Y, vector83.X, vector83.Y, type, damage, .5f, player.whoAmI, vector82.ToRotation(), ai); - return false; - } + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + Vector2 vector82 = -Main.player[Main.myPlayer].Center + Main.MouseWorld; + float ai = Main.rand.Next(100); + Vector2 vector83 = Vector2.Normalize(vector82) * item.shootSpeed; + Projectile.NewProjectile(player.Center.X, player.Center.Y, vector83.X, vector83.Y, type, damage, .5f, player.whoAmI, vector82.ToRotation(), ai); + return false; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Glass, 30); - recipe.AddIngredient(null, "AirFragment", 16); - recipe.AddIngredient(ItemID.SoulofLight, 12); - recipe.AddIngredient(ItemID.SoulofNight, 12); - recipe.AddIngredient(ItemID.Diamond, 15); - recipe.AddIngredient(ItemID.RainCloud, 25); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Glass, 30); + recipe.AddIngredient(null, "AirFragment", 16); + recipe.AddIngredient(ItemID.SoulofLight, 12); + recipe.AddIngredient(ItemID.SoulofNight, 12); + recipe.AddIngredient(ItemID.Diamond, 15); + recipe.AddIngredient(ItemID.RainCloud, 25); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } diff --git a/Items/LightningStaff.cs b/Items/LightningStaff.cs index a034d939..3a600cce 100644 --- a/Items/LightningStaff.cs +++ b/Items/LightningStaff.cs @@ -6,47 +6,49 @@ using Terraria.ModLoader; using Microsoft.Xna.Framework; -namespace Tremor.Items { -public class LightningStaff: ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.mana = 22; - item.UseSound = SoundID.Item82; - item.useStyle = 5; - item.damage = 180; - item.useTime = 40; - item.useAnimation = 40; - item.width = 36; - item.height = 40; - item.shoot = 580; - item.shootSpeed = 13f; - - item.knockBack = 4.4f; - Item.staff[item.type] = true; - item.magic = true; - item.autoReuse = true; - item.value = 100000; - item.rare = 11; - item.noMelee = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Lightning Staff"); - Tooltip.SetDefault("Sends out huge lightnings"); - } - - - - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - Vector2 vector82 = -Main.player[Main.myPlayer].Center + Main.MouseWorld; - float ai = Main.rand.Next(100); - Vector2 vector83 = Vector2.Normalize(vector82) * item.shootSpeed; - Projectile.NewProjectile(player.Center.X, player.Center.Y, vector83.X, vector83.Y, type, damage, .490f, player.whoAmI, vector82.ToRotation(), ai); - return false; - } - -}} + public class LightningStaff : ModItem + { + public override void SetDefaults() + { + + item.mana = 22; + item.UseSound = SoundID.Item82; + item.useStyle = 5; + item.damage = 180; + item.useTime = 40; + item.useAnimation = 40; + item.width = 36; + item.height = 40; + item.shoot = 580; + item.shootSpeed = 13f; + + item.knockBack = 4.4f; + Item.staff[item.type] = true; + item.magic = true; + item.autoReuse = true; + item.value = 100000; + item.rare = 11; + item.noMelee = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Lightning Staff"); + Tooltip.SetDefault("Sends out huge lightnings"); + } + + + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + Vector2 vector82 = -Main.player[Main.myPlayer].Center + Main.MouseWorld; + float ai = Main.rand.Next(100); + Vector2 vector83 = Vector2.Normalize(vector82) * item.shootSpeed; + Projectile.NewProjectile(player.Center.X, player.Center.Y, vector83.X, vector83.Y, type, damage, .490f, player.whoAmI, vector82.ToRotation(), ai); + return false; + } + + } +} diff --git a/Items/LightningTome.cs b/Items/LightningTome.cs index 93048033..a2d66ac3 100644 --- a/Items/LightningTome.cs +++ b/Items/LightningTome.cs @@ -5,35 +5,36 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class LightningTome : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class LightningTome : ModItem + { + public override void SetDefaults() + { - item.damage = 15; - item.melee = false; - item.magic = true; - item.width = 50; - item.height = 55; - item.useTime = 14; - item.mana = 7; - item.useAnimation = 14; - item.useStyle = 5; - item.shoot = mod.ProjectileType("LightningTome"); - item.shootSpeed = 12f; - item.knockBack = 4; - item.value = 50000; - item.rare = 3; - item.UseSound = SoundID.Item9; - item.autoReuse = false; - } + item.damage = 15; + item.melee = false; + item.magic = true; + item.width = 50; + item.height = 55; + item.useTime = 14; + item.mana = 7; + item.useAnimation = 14; + item.useStyle = 5; + item.shoot = mod.ProjectileType("LightningTome"); + item.shootSpeed = 12f; + item.knockBack = 4; + item.value = 50000; + item.rare = 3; + item.UseSound = SoundID.Item9; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Lightning Tome"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Lightning Tome"); + Tooltip.SetDefault(""); + } -} + } } diff --git a/Items/LinearBurst.cs b/Items/LinearBurst.cs index 36a7a670..ddad66ef 100644 --- a/Items/LinearBurst.cs +++ b/Items/LinearBurst.cs @@ -4,57 +4,59 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class LinearBurst : ModItem +namespace Tremor.Items { - public override bool CanEquipAccessory(Player player, int slot) - { - for(int i=0; i < player.armor.Length; i++) - { - MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - if(modPlayer.nitro == true) - { - return false; - } - } - return true; - } - - public override void SetDefaults() - { - - item.width = 22; - item.height = 44; - - item.value = 300000; - item.rare = 6; - item.accessory = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Linear Burst"); - Tooltip.SetDefault("Achemical flasks leave five death flames"); - } - - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.ExplosivePowder, 15); - recipe.AddIngredient(null, "ReinforcedBurst", 1); - recipe.AddIngredient(ItemID.SoulofLight, 10); - recipe.AddIngredient(ItemID.SoulofNight, 10); - recipe.AddIngredient(ItemID.HallowedBar, 15); - recipe.SetResult(this); - recipe.AddTile(114); - recipe.AddRecipe(); - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - player.AddBuff(mod.BuffType("LinearBurstBuff"), 2); - modPlayer.nitro = true; - } -}} + public class LinearBurst : ModItem + { + public override bool CanEquipAccessory(Player player, int slot) + { + for (int i = 0; i < player.armor.Length; i++) + { + MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); + if (modPlayer.nitro == true) + { + return false; + } + } + return true; + } + + public override void SetDefaults() + { + + item.width = 22; + item.height = 44; + + item.value = 300000; + item.rare = 6; + item.accessory = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Linear Burst"); + Tooltip.SetDefault("Achemical flasks leave five death flames"); + } + + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.ExplosivePowder, 15); + recipe.AddIngredient(null, "ReinforcedBurst", 1); + recipe.AddIngredient(ItemID.SoulofLight, 10); + recipe.AddIngredient(ItemID.SoulofNight, 10); + recipe.AddIngredient(ItemID.HallowedBar, 15); + recipe.SetResult(this); + recipe.AddTile(114); + recipe.AddRecipe(); + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); + player.AddBuff(mod.BuffType("LinearBurstBuff"), 2); + modPlayer.nitro = true; + } + } +} diff --git a/Items/LivingTombstone.cs b/Items/LivingTombstone.cs index 8dc6d884..c19254a6 100644 --- a/Items/LivingTombstone.cs +++ b/Items/LivingTombstone.cs @@ -13,19 +13,19 @@ public override void SetDefaults() { item.CloneDefaults(ItemID.Carrot); - item.useTime = 25; - item.useAnimation = 25; + item.useTime = 25; + item.useAnimation = 25; item.shoot = mod.ProjectileType("LivingTombstonePro"); item.buffType = mod.BuffType("LivingTombstoneBuff"); item.value = 500000; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Living Tombstone"); - Tooltip.SetDefault("Summons a living tombstone"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Living Tombstone"); + Tooltip.SetDefault("Summons a living tombstone"); + } public override void UseStyle(Player player) diff --git a/Items/LivingWoodBreastplate.cs b/Items/LivingWoodBreastplate.cs index 3b02cc09..904c17ef 100644 --- a/Items/LivingWoodBreastplate.cs +++ b/Items/LivingWoodBreastplate.cs @@ -5,43 +5,45 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class LivingWoodBreastplate : ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 38; - item.height = 22; - - - item.value = 200; - item.rare = 1; - item.defense = 2; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Living Wood Breastplate"); - Tooltip.SetDefault("Increases minion damage by 4%\nIncreases your max number of minions"); - } - - - public override void UpdateEquip(Player player) - { - player.maxMinions += 1; - player.minionDamage += 0.04f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Wood, 30); - recipe.SetResult(this); - recipe.AddTile(304); - recipe.AddRecipe(); - } - -}} + [AutoloadEquip(EquipType.Body)] + public class LivingWoodBreastplate : ModItem + { + + public override void SetDefaults() + { + + item.width = 38; + item.height = 22; + + + item.value = 200; + item.rare = 1; + item.defense = 2; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Living Wood Breastplate"); + Tooltip.SetDefault("Increases minion damage by 4%\nIncreases your max number of minions"); + } + + + public override void UpdateEquip(Player player) + { + player.maxMinions += 1; + player.minionDamage += 0.04f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Wood, 30); + recipe.SetResult(this); + recipe.AddTile(304); + recipe.AddRecipe(); + } + + } +} diff --git a/Items/LivingWoodGreaves.cs b/Items/LivingWoodGreaves.cs index ff1ee146..e4bc3841 100644 --- a/Items/LivingWoodGreaves.cs +++ b/Items/LivingWoodGreaves.cs @@ -5,41 +5,44 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class LivingWoodGreaves : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Legs)] + public class LivingWoodGreaves : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 18; - item.value = 200; + item.width = 22; + item.height = 18; + item.value = 200; - item.rare = 1; - item.defense = 1; - } + item.rare = 1; + item.defense = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Living Wood Greaves"); - Tooltip.SetDefault("Increases minion damage by 4%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Living Wood Greaves"); + Tooltip.SetDefault("Increases minion damage by 4%"); + } - public override void UpdateEquip(Player player) - { - player.minionDamage += 0.04f; - } + public override void UpdateEquip(Player player) + { + player.minionDamage += 0.04f; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Wood, 25); - recipe.SetResult(this); - recipe.AddTile(304); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Wood, 25); + recipe.SetResult(this); + recipe.AddTile(304); + recipe.AddRecipe(); + } -}} + } +} diff --git a/Items/LivingWoodMask.cs b/Items/LivingWoodMask.cs index 4a9e1df7..d7bfea99 100644 --- a/Items/LivingWoodMask.cs +++ b/Items/LivingWoodMask.cs @@ -5,52 +5,55 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class LivingWoodMask : ModItem +namespace Tremor.Items { - - - public override void SetDefaults() - { - - item.width = 34; - item.height = 26; - - item.value = 200; - item.rare = 1; - item.defense = 1; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Living Wood Mask"); - Tooltip.SetDefault("Increases minion damage by 4%"); - } - - - public override void UpdateEquip(Player player) - { - player.minionDamage += 0.04f; - } - - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("LivingWoodBreastplate") && legs.type == mod.ItemType("LivingWoodGreaves"); - } - - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increases your max number of minions"; -player.maxMinions += 1; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Wood, 20); - recipe.SetResult(this); - recipe.AddTile(304); - recipe.AddRecipe(); - } - -}} + [AutoloadEquip(EquipType.Head)] + public class LivingWoodMask : ModItem + { + + + public override void SetDefaults() + { + + item.width = 34; + item.height = 26; + + item.value = 200; + item.rare = 1; + item.defense = 1; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Living Wood Mask"); + Tooltip.SetDefault("Increases minion damage by 4%"); + } + + + public override void UpdateEquip(Player player) + { + player.minionDamage += 0.04f; + } + + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("LivingWoodBreastplate") && legs.type == mod.ItemType("LivingWoodGreaves"); + } + + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increases your max number of minions"; + player.maxMinions += 1; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Wood, 20); + recipe.SetResult(this); + recipe.AddTile(304); + recipe.AddRecipe(); + } + + } +} diff --git a/Items/LivingWoodThreepeater.cs b/Items/LivingWoodThreepeater.cs index a9eba270..079eff80 100644 --- a/Items/LivingWoodThreepeater.cs +++ b/Items/LivingWoodThreepeater.cs @@ -5,45 +5,47 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class LivingWoodThreepeater : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class LivingWoodThreepeater : ModItem + { + public override void SetDefaults() + { - item.damage = 45; - item.ranged = true; - item.width = 40; - item.height = 20; - item.useTime = 29; - item.useAnimation = 29; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 6; - item.value = 30000; - item.rare = 6; - item.UseSound = SoundID.Item5; - item.autoReuse = true; - item.shoot = 1; - item.shootSpeed = 12f; - item.useAmmo = AmmoID.Arrow; - } + item.damage = 45; + item.ranged = true; + item.width = 40; + item.height = 20; + item.useTime = 29; + item.useAnimation = 29; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 6; + item.value = 30000; + item.rare = 6; + item.UseSound = SoundID.Item5; + item.autoReuse = true; + item.shoot = 1; + item.shootSpeed = 12f; + item.useAmmo = AmmoID.Arrow; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Living Wood Threepeater"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Living Wood Threepeater"); + Tooltip.SetDefault(""); + } -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) -{ - for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. - { - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); - } - return false; + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. + { + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); + } + return false; + } + } } -}} diff --git a/Items/LongBow.cs b/Items/LongBow.cs index 959221ce..7f742eab 100644 --- a/Items/LongBow.cs +++ b/Items/LongBow.cs @@ -4,33 +4,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class LongBow : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class LongBow : ModItem + { + public override void SetDefaults() + { - item.damage = 14; - item.width = 16; - item.height = 32; - item.ranged = true; - item.useTime = 30; - item.shoot = 1; - item.shootSpeed = 8f; - item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 5; - item.value = 1040; - item.useAmmo = AmmoID.Arrow; - item.rare = 2; - item.UseSound = SoundID.Item5; - item.autoReuse = true; - } + item.damage = 14; + item.width = 16; + item.height = 32; + item.ranged = true; + item.useTime = 30; + item.shoot = 1; + item.shootSpeed = 8f; + item.useAnimation = 30; + item.useStyle = 5; + item.knockBack = 5; + item.value = 1040; + item.useAmmo = AmmoID.Arrow; + item.rare = 2; + item.UseSound = SoundID.Item5; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Long Bow"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Long Bow"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/LongFuse.cs b/Items/LongFuse.cs index b8803f68..c232ea36 100644 --- a/Items/LongFuse.cs +++ b/Items/LongFuse.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class LongFuse : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class LongFuse : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 44; + item.width = 22; + item.height = 44; - item.value = 25000; - item.rare = 5; - item.accessory = true; - item.defense = 1; - } + item.value = 25000; + item.rare = 5; + item.accessory = true; + item.defense = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Long Fuse"); - Tooltip.SetDefault("Alchemical weapons throws further"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Long Fuse"); + Tooltip.SetDefault("Alchemical weapons throws further"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.AddBuff(mod.BuffType("LongFuseBuff"), 2); - } -}} + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.AddBuff(mod.BuffType("LongFuseBuff"), 2); + } + } +} diff --git a/Items/LostTurtleKnife.cs b/Items/LostTurtleKnife.cs index 7bb81464..5f9e030d 100644 --- a/Items/LostTurtleKnife.cs +++ b/Items/LostTurtleKnife.cs @@ -5,36 +5,38 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class LostTurtleKnife : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class LostTurtleKnife : ModItem + { + public override void SetDefaults() + { - item.damage = 177; - item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("LostTurtleKnifePro"); - item.shootSpeed = 22f; - item.useStyle = 1; - item.knockBack = 4; - item.value = 11; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 177; + item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("LostTurtleKnifePro"); + item.shootSpeed = 22f; + item.useStyle = 1; + item.knockBack = 4; + item.value = 11; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Lost Turtle Knife"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Lost Turtle Knife"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/LunarRoot.cs b/Items/LunarRoot.cs index ccedd50f..4a0af867 100644 --- a/Items/LunarRoot.cs +++ b/Items/LunarRoot.cs @@ -4,24 +4,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class LunarRoot : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class LunarRoot : ModItem + { + public override void SetDefaults() + { - item.width = 14; - item.height = 22; - item.maxStack = 999; - item.rare = 11; + item.width = 14; + item.height = 22; + item.maxStack = 999; + item.rare = 11; - item.value = Item.buyPrice(0, 1, 0, 0); - } + item.value = Item.buyPrice(0, 1, 0, 0); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Lunar Root"); - Tooltip.SetDefault("'Moon root power, make up!'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Lunar Root"); + Tooltip.SetDefault("'Moon root power, make up!'"); + } -}} + } +} diff --git a/Items/LunarSquid.cs b/Items/LunarSquid.cs index 0a58c852..dea11d9f 100644 --- a/Items/LunarSquid.cs +++ b/Items/LunarSquid.cs @@ -21,11 +21,11 @@ public override void SetDefaults() item.rare = -11; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Lunar Squid"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Lunar Squid"); + Tooltip.SetDefault(""); + } public override bool IsQuestFish() diff --git a/Items/LuxoriousBreastplate.cs b/Items/LuxoriousBreastplate.cs index 597ca4a9..062ffb72 100644 --- a/Items/LuxoriousBreastplate.cs +++ b/Items/LuxoriousBreastplate.cs @@ -7,38 +7,39 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class LuxoriousBreastplate : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Body)] + public class LuxoriousBreastplate : ModItem + { - public override void SetDefaults() - { - item.defense = 20; - item.width = 22; - item.height = 30; - item.value = 2500; - item.rare = 8; - } + public override void SetDefaults() + { + item.defense = 20; + item.width = 22; + item.height = 30; + item.value = 2500; + item.rare = 8; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Luxorious Breastplate"); - Tooltip.SetDefault("Increases mining speed by 12%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Luxorious Breastplate"); + Tooltip.SetDefault("Increases mining speed by 12%"); + } - public override void UpdateEquip(Player player) - { - player.pickSpeed -= 0.12f; - } + public override void UpdateEquip(Player player) + { + player.pickSpeed -= 0.12f; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "EvershinyBar", 25); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "EvershinyBar", 25); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } } diff --git a/Items/LuxoriousHelmet.cs b/Items/LuxoriousHelmet.cs index db3d3019..33cbaf74 100644 --- a/Items/LuxoriousHelmet.cs +++ b/Items/LuxoriousHelmet.cs @@ -7,57 +7,59 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class LuxoriousHelmet : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class LuxoriousHelmet : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.defense = 15; - item.width = 26; - item.height = 32; - item.value = 2500; - item.rare = 8; - } + item.defense = 15; + item.width = 26; + item.height = 32; + item.value = 2500; + item.rare = 8; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Luxorious Helmet"); - Tooltip.SetDefault("Increases mining speed by 12%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Luxorious Helmet"); + Tooltip.SetDefault("Increases mining speed by 12%"); + } - public override void UpdateEquip(Player player) - { - player.pickSpeed -= 0.12f; - } + public override void UpdateEquip(Player player) + { + player.pickSpeed -= 0.12f; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == mod.ItemType("LuxoriousBreastplate") && legs.type == mod.ItemType("LuxoriousLeggings"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("LuxoriousBreastplate") && legs.type == mod.ItemType("LuxoriousLeggings"); + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Allows to detect treasures, ores and traps"; - player.findTreasure = true; - player.AddBuff(111, 2); - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Allows to detect treasures, ores and traps"; + player.findTreasure = true; + player.AddBuff(111, 2); + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawOutlines=true; + player.armorEffectDrawOutlines = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "EvershinyBar", 15); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "EvershinyBar", 15); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } } diff --git a/Items/LuxoriousLeggings.cs b/Items/LuxoriousLeggings.cs index 6bd033dc..59112efb 100644 --- a/Items/LuxoriousLeggings.cs +++ b/Items/LuxoriousLeggings.cs @@ -7,39 +7,41 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class LuxoriousLeggings : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Legs)] + public class LuxoriousLeggings : ModItem + { - public override void SetDefaults() - { - item.defense = 15; - item.width = 22; - item.height = 18; - item.value = 2500; - item.rare = 8; - } + public override void SetDefaults() + { + item.defense = 15; + item.width = 22; + item.height = 18; + item.value = 2500; + item.rare = 8; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Luxorious Leggings"); - Tooltip.SetDefault("Increases mining speed by 12%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Luxorious Leggings"); + Tooltip.SetDefault("Increases mining speed by 12%"); + } - public override void UpdateEquip(Player player) - { - player.pickSpeed -= 0.12f; - } + public override void UpdateEquip(Player player) + { + player.pickSpeed -= 0.12f; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "EvershinyBar", 20); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "EvershinyBar", 20); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } } diff --git a/Items/M29.cs b/Items/M29.cs index ea7c665d..9b221428 100644 --- a/Items/M29.cs +++ b/Items/M29.cs @@ -5,34 +5,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class M29: ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class M29 : ModItem + { + public override void SetDefaults() + { - item.damage = 313; - item.ranged = true; - item.width = 98; - item.height = 28; - item.useTime = 60; - item.useAmmo = AmmoID.Bullet; - item.useAnimation = 60; - item.shoot = 242; - item.shootSpeed = 15f; - item.useStyle = 5; - item.knockBack =10; - item.value = 96300; - item.rare = 10; - item.UseSound = SoundID.Item40; - item.autoReuse = true; - } + item.damage = 313; + item.ranged = true; + item.width = 98; + item.height = 28; + item.useTime = 60; + item.useAmmo = AmmoID.Bullet; + item.useAnimation = 60; + item.shoot = 242; + item.shootSpeed = 15f; + item.useStyle = 5; + item.knockBack = 10; + item.value = 96300; + item.rare = 10; + item.UseSound = SoundID.Item40; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("M-29"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("M-29"); + Tooltip.SetDefault(""); + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) @@ -41,10 +42,10 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX return base.Shoot(player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack); } - public override Vector2? HoldoutOffset() - { - return new Vector2(-25, 0); - } + public override Vector2? HoldoutOffset() + { + return new Vector2(-25, 0); + } public override void AddRecipes() { @@ -56,5 +57,6 @@ public override void AddRecipes() recipe.AddTile(412); recipe.SetResult(this); recipe.AddRecipe(); - } -}} + } + } +} diff --git a/Items/MagicWorkbench.cs b/Items/MagicWorkbench.cs index 5687a024..c6996610 100644 --- a/Items/MagicWorkbench.cs +++ b/Items/MagicWorkbench.cs @@ -4,41 +4,43 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class MagicWorkbench : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class MagicWorkbench : ModItem + { + public override void SetDefaults() + { - item.width = 50; - item.height = 26; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; + item.width = 50; + item.height = 26; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 150; - item.createTile = mod.TileType("MagicWorkbenchTile"); - } + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 150; + item.createTile = mod.TileType("MagicWorkbenchTile"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Magic Workbench"); - Tooltip.SetDefault("Allows you to create scientific-magical things"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Magic Workbench"); + Tooltip.SetDefault("Allows you to create scientific-magical things"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Wood, 15); - recipe.AddIngredient(ItemID.ManaCrystal, 2); - recipe.AddIngredient(ItemID.MagicHat, 1); - recipe.AddIngredient(ItemID.Bunny, 1); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Wood, 15); + recipe.AddIngredient(ItemID.ManaCrystal, 2); + recipe.AddIngredient(ItemID.MagicHat, 1); + recipe.AddIngredient(ItemID.Bunny, 1); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/MagicalGreaves.cs b/Items/MagicalGreaves.cs index e5add33b..b5cd5f7b 100644 --- a/Items/MagicalGreaves.cs +++ b/Items/MagicalGreaves.cs @@ -5,49 +5,52 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class MagicalGreaves : ModItem +namespace Tremor.Items { - - - public override void SetDefaults() - { - - item.width = 22; - item.height = 18; - item.value = 250; - - item.rare = 1; - item.defense = 2; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Theurgic Greaves"); - Tooltip.SetDefault("3% increased magic damage"); - } - - public override void UpdateEquip(Player player) - { - player.magicDamage += 0.03f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Silk, 8); - recipe.AddIngredient(ItemID.LeadBar, 3); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Silk, 8); - recipe.AddIngredient(ItemID.IronBar, 3); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - - } - -}} + [AutoloadEquip(EquipType.Legs)] + public class MagicalGreaves : ModItem + { + + + public override void SetDefaults() + { + + item.width = 22; + item.height = 18; + item.value = 250; + + item.rare = 1; + item.defense = 2; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Theurgic Greaves"); + Tooltip.SetDefault("3% increased magic damage"); + } + + public override void UpdateEquip(Player player) + { + player.magicDamage += 0.03f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Silk, 8); + recipe.AddIngredient(ItemID.LeadBar, 3); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Silk, 8); + recipe.AddIngredient(ItemID.IronBar, 3); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + + } + + } +} diff --git a/Items/MagicalHat.cs b/Items/MagicalHat.cs index ad231513..e78905e8 100644 --- a/Items/MagicalHat.cs +++ b/Items/MagicalHat.cs @@ -5,60 +5,63 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class MagicalHat : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class MagicalHat : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 22; + item.width = 26; + item.height = 22; - item.value = 250; - item.rare = 1; - item.defense = 2; - } + item.value = 250; + item.rare = 1; + item.defense = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Theurgic Hat"); - Tooltip.SetDefault("3% increased magic damage"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Theurgic Hat"); + Tooltip.SetDefault("3% increased magic damage"); + } - public override void UpdateEquip(Player player) - { - player.magicDamage += 0.03f; - } + public override void UpdateEquip(Player player) + { + player.magicDamage += 0.03f; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == mod.ItemType("MagicalRobe") && legs.type == mod.ItemType("MagicalGreaves"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("MagicalRobe") && legs.type == mod.ItemType("MagicalGreaves"); + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increases maximum mana by 20"; - player.statManaMax2 += 20; - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increases maximum mana by 20"; + player.statManaMax2 += 20; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Silk, 7); - recipe.AddIngredient(ItemID.LeadBar, 3); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Silk, 7); + recipe.AddIngredient(ItemID.LeadBar, 3); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Silk, 7); - recipe.AddIngredient(ItemID.IronBar, 3); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Silk, 7); + recipe.AddIngredient(ItemID.IronBar, 3); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); - } + } -}} + } +} diff --git a/Items/MagicalRobe.cs b/Items/MagicalRobe.cs index d93c9e79..26fc27d1 100644 --- a/Items/MagicalRobe.cs +++ b/Items/MagicalRobe.cs @@ -5,50 +5,52 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class MagicalRobe : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.width = 250; - - - item.height = 28; - item.value = 600; - item.rare = 1; - item.defense = 4; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Theurgic Mantle"); - Tooltip.SetDefault("4% increased magic damage\nIncreases maximum mana by 20"); - } - - - public override void UpdateEquip(Player player) - { - player.magicDamage += 0.04f; - player.statManaMax2 += 20; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Silk, 14); - recipe.AddIngredient(ItemID.LeadBar, 6); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Silk, 14); - recipe.AddIngredient(ItemID.IronBar, 6); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } - -}} + [AutoloadEquip(EquipType.Body)] + public class MagicalRobe : ModItem + { + public override void SetDefaults() + { + + item.width = 250; + + + item.height = 28; + item.value = 600; + item.rare = 1; + item.defense = 4; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Theurgic Mantle"); + Tooltip.SetDefault("4% increased magic damage\nIncreases maximum mana by 20"); + } + + + public override void UpdateEquip(Player player) + { + player.magicDamage += 0.04f; + player.statManaMax2 += 20; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Silk, 14); + recipe.AddIngredient(ItemID.LeadBar, 6); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Silk, 14); + recipe.AddIngredient(ItemID.IronBar, 6); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } + + } +} diff --git a/Items/MagiumBreastplate.cs b/Items/MagiumBreastplate.cs index e09ee961..bedbfba5 100644 --- a/Items/MagiumBreastplate.cs +++ b/Items/MagiumBreastplate.cs @@ -5,44 +5,46 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class MagiumBreastplate : ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 38; - item.height = 22; - - - item.value = 18000; - item.rare = 5; - item.defense = 9; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Magium Breastplate"); - Tooltip.SetDefault("10% increased magic damage\nIncreases maximum mana by 40"); - } - - - public override void UpdateEquip(Player player) - { - player.statManaMax2 += 40; - player.magicDamage += 0.1f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "RuneBar", 12); - recipe.AddIngredient(null, "MagiumShard", 10); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } - -}} + [AutoloadEquip(EquipType.Body)] + public class MagiumBreastplate : ModItem + { + + public override void SetDefaults() + { + + item.width = 38; + item.height = 22; + + + item.value = 18000; + item.rare = 5; + item.defense = 9; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Magium Breastplate"); + Tooltip.SetDefault("10% increased magic damage\nIncreases maximum mana by 40"); + } + + + public override void UpdateEquip(Player player) + { + player.statManaMax2 += 40; + player.magicDamage += 0.1f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "RuneBar", 12); + recipe.AddIngredient(null, "MagiumShard", 10); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + + } +} diff --git a/Items/MagiumGreaves.cs b/Items/MagiumGreaves.cs index ff181e0b..e07a7243 100644 --- a/Items/MagiumGreaves.cs +++ b/Items/MagiumGreaves.cs @@ -5,44 +5,47 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class MagiumGreaves : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Legs)] + public class MagiumGreaves : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 38; - item.height = 22; + item.width = 38; + item.height = 22; - item.value = 18000; - item.rare = 5; - item.defense = 8; - } + item.value = 18000; + item.rare = 5; + item.defense = 8; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Magium Greaves"); - Tooltip.SetDefault("Increases movement speed by 25%\nIncreases maximum mana by 40"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Magium Greaves"); + Tooltip.SetDefault("Increases movement speed by 25%\nIncreases maximum mana by 40"); + } - public override void UpdateEquip(Player player) - { - player.moveSpeed += 0.2f; - player.statManaMax2 += 40; - } + public override void UpdateEquip(Player player) + { + player.moveSpeed += 0.2f; + player.statManaMax2 += 40; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "RuneBar", 10); - recipe.AddIngredient(null, "MagiumShard", 8); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "RuneBar", 10); + recipe.AddIngredient(null, "MagiumShard", 8); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } -}} + } +} diff --git a/Items/MagiumHelmet.cs b/Items/MagiumHelmet.cs index d69b27a8..2bdec3c2 100644 --- a/Items/MagiumHelmet.cs +++ b/Items/MagiumHelmet.cs @@ -5,55 +5,58 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class MagiumHelmet : ModItem +namespace Tremor.Items { - - - public override void SetDefaults() - { - - item.width = 38; - item.height = 22; - - - item.value = 18000; - item.rare = 5; - item.defense = 8; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Magium Helmet"); - Tooltip.SetDefault("9% increased magic critical strike chance\nIncreases maximum mana by 40"); - } - - - public override void UpdateEquip(Player player) - { - player.magicCrit += 9; - player.statManaMax2 += 40; - } - - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("MagiumBreastplate") && legs.type == mod.ItemType("MagiumGreaves"); - } - - public override void UpdateArmorSet(Player p) - { - p.setBonus = "25% decreased mana cost"; - p.manaCost -= 0.25f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "RuneBar", 8); - recipe.AddIngredient(null, "MagiumShard", 6); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } - -}} + [AutoloadEquip(EquipType.Head)] + public class MagiumHelmet : ModItem + { + + + public override void SetDefaults() + { + + item.width = 38; + item.height = 22; + + + item.value = 18000; + item.rare = 5; + item.defense = 8; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Magium Helmet"); + Tooltip.SetDefault("9% increased magic critical strike chance\nIncreases maximum mana by 40"); + } + + + public override void UpdateEquip(Player player) + { + player.magicCrit += 9; + player.statManaMax2 += 40; + } + + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("MagiumBreastplate") && legs.type == mod.ItemType("MagiumGreaves"); + } + + public override void UpdateArmorSet(Player p) + { + p.setBonus = "25% decreased mana cost"; + p.manaCost -= 0.25f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "RuneBar", 8); + recipe.AddIngredient(null, "MagiumShard", 6); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + + } +} diff --git a/Items/MagiumRod.cs b/Items/MagiumRod.cs index 4fa7163b..e4efe075 100644 --- a/Items/MagiumRod.cs +++ b/Items/MagiumRod.cs @@ -4,113 +4,115 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class MagiumRod : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.damage = 42; - item.magic = true; - item.mana = 6; - item.width = 40; - item.height = 40; - item.useTime = 16; - item.useAnimation = 16; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 3; - item.value = 13800; - item.rare = 5; - item.UseSound = SoundID.Item43; - item.autoReuse = false; - Item.staff[item.type] = true; - item.shoot = mod.ProjectileType("MagiumRodPro"); - item.shootSpeed = 15f; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Magium Rod"); - Tooltip.SetDefault(""); - } - - - - public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - int i = Main.myPlayer; - float num72 = item.shootSpeed; - int num73 = item.damage; - float num74 = item.knockBack; - num74 = player.GetWeaponKnockback(item, num74); - player.itemTime = item.useTime; - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default(Vector2)); - Vector2 vector3 = Main.MouseWorld - vector2; - float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (player.gravDir == -1f) - { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; - } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - float num81 = num80; - if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) - { - num78 = (float)player.direction; - num79 = 0f; - num80 = num72; - } - else - { - num80 = num72 / num80; - } - num78 *= num80; - num79 *= num80; - int num146 = 4; - if (Main.rand.Next(2) == 0) + public class MagiumRod : ModItem + { + public override void SetDefaults() { - num146++; - } - if (Main.rand.Next(4) == 0) - { - num146++; + + item.damage = 42; + item.magic = true; + item.mana = 6; + item.width = 40; + item.height = 40; + item.useTime = 16; + item.useAnimation = 16; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 3; + item.value = 13800; + item.rare = 5; + item.UseSound = SoundID.Item43; + item.autoReuse = false; + Item.staff[item.type] = true; + item.shoot = mod.ProjectileType("MagiumRodPro"); + item.shootSpeed = 15f; } - if (Main.rand.Next(8) == 0) + + public override void SetStaticDefaults() { - num146++; + DisplayName.SetDefault("Magium Rod"); + Tooltip.SetDefault(""); } - if (Main.rand.Next(16) == 0) + + + + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - num146++; + int i = Main.myPlayer; + float num72 = item.shootSpeed; + int num73 = item.damage; + float num74 = item.knockBack; + num74 = player.GetWeaponKnockback(item, num74); + player.itemTime = item.useTime; + Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); + Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default(Vector2)); + Vector2 vector3 = Main.MouseWorld - vector2; + float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (player.gravDir == -1f) + { + num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + } + float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + float num81 = num80; + if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) + { + num78 = (float)player.direction; + num79 = 0f; + num80 = num72; + } + else + { + num80 = num72 / num80; + } + num78 *= num80; + num79 *= num80; + int num146 = 4; + if (Main.rand.Next(2) == 0) + { + num146++; + } + if (Main.rand.Next(4) == 0) + { + num146++; + } + if (Main.rand.Next(8) == 0) + { + num146++; + } + if (Main.rand.Next(16) == 0) + { + num146++; + } + for (int num147 = 0; num147 < num146; num147++) + { + float num148 = num78; + float num149 = num79; + float num150 = 0.05f * (float)num147; + num148 += (float)Main.rand.Next(-35, 36) * num150; + num149 += (float)Main.rand.Next(-35, 36) * num150; + num80 = (float)Math.Sqrt((double)(num148 * num148 + num149 * num149)); + num80 = num72 / num80; + num148 *= num80; + num149 *= num80; + float x4 = vector2.X; + float y4 = vector2.Y; + Projectile.NewProjectile(x4, y4, num148, num149, mod.ProjectileType("MagiumRodPro"), num73, num74, i, 0f, 0f); + } + return false; } - for (int num147 = 0; num147 < num146; num147++) + + public override void AddRecipes() { - float num148 = num78; - float num149 = num79; - float num150 = 0.05f * (float)num147; - num148 += (float)Main.rand.Next(-35, 36) * num150; - num149 += (float)Main.rand.Next(-35, 36) * num150; - num80 = (float)Math.Sqrt((double)(num148 * num148 + num149 * num149)); - num80 = num72 / num80; - num148 *= num80; - num149 *= num80; - float x4 = vector2.X; - float y4 = vector2.Y; - Projectile.NewProjectile(x4, y4, num148, num149, mod.ProjectileType("MagiumRodPro"), num73, num74, i, 0f, 0f); + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "RuneBar", 12); + recipe.AddIngredient(null, "Gloomstone", 15); + recipe.AddIngredient(null, "MagiumShard", 8); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); } - return false; } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "RuneBar", 12); - recipe.AddIngredient(null, "Gloomstone", 15); - recipe.AddIngredient(null, "MagiumShard", 8); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} +} diff --git a/Items/MagiumShard.cs b/Items/MagiumShard.cs index f2339fca..242424cc 100644 --- a/Items/MagiumShard.cs +++ b/Items/MagiumShard.cs @@ -4,23 +4,25 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class MagiumShard : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class MagiumShard : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 120; - item.rare = 5; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 120; + item.rare = 5; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Magium Shard"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Magium Shard"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/MagmaCrusher.cs b/Items/MagmaCrusher.cs index dfabfb1e..366f7e21 100644 --- a/Items/MagmaCrusher.cs +++ b/Items/MagmaCrusher.cs @@ -4,40 +4,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class MagmaCrusher : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class MagmaCrusher : ModItem + { + public override void SetDefaults() + { - item.damage = 85; - item.melee = true; - item.width = 52; - item.height = 52; - item.useTime = 27; - item.useAnimation = 27; - item.hammer = 180; - item.useStyle = 1; - item.knockBack = 8; - item.value = 600; - item.rare = 8; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 85; + item.melee = true; + item.width = 52; + item.height = 52; + item.useTime = 27; + item.useAnimation = 27; + item.hammer = 180; + item.useStyle = 1; + item.knockBack = 8; + item.value = 600; + item.rare = 8; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Magma Crusher"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Magma Crusher"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "MagmoniumBar", 15); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "MagmoniumBar", 15); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Magmaxe.cs b/Items/Magmaxe.cs index a2b6539b..3b29b67a 100644 --- a/Items/Magmaxe.cs +++ b/Items/Magmaxe.cs @@ -4,40 +4,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Magmaxe : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Magmaxe : ModItem + { + public override void SetDefaults() + { - item.damage = 65; - item.melee = true; - item.width = 60; - item.height = 52; - item.useTime = 32; - item.useAnimation = 32; - item.axe = 40; - item.useStyle = 1; - item.knockBack = 6; - item.value = 600; - item.rare = 8; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 65; + item.melee = true; + item.width = 60; + item.height = 52; + item.useTime = 32; + item.useAnimation = 32; + item.axe = 40; + item.useStyle = 1; + item.knockBack = 6; + item.value = 600; + item.rare = 8; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Magmaxe"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Magmaxe"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "MagmoniumBar", 10); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "MagmoniumBar", 10); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Magminer.cs b/Items/Magminer.cs index e0c3347b..1ed5c58e 100644 --- a/Items/Magminer.cs +++ b/Items/Magminer.cs @@ -4,40 +4,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Magminer : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Magminer : ModItem + { + public override void SetDefaults() + { - item.damage = 40; - item.melee = true; - item.width = 60; - item.height = 52; - item.useTime = 12; - item.useAnimation = 15; - item.pick = 200; - item.useStyle = 1; - item.knockBack = 2; - item.value = 600; - item.rare = 8; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 40; + item.melee = true; + item.width = 60; + item.height = 52; + item.useTime = 12; + item.useAnimation = 15; + item.pick = 200; + item.useStyle = 1; + item.knockBack = 2; + item.value = 600; + item.rare = 8; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Magminer"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Magminer"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "MagmoniumBar", 15); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "MagmoniumBar", 15); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/MagmoniumBar.cs b/Items/MagmoniumBar.cs index f5fb8518..f4df6fe2 100644 --- a/Items/MagmoniumBar.cs +++ b/Items/MagmoniumBar.cs @@ -4,40 +4,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class MagmoniumBar : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class MagmoniumBar : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 10000; - item.rare = 8; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.createTile = mod.TileType("MagmoniumBar"); - item.useStyle = 1; - item.consumable = true; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 10000; + item.rare = 8; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.createTile = mod.TileType("MagmoniumBar"); + item.useStyle = 1; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Magmonium Bar"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Magmonium Bar"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.HellstoneBar, 1); - recipe.AddIngredient(ItemID.Ectoplasm, 2); - recipe.SetResult(this); - recipe.AddTile(133); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.HellstoneBar, 1); + recipe.AddIngredient(ItemID.Ectoplasm, 2); + recipe.SetResult(this); + recipe.AddTile(133); + recipe.AddRecipe(); + } + } +} diff --git a/Items/MagmoniumBreastplate.cs b/Items/MagmoniumBreastplate.cs index 6847dc30..c3106390 100644 --- a/Items/MagmoniumBreastplate.cs +++ b/Items/MagmoniumBreastplate.cs @@ -7,45 +7,46 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class MagmoniumBreastplate : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Body)] + public class MagmoniumBreastplate : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.defense = 25; - item.width = 22; - item.height = 30; - item.value = 60000; - item.rare = 8; - } + item.defense = 25; + item.width = 22; + item.height = 30; + item.value = 60000; + item.rare = 8; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Magmonium Breastplate"); - Tooltip.SetDefault("12% increased all damage"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Magmonium Breastplate"); + Tooltip.SetDefault("12% increased all damage"); + } - public override void UpdateEquip(Player player) - { - player.meleeDamage += 0.12f; - player.thrownDamage += 0.12f; - player.rangedDamage += 0.12f; - player.magicDamage += 0.12f; - player.minionDamage += 0.12f; - player.GetModPlayer(mod).alchemistDamage += 0.12f; - } + public override void UpdateEquip(Player player) + { + player.meleeDamage += 0.12f; + player.thrownDamage += 0.12f; + player.rangedDamage += 0.12f; + player.magicDamage += 0.12f; + player.minionDamage += 0.12f; + player.GetModPlayer(mod).alchemistDamage += 0.12f; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "MagmoniumBar", 25); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "MagmoniumBar", 25); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } } diff --git a/Items/MagmoniumGreaves.cs b/Items/MagmoniumGreaves.cs index 5610230f..2515b471 100644 --- a/Items/MagmoniumGreaves.cs +++ b/Items/MagmoniumGreaves.cs @@ -7,40 +7,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class MagmoniumGreaves : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Legs)] + public class MagmoniumGreaves : ModItem + { - public override void SetDefaults() - { - item.defense = 15; - item.width = 22; - item.height = 18; - item.value = 2500; - item.rare = 8; - } + public override void SetDefaults() + { + item.defense = 15; + item.width = 22; + item.height = 18; + item.value = 2500; + item.rare = 8; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Magmonium Greaves"); - Tooltip.SetDefault("10% increased melee speed\n10% reduced mana usage"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Magmonium Greaves"); + Tooltip.SetDefault("10% increased melee speed\n10% reduced mana usage"); + } - public override void UpdateEquip(Player player) - { - player.manaCost -= 0.1f; - player.meleeSpeed += 0.1f; - } + public override void UpdateEquip(Player player) + { + player.manaCost -= 0.1f; + player.meleeSpeed += 0.1f; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "MagmoniumBar", 20); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "MagmoniumBar", 20); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } } diff --git a/Items/MagmoniumHelmet.cs b/Items/MagmoniumHelmet.cs index e4ab605f..fb398f5c 100644 --- a/Items/MagmoniumHelmet.cs +++ b/Items/MagmoniumHelmet.cs @@ -7,59 +7,61 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class MagmoniumHelmet : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class MagmoniumHelmet : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.defense = 20; - item.width = 26; - item.height = 32; - item.value = 40000; - item.rare = 8; - } + item.defense = 20; + item.width = 26; + item.height = 32; + item.value = 40000; + item.rare = 8; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Magmonium Helmet"); - Tooltip.SetDefault("Inflicts fire damage on attack"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Magmonium Helmet"); + Tooltip.SetDefault("Inflicts fire damage on attack"); + } - public override void UpdateEquip(Player player) - { + public override void UpdateEquip(Player player) + { player.magmaStone = true; - } + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == mod.ItemType("MagmoniumBreastplate") && legs.type == mod.ItemType("MagmoniumGreaves"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("MagmoniumBreastplate") && legs.type == mod.ItemType("MagmoniumGreaves"); + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Provides immunity to lava and fire"; - player.buffImmune[BuffID.OnFire] = true; - player.buffImmune[BuffID.Burning] = true; - player.lavaImmune = true; - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Provides immunity to lava and fire"; + player.buffImmune[BuffID.OnFire] = true; + player.buffImmune[BuffID.Burning] = true; + player.lavaImmune = true; + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawShadowLokis = true; + player.armorEffectDrawShadowLokis = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "MagmoniumBar", 15); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "MagmoniumBar", 15); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } } diff --git a/Items/MagmoniumWings.cs b/Items/MagmoniumWings.cs index 77d588ea..452fe495 100644 --- a/Items/MagmoniumWings.cs +++ b/Items/MagmoniumWings.cs @@ -5,59 +5,61 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Wings)] -public class MagmoniumWings : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Wings)] + public class MagmoniumWings : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 20; + item.width = 22; + item.height = 20; - item.value = 80000; - item.rare = 8; - item.accessory = true; - } + item.value = 80000; + item.rare = 8; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Magmonium Wings"); - Tooltip.SetDefault("Allows flight and slow fall"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Magmonium Wings"); + Tooltip.SetDefault("Allows flight and slow fall"); + } - //these wings use the same values as the solar wings + //these wings use the same values as the solar wings - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.wingTimeMax = 163; - } + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.wingTimeMax = 163; + } public override void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend) - { - ascentWhenFalling = 0.85f; - ascentWhenRising = 0.15f; - maxCanAscendMultiplier = 1f; - maxAscentMultiplier = 3f; - constantAscend = 0.135f; - } - - public override void HorizontalWingSpeeds(Player player, ref float speed, ref float acceleration) - { - speed = 9f; - acceleration *= 2.5f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "MagmoniumBar", 20); - recipe.AddIngredient(ItemID.SoulofFlight, 20); - recipe.AddTile(134); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + { + ascentWhenFalling = 0.85f; + ascentWhenRising = 0.15f; + maxCanAscendMultiplier = 1f; + maxAscentMultiplier = 3f; + constantAscend = 0.135f; + } + + public override void HorizontalWingSpeeds(Player player, ref float speed, ref float acceleration) + { + speed = 9f; + acceleration *= 2.5f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "MagmoniumBar", 20); + recipe.AddIngredient(ItemID.SoulofFlight, 20); + recipe.AddTile(134); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/MagusTome.cs b/Items/MagusTome.cs index 795e2843..1a5d764b 100644 --- a/Items/MagusTome.cs +++ b/Items/MagusTome.cs @@ -5,36 +5,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class MagusTome : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class MagusTome : ModItem + { + public override void SetDefaults() + { - item.damage = 25; - item.melee = false; - item.magic = true; - item.width = 50; - item.height = 55; - item.useTime = 25; - item.mana = 9; - item.useAnimation = 25; - item.useStyle = 5; - item.shoot = mod.ProjectileType("MagusBallF"); - item.shootSpeed = 12f; - item.knockBack = 4; - item.value = 32000; - item.rare = 4; - item.UseSound = SoundID.Item9; - item.autoReuse = true; + item.damage = 25; + item.melee = false; + item.magic = true; + item.width = 50; + item.height = 55; + item.useTime = 25; + item.mana = 9; + item.useAnimation = 25; + item.useStyle = 5; + item.shoot = mod.ProjectileType("MagusBallF"); + item.shootSpeed = 12f; + item.knockBack = 4; + item.value = 32000; + item.rare = 4; + item.UseSound = SoundID.Item9; + item.autoReuse = true; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Magus Tome"); - Tooltip.SetDefault("Shoots out a bolt that pierces enemies and explodes on contant with blocks"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Magus Tome"); + Tooltip.SetDefault("Shoots out a bolt that pierces enemies and explodes on contant with blocks"); + } -} + } } diff --git a/Items/ManaBooster.cs b/Items/ManaBooster.cs index 5cff097d..1013256a 100644 --- a/Items/ManaBooster.cs +++ b/Items/ManaBooster.cs @@ -5,28 +5,29 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ManaBooster : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ManaBooster : ModItem + { + public override void SetDefaults() + { - item.useAnimation = 15; - item.useTime = 15; - item.useStyle = 4; - item.width = 22; - item.UseSound = SoundID.Item43; - item.height = 18; - item.buffType = mod.BuffType("ManaBooster"); - item.value = 5160000; - item.rare = 11; - } + item.useAnimation = 15; + item.useTime = 15; + item.useStyle = 4; + item.width = 22; + item.UseSound = SoundID.Item43; + item.height = 18; + item.buffType = mod.BuffType("ManaBooster"); + item.value = 5160000; + item.rare = 11; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Mana Booster"); - Tooltip.SetDefault("Regenerates mana every minute"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Mana Booster"); + Tooltip.SetDefault("Regenerates mana every minute"); + } public override void UseStyle(Player player) @@ -36,5 +37,6 @@ public override void UseStyle(Player player) player.AddBuff(item.buffType, 3600, true); } } - -}} + + } +} diff --git a/Items/ManaDagger.cs b/Items/ManaDagger.cs index e2eb8ae8..ccffbb65 100644 --- a/Items/ManaDagger.cs +++ b/Items/ManaDagger.cs @@ -4,36 +4,36 @@ namespace Tremor.Items { - public class ManaDagger : ModItem - { - public override void SetDefaults() - { + public class ManaDagger : ModItem + { + public override void SetDefaults() + { - item.width = 14; - item.height = 28; - item.rare = 7; - item.damage = 30; - item.magic = true; - item.mana = 12; + item.width = 14; + item.height = 28; + item.rare = 7; + item.damage = 30; + item.magic = true; + item.mana = 12; - item.useTime = 8; - item.useAnimation = 8; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 1; - item.value = 270000; - item.UseSound = SoundID.Item20; - item.autoReuse = false; - item.shoot = mod.ProjectileType("projManaDagger"); - item.shootSpeed = 15f; - } + item.useTime = 8; + item.useAnimation = 8; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 1; + item.value = 270000; + item.UseSound = SoundID.Item20; + item.autoReuse = false; + item.shoot = mod.ProjectileType("projManaDagger"); + item.shootSpeed = 15f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Mana Dagger"); - Tooltip.SetDefault("A magical returning dagger\nGives mana after hitting an enemy and returning"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Mana Dagger"); + Tooltip.SetDefault("A magical returning dagger\nGives mana after hitting an enemy and returning"); + } - } + } } diff --git a/Items/ManaFruit.cs b/Items/ManaFruit.cs index e8d6022e..1e1bfd63 100644 --- a/Items/ManaFruit.cs +++ b/Items/ManaFruit.cs @@ -4,23 +4,25 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ManaFruit : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ManaFruit : ModItem + { + public override void SetDefaults() + { - item.width = 26; - item.height = 26; - item.maxStack = 99; - item.value = 250; - item.rare = 3; - } + item.width = 26; + item.height = 26; + item.maxStack = 99; + item.value = 250; + item.rare = 3; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Mana Fruit"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Mana Fruit"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/ManaGenerator.cs b/Items/ManaGenerator.cs index 180fb1a2..a067623b 100644 --- a/Items/ManaGenerator.cs +++ b/Items/ManaGenerator.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ManaGenerator : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ManaGenerator : ModItem + { + public override void SetDefaults() + { - item.width = 50; - item.height = 26; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; + item.width = 50; + item.height = 26; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.rare = 9; - item.useStyle = 1; - item.consumable = true; - item.value = 300000; - item.createTile = mod.TileType("ManaGeneratorTile"); - } + item.useAnimation = 15; + item.useTime = 10; + item.rare = 9; + item.useStyle = 1; + item.consumable = true; + item.value = 300000; + item.createTile = mod.TileType("ManaGeneratorTile"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Mana Generator"); - Tooltip.SetDefault("Decreases mana cost of the player standing near"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Mana Generator"); + Tooltip.SetDefault("Decreases mana cost of the player standing near"); + } -}} + } +} diff --git a/Items/ManaStimPack.cs b/Items/ManaStimPack.cs index a5cac7a4..7317579a 100644 --- a/Items/ManaStimPack.cs +++ b/Items/ManaStimPack.cs @@ -3,46 +3,48 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class ManaStimPack : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.width = 36; - item.height = 36; - item.maxStack = 999; - item.rare = 11; - item.useAnimation = 15; - item.useTime = 15; - item.useStyle = 2; - item.UseSound = SoundID.Item3; - item.consumable = true; - } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Mana Stim Pack"); - Tooltip.SetDefault("Restores 20 mana\nHas no cooldown"); - } + public class ManaStimPack : ModItem + { + public override void SetDefaults() + { + item.width = 36; + item.height = 36; + item.maxStack = 999; + item.rare = 11; + item.useAnimation = 15; + item.useTime = 15; + item.useStyle = 2; + item.UseSound = SoundID.Item3; + item.consumable = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Mana Stim Pack"); + Tooltip.SetDefault("Restores 20 mana\nHas no cooldown"); + } - public override bool UseItem(Player player) - { + public override bool UseItem(Player player) + { Main.PlaySound(2, (int)player.position.X, (int)player.position.Y, 3); Main.player[Main.myPlayer].ManaEffect(20); player.statMana += 20; return true; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BrassBar", 2); - recipe.AddIngredient(ItemID.SuperManaPotion); - recipe.AddIngredient(ItemID.BottledWater); - recipe.AddIngredient(null, "NightmareBar", 5); - recipe.SetResult(this); - recipe.AddTile(13); - recipe.AddRecipe(); - } -}} \ No newline at end of file + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "BrassBar", 2); + recipe.AddIngredient(ItemID.SuperManaPotion); + recipe.AddIngredient(ItemID.BottledWater); + recipe.AddIngredient(null, "NightmareBar", 5); + recipe.SetResult(this); + recipe.AddTile(13); + recipe.AddRecipe(); + } + } +} \ No newline at end of file diff --git a/Items/ManaSupportFlask.cs b/Items/ManaSupportFlask.cs index 09e15987..9864ba7f 100644 --- a/Items/ManaSupportFlask.cs +++ b/Items/ManaSupportFlask.cs @@ -8,71 +8,72 @@ namespace Tremor.Items { public class ManaSupportFlask : ModItem - { + { - public override void SetDefaults() - { - item.crit = 4; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("ManaSupportFlaskPro"); - item.shootSpeed = 8f; - item.useStyle = 1; - item.knockBack = 1; - item.UseSound = SoundID.Item106; - item.value = 200; - item.rare = 2; - item.autoReuse = false; + public override void SetDefaults() + { + item.crit = 4; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("ManaSupportFlaskPro"); + item.shootSpeed = 8f; + item.useStyle = 1; + item.knockBack = 1; + item.UseSound = SoundID.Item106; + item.value = 200; + item.rare = 2; + item.autoReuse = false; - item.ammo = mod.ItemType("BoomFlask"); - } + item.ammo = mod.ItemType("BoomFlask"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Mana Support Flask"); - Tooltip.SetDefault("Throws a flask that explodes into clouds\nClouds restore mana of your allies"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Mana Support Flask"); + Tooltip.SetDefault("Throws a flask that explodes into clouds\nClouds restore mana of your allies"); + } - public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) - { - type = mod.ProjectileType("ManaSupportCloudPro"); - } - - public override void UpdateInventory(Player player) - { - MPlayer modPlayer = player.GetModPlayer(mod); - if (modPlayer.novaHelmet) - { - item.autoReuse = true; - } - if (!modPlayer.novaHelmet) - { - item.autoReuse = false; - } - - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) - { - item.shootSpeed = 11f; - } - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) - { - item.shootSpeed = 8f; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) - { - item.autoReuse = true; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) - { - item.autoReuse = false; - } - } + public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) + { + type = mod.ProjectileType("ManaSupportCloudPro"); + } -}} + public override void UpdateInventory(Player player) + { + MPlayer modPlayer = player.GetModPlayer(mod); + if (modPlayer.novaHelmet) + { + item.autoReuse = true; + } + if (!modPlayer.novaHelmet) + { + item.autoReuse = false; + } + + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) + { + item.shootSpeed = 11f; + } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) + { + item.shootSpeed = 8f; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) + { + item.autoReuse = true; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) + { + item.autoReuse = false; + } + } + + } +} diff --git a/Items/ManiacChainsaw.cs b/Items/ManiacChainsaw.cs index 1cb482a7..6abd9cec 100644 --- a/Items/ManiacChainsaw.cs +++ b/Items/ManiacChainsaw.cs @@ -3,43 +3,44 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; -namespace Tremor.Items { - -public class ManiacChainsaw : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.damage = 202; - item.melee = true; - item.width = 140; - item.height = 34; - item.useTime = 8; - item.useAnimation = 25; - item.channel = true; - item.noUseGraphic = true; - item.noMelee = true; - item.axe = 35; - item.tileBoost+=5; - item.useStyle = 5; - item.knockBack = 6; - item.value = Item.buyPrice(0, 1, 50, 0); - item.rare = 10; - item.UseSound = SoundID.Item23; - item.autoReuse = true; + public class ManiacChainsaw : ModItem + { + public override void SetDefaults() + { + + item.damage = 202; + item.melee = true; + item.width = 140; + item.height = 34; + item.useTime = 8; + item.useAnimation = 25; + item.channel = true; + item.noUseGraphic = true; + item.noMelee = true; + item.axe = 35; + item.tileBoost += 5; + item.useStyle = 5; + item.knockBack = 6; + item.value = Item.buyPrice(0, 1, 50, 0); + item.rare = 10; + item.UseSound = SoundID.Item23; + item.autoReuse = true; - item.shoot = mod.ProjectileType("ManiacChainsawPro"); - item.shootSpeed = 0.4f; - } + item.shoot = mod.ProjectileType("ManiacChainsawPro"); + item.shootSpeed = 0.4f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Maniacal Chainsaw"); - Tooltip.SetDefault("'A weapon of a true man killer'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Maniacal Chainsaw"); + Tooltip.SetDefault("'A weapon of a true man killer'"); + } - } + } } diff --git a/Items/MarbleBreastplate.cs b/Items/MarbleBreastplate.cs index 3107464e..353516de 100644 --- a/Items/MarbleBreastplate.cs +++ b/Items/MarbleBreastplate.cs @@ -7,40 +7,41 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class MarbleBreastplate : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + [AutoloadEquip(EquipType.Body)] + public class MarbleBreastplate : ModItem + { + public override void SetDefaults() + { - item.defense = 6; - item.width = 22; - item.height = 30; - item.value = 5000; - item.rare = 1; - } + item.defense = 6; + item.width = 22; + item.height = 30; + item.value = 5000; + item.rare = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Marble Breastplate"); - Tooltip.SetDefault("10% increased throwing damage"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Marble Breastplate"); + Tooltip.SetDefault("10% increased throwing damage"); + } - public override void UpdateEquip(Player p) - { - p.thrownDamage += 0.1f; - } + public override void UpdateEquip(Player p) + { + p.thrownDamage += 0.1f; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.MarbleBlock, 80); - recipe.AddIngredient(null, "StoneofLife", 1); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.MarbleBlock, 80); + recipe.AddIngredient(null, "StoneofLife", 1); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } } diff --git a/Items/MarbleHelmet.cs b/Items/MarbleHelmet.cs index 0be45a15..42e67f77 100644 --- a/Items/MarbleHelmet.cs +++ b/Items/MarbleHelmet.cs @@ -7,51 +7,53 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class MarbleHelmet : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class MarbleHelmet : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.defense = 2; - item.width = 26; - item.height = 32; - item.value = 2500; - item.rare = 1; - } + item.defense = 2; + item.width = 26; + item.height = 32; + item.value = 2500; + item.rare = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Marble Helmet"); - Tooltip.SetDefault("10% increased throwing velocity"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Marble Helmet"); + Tooltip.SetDefault("10% increased throwing velocity"); + } - public override void UpdateEquip(Player p) - { - p.thrownVelocity += 0.1f; - } + public override void UpdateEquip(Player p) + { + p.thrownVelocity += 0.1f; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == mod.ItemType("MarbleBreastplate") && legs.type == mod.ItemType("MarbleLeggings"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("MarbleBreastplate") && legs.type == mod.ItemType("MarbleLeggings"); + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawShadowSubtle=true; + player.armorEffectDrawShadowSubtle = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.MarbleBlock, 25); - recipe.AddIngredient(null, "StoneofLife", 1); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.MarbleBlock, 25); + recipe.AddIngredient(null, "StoneofLife", 1); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } } diff --git a/Items/MarbleLeggings.cs b/Items/MarbleLeggings.cs index 134eda0c..6406e074 100644 --- a/Items/MarbleLeggings.cs +++ b/Items/MarbleLeggings.cs @@ -7,42 +7,44 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class MarbleLeggings : ModItem +namespace Tremor.Items { - - - public override void SetDefaults() - { - - - item.defense = 2; - item.width = 22; - item.height = 18; - item.value = 2500; - item.rare = 1; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Marble Leggings"); - Tooltip.SetDefault("10% increased throwing critical strike chance"); - } - - - public override void UpdateEquip(Player p) - { - p.thrownCrit += 10; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.MarbleBlock, 45); - recipe.AddIngredient(null, "StoneofLife", 1); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } - } + [AutoloadEquip(EquipType.Legs)] + public class MarbleLeggings : ModItem + { + + + public override void SetDefaults() + { + + + item.defense = 2; + item.width = 22; + item.height = 18; + item.value = 2500; + item.rare = 1; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Marble Leggings"); + Tooltip.SetDefault("10% increased throwing critical strike chance"); + } + + + public override void UpdateEquip(Player p) + { + p.thrownCrit += 10; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.MarbleBlock, 45); + recipe.AddIngredient(null, "StoneofLife", 1); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } } diff --git a/Items/MarbleVase.cs b/Items/MarbleVase.cs index 9b7cbd6f..cfb1b5c4 100644 --- a/Items/MarbleVase.cs +++ b/Items/MarbleVase.cs @@ -4,39 +4,41 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class MarbleVase : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class MarbleVase : ModItem + { + public override void SetDefaults() + { - item.width = 20; - item.height = 22; - item.maxStack = 999; - item.value = 100; - item.rare = 1; - item.createTile = mod.TileType("MarbleVase"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - } + item.width = 20; + item.height = 22; + item.maxStack = 999; + item.value = 100; + item.rare = 1; + item.createTile = mod.TileType("MarbleVase"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Marble Vase"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Marble Vase"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.MarbleBlock, 10); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.MarbleBlock, 10); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } + } +} diff --git a/Items/MartianCommunicator.cs b/Items/MartianCommunicator.cs index 705a488a..e4f20da6 100644 --- a/Items/MartianCommunicator.cs +++ b/Items/MartianCommunicator.cs @@ -4,56 +4,57 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - public class MartianCommunicator : ModItem - { - const int XOffset = 0; - const int YOffset = -200; - - public override void SetDefaults() - { - - item.width = 34; - item.height = 30; - item.maxStack = 20; - - item.value = 100; - item.rare = 1; - item.useAnimation = 30; - item.useTime = 30; - item.useStyle = 4; - item.consumable = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Martian Communicator"); - Tooltip.SetDefault("Starts the Martian Madness"); - } - - - public override bool CanUseItem(Player player) - { - return Main.hardMode && NPC.downedGolemBoss; - } - - public override bool UseItem(Player player) - { - Main.StartInvasion(4); - return true; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.MartianConduitPlating, 25); - recipe.AddIngredient(ItemID.SoulofMight, 5); - recipe.AddIngredient(ItemID.SoulofSight, 5); - recipe.AddIngredient(ItemID.SoulofFright, 5); - recipe.AddIngredient(ItemID.Wire, 40); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } - } +namespace Tremor.Items +{ + public class MartianCommunicator : ModItem + { + const int XOffset = 0; + const int YOffset = -200; + + public override void SetDefaults() + { + + item.width = 34; + item.height = 30; + item.maxStack = 20; + + item.value = 100; + item.rare = 1; + item.useAnimation = 30; + item.useTime = 30; + item.useStyle = 4; + item.consumable = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Martian Communicator"); + Tooltip.SetDefault("Starts the Martian Madness"); + } + + + public override bool CanUseItem(Player player) + { + return Main.hardMode && NPC.downedGolemBoss; + } + + public override bool UseItem(Player player) + { + Main.StartInvasion(4); + return true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.MartianConduitPlating, 25); + recipe.AddIngredient(ItemID.SoulofMight, 5); + recipe.AddIngredient(ItemID.SoulofSight, 5); + recipe.AddIngredient(ItemID.SoulofFright, 5); + recipe.AddIngredient(ItemID.Wire, 40); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } } diff --git a/Items/MartianSprayer.cs b/Items/MartianSprayer.cs index 023b8ec1..d34a7883 100644 --- a/Items/MartianSprayer.cs +++ b/Items/MartianSprayer.cs @@ -7,124 +7,124 @@ namespace Tremor.Items { - public class MartianSprayer : AlchemistItem - { + public class MartianSprayer : AlchemistItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.damage = 45; - item.width = 80; - item.height = 36; - item.useTime = 15; - item.useAnimation = 15; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 4; - item.value = 10000; - item.rare = 10; - item.UseSound = SoundID.Item11; - item.autoReuse = false; - item.shoot = 10; - item.shootSpeed = 6f; - item.crit = 4; - item.useAmmo = mod.ItemType("BoomFlask"); + item.damage = 45; + item.width = 80; + item.height = 36; + item.useTime = 15; + item.useAnimation = 15; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 4; + item.value = 10000; + item.rare = 10; + item.UseSound = SoundID.Item11; + item.autoReuse = false; + item.shoot = 10; + item.shootSpeed = 6f; + item.crit = 4; + item.useAmmo = mod.ItemType("BoomFlask"); - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Martian Sprayer"); - Tooltip.SetDefault("Uses flasks as ammo\nSprays alchemical clouds"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Martian Sprayer"); + Tooltip.SetDefault("Uses flasks as ammo\nSprays alchemical clouds"); + } - public override bool ConsumeAmmo(Player player) - { - if (player.FindBuffIndex(mod.BuffType("EnchantmentSolution")) != -1) - { - if (Main.rand.Next(0, 100) <= 50) - return false; - } - if (player.FindBuffIndex(mod.BuffType("AmplifiedEnchantmentSolution")) != -1) - { - if (Main.rand.Next(0, 100) <= 70) - return false; - } - return true; - } + public override bool ConsumeAmmo(Player player) + { + if (player.FindBuffIndex(mod.BuffType("EnchantmentSolution")) != -1) + { + if (Main.rand.Next(0, 100) <= 50) + return false; + } + if (player.FindBuffIndex(mod.BuffType("AmplifiedEnchantmentSolution")) != -1) + { + if (Main.rand.Next(0, 100) <= 70) + return false; + } + return true; + } - public override Vector2? HoldoutOffset() - { - return new Vector2(-15, 0); - } + public override Vector2? HoldoutOffset() + { + return new Vector2(-15, 0); + } - public override void UpdateInventory(Player player) - { - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) - { - item.autoReuse = true; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) - { - item.autoReuse = false; - } - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) - { - item.shootSpeed = 14f; - } - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) - { - item.shootSpeed = 6f; - } - } + public override void UpdateInventory(Player player) + { + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) + { + item.autoReuse = true; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) + { + item.autoReuse = false; + } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) + { + item.shootSpeed = 14f; + } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) + { + item.shootSpeed = 6f; + } + } - public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - MPlayer modPlayer = player.GetModPlayer(mod); - if (modPlayer.glove) - { - for (int i = 0; i < 1; ++i) - { - if (player.FindBuffIndex(mod.BuffType("BottledSpirit")) != -1) - { - Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 297, damage, knockBack, Main.myPlayer); - } - if (player.FindBuffIndex(mod.BuffType("BigBottledSpirit")) != -1) - { - Projectile.NewProjectile(position.X, position.Y, speedX + 3, speedY + 3, 297, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 297, damage, knockBack, Main.myPlayer); - } - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - int k = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Main.projectile[k].friendly = true; - } - return false; - } - if (player.FindBuffIndex(mod.BuffType("BottledSpirit")) != -1 && !modPlayer.glove) - { - for (int i = 0; i < 1; ++i) - { - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, 297, damage, knockBack, Main.myPlayer); - int k = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Main.projectile[k].friendly = true; - } - return false; - } - if (player.FindBuffIndex(mod.BuffType("BigBottledSpirit")) != -1 && !modPlayer.glove) - { - for (int i = 0; i < 1; ++i) - { - Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 297, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, 297, damage, knockBack, Main.myPlayer); - int k = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Main.projectile[k].friendly = true; - } - return false; - } - return true; - } - } + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + MPlayer modPlayer = player.GetModPlayer(mod); + if (modPlayer.glove) + { + for (int i = 0; i < 1; ++i) + { + if (player.FindBuffIndex(mod.BuffType("BottledSpirit")) != -1) + { + Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 297, damage, knockBack, Main.myPlayer); + } + if (player.FindBuffIndex(mod.BuffType("BigBottledSpirit")) != -1) + { + Projectile.NewProjectile(position.X, position.Y, speedX + 3, speedY + 3, 297, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 297, damage, knockBack, Main.myPlayer); + } + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + int k = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Main.projectile[k].friendly = true; + } + return false; + } + if (player.FindBuffIndex(mod.BuffType("BottledSpirit")) != -1 && !modPlayer.glove) + { + for (int i = 0; i < 1; ++i) + { + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, 297, damage, knockBack, Main.myPlayer); + int k = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Main.projectile[k].friendly = true; + } + return false; + } + if (player.FindBuffIndex(mod.BuffType("BigBottledSpirit")) != -1 && !modPlayer.glove) + { + for (int i = 0; i < 1; ++i) + { + Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 297, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, 297, damage, knockBack, Main.myPlayer); + int k = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Main.projectile[k].friendly = true; + } + return false; + } + return true; + } + } } diff --git a/Items/MassiveHammer.cs b/Items/MassiveHammer.cs index fca5544a..180c87e4 100644 --- a/Items/MassiveHammer.cs +++ b/Items/MassiveHammer.cs @@ -4,31 +4,33 @@ using Terraria.ModLoader; using Terraria.ID; -namespace Tremor.Items { -public class MassiveHammer : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class MassiveHammer : ModItem + { + public override void SetDefaults() + { - item.damage = 28; - item.melee = true; - item.width = 56; - item.height = 56; - item.useTime = 25; - item.useAnimation = 45; - item.useStyle = 1; - item.knockBack = 6; - item.value = 12000; - item.rare = 3; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 28; + item.melee = true; + item.width = 56; + item.height = 56; + item.useTime = 25; + item.useAnimation = 45; + item.useStyle = 1; + item.knockBack = 6; + item.value = 12000; + item.rare = 3; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Massive Hammer"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Massive Hammer"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/MeatChunk.cs b/Items/MeatChunk.cs index 95c5f497..7aa4f89d 100644 --- a/Items/MeatChunk.cs +++ b/Items/MeatChunk.cs @@ -6,20 +6,20 @@ namespace Tremor.Items { - public class MeatChunk : ModItem - { - public override void SetDefaults() - { + public class MeatChunk : ModItem + { + public override void SetDefaults() + { - item.rare = 3; - item.maxStack = 30; - } + item.rare = 3; + item.maxStack = 30; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Meat Chunk"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Meat Chunk"); + Tooltip.SetDefault(""); + } - } + } } diff --git a/Items/MeatClub.cs b/Items/MeatClub.cs index e384c333..d43f1ef4 100644 --- a/Items/MeatClub.cs +++ b/Items/MeatClub.cs @@ -5,41 +5,43 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class MeatClub : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class MeatClub : ModItem + { + public override void SetDefaults() + { - item.damage = 52; - item.melee = true; - item.width = 44; - item.height = 44; - item.useTime = 26; - item.useAnimation = 26; - item.useStyle = 1; - item.knockBack = 9; - item.value = 60000; - item.rare = 3; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 52; + item.melee = true; + item.width = 44; + item.height = 44; + item.useTime = 26; + item.useAnimation = 26; + item.useStyle = 1; + item.knockBack = 9; + item.value = 60000; + item.rare = 3; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Meat Club"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Meat Club"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Wood, 5); - recipe.AddIngredient(ItemID.Rope, 5); - recipe.AddIngredient(null, "MeatChunk", 15); - recipe.SetResult(this); - recipe.AddTile(14); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Wood, 5); + recipe.AddIngredient(ItemID.Rope, 5); + recipe.AddIngredient(null, "MeatChunk", 15); + recipe.SetResult(this); + recipe.AddTile(14); + recipe.AddRecipe(); + } + } +} diff --git a/Items/MeatShield.cs b/Items/MeatShield.cs index d392df1d..c3b9c189 100644 --- a/Items/MeatShield.cs +++ b/Items/MeatShield.cs @@ -5,47 +5,49 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Shield)] -public class MeatShield : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Shield)] + public class MeatShield : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 26; - item.value = 11000; - item.rare = 6; - item.accessory = true; - item.defense = 12; - } + item.width = 26; + item.height = 26; + item.value = 11000; + item.rare = 6; + item.accessory = true; + item.defense = 12; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Meat Shield"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Meat Shield"); + Tooltip.SetDefault(""); + } - public override void UpdateEquip(Player player) - { - player.moveSpeed -= 0.40f; - player.aggro += 400; - } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.FleshKnuckles, 1); - recipe.AddIngredient(null, "HardBulwark", 1); - recipe.SetResult(this); - recipe.AddTile(114); - recipe.AddRecipe(); - - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.PutridScent, 1); - recipe.AddIngredient(null, "HardBulwark", 1); - recipe.SetResult(this); - recipe.AddTile(114); - recipe.AddRecipe(); - } -}} + public override void UpdateEquip(Player player) + { + player.moveSpeed -= 0.40f; + player.aggro += 400; + } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.FleshKnuckles, 1); + recipe.AddIngredient(null, "HardBulwark", 1); + recipe.SetResult(this); + recipe.AddTile(114); + recipe.AddRecipe(); + + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.PutridScent, 1); + recipe.AddIngredient(null, "HardBulwark", 1); + recipe.SetResult(this); + recipe.AddTile(114); + recipe.AddRecipe(); + } + } +} diff --git a/Items/MechaSprayer.cs b/Items/MechaSprayer.cs index 50105763..815c568e 100644 --- a/Items/MechaSprayer.cs +++ b/Items/MechaSprayer.cs @@ -7,124 +7,124 @@ namespace Tremor.Items { - public class MechaSprayer : AlchemistItem - { + public class MechaSprayer : AlchemistItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.damage = 28; - item.width = 80; - item.height = 30; - item.useTime = 16; - item.useAnimation = 16; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 4; - item.value = 30000; - item.rare = 5; - item.UseSound = SoundID.Item20; - item.autoReuse = false; - item.shoot = 10; - item.shootSpeed = 6f; - item.crit = 4; - item.useAmmo = mod.ItemType("BoomFlask"); + item.damage = 28; + item.width = 80; + item.height = 30; + item.useTime = 16; + item.useAnimation = 16; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 4; + item.value = 30000; + item.rare = 5; + item.UseSound = SoundID.Item20; + item.autoReuse = false; + item.shoot = 10; + item.shootSpeed = 6f; + item.crit = 4; + item.useAmmo = mod.ItemType("BoomFlask"); - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Mecha Sprayer"); - Tooltip.SetDefault("Uses flasks as ammo\nSprays alchemical clouds"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Mecha Sprayer"); + Tooltip.SetDefault("Uses flasks as ammo\nSprays alchemical clouds"); + } - public override bool ConsumeAmmo(Player player) - { - if (player.FindBuffIndex(mod.BuffType("EnchantmentSolution")) != -1) - { - if (Main.rand.Next(0, 100) <= 50) - return false; - } - if (player.FindBuffIndex(mod.BuffType("AmplifiedEnchantmentSolution")) != -1) - { - if (Main.rand.Next(0, 100) <= 70) - return false; - } - return true; - } + public override bool ConsumeAmmo(Player player) + { + if (player.FindBuffIndex(mod.BuffType("EnchantmentSolution")) != -1) + { + if (Main.rand.Next(0, 100) <= 50) + return false; + } + if (player.FindBuffIndex(mod.BuffType("AmplifiedEnchantmentSolution")) != -1) + { + if (Main.rand.Next(0, 100) <= 70) + return false; + } + return true; + } - public override Vector2? HoldoutOffset() - { - return new Vector2(-18, -4); - } + public override Vector2? HoldoutOffset() + { + return new Vector2(-18, -4); + } - public override void UpdateInventory(Player player) - { - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) - { - item.autoReuse = true; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) - { - item.autoReuse = false; - } - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) - { - item.shootSpeed = 14f; - } - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) - { - item.shootSpeed = 6f; - } - } + public override void UpdateInventory(Player player) + { + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) + { + item.autoReuse = true; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) + { + item.autoReuse = false; + } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) + { + item.shootSpeed = 14f; + } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) + { + item.shootSpeed = 6f; + } + } - public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - MPlayer modPlayer = player.GetModPlayer(mod); - if (modPlayer.glove) - { - for (int i = 0; i < 1; ++i) - { - if (player.FindBuffIndex(mod.BuffType("BottledSpirit")) != -1) - { - Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 297, damage, knockBack, Main.myPlayer); - } - if (player.FindBuffIndex(mod.BuffType("BigBottledSpirit")) != -1) - { - Projectile.NewProjectile(position.X, position.Y, speedX + 3, speedY + 3, 297, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 297, damage, knockBack, Main.myPlayer); - } - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - int k = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Main.projectile[k].friendly = true; - } - return false; - } - if (player.FindBuffIndex(mod.BuffType("BottledSpirit")) != -1 && !modPlayer.glove) - { - for (int i = 0; i < 1; ++i) - { - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, 297, damage, knockBack, Main.myPlayer); - int k = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Main.projectile[k].friendly = true; - } - return false; - } - if (player.FindBuffIndex(mod.BuffType("BigBottledSpirit")) != -1 && !modPlayer.glove) - { - for (int i = 0; i < 1; ++i) - { - Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 297, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, 297, damage, knockBack, Main.myPlayer); - int k = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Main.projectile[k].friendly = true; - } - return false; - } - return true; - } - } + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + MPlayer modPlayer = player.GetModPlayer(mod); + if (modPlayer.glove) + { + for (int i = 0; i < 1; ++i) + { + if (player.FindBuffIndex(mod.BuffType("BottledSpirit")) != -1) + { + Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 297, damage, knockBack, Main.myPlayer); + } + if (player.FindBuffIndex(mod.BuffType("BigBottledSpirit")) != -1) + { + Projectile.NewProjectile(position.X, position.Y, speedX + 3, speedY + 3, 297, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 297, damage, knockBack, Main.myPlayer); + } + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + int k = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Main.projectile[k].friendly = true; + } + return false; + } + if (player.FindBuffIndex(mod.BuffType("BottledSpirit")) != -1 && !modPlayer.glove) + { + for (int i = 0; i < 1; ++i) + { + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, 297, damage, knockBack, Main.myPlayer); + int k = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Main.projectile[k].friendly = true; + } + return false; + } + if (player.FindBuffIndex(mod.BuffType("BigBottledSpirit")) != -1 && !modPlayer.glove) + { + for (int i = 0; i < 1; ++i) + { + Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 297, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, 297, damage, knockBack, Main.myPlayer); + int k = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Main.projectile[k].friendly = true; + } + return false; + } + return true; + } + } } diff --git a/Items/MechanicalBrain.cs b/Items/MechanicalBrain.cs index 1f47802f..7308a0e3 100644 --- a/Items/MechanicalBrain.cs +++ b/Items/MechanicalBrain.cs @@ -4,39 +4,40 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class MechanicalBrain : ModItem +namespace Tremor.Items { - const int XOffset = 0; - const int YOffset = -200; + public class MechanicalBrain : ModItem + { - public override void SetDefaults() - { + const int XOffset = 0; + const int YOffset = -200; - item.width = 20; - item.height = 18; - item.maxStack = 20; + public override void SetDefaults() + { - item.rare = 5; - item.useAnimation = 45; - item.useTime = 45; - item.useStyle = 4; - item.consumable = true; - } + item.width = 20; + item.height = 18; + item.maxStack = 20; - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Mechanical Brain"); - Tooltip.SetDefault("Summons the Motherboard"); - } + item.rare = 5; + item.useAnimation = 45; + item.useTime = 45; + item.useStyle = 4; + item.consumable = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Mechanical Brain"); + Tooltip.SetDefault("Summons the Motherboard"); + } - public override bool CanUseItem(Player player) - { - return Main.hardMode && !Main.dayTime && !NPC.AnyNPCs(mod.NPCType("Motherboard")); - } + public override bool CanUseItem(Player player) + { + return Main.hardMode && !Main.dayTime && !NPC.AnyNPCs(mod.NPCType("Motherboard")); + } public override bool UseItem(Player player) { @@ -46,22 +47,23 @@ public override bool UseItem(Player player) } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Vertebrae, 6); - recipe.AddIngredient(ItemID.IronBar, 6); - recipe.AddIngredient(ItemID.SoulofNight, 6); - recipe.AddTile(134); - recipe.SetResult(this); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Vertebrae, 6); + recipe.AddIngredient(ItemID.IronBar, 6); + recipe.AddIngredient(ItemID.SoulofNight, 6); + recipe.AddTile(134); + recipe.SetResult(this); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Vertebrae, 6); - recipe.AddIngredient(ItemID.LeadBar, 6); - recipe.AddIngredient(ItemID.SoulofNight, 6); - recipe.AddTile(134); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Vertebrae, 6); + recipe.AddIngredient(ItemID.LeadBar, 6); + recipe.AddIngredient(ItemID.SoulofNight, 6); + recipe.AddTile(134); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/MechanicalFirefly.cs b/Items/MechanicalFirefly.cs index 2a28093f..a668bb85 100644 --- a/Items/MechanicalFirefly.cs +++ b/Items/MechanicalFirefly.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class MechanicalFirefly : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class MechanicalFirefly : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 75; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 75; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Mechanical Firefly"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Mechanical Firefly"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/Megalodon.cs b/Items/Megalodon.cs index 33f1f7fa..71992572 100644 --- a/Items/Megalodon.cs +++ b/Items/Megalodon.cs @@ -5,71 +5,73 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Megalodon : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.useStyle = 5; - item.autoReuse = true; - item.useAnimation = 4; - item.useTime = 4; + public class Megalodon : ModItem + { + public override void SetDefaults() + { + item.useStyle = 5; + item.autoReuse = true; + item.useAnimation = 4; + item.useTime = 4; - item.width = 50; - item.height = 18; - item.shoot = 10; - item.useAmmo = AmmoID.Bullet; - item.UseSound = SoundID.Item41; - item.damage = 73; - item.shootSpeed = 14f; - item.noMelee = true; - item.value = Item.sellPrice(0, 5, 0, 0); - item.rare = 10; + item.width = 50; + item.height = 18; + item.shoot = 10; + item.useAmmo = AmmoID.Bullet; + item.UseSound = SoundID.Item41; + item.damage = 73; + item.shootSpeed = 14f; + item.noMelee = true; + item.value = Item.sellPrice(0, 5, 0, 0); + item.rare = 10; - item.knockBack = 1.75f; - item.ranged = true; - } + item.knockBack = 1.75f; + item.ranged = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Megalodon"); - Tooltip.SetDefault("50% chance not to consume ammo"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Megalodon"); + Tooltip.SetDefault("50% chance not to consume ammo"); + } - public override Vector2? HoldoutOffset() - { - return new Vector2(-20, 0); - } + public override Vector2? HoldoutOffset() + { + return new Vector2(-20, 0); + } - public override bool ConsumeAmmo(Player p) + public override bool ConsumeAmmo(Player p) { return Main.rand.Next(3) == 0; } -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) -{ - for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. - { - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); - } - return false; -} + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. + { + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); + } + return false; + } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(null, "EyeofOblivion", 1); - recipe.AddIngredient(ItemID.Megashark, 1); + recipe.AddIngredient(ItemID.Megashark, 1); recipe.AddIngredient(null, "NightmareBar", 20); recipe.AddIngredient(null, "CarbonSteel", 10); recipe.AddIngredient(null, "DeadTissue", 5); recipe.AddTile(412); recipe.SetResult(this); recipe.AddRecipe(); - } -}} + } + } +} diff --git a/Items/Megavolt.cs b/Items/Megavolt.cs index 9c56f56a..c40e6129 100644 --- a/Items/Megavolt.cs +++ b/Items/Megavolt.cs @@ -5,113 +5,115 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Megavolt : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.damage = 223; - item.width = 18; - item.height = 56; - item.ranged = true; - item.useTime = 30; - item.shoot = 1; - item.shootSpeed = 12f; - - item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 5; - item.value = 25000; - item.useAmmo = AmmoID.Arrow; - item.rare = 3; - item.UseSound = SoundID.Item5; - item.autoReuse = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Megavolt"); - Tooltip.SetDefault("Shoots the charged arrows"); - } + public class Megavolt : ModItem + { + public override void SetDefaults() + { + item.damage = 223; + item.width = 18; + item.height = 56; + item.ranged = true; + item.useTime = 30; + item.shoot = 1; + item.shootSpeed = 12f; - - public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - int i = Main.myPlayer; - float num72 = item.shootSpeed; - int num73 = item.damage; - float num74 = item.knockBack; - num74 = player.GetWeaponKnockback(item, num74); - player.itemTime = item.useTime; - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default(Vector2)); - Vector2 vector3 = Main.MouseWorld - vector2; - float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (player.gravDir == -1f) - { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + item.useAnimation = 30; + item.useStyle = 5; + item.knockBack = 5; + item.value = 25000; + item.useAmmo = AmmoID.Arrow; + item.rare = 3; + item.UseSound = SoundID.Item5; + item.autoReuse = true; } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - float num81 = num80; - if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) - { - num78 = (float)player.direction; - num79 = 0f; - num80 = num72; - } - else - { - num80 = num72 / num80; - } - num78 *= num80; - num79 *= num80; - int num146 = 4; - if (Main.rand.Next(2) == 0) - { - num146++; - } - if (Main.rand.Next(4) == 0) - { - num146++; - } - if (Main.rand.Next(8) == 0) + + public override void SetStaticDefaults() { - num146++; + DisplayName.SetDefault("Megavolt"); + Tooltip.SetDefault("Shoots the charged arrows"); } - if (Main.rand.Next(16) == 0) + + + + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - num146++; + int i = Main.myPlayer; + float num72 = item.shootSpeed; + int num73 = item.damage; + float num74 = item.knockBack; + num74 = player.GetWeaponKnockback(item, num74); + player.itemTime = item.useTime; + Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); + Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default(Vector2)); + Vector2 vector3 = Main.MouseWorld - vector2; + float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (player.gravDir == -1f) + { + num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + } + float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + float num81 = num80; + if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) + { + num78 = (float)player.direction; + num79 = 0f; + num80 = num72; + } + else + { + num80 = num72 / num80; + } + num78 *= num80; + num79 *= num80; + int num146 = 4; + if (Main.rand.Next(2) == 0) + { + num146++; + } + if (Main.rand.Next(4) == 0) + { + num146++; + } + if (Main.rand.Next(8) == 0) + { + num146++; + } + if (Main.rand.Next(16) == 0) + { + num146++; + } + for (int num147 = 0; num147 < num146; num147++) + { + float num148 = num78; + float num149 = num79; + float num150 = 0.05f * (float)num147; + num148 += (float)Main.rand.Next(-35, 36) * num150; + num149 += (float)Main.rand.Next(-35, 36) * num150; + num80 = (float)Math.Sqrt((double)(num148 * num148 + num149 * num149)); + num80 = num72 / num80; + num148 *= num80; + num149 *= num80; + float x4 = vector2.X; + float y4 = vector2.Y; + Projectile.NewProjectile(x4, y4, num148, num149, mod.ProjectileType("ChargedArrow"), num73, num74, i, 0f, 0f); + } + return false; } - for (int num147 = 0; num147 < num146; num147++) + + public override void AddRecipes() { - float num148 = num78; - float num149 = num79; - float num150 = 0.05f * (float)num147; - num148 += (float)Main.rand.Next(-35, 36) * num150; - num149 += (float)Main.rand.Next(-35, 36) * num150; - num80 = (float)Math.Sqrt((double)(num148 * num148 + num149 * num149)); - num80 = num72 / num80; - num148 *= num80; - num149 *= num80; - float x4 = vector2.X; - float y4 = vector2.Y; - Projectile.NewProjectile(x4, y4, num148, num149, mod.ProjectileType("ChargedArrow"), num73, num74, i, 0f, 0f); + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "CometiteBar", 12); + recipe.AddIngredient(ItemID.MartianConduitPlating, 30); + recipe.AddIngredient(null, "LunarRoot", 12); + recipe.AddIngredient(null, "NightCore", 5); + recipe.AddTile(412); + recipe.SetResult(this); + recipe.AddRecipe(); } - return false; } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "CometiteBar", 12); - recipe.AddIngredient(ItemID.MartianConduitPlating, 30); - recipe.AddIngredient(null, "LunarRoot", 12); - recipe.AddIngredient(null, "NightCore", 5); - recipe.AddTile(412); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} +} diff --git a/Items/MeltedInvarSword.cs b/Items/MeltedInvarSword.cs index ac41a908..baff34b0 100644 --- a/Items/MeltedInvarSword.cs +++ b/Items/MeltedInvarSword.cs @@ -4,24 +4,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class MeltedInvarSword : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class MeltedInvarSword : ModItem + { + public override void SetDefaults() + { - item.width = 28; - item.height = 30; - item.maxStack = 99; - item.value = 25; - item.rare = 1; - } + item.width = 28; + item.height = 30; + item.maxStack = 99; + item.value = 25; + item.rare = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Melted Invar Sword"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Melted Invar Sword"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/MeteorBlade.cs b/Items/MeteorBlade.cs index e423d526..a102022c 100644 --- a/Items/MeteorBlade.cs +++ b/Items/MeteorBlade.cs @@ -5,52 +5,54 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class MeteorBlade : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class MeteorBlade : ModItem + { + public override void SetDefaults() + { - item.damage = 25; - item.melee = true; - item.width = 50; - item.height = 50; - item.useTime = 30; - item.useAnimation = 30; - item.useStyle = 1; - item.knockBack = 2; - item.value = 10000; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 25; + item.melee = true; + item.width = 50; + item.height = 50; + item.useTime = 30; + item.useAnimation = 30; + item.useStyle = 1; + item.knockBack = 2; + item.value = 10000; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Meteor Blade"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Meteor Blade"); + Tooltip.SetDefault(""); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if(Main.rand.Next(2) == 0) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 6); - } - } + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.Next(2) == 0) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 6); + } + } - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(24, 600); - } + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(24, 600); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(117, 25); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(117, 25); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/MeteorMask.cs b/Items/MeteorMask.cs index 489fa985..d3f880e1 100644 --- a/Items/MeteorMask.cs +++ b/Items/MeteorMask.cs @@ -5,52 +5,55 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class MeteorMask : ModItem +namespace Tremor.Items { - - - - public override void SetDefaults() - { - - item.width = 18; - item.height = 28; - - item.value = 9000; - item.rare = 1; - item.defense = 4; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Meteor Mask"); - Tooltip.SetDefault("Increases magic critical strike chance by 9"); - } - - - public override void UpdateEquip(Player player) - { - player.magicCrit += 9; - } - - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == 124 && legs.type == 125; - } - - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Reduces the mana cost of the Space Gun to zero"; - player.spaceGun = true; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(117, 15); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + [AutoloadEquip(EquipType.Head)] + public class MeteorMask : ModItem + { + + + + public override void SetDefaults() + { + + item.width = 18; + item.height = 28; + + item.value = 9000; + item.rare = 1; + item.defense = 4; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Meteor Mask"); + Tooltip.SetDefault("Increases magic critical strike chance by 9"); + } + + + public override void UpdateEquip(Player player) + { + player.magicCrit += 9; + } + + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == 124 && legs.type == 125; + } + + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Reduces the mana cost of the Space Gun to zero"; + player.spaceGun = true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(117, 15); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/MeteorScepter.cs b/Items/MeteorScepter.cs index 97709c9e..df22ff86 100644 --- a/Items/MeteorScepter.cs +++ b/Items/MeteorScepter.cs @@ -31,26 +31,26 @@ public override void SetDefaults() item.buffTime = 3600; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Meteor Scepter"); - Tooltip.SetDefault("Summons a meteor head to fight for you."); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Meteor Scepter"); + Tooltip.SetDefault("Summons a meteor head to fight for you."); + } public override bool AltFunctionUse(Player player) { return true; } - + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { return player.altFunctionUse != 2; } - + public override bool UseItem(Player player) { - if(player.altFunctionUse == 2) + if (player.altFunctionUse == 2) { player.MinionNPCTargetAim(); } diff --git a/Items/MeteoriteGolemBanner.cs b/Items/MeteoriteGolemBanner.cs index a40ab78b..bd7daf37 100644 --- a/Items/MeteoriteGolemBanner.cs +++ b/Items/MeteoriteGolemBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class MeteoriteGolemBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class MeteoriteGolemBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 76; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 76; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Meteorite Golem Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Meteorite Golem Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/MidnightPotion.cs b/Items/MidnightPotion.cs index b0e3cebe..748f62d0 100644 --- a/Items/MidnightPotion.cs +++ b/Items/MidnightPotion.cs @@ -3,47 +3,49 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class MidnightPotion : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.width = 38; - item.height = 32; - item.maxStack = 20; - - item.rare = 11; - item.useAnimation = 15; - item.useTime = 15; - item.useStyle = 2; - item.UseSound = SoundID.Item3; - item.consumable = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Midnight Potion"); - Tooltip.SetDefault("Increases all stats during night time"); - } - - - public override bool UseItem(Player player) - { - player.AddBuff(mod.BuffType("NightHunting"), 14400); - return true; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.BottledWater, 1); - recipe.AddIngredient(null, "LapisLazuli", 1); - recipe.AddIngredient(null, "AlienTongue", 1); - recipe.AddIngredient(null, "PinkGelCube", 1); - recipe.AddTile(null, "AlchemyStationTile"); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + + public class MidnightPotion : ModItem + { + public override void SetDefaults() + { + + item.width = 38; + item.height = 32; + item.maxStack = 20; + + item.rare = 11; + item.useAnimation = 15; + item.useTime = 15; + item.useStyle = 2; + item.UseSound = SoundID.Item3; + item.consumable = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Midnight Potion"); + Tooltip.SetDefault("Increases all stats during night time"); + } + + + public override bool UseItem(Player player) + { + player.AddBuff(mod.BuffType("NightHunting"), 14400); + return true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.BottledWater, 1); + recipe.AddIngredient(null, "LapisLazuli", 1); + recipe.AddIngredient(null, "AlienTongue", 1); + recipe.AddIngredient(null, "PinkGelCube", 1); + recipe.AddTile(null, "AlchemyStationTile"); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/MightyNimbusBanner.cs b/Items/MightyNimbusBanner.cs index fbc5a7fa..530b5133 100644 --- a/Items/MightyNimbusBanner.cs +++ b/Items/MightyNimbusBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class MightyNimbusBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class MightyNimbusBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 77; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 77; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Mighty Nimbus Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Mighty Nimbus Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/MineralTransmutator.cs b/Items/MineralTransmutator.cs index 49e554b1..761261b7 100644 --- a/Items/MineralTransmutator.cs +++ b/Items/MineralTransmutator.cs @@ -4,40 +4,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class MineralTransmutator : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class MineralTransmutator : ModItem + { + public override void SetDefaults() + { - item.width = 46; - item.height = 46; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 150; - item.createTile = mod.TileType("MineralTransmutator"); - } + item.width = 46; + item.height = 46; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 150; + item.createTile = mod.TileType("MineralTransmutator"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Mineral Transmutator"); - Tooltip.SetDefault("Allows to transform pre-hardmode metals to their alternatives"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Mineral Transmutator"); + Tooltip.SetDefault("Allows to transform pre-hardmode metals to their alternatives"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Extractinator, 1); - recipe.AddIngredient(ItemID.SilverOre, 15); - recipe.AddIngredient(ItemID.TungstenOre, 15); - recipe.AddIngredient(ItemID.Diamond, 6); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Extractinator, 1); + recipe.AddIngredient(ItemID.SilverOre, 15); + recipe.AddIngredient(ItemID.TungstenOre, 15); + recipe.AddIngredient(ItemID.Diamond, 6); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/MinersLamp.cs b/Items/MinersLamp.cs index 6b4d022d..ca0c0380 100644 --- a/Items/MinersLamp.cs +++ b/Items/MinersLamp.cs @@ -19,28 +19,28 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("MinersLampTile"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Miners Lamp"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Miners Lamp"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Chain, 1); - recipe.AddIngredient(null, "SteelBar", 4); - recipe.AddIngredient(null, "Charcoal", 4); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Chain, 1); + recipe.AddIngredient(null, "SteelBar", 4); + recipe.AddIngredient(null, "Charcoal", 4); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } } } diff --git a/Items/MiniGun.cs b/Items/MiniGun.cs index a41ad23a..d77b2119 100644 --- a/Items/MiniGun.cs +++ b/Items/MiniGun.cs @@ -5,35 +5,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class MiniGun : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class MiniGun : ModItem + { + public override void SetDefaults() + { - item.damage = 8; - item.ranged = true; - item.width = 40; - item.height = 20; - item.useTime = 12; - item.useAnimation = 12; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 6; - item.value = 100000; - item.rare = 3; - item.UseSound = SoundID.Item11; - item.autoReuse = true; - item.shoot = 10; - item.shootSpeed = 15f; - item.useAmmo = AmmoID.Bullet; - } + item.damage = 8; + item.ranged = true; + item.width = 40; + item.height = 20; + item.useTime = 12; + item.useAnimation = 12; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 6; + item.value = 100000; + item.rare = 3; + item.UseSound = SoundID.Item11; + item.autoReuse = true; + item.shoot = 10; + item.shootSpeed = 15f; + item.useAmmo = AmmoID.Bullet; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Mini Gun"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Mini Gun"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/MinotaurBanner.cs b/Items/MinotaurBanner.cs index 56b779e6..ceb55f7e 100644 --- a/Items/MinotaurBanner.cs +++ b/Items/MinotaurBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class MinotaurBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class MinotaurBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 78; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 78; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Minotaur Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Minotaur Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/MinotaurHorn.cs b/Items/MinotaurHorn.cs index edfd1ba4..38fdf866 100644 --- a/Items/MinotaurHorn.cs +++ b/Items/MinotaurHorn.cs @@ -6,23 +6,25 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class MinotaurHorn : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class MinotaurHorn : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 100; - item.rare = 3; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 100; + item.rare = 3; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Horn"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Horn"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/MoltenHeart.cs b/Items/MoltenHeart.cs index 37b39832..66492bf7 100644 --- a/Items/MoltenHeart.cs +++ b/Items/MoltenHeart.cs @@ -8,48 +8,48 @@ namespace Tremor.Items { - public class MoltenHeart : ModItem - { - const int XOffset = 300; - const int YOffset = 100; - - public override void SetDefaults() - { - - item.width = 40; - item.height = 28; - item.maxStack = 20; - item.value = 100; - item.rare = 3; - item.useAnimation = 15; - item.useTime = 15; - item.useStyle = 4; - item.consumable = true; - - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Molten Heart"); - Tooltip.SetDefault("Summons Heater of Worlds"); - } - - - public override bool CanUseItem(Player player) - { - return player.position.Y / 16f > Main.maxTilesY - 200 && NPC.downedBoss2 && !NPC.AnyNPCs(mod.NPCType("HeaterOfWorldsHead")); - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Hellstone, 25); - recipe.AddIngredient(ItemID.LifeCrystal, 1); - recipe.AddIngredient(null, "FireFragment", 12); - recipe.SetResult(this); - recipe.AddTile(26); - recipe.AddRecipe(); - } + public class MoltenHeart : ModItem + { + const int XOffset = 300; + const int YOffset = 100; + + public override void SetDefaults() + { + + item.width = 40; + item.height = 28; + item.maxStack = 20; + item.value = 100; + item.rare = 3; + item.useAnimation = 15; + item.useTime = 15; + item.useStyle = 4; + item.consumable = true; + + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Molten Heart"); + Tooltip.SetDefault("Summons Heater of Worlds"); + } + + + public override bool CanUseItem(Player player) + { + return player.position.Y / 16f > Main.maxTilesY - 200 && NPC.downedBoss2 && !NPC.AnyNPCs(mod.NPCType("HeaterOfWorldsHead")); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Hellstone, 25); + recipe.AddIngredient(ItemID.LifeCrystal, 1); + recipe.AddIngredient(null, "FireFragment", 12); + recipe.SetResult(this); + recipe.AddTile(26); + recipe.AddRecipe(); + } public override bool UseItem(Player player) { @@ -57,5 +57,5 @@ public override bool UseItem(Player player) Main.PlaySound(SoundID.Roar, player.position, 0); return true; } - } + } } diff --git a/Items/MoltenLance.cs b/Items/MoltenLance.cs index 918d6006..65af5a0b 100644 --- a/Items/MoltenLance.cs +++ b/Items/MoltenLance.cs @@ -5,53 +5,55 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class MoltenLance : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class MoltenLance : ModItem + { + public override void SetDefaults() + { - item.damage = 15; - item.melee = true; - item.width = 32; - item.height = 32; - item.useTime = 11; - item.useAnimation = 9; - item.useStyle = 3; - item.knockBack = 2; - item.value = 800; - item.rare = 3; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 15; + item.melee = true; + item.width = 32; + item.height = 32; + item.useTime = 11; + item.useAnimation = 9; + item.useStyle = 3; + item.knockBack = 2; + item.value = 800; + item.rare = 3; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Molten Lance"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Molten Lance"); + Tooltip.SetDefault(""); + } - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(24, 60); - } + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(24, 60); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "RipperKnife"); - recipe.AddIngredient(ItemID.HellstoneBar, 20); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "RipperKnife"); + recipe.AddIngredient(ItemID.HellstoneBar, 20); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if(Main.rand.Next(3) == 0) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 6); - } - } -}} + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.Next(3) == 0) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 6); + } + } + } +} diff --git a/Items/MoltenParts.cs b/Items/MoltenParts.cs index 4bf86856..85e5eacd 100644 --- a/Items/MoltenParts.cs +++ b/Items/MoltenParts.cs @@ -8,24 +8,24 @@ namespace Tremor.Items { - public class MoltenParts : ModItem - { + public class MoltenParts : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 40; - item.height = 28; - item.maxStack = 99; - item.value = 1000; - item.rare = 3; - } + item.width = 40; + item.height = 28; + item.maxStack = 99; + item.value = 1000; + item.rare = 3; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Molten Parts"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Molten Parts"); + Tooltip.SetDefault(""); + } - } + } } diff --git a/Items/MoltenStaff.cs b/Items/MoltenStaff.cs index ae80feab..fe9b4cf8 100644 --- a/Items/MoltenStaff.cs +++ b/Items/MoltenStaff.cs @@ -5,46 +5,48 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class MoltenStaff : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class MoltenStaff : ModItem + { + public override void SetDefaults() + { - item.damage = 26; - item.magic = true; - item.mana = 8; - item.width = 48; - item.height = 48; + item.damage = 26; + item.magic = true; + item.mana = 8; + item.width = 48; + item.height = 48; - item.useTime = 25; - item.useAnimation = 25; - item.useStyle = 5; - Item.staff[item.type] = true; - item.noMelee = true; - item.knockBack = 5; - item.value = 17500; - item.rare = 2; - item.UseSound = SoundID.Item20; - item.autoReuse = true; - item.shoot = 85; - item.shootSpeed = 6f; - } + item.useTime = 25; + item.useAnimation = 25; + item.useStyle = 5; + Item.staff[item.type] = true; + item.noMelee = true; + item.knockBack = 5; + item.value = 17500; + item.rare = 2; + item.UseSound = SoundID.Item20; + item.autoReuse = true; + item.shoot = 85; + item.shootSpeed = 6f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Molten Staff"); - Tooltip.SetDefault("Casts flames to burn your enemies!"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Molten Staff"); + Tooltip.SetDefault("Casts flames to burn your enemies!"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "FireFragment", 15); - recipe.AddIngredient(null, "MoltenParts", 1); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "FireFragment", 15); + recipe.AddIngredient(null, "MoltenParts", 1); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/MoneySack.cs b/Items/MoneySack.cs index 1de71941..5203a8fa 100644 --- a/Items/MoneySack.cs +++ b/Items/MoneySack.cs @@ -4,49 +4,51 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class MoneySack : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.maxStack = 999; - item.consumable = true; - item.width = 32; - item.height = 32; - - item.rare = 0; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Money Sack"); - Tooltip.SetDefault("Right click to open"); - } - - - public override bool CanRightClick() - { - return true; - } - - public override void RightClick(Player player) - { - player.QuickSpawnItem(71, Main.rand.Next(70,98)); - player.QuickSpawnItem(72, Main.rand.Next(50,75)); - player.QuickSpawnItem(73); - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(73, Main.rand.Next(1,3)); - } - if(Main.rand.Next(5) == 0 ) - { - player.QuickSpawnItem(73, Main.rand.Next(5,7)); - } - if(Main.rand.Next(25) == 0) - { - player.QuickSpawnItem(73, Main.rand.Next(10,15)); - } - } - -}} + public class MoneySack : ModItem + { + public override void SetDefaults() + { + + item.maxStack = 999; + item.consumable = true; + item.width = 32; + item.height = 32; + + item.rare = 0; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Money Sack"); + Tooltip.SetDefault("Right click to open"); + } + + + public override bool CanRightClick() + { + return true; + } + + public override void RightClick(Player player) + { + player.QuickSpawnItem(71, Main.rand.Next(70, 98)); + player.QuickSpawnItem(72, Main.rand.Next(50, 75)); + player.QuickSpawnItem(73); + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(73, Main.rand.Next(1, 3)); + } + if (Main.rand.Next(5) == 0) + { + player.QuickSpawnItem(73, Main.rand.Next(5, 7)); + } + if (Main.rand.Next(25) == 0) + { + player.QuickSpawnItem(73, Main.rand.Next(10, 15)); + } + } + + } +} diff --git a/Items/MonsterTooth.cs b/Items/MonsterTooth.cs index e6f4aed6..9a4a1053 100644 --- a/Items/MonsterTooth.cs +++ b/Items/MonsterTooth.cs @@ -5,36 +5,38 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class MonsterTooth : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class MonsterTooth : ModItem + { + public override void SetDefaults() + { - item.damage = 15; - item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("MonsterToothPro"); - item.shootSpeed = 22f; - item.useStyle = 1; - item.knockBack = 4; - item.value = 7; - item.rare = 2; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 15; + item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("MonsterToothPro"); + item.shootSpeed = 22f; + item.useStyle = 1; + item.knockBack = 4; + item.value = 7; + item.rare = 2; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Monster Tooth"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Monster Tooth"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/MoonDustFlask.cs b/Items/MoonDustFlask.cs index 3489d4bc..1852b335 100644 --- a/Items/MoonDustFlask.cs +++ b/Items/MoonDustFlask.cs @@ -9,65 +9,66 @@ namespace Tremor.Items { public class MoonDustFlask : AlchemistItem - { + { - public override void SetDefaults() - { - item.crit = 4; - item.damage = 92; - //item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("MoonDustFlaskPro"); - item.shootSpeed = 8f; - item.useStyle = 1; - item.knockBack = 1; - item.UseSound = SoundID.Item106; - item.value = 30; - item.rare = 1; - item.autoReuse = false; + public override void SetDefaults() + { + item.crit = 4; + item.damage = 92; + //item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("MoonDustFlaskPro"); + item.shootSpeed = 8f; + item.useStyle = 1; + item.knockBack = 1; + item.UseSound = SoundID.Item106; + item.value = 30; + item.rare = 1; + item.autoReuse = false; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Moon Dust Flask"); - Tooltip.SetDefault("Throws a flask that explodes into moon exlposions"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Moon Dust Flask"); + Tooltip.SetDefault("Throws a flask that explodes into moon exlposions"); + } - public override void UpdateInventory(Player player) - { - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) - { - item.shootSpeed = 11f; - } - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) - { - item.shootSpeed = 8f; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) - { - item.autoReuse = true; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) - { - item.autoReuse = false; - } - } + public override void UpdateInventory(Player player) + { + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) + { + item.shootSpeed = 11f; + } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) + { + item.shootSpeed = 8f; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) + { + item.autoReuse = true; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) + { + item.autoReuse = false; + } + } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.Bottle, 1); recipe.AddIngredient(3460, 3); - recipe.AddIngredient(null, "GelCube", 1); + recipe.AddIngredient(null, "GelCube", 1); recipe.SetResult(this, 15); recipe.AddRecipe(); } -}} + } +} diff --git a/Items/MoonFlash.cs b/Items/MoonFlash.cs index b2c7b182..d8e02498 100644 --- a/Items/MoonFlash.cs +++ b/Items/MoonFlash.cs @@ -11,52 +11,52 @@ public class MoonFlash : ModItem public override void SetDefaults() { - item.damage = 90; - item.melee = false; - item.magic = true; - item.width = 50; - item.height = 55; - item.useTime = 25; - item.mana = 10; - item.useAnimation = 25; - item.useStyle = 5; - item.shoot = 645; - item.shootSpeed = 40f; - item.knockBack = 6; - item.value = Item.buyPrice(0, 30, 0, 0); - item.rare = 11; - item.UseSound = SoundID.Item77; - item.autoReuse = true; + item.damage = 90; + item.melee = false; + item.magic = true; + item.width = 50; + item.height = 55; + item.useTime = 25; + item.mana = 10; + item.useAnimation = 25; + item.useStyle = 5; + item.shoot = 645; + item.shootSpeed = 40f; + item.knockBack = 6; + item.value = Item.buyPrice(0, 30, 0, 0); + item.rare = 11; + item.UseSound = SoundID.Item77; + item.autoReuse = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Moon Flash"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Moon Flash"); + Tooltip.SetDefault(""); + } -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) -{ - for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. - { - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); - } - return false; -} - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.SpellTome, 1); - recipe.AddIngredient(null, "LunarRoot", 6); - recipe.AddIngredient(3467, 30); - recipe.AddTile(412); - recipe.SetResult(this); - recipe.AddRecipe(); + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. + { + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); + } + return false; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.SpellTome, 1); + recipe.AddIngredient(null, "LunarRoot", 6); + recipe.AddIngredient(3467, 30); + recipe.AddTile(412); + recipe.SetResult(this); + recipe.AddRecipe(); - } + } } -} +} diff --git a/Items/MoonLash.cs b/Items/MoonLash.cs index faefa778..8d7070f5 100644 --- a/Items/MoonLash.cs +++ b/Items/MoonLash.cs @@ -5,61 +5,63 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class MoonLash : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class MoonLash : ModItem + { + public override void SetDefaults() + { - item.damage = 259; - item.magic = true; - item.mana = 20; - item.width = 34; - item.height = 30; - item.useTime = 35; - item.useAnimation = 35; - item.useStyle = 1; - item.noMelee = true; - item.knockBack = 3; - item.value = 13800; - item.rare = 10; - item.UseSound = SoundID.Item43; - item.autoReuse = false; - item.shoot = 645; - item.shootSpeed = 12f; + item.damage = 259; + item.magic = true; + item.mana = 20; + item.width = 34; + item.height = 30; + item.useTime = 35; + item.useAnimation = 35; + item.useStyle = 1; + item.noMelee = true; + item.knockBack = 3; + item.value = 13800; + item.rare = 10; + item.UseSound = SoundID.Item43; + item.autoReuse = false; + item.shoot = 645; + item.shootSpeed = 12f; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Moon Lash"); - Tooltip.SetDefault("Erupts three moon flame bolts"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Moon Lash"); + Tooltip.SetDefault("Erupts three moon flame bolts"); + } -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) -{ - for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. - { - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); - } - return false; -} + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. + { + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); + } + return false; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ScourgeofFlames", 1); - recipe.AddIngredient(3467, 15); - recipe.AddIngredient(null, "NightmareBar", 11); - recipe.AddIngredient(ItemID.PlatinumBar, 9); - recipe.AddIngredient(ItemID.GoldBar, 9); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ScourgeofFlames", 1); + recipe.AddIngredient(3467, 15); + recipe.AddIngredient(null, "NightmareBar", 11); + recipe.AddIngredient(ItemID.PlatinumBar, 9); + recipe.AddIngredient(ItemID.GoldBar, 9); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Motherboard.cs b/Items/Motherboard.cs index c623607a..f9785741 100644 --- a/Items/Motherboard.cs +++ b/Items/Motherboard.cs @@ -12,45 +12,45 @@ public class Motherboard : ModItem public override void SetDefaults() { - item.width = 38; - item.height = 38; - item.maxStack = 20; + item.width = 38; + item.height = 38; + item.maxStack = 20; - item.rare = 9; - item.useAnimation = 45; - item.useTime = 45; - item.useStyle = 4; - item.UseSound = SoundID.Item44; - } + item.rare = 9; + item.useAnimation = 45; + item.useTime = 45; + item.useStyle = 4; + item.UseSound = SoundID.Item44; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Motherboard"); - Tooltip.SetDefault("Summon bosses"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Motherboard"); + Tooltip.SetDefault("Summon bosses"); + } - public override bool UseItem(Player player) - { - summonWallOfShadows(player); - //NPC.SpawnOnPlayer(player.whoAmI, mod.NPCType("CogLord")); - return true; - } + public override bool UseItem(Player player) + { + summonWallOfShadows(player); + //NPC.SpawnOnPlayer(player.whoAmI, mod.NPCType("CogLord")); + return true; + } - public void summonWallOfShadows (Player player) - { - Vector2 spawnPos; - int dir; - if (player.Center.X > Main.rightWorld / 2) - { - spawnPos = new Vector2(player.Center.X + Main.screenWidth / 2 + 25, player.Center.Y + 1050); - dir = -1; - } - else - { - spawnPos = new Vector2(player.Center.X - Main.screenWidth / 2 - 25, player.Center.Y + 1050); - dir = 1; - } - int newWall = NPC.NewNPC((int)spawnPos.X, (int)spawnPos.Y, mod.NPCType("WallOfShadow"), 0, dir, 0, 0, 0, player.whoAmI); - } - } + public void summonWallOfShadows(Player player) + { + Vector2 spawnPos; + int dir; + if (player.Center.X > Main.rightWorld / 2) + { + spawnPos = new Vector2(player.Center.X + Main.screenWidth / 2 + 25, player.Center.Y + 1050); + dir = -1; + } + else + { + spawnPos = new Vector2(player.Center.X - Main.screenWidth / 2 - 25, player.Center.Y + 1050); + dir = 1; + } + int newWall = NPC.NewNPC((int)spawnPos.X, (int)spawnPos.Y, mod.NPCType("WallOfShadow"), 0, dir, 0, 0, 0, player.whoAmI); + } + } } diff --git a/Items/MotherboardBag.cs b/Items/MotherboardBag.cs index ccf2664d..8b3d6827 100644 --- a/Items/MotherboardBag.cs +++ b/Items/MotherboardBag.cs @@ -4,54 +4,56 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class MotherboardBag : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.maxStack = 999; - item.consumable = true; - item.width = 24; - item.height = 24; - - item.rare = 9; - item.expert = true; - bossBagNPC = mod.NPCType("Motherboard"); - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Treasure Bag"); - Tooltip.SetDefault("Right click to open"); - } - - - public override bool CanRightClick() - { - return true; - } - - public override void OpenBossBag(Player player) - { - player.QuickSpawnItem(3355); - if(Main.rand.Next(1) == 0) - { - player.QuickSpawnItem(mod.ItemType("SoulofMind"), Main.rand.Next(20,40)); - } - if(Main.rand.Next(1) == 0) - { - player.QuickSpawnItem(499, Main.rand.Next(5,15)); - } - if(Main.rand.Next(1) == 0) - { - player.QuickSpawnItem(1225, Main.rand.Next(15, 35));; - } - if(Main.rand.Next(7) == 0) - { - player.QuickSpawnItem(mod.ItemType("MotherboardMask")); - } - player.TryGettingDevArmor(); - } - -}} + public class MotherboardBag : ModItem + { + public override void SetDefaults() + { + + item.maxStack = 999; + item.consumable = true; + item.width = 24; + item.height = 24; + + item.rare = 9; + item.expert = true; + bossBagNPC = mod.NPCType("Motherboard"); + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Treasure Bag"); + Tooltip.SetDefault("Right click to open"); + } + + + public override bool CanRightClick() + { + return true; + } + + public override void OpenBossBag(Player player) + { + player.QuickSpawnItem(3355); + if (Main.rand.Next(1) == 0) + { + player.QuickSpawnItem(mod.ItemType("SoulofMind"), Main.rand.Next(20, 40)); + } + if (Main.rand.Next(1) == 0) + { + player.QuickSpawnItem(499, Main.rand.Next(5, 15)); + } + if (Main.rand.Next(1) == 0) + { + player.QuickSpawnItem(1225, Main.rand.Next(15, 35)); ; + } + if (Main.rand.Next(7) == 0) + { + player.QuickSpawnItem(mod.ItemType("MotherboardMask")); + } + player.TryGettingDevArmor(); + } + + } +} diff --git a/Items/MotherboardMask.cs b/Items/MotherboardMask.cs index 6ff4235e..4687f1ae 100644 --- a/Items/MotherboardMask.cs +++ b/Items/MotherboardMask.cs @@ -4,25 +4,28 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class MotherboardMask : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class MotherboardMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 32; - item.height = 28; - item.rare = 1; - item.vanity = true; - } + item.width = 32; + item.height = 28; + item.rare = 1; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Motherboard Mask"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Motherboard Mask"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/MotherboardTrophy.cs b/Items/MotherboardTrophy.cs index 69f0acd2..c8db4d6e 100644 --- a/Items/MotherboardTrophy.cs +++ b/Items/MotherboardTrophy.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class MotherboardTrophy : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class MotherboardTrophy : ModItem + { + public override void SetDefaults() + { - item.width = 32; - item.height = 32; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 50000; - item.createTile = mod.TileType("MotherboardTrophy"); - item.placeStyle = 0; - } + item.width = 32; + item.height = 32; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 50000; + item.createTile = mod.TileType("MotherboardTrophy"); + item.placeStyle = 0; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Motherboard Trophy"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Motherboard Trophy"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/MourningWoodMask.cs b/Items/MourningWoodMask.cs index 2c5a4e23..b988fa50 100644 --- a/Items/MourningWoodMask.cs +++ b/Items/MourningWoodMask.cs @@ -4,25 +4,28 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class MourningWoodMask : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class MourningWoodMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 32; - item.height = 24; - item.rare = 1; - item.vanity = true; - } + item.width = 32; + item.height = 24; + item.rare = 1; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Mourning Wood Mask"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Mourning Wood Mask"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/MultidimensionalFragment.cs b/Items/MultidimensionalFragment.cs index 08a22ce7..4a552336 100644 --- a/Items/MultidimensionalFragment.cs +++ b/Items/MultidimensionalFragment.cs @@ -6,26 +6,28 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class MultidimensionalFragment : ModItem +namespace Tremor.Items { + public class MultidimensionalFragment : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 22; - item.rare = 11; - item.maxStack = 999; - ItemID.Sets.ItemNoGravity[item.type] = true; - ItemID.Sets.ItemIconPulse[item.type] = true; - } + item.width = 22; + item.height = 22; + item.rare = 11; + item.maxStack = 999; + ItemID.Sets.ItemNoGravity[item.type] = true; + ItemID.Sets.ItemIconPulse[item.type] = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Multidimensional Fragment"); - Tooltip.SetDefault(""); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 12)); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Multidimensional Fragment"); + Tooltip.SetDefault(""); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 12)); + } -}} + } +} diff --git a/Items/Murasamu.cs b/Items/Murasamu.cs index 191089ca..0fa952a5 100644 --- a/Items/Murasamu.cs +++ b/Items/Murasamu.cs @@ -5,43 +5,45 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { -public class Murasamu : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Murasamu : ModItem + { + public override void SetDefaults() + { - item.damage = 24; - item.melee = true; - item.width = 40; - item.height = 40; - item.useTime = 20; - item.useAnimation = 20; - item.useStyle = 1; - item.knockBack = 6; - item.value = 1000; - item.rare = 3; - item.shoot = 22; - item.shootSpeed = 16f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 24; + item.melee = true; + item.width = 40; + item.height = 40; + item.useTime = 20; + item.useAnimation = 20; + item.useStyle = 1; + item.knockBack = 6; + item.value = 1000; + item.rare = 3; + item.shoot = 22; + item.shootSpeed = 16f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Murasamu"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Murasamu"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Muramasa, 1); - recipe.AddIngredient(null, "SeaFragment", 16); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Muramasa, 1); + recipe.AddIngredient(null, "SeaFragment", 16); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/MushroomCreatureBanner.cs b/Items/MushroomCreatureBanner.cs index 2e8722f4..74e4ef81 100644 --- a/Items/MushroomCreatureBanner.cs +++ b/Items/MushroomCreatureBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class MushroomCreatureBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class MushroomCreatureBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 10; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 10; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Mushroom Creature Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Mushroom Creature Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/MushroomCrystal.cs b/Items/MushroomCrystal.cs index 88780734..b4426f83 100644 --- a/Items/MushroomCrystal.cs +++ b/Items/MushroomCrystal.cs @@ -8,47 +8,47 @@ namespace Tremor.Items { - public class MushroomCrystal : ModItem - { - - public override void SetDefaults() - { - - item.width = 24; - item.height = 24; - item.maxStack = 20; - item.value = 100; - item.rare = 3; - item.useAnimation = 15; - item.useTime = 15; - item.useStyle = 4; - item.consumable = true; - - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Mushroom Crystal"); - Tooltip.SetDefault("Summons Fungus Beetle"); - } - - - public override bool CanUseItem(Player player) - { - return NPC.downedBoss3 && !NPC.AnyNPCs(mod.NPCType("FungusBeetle")); - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.GlowingMushroom, 15); - recipe.AddIngredient(null, "Gloomstone", 8); - recipe.AddIngredient(ItemID.StoneBlock, 10); - recipe.AddIngredient(ItemID.Sapphire, 12); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } + public class MushroomCrystal : ModItem + { + + public override void SetDefaults() + { + + item.width = 24; + item.height = 24; + item.maxStack = 20; + item.value = 100; + item.rare = 3; + item.useAnimation = 15; + item.useTime = 15; + item.useStyle = 4; + item.consumable = true; + + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Mushroom Crystal"); + Tooltip.SetDefault("Summons Fungus Beetle"); + } + + + public override bool CanUseItem(Player player) + { + return NPC.downedBoss3 && !NPC.AnyNPCs(mod.NPCType("FungusBeetle")); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.GlowingMushroom, 15); + recipe.AddIngredient(null, "Gloomstone", 8); + recipe.AddIngredient(ItemID.StoneBlock, 10); + recipe.AddIngredient(ItemID.Sapphire, 12); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } public override bool UseItem(Player player) { @@ -56,5 +56,5 @@ public override bool UseItem(Player player) Main.PlaySound(SoundID.Roar, player.position, 0); return true; } - } + } } diff --git a/Items/MusketeerHat.cs b/Items/MusketeerHat.cs index f09fd35a..cf553ad1 100644 --- a/Items/MusketeerHat.cs +++ b/Items/MusketeerHat.cs @@ -5,25 +5,28 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class MusketeerHat : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class MusketeerHat : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 24; - item.value = 2500; - item.rare = 1; - item.defense = 3; - } + item.width = 26; + item.height = 24; + item.value = 2500; + item.rare = 1; + item.defense = 3; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Muskeeter Hat"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Muskeeter Hat"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/MysteriousDrum.cs b/Items/MysteriousDrum.cs index 1944e19b..24964647 100644 --- a/Items/MysteriousDrum.cs +++ b/Items/MysteriousDrum.cs @@ -4,36 +4,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class MysteriousDrum : ModItem -{ +namespace Tremor.Items +{ + public class MysteriousDrum : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 28; - item.height = 32; - item.maxStack = 20; - item.useTurn = true; - item.autoReuse = false; - item.useAnimation = 18; - item.useTime = 18; - item.useStyle = 4; - item.consumable = true; - item.value = 150; - } + item.width = 28; + item.height = 32; + item.maxStack = 20; + item.useTurn = true; + item.autoReuse = false; + item.useAnimation = 18; + item.useTime = 18; + item.useStyle = 4; + item.consumable = true; + item.value = 150; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Mysterious Drum"); - Tooltip.SetDefault("Summons Tiki Totem"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Mysterious Drum"); + Tooltip.SetDefault("Summons Tiki Totem"); + } - public override bool CanUseItem(Player player) - { - return !Main.dayTime && player.ZoneJungle && !NPC.AnyNPCs(mod.NPCType("TikiTotem")); - } + public override bool CanUseItem(Player player) + { + return !Main.dayTime && player.ZoneJungle && !NPC.AnyNPCs(mod.NPCType("TikiTotem")); + } public override bool UseItem(Player player) { @@ -41,25 +42,26 @@ public override bool UseItem(Player player) Main.PlaySound(SoundID.Roar, player.position, 0); return true; } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.RichMahogany, 45); - recipe.AddIngredient(ItemID.Stinger, 2); - recipe.AddIngredient(ItemID.Rope, 25); - recipe.AddIngredient(ItemID.ShadowScale, 8); - recipe.AddIngredient(ItemID.Silk, 6); - recipe.SetResult(this); - recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.RichMahogany, 45); - recipe.AddIngredient(ItemID.Stinger, 2); - recipe.AddIngredient(ItemID.Rope, 25); - recipe.AddIngredient(ItemID.TissueSample, 8); - recipe.AddIngredient(ItemID.Silk, 6); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.RichMahogany, 45); + recipe.AddIngredient(ItemID.Stinger, 2); + recipe.AddIngredient(ItemID.Rope, 25); + recipe.AddIngredient(ItemID.ShadowScale, 8); + recipe.AddIngredient(ItemID.Silk, 6); + recipe.SetResult(this); + recipe.AddRecipe(); + + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.RichMahogany, 45); + recipe.AddIngredient(ItemID.Stinger, 2); + recipe.AddIngredient(ItemID.Rope, 25); + recipe.AddIngredient(ItemID.TissueSample, 8); + recipe.AddIngredient(ItemID.Silk, 6); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/MythrilDisc.cs b/Items/MythrilDisc.cs index a12afdf6..07446082 100644 --- a/Items/MythrilDisc.cs +++ b/Items/MythrilDisc.cs @@ -4,53 +4,55 @@ using Terraria.ModLoader; using Terraria.ID; -namespace Tremor.Items { -public class MythrilDisc : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class MythrilDisc : ModItem + { + public override void SetDefaults() + { - item.damage = 39; - item.thrown = true; - item.width = 48; - item.height = 48; - item.useTime = 20; - item.shootSpeed = 12f; - item.useAnimation = 20; - item.useStyle = 1; - item.knockBack = 3f; - item.shoot = mod.ProjectileType("MythrilDiscPro"); - item.value = 27600; - item.rare = 4; - item.noUseGraphic = true; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 39; + item.thrown = true; + item.width = 48; + item.height = 48; + item.useTime = 20; + item.shootSpeed = 12f; + item.useAnimation = 20; + item.useStyle = 1; + item.knockBack = 3f; + item.shoot = mod.ProjectileType("MythrilDiscPro"); + item.value = 27600; + item.rare = 4; + item.noUseGraphic = true; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Mythril Disc"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Mythril Disc"); + Tooltip.SetDefault(""); + } -public override bool CanUseItem(Player player) -{ - for (int i = 0; i < 1000; ++i) - { - if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) - { - return false; - } - } - return true; + public override bool CanUseItem(Player player) + { + for (int i = 0; i < 1000; ++i) + { + if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) + { + return false; + } + } + return true; + } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.MythrilBar, 12); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.MythrilBar, 12); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} diff --git a/Items/MythrilHeader.cs b/Items/MythrilHeader.cs index 0a7eccb1..98f479ee 100644 --- a/Items/MythrilHeader.cs +++ b/Items/MythrilHeader.cs @@ -5,57 +5,60 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class MythrilHeader : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class MythrilHeader : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 28; - item.height = 26; + item.width = 28; + item.height = 26; - item.value = 400; - item.rare = 4; - item.defense = 5; - } + item.value = 400; + item.rare = 4; + item.defense = 5; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Mythril Header"); - Tooltip.SetDefault("Increases thrown damage by 20%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Mythril Header"); + Tooltip.SetDefault("Increases thrown damage by 20%"); + } - public override void UpdateEquip(Player player) - { - player.thrownDamage += 0.20f; - } + public override void UpdateEquip(Player player) + { + player.thrownDamage += 0.20f; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == 379 && legs.type == 380; - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == 379 && legs.type == 380; + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increases thrown weapon velocity"; - player.thrownVelocity +=0.25f; - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increases thrown weapon velocity"; + player.thrownVelocity += 0.25f; + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawShadowSubtle=true; + player.armorEffectDrawShadowSubtle = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.MythrilBar, 12); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.MythrilBar, 12); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/MythrilMask.cs b/Items/MythrilMask.cs index f49b6064..ade1f8cc 100644 --- a/Items/MythrilMask.cs +++ b/Items/MythrilMask.cs @@ -5,57 +5,60 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class MythrilMask : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class MythrilMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 28; - item.height = 26; + item.width = 28; + item.height = 26; - item.value = 400; - item.rare = 4; - item.defense = 5; - } + item.value = 400; + item.rare = 4; + item.defense = 5; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Mythril Mask"); - Tooltip.SetDefault("Increases minion damage by 20%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Mythril Mask"); + Tooltip.SetDefault("Increases minion damage by 20%"); + } - public override void UpdateEquip(Player player) - { - player.minionDamage += 0.20f; - } + public override void UpdateEquip(Player player) + { + player.minionDamage += 0.20f; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == 379 && legs.type == 380; - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == 379 && legs.type == 380; + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increases your max number of minions"; - player.maxMinions += 2; - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increases your max number of minions"; + player.maxMinions += 2; + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawShadowSubtle=true; + player.armorEffectDrawShadowSubtle = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.MythrilBar, 12); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.MythrilBar, 12); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/MythrilRifle.cs b/Items/MythrilRifle.cs index 06c18659..a093d20b 100644 --- a/Items/MythrilRifle.cs +++ b/Items/MythrilRifle.cs @@ -5,47 +5,49 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class MythrilRifle : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class MythrilRifle : ModItem + { + public override void SetDefaults() + { - item.damage = 38; - item.ranged = true; - item.width = 40; - item.height = 20; - item.useTime = 15; - item.useAnimation = 15; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 6; - item.value = 10000; - item.rare = 4; - item.UseSound = SoundID.Item11; - item.autoReuse = true; - item.shoot = 10; - item.shootSpeed = 12f; - item.useAmmo = 14; - } + item.damage = 38; + item.ranged = true; + item.width = 40; + item.height = 20; + item.useTime = 15; + item.useAnimation = 15; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 6; + item.value = 10000; + item.rare = 4; + item.UseSound = SoundID.Item11; + item.autoReuse = true; + item.shoot = 10; + item.shootSpeed = 12f; + item.useAmmo = 14; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Mythril Rifle"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Mythril Rifle"); + Tooltip.SetDefault(""); + } - public override Vector2? HoldoutOffset() - { - return new Vector2(-15, 0); - } + public override Vector2? HoldoutOffset() + { + return new Vector2(-15, 0); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.MythrilBar, 15); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.MythrilBar, 15); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/MythrilStaff.cs b/Items/MythrilStaff.cs index 36be4abf..5ba38547 100644 --- a/Items/MythrilStaff.cs +++ b/Items/MythrilStaff.cs @@ -5,44 +5,46 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class MythrilStaff : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class MythrilStaff : ModItem + { + public override void SetDefaults() + { - item.damage = 37; - item.magic = true; - item.mana = 8; - item.width = 40; - item.height = 40; - item.useTime = 10; - item.useAnimation = 30; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 3; - item.value = 18440; - item.rare = 4; - item.UseSound = SoundID.Item82; - item.autoReuse = false; - Item.staff[item.type] = true; //this makes the useStyle animate as a staff instead of as a gun - item.shoot = mod.ProjectileType("MythrilBolt"); - item.shootSpeed = 14f; - } + item.damage = 37; + item.magic = true; + item.mana = 8; + item.width = 40; + item.height = 40; + item.useTime = 10; + item.useAnimation = 30; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 3; + item.value = 18440; + item.rare = 4; + item.UseSound = SoundID.Item82; + item.autoReuse = false; + Item.staff[item.type] = true; //this makes the useStyle animate as a staff instead of as a gun + item.shoot = mod.ProjectileType("MythrilBolt"); + item.shootSpeed = 14f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Mythril Staff"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Mythril Staff"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.MythrilBar, 12); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.MythrilBar, 12); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/MythrilVisage.cs b/Items/MythrilVisage.cs index 57243287..5133900b 100644 --- a/Items/MythrilVisage.cs +++ b/Items/MythrilVisage.cs @@ -7,51 +7,51 @@ namespace Tremor.Items { -[AutoloadEquip(EquipType.Head)] - public class MythrilVisage : ModItem - { - - public override void SetDefaults() - { - - item.width = 28; - item.height = 26; - - item.value = 400; - item.rare = 4; - item.defense = 6; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Mythril Visage"); - Tooltip.SetDefault("Increases alchemic damage by 20%"); - } - - - public override void UpdateEquip(Player player) - { - player.GetModPlayer(mod).alchemistDamage += 0.20f; - } - - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == 379 && legs.type == 380; - } - - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increases alchemic critical strike chance by 16%"; - player.GetModPlayer(mod).alchemistCrit += 16; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.MythrilBar, 10); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } - } + [AutoloadEquip(EquipType.Head)] + public class MythrilVisage : ModItem + { + + public override void SetDefaults() + { + + item.width = 28; + item.height = 26; + + item.value = 400; + item.rare = 4; + item.defense = 6; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Mythril Visage"); + Tooltip.SetDefault("Increases alchemic damage by 20%"); + } + + + public override void UpdateEquip(Player player) + { + player.GetModPlayer(mod).alchemistDamage += 0.20f; + } + + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == 379 && legs.type == 380; + } + + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increases alchemic critical strike chance by 16%"; + player.GetModPlayer(mod).alchemistCrit += 16; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.MythrilBar, 10); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } } diff --git a/Items/MythrilWarhammer.cs b/Items/MythrilWarhammer.cs index 9d03c7ce..05ed6f97 100644 --- a/Items/MythrilWarhammer.cs +++ b/Items/MythrilWarhammer.cs @@ -4,40 +4,42 @@ using Terraria.ModLoader; using Terraria.ID; -namespace Tremor.Items { -public class MythrilWarhammer : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class MythrilWarhammer : ModItem + { + public override void SetDefaults() + { - item.damage = 44; - item.melee = true; - item.width = 38; - item.height = 38; - item.useTime = 37; - item.useAnimation = 37; - item.hammer = 83; - item.useStyle = 1; - item.knockBack = 6; - item.value = 27000; - item.rare = 4; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 44; + item.melee = true; + item.width = 38; + item.height = 38; + item.useTime = 37; + item.useAnimation = 37; + item.hammer = 83; + item.useStyle = 1; + item.knockBack = 6; + item.value = 27000; + item.rare = 4; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Mythril Warhammer"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Mythril Warhammer"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.MythrilBar, 10); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.MythrilBar, 10); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/NanoBar.cs b/Items/NanoBar.cs index 6040fb66..050a0f26 100644 --- a/Items/NanoBar.cs +++ b/Items/NanoBar.cs @@ -4,53 +4,55 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class NanoBar : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.width = 28; - item.height = 30; - - item.maxStack = 99; - item.value = 10000; - item.rare = 6; - item.createTile = mod.TileType("NanoBar"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nano Bar"); - Tooltip.SetDefault("Pulsing with pure energy"); - } - - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.TitaniumBar, 1); - recipe.AddIngredient(ItemID.SoulofNight, 1); - recipe.AddIngredient(ItemID.SoulofLight, 1); - recipe.AddIngredient(ItemID.Nanites, 1); - recipe.SetResult(this, 2); - recipe.AddTile(134); - recipe.AddRecipe(); - - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.AdamantiteBar, 1); - recipe.AddIngredient(ItemID.SoulofNight, 1); - recipe.AddIngredient(ItemID.SoulofLight, 1); - recipe.AddIngredient(ItemID.Nanites, 1); - recipe.SetResult(this, 2); - recipe.AddTile(134); - recipe.AddRecipe(); - } - -}} + public class NanoBar : ModItem + { + public override void SetDefaults() + { + + item.width = 28; + item.height = 30; + + item.maxStack = 99; + item.value = 10000; + item.rare = 6; + item.createTile = mod.TileType("NanoBar"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nano Bar"); + Tooltip.SetDefault("Pulsing with pure energy"); + } + + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.TitaniumBar, 1); + recipe.AddIngredient(ItemID.SoulofNight, 1); + recipe.AddIngredient(ItemID.SoulofLight, 1); + recipe.AddIngredient(ItemID.Nanites, 1); + recipe.SetResult(this, 2); + recipe.AddTile(134); + recipe.AddRecipe(); + + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.AdamantiteBar, 1); + recipe.AddIngredient(ItemID.SoulofNight, 1); + recipe.AddIngredient(ItemID.SoulofLight, 1); + recipe.AddIngredient(ItemID.Nanites, 1); + recipe.SetResult(this, 2); + recipe.AddTile(134); + recipe.AddRecipe(); + } + + } +} diff --git a/Items/NanoBlade.cs b/Items/NanoBlade.cs index efd3d1cb..22e3c899 100644 --- a/Items/NanoBlade.cs +++ b/Items/NanoBlade.cs @@ -5,53 +5,54 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class NanoBlade : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class NanoBlade : ModItem + { + public override void SetDefaults() + { - item.damage = 72; - item.melee = true; - item.width = 50; - item.height = 55; - item.useTime = 25; - item.useAnimation = 25; - item.useStyle = 1; - item.shootSpeed = 10f; - item.knockBack = 8; - item.value = 10000; - item.rare = 8; - item.UseSound = SoundID.Item1; - item.useTurn = false; - item.autoReuse = true; - } + item.damage = 72; + item.melee = true; + item.width = 50; + item.height = 55; + item.useTime = 25; + item.useAnimation = 25; + item.useStyle = 1; + item.shootSpeed = 10f; + item.knockBack = 8; + item.value = 10000; + item.rare = 8; + item.UseSound = SoundID.Item1; + item.useTurn = false; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nano Blade"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nano Blade"); + Tooltip.SetDefault(""); + } - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(144, 1200); - } + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(144, 1200); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 59); - } + public override void MeleeEffects(Player player, Rectangle hitbox) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 59); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "NanoBar", 15); - recipe.AddIngredient(ItemID.HallowedBar, 5); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "NanoBar", 15); + recipe.AddIngredient(ItemID.HallowedBar, 5); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } } diff --git a/Items/NanoBreastplate.cs b/Items/NanoBreastplate.cs index 6d4e5ecd..ab973d76 100644 --- a/Items/NanoBreastplate.cs +++ b/Items/NanoBreastplate.cs @@ -5,45 +5,47 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class NanoBreastplate : ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 26; - item.height = 18; - - - item.value = 60000; - item.rare = 6; - item.defense = 17; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nano Breastplate"); - Tooltip.SetDefault("8% increased all damage\n10% increases melee speed"); - } - - - public override void UpdateEquip(Player player) - { - player.meleeDamage += 0.08f; - player.magicDamage += 0.08f; - player.minionDamage += 0.08f; - player.thrownDamage += 0.08f; - player.rangedDamage += 0.08f; - player.meleeSpeed += 0.10f; - } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "NanoBar", 20); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + [AutoloadEquip(EquipType.Body)] + public class NanoBreastplate : ModItem + { + + public override void SetDefaults() + { + + item.width = 26; + item.height = 18; + + + item.value = 60000; + item.rare = 6; + item.defense = 17; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nano Breastplate"); + Tooltip.SetDefault("8% increased all damage\n10% increases melee speed"); + } + + + public override void UpdateEquip(Player player) + { + player.meleeDamage += 0.08f; + player.magicDamage += 0.08f; + player.minionDamage += 0.08f; + player.thrownDamage += 0.08f; + player.rangedDamage += 0.08f; + player.meleeSpeed += 0.10f; + } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "NanoBar", 20); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/NanoDrill.cs b/Items/NanoDrill.cs index cfbd385b..d00a8eeb 100644 --- a/Items/NanoDrill.cs +++ b/Items/NanoDrill.cs @@ -3,46 +3,48 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { - -public class NanoDrill : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.damage = 18; - item.melee = true; - item.width = 20; - item.height = 12; - item.useTime = 8; - item.useAnimation = 8; - item.channel = true; - item.noUseGraphic = true; - item.noMelee = true; - item.pick = 200; - item.tileBoost++; - item.useStyle = 5; - item.knockBack = 6; - item.value = Item.buyPrice(0, 4, 50, 0); - item.rare = 6; - item.UseSound = SoundID.Item23; - item.autoReuse = true; - item.shoot = mod.ProjectileType("NanoDrillPro"); - item.shootSpeed = 26f; - } + public class NanoDrill : ModItem + { + public override void SetDefaults() + { + + item.damage = 18; + item.melee = true; + item.width = 20; + item.height = 12; + item.useTime = 8; + item.useAnimation = 8; + item.channel = true; + item.noUseGraphic = true; + item.noMelee = true; + item.pick = 200; + item.tileBoost++; + item.useStyle = 5; + item.knockBack = 6; + item.value = Item.buyPrice(0, 4, 50, 0); + item.rare = 6; + item.UseSound = SoundID.Item23; + item.autoReuse = true; + item.shoot = mod.ProjectileType("NanoDrillPro"); + item.shootSpeed = 26f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nano Drill"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nano Drill"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "NanoBar", 16); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "NanoBar", 16); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/NanoGreaves.cs b/Items/NanoGreaves.cs index 312e985f..e31a3029 100644 --- a/Items/NanoGreaves.cs +++ b/Items/NanoGreaves.cs @@ -4,39 +4,42 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class NanoGreaves : ModItem +namespace Tremor.Items { - - - public override void SetDefaults() - { - - item.width = 22; - item.height = 18; - item.value = 6000; - - item.rare = 6; - item.defense = 12; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nano Greaves"); - Tooltip.SetDefault("20% increased movement speed"); - } - - - public override void UpdateEquip(Player player) - { - player.moveSpeed += 0.20f; - } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "NanoBar", 15); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + [AutoloadEquip(EquipType.Legs)] + public class NanoGreaves : ModItem + { + + + public override void SetDefaults() + { + + item.width = 22; + item.height = 18; + item.value = 6000; + + item.rare = 6; + item.defense = 12; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nano Greaves"); + Tooltip.SetDefault("20% increased movement speed"); + } + + + public override void UpdateEquip(Player player) + { + player.moveSpeed += 0.20f; + } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "NanoBar", 15); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/NanoHelmet.cs b/Items/NanoHelmet.cs index f40b6d3c..69a70147 100644 --- a/Items/NanoHelmet.cs +++ b/Items/NanoHelmet.cs @@ -5,72 +5,75 @@ using Terraria.ModLoader; using Microsoft.Xna.Framework; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class NanoHelmet : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class NanoHelmet : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 32; - item.height = 26; + item.width = 32; + item.height = 26; - item.value = 60000; - item.rare = 6; - item.defense = 12; - } + item.value = 60000; + item.rare = 6; + item.defense = 12; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nano Helmet"); - Tooltip.SetDefault("Maximum mana increased by 60\nIncreases critical strike chance by 8%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nano Helmet"); + Tooltip.SetDefault("Maximum mana increased by 60\nIncreases critical strike chance by 8%"); + } - public override void UpdateEquip(Player player) - { - player.statManaMax2 += 60; - player.meleeCrit += 8; - player.rangedCrit += 8; - player.magicCrit += 8; - player.thrownCrit += 8; - player.GetModPlayer(mod).alchemistCrit += 8; - } + public override void UpdateEquip(Player player) + { + player.statManaMax2 += 60; + player.meleeCrit += 8; + player.rangedCrit += 8; + player.magicCrit += 8; + player.thrownCrit += 8; + player.GetModPlayer(mod).alchemistCrit += 8; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("NanoBreastplate") && legs.type == mod.ItemType("NanoGreaves"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("NanoBreastplate") && legs.type == mod.ItemType("NanoGreaves"); + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Summons the nano dron will fight for you"; - player.AddBuff(mod.BuffType("NanoDronBuff"), 2); - player.nightVision = true; - if(Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y) > 1f && !player.rocketFrame) // Makes sure the player is actually moving - { - for (int k = 0; k < 2; k++) - { - int index= Dust.NewDust(new Vector2(player.position.X - player.velocity.X * 2f, player.position.Y - 2f - player.velocity.Y * 2f), player.width, player.height, 226, 0f, 0f, 100, default(Color), 0.4f); - Main.dust[index].noGravity = true; - Main.dust[index].noLight = true; - Dust dust = Main.dust[index]; - dust.velocity.X = dust.velocity.X - player.velocity.X * 0.5f; - dust.velocity.Y = dust.velocity.Y - player.velocity.Y * 0.5f; - } - } - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Summons the nano dron will fight for you"; + player.AddBuff(mod.BuffType("NanoDronBuff"), 2); + player.nightVision = true; + if (Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y) > 1f && !player.rocketFrame) // Makes sure the player is actually moving + { + for (int k = 0; k < 2; k++) + { + int index = Dust.NewDust(new Vector2(player.position.X - player.velocity.X * 2f, player.position.Y - 2f - player.velocity.Y * 2f), player.width, player.height, 226, 0f, 0f, 100, default(Color), 0.4f); + Main.dust[index].noGravity = true; + Main.dust[index].noLight = true; + Dust dust = Main.dust[index]; + dust.velocity.X = dust.velocity.X - player.velocity.X * 0.5f; + dust.velocity.Y = dust.velocity.Y - player.velocity.Y * 0.5f; + } + } + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "NanoBar", 12); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "NanoBar", 12); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/NanoJackhammer.cs b/Items/NanoJackhammer.cs index db703a72..f39653cb 100644 --- a/Items/NanoJackhammer.cs +++ b/Items/NanoJackhammer.cs @@ -3,46 +3,48 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { - -public class NanoJackhammer : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.damage = 18; - item.melee = true; - item.width = 20; - item.height = 12; - item.useTime = 12; - item.useAnimation = 25; - item.channel = true; - item.noUseGraphic = true; - item.noMelee = true; - item.hammer = 110; - item.tileBoost++; - item.useStyle = 5; - item.knockBack = 6; - item.value = Item.buyPrice(0, 4, 50, 0); - item.rare = 6; - item.UseSound = SoundID.Item23; - item.autoReuse = true; - item.shoot = mod.ProjectileType("NanoJackhammerPro"); - item.shootSpeed = 40f; - } + public class NanoJackhammer : ModItem + { + public override void SetDefaults() + { + + item.damage = 18; + item.melee = true; + item.width = 20; + item.height = 12; + item.useTime = 12; + item.useAnimation = 25; + item.channel = true; + item.noUseGraphic = true; + item.noMelee = true; + item.hammer = 110; + item.tileBoost++; + item.useStyle = 5; + item.knockBack = 6; + item.value = Item.buyPrice(0, 4, 50, 0); + item.rare = 6; + item.UseSound = SoundID.Item23; + item.autoReuse = true; + item.shoot = mod.ProjectileType("NanoJackhammerPro"); + item.shootSpeed = 40f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nano Jackhammer"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nano Jackhammer"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "NanoBar", 15); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "NanoBar", 15); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/NanoSaw.cs b/Items/NanoSaw.cs index bf6d63d6..099ae208 100644 --- a/Items/NanoSaw.cs +++ b/Items/NanoSaw.cs @@ -3,46 +3,48 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { - -public class NanoSaw : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.damage = 18; - item.melee = true; - item.width = 20; - item.height = 12; - item.useTime = 12; - item.useAnimation = 25; - item.channel = true; - item.noUseGraphic = true; - item.noMelee = true; - item.axe = 22; - item.tileBoost++; - item.useStyle = 5; - item.knockBack = 6; - item.value = Item.buyPrice(0, 4, 50, 0); - item.rare = 6; - item.UseSound = SoundID.Item23; - item.autoReuse = true; - item.shoot = mod.ProjectileType("NanoSawPro"); - item.shootSpeed = 40f; - } + public class NanoSaw : ModItem + { + public override void SetDefaults() + { + + item.damage = 18; + item.melee = true; + item.width = 20; + item.height = 12; + item.useTime = 12; + item.useAnimation = 25; + item.channel = true; + item.noUseGraphic = true; + item.noMelee = true; + item.axe = 22; + item.tileBoost++; + item.useStyle = 5; + item.knockBack = 6; + item.value = Item.buyPrice(0, 4, 50, 0); + item.rare = 6; + item.UseSound = SoundID.Item23; + item.autoReuse = true; + item.shoot = mod.ProjectileType("NanoSawPro"); + item.shootSpeed = 40f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nano Saw"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nano Saw"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "NanoBar", 15); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "NanoBar", 15); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Narsil.cs b/Items/Narsil.cs index 12d6d640..f2bdff87 100644 --- a/Items/Narsil.cs +++ b/Items/Narsil.cs @@ -5,38 +5,40 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Narsil : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Narsil : ModItem + { + public override void SetDefaults() + { - item.damage = 64; - item.melee = true; - item.width = 56; - item.height = 56; - item.useTime = 22; - item.useAnimation = 30; - item.useStyle = 1; - item.knockBack = 3; - item.value = 125000; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 64; + item.melee = true; + item.width = 56; + item.height = 56; + item.useTime = 22; + item.useAnimation = 30; + item.useStyle = 1; + item.knockBack = 3; + item.value = 125000; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Narsil"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Narsil"); + Tooltip.SetDefault(""); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if(Main.rand.Next(2) == 0) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 57); - } - } -}} + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.Next(2) == 0) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 57); + } + } + } +} diff --git a/Items/NastyJavelin.cs b/Items/NastyJavelin.cs index 67465b46..a9073aa2 100644 --- a/Items/NastyJavelin.cs +++ b/Items/NastyJavelin.cs @@ -4,35 +4,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class NastyJavelin : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class NastyJavelin : ModItem + { + public override void SetDefaults() + { - item.damage = 162; - item.width = 14; - item.thrown = true; - item.height = 84; - item.noUseGraphic = true; - item.consumable = true; - item.maxStack = 999; - item.useTime = 22; - item.shoot = mod.ProjectileType("NastyJavelinPro"); - item.shootSpeed = 20f; - item.useAnimation = 22; - item.useStyle = 1; - item.knockBack = 4; - item.value = 10000; - item.rare = 11; - item.UseSound = SoundID.Item5; - item.autoReuse = true; - } + item.damage = 162; + item.width = 14; + item.thrown = true; + item.height = 84; + item.noUseGraphic = true; + item.consumable = true; + item.maxStack = 999; + item.useTime = 22; + item.shoot = mod.ProjectileType("NastyJavelinPro"); + item.shootSpeed = 20f; + item.useAnimation = 22; + item.useStyle = 1; + item.knockBack = 4; + item.value = 10000; + item.rare = 11; + item.UseSound = SoundID.Item5; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nasty Javelin"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nasty Javelin"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/NebulaBand.cs b/Items/NebulaBand.cs index c541871e..f0627a9d 100644 --- a/Items/NebulaBand.cs +++ b/Items/NebulaBand.cs @@ -13,20 +13,20 @@ public override void SetDefaults() { item.CloneDefaults(ItemID.Carrot); - item.rare = 11; - item.value = 380000; - item.useTime = 25; - item.useAnimation = 25; + item.rare = 11; + item.value = 380000; + item.useTime = 25; + item.useAnimation = 25; item.shoot = mod.ProjectileType("NebulaJellyfish"); item.buffType = mod.BuffType("NebulaJellyfishBuff"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nebula Band"); - Tooltip.SetDefault("Summons a nebula jellyfish"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nebula Band"); + Tooltip.SetDefault("Summons a nebula jellyfish"); + } public override void UseStyle(Player player) @@ -37,14 +37,14 @@ public override void UseStyle(Player player) } } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "UnchargedBand"); - recipe.AddIngredient(3457, 10); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "UnchargedBand"); + recipe.AddIngredient(3457, 10); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } } } diff --git a/Items/NebulaRing.cs b/Items/NebulaRing.cs index 98fb5418..00b3a9b3 100644 --- a/Items/NebulaRing.cs +++ b/Items/NebulaRing.cs @@ -4,43 +4,45 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class NebulaRing : ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 28; - item.height = 22; - item.value = 250000; - item.rare = 8; - item.accessory = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nebula Ring "); - Tooltip.SetDefault("20% increased magic damage\nIncreases magic critical strike chance by 15\nIncreases maximum mana by 80"); - } - - - public override void UpdateAccessory(Player player, bool hideVisual) - - { - player.magicDamage += 0.2f; - player.magicCrit += 15; - player.statManaMax2 += 80; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(3457, 10); - recipe.AddIngredient(3467, 15); - recipe.AddIngredient(null, "Band"); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } -}} + public class NebulaRing : ModItem + { + + public override void SetDefaults() + { + + item.width = 28; + item.height = 22; + item.value = 250000; + item.rare = 8; + item.accessory = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nebula Ring "); + Tooltip.SetDefault("20% increased magic damage\nIncreases magic critical strike chance by 15\nIncreases maximum mana by 80"); + } + + + public override void UpdateAccessory(Player player, bool hideVisual) + + { + player.magicDamage += 0.2f; + player.magicCrit += 15; + player.statManaMax2 += 80; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(3457, 10); + recipe.AddIngredient(3467, 15); + recipe.AddIngredient(null, "Band"); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } +} diff --git a/Items/NecroBow.cs b/Items/NecroBow.cs index cceb42f3..5ca79b86 100644 --- a/Items/NecroBow.cs +++ b/Items/NecroBow.cs @@ -4,43 +4,45 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class NecroBow : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class NecroBow : ModItem + { + public override void SetDefaults() + { - item.damage = 36; - item.width = 16; - item.height = 32; - item.useTime = 38; - item.ranged = true; - item.shoot = 1; - item.shootSpeed = 22f; - item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 5; - item.value = 12540; - item.useAmmo = AmmoID.Arrow; - item.rare = 3; - item.UseSound = SoundID.Item5; - item.autoReuse = false; - } + item.damage = 36; + item.width = 16; + item.height = 32; + item.useTime = 38; + item.ranged = true; + item.shoot = 1; + item.shootSpeed = 22f; + item.useAnimation = 30; + item.useStyle = 5; + item.knockBack = 5; + item.value = 12540; + item.useAmmo = AmmoID.Arrow; + item.rare = 3; + item.UseSound = SoundID.Item5; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Necro Bow"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Necro Bow"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Bone, 25); - recipe.AddIngredient(ItemID.Cobweb, 30); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Bone, 25); + recipe.AddIngredient(ItemID.Cobweb, 30); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/NecroShield.cs b/Items/NecroShield.cs index 020489d4..190737e9 100644 --- a/Items/NecroShield.cs +++ b/Items/NecroShield.cs @@ -5,32 +5,34 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Shield)] -public class NecroShield : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Shield)] + public class NecroShield : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 30; - item.value = 110; - item.rare = 0; - item.accessory = true; - item.defense = 1; - } + item.width = 26; + item.height = 30; + item.value = 110; + item.rare = 0; + item.accessory = true; + item.defense = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Necro Shield"); - Tooltip.SetDefault("Increases minion damage by 10%\nIncreases magic critical strike chance by 10"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Necro Shield"); + Tooltip.SetDefault("Increases minion damage by 10%\nIncreases magic critical strike chance by 10"); + } - public override void UpdateEquip(Player player) - { - player.magicCrit += 10; - player.minionDamage += 0.1f; - } + public override void UpdateEquip(Player player) + { + player.magicCrit += 10; + player.minionDamage += 0.1f; + } -}} + } +} diff --git a/Items/NecroWarhammer.cs b/Items/NecroWarhammer.cs index 5a616434..2413d3a0 100644 --- a/Items/NecroWarhammer.cs +++ b/Items/NecroWarhammer.cs @@ -7,32 +7,32 @@ namespace Tremor.Items { - public class NecroWarhammer : ModItem - { - public override void SetDefaults() - { + public class NecroWarhammer : ModItem + { + public override void SetDefaults() + { - item.damage = 73; - item.melee = true; - item.width = 38; - item.height = 20; - item.useTime = 26; - item.useAnimation = 26; - item.useStyle = 1; - item.knockBack = 10; - item.value = 150000; - item.rare = 6; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.shoot = 270; - item.shootSpeed = 12f; - } + item.damage = 73; + item.melee = true; + item.width = 38; + item.height = 20; + item.useTime = 26; + item.useAnimation = 26; + item.useStyle = 1; + item.knockBack = 10; + item.value = 150000; + item.rare = 6; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.shoot = 270; + item.shootSpeed = 12f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Necro War Hammer"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Necro War Hammer"); + Tooltip.SetDefault(""); + } - } + } } diff --git a/Items/NecromancerArmor.cs b/Items/NecromancerArmor.cs index d1359b7c..9e69c1c6 100644 --- a/Items/NecromancerArmor.cs +++ b/Items/NecromancerArmor.cs @@ -5,43 +5,45 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class NecromancerArmor : ModItem +namespace Tremor.Items { + public class NecromancerArmor : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 34; - item.height = 34; - item.value = 150000; - item.rare = 3; - item.defense = 10; - item.accessory = true; - } + item.width = 34; + item.height = 34; + item.value = 150000; + item.rare = 3; + item.defense = 10; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Necromancer Armor"); - Tooltip.SetDefault("18% increased minion damage\n20% increased minion knockback"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Necromancer Armor"); + Tooltip.SetDefault("18% increased minion damage\n20% increased minion knockback"); + } - public override void UpdateEquip(Player player) - { - player.minionDamage += 0.18f; - player.minionKB += 0.2f; - } + public override void UpdateEquip(Player player) + { + player.minionDamage += 0.18f; + player.minionKB += 0.2f; + } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(null, "HardArmor", 1); recipe.AddIngredient(null, "TikiArmor", 1); recipe.AddIngredient(null, "NecromancerBelt", 1); - recipe.AddIngredient(ItemID.SoulofNight, 25); + recipe.AddIngredient(ItemID.SoulofNight, 25); recipe.AddTile(114); recipe.SetResult(this); recipe.AddRecipe(); - } + } -}} + } +} diff --git a/Items/NecromancerBelt.cs b/Items/NecromancerBelt.cs index 2cc4607e..daf85969 100644 --- a/Items/NecromancerBelt.cs +++ b/Items/NecromancerBelt.cs @@ -4,43 +4,45 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class NecromancerBelt : ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 30; - item.height = 24; - item.value = 30000; - item.rare = 2; - item.accessory = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Necromancer Belt"); - Tooltip.SetDefault("Increases minion knockback by 20%\nIncreases your maximum number of minions"); - } - - - public override void UpdateAccessory(Player player, bool hideVisual) - - { - player.minionKB += 0.2f; - player.maxMinions += 1; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "StrongBelt"); - recipe.AddIngredient(1158, 1); - recipe.AddIngredient(null, "UntreatedFlesh", 25); - recipe.AddIngredient(ItemID.Bone, 25); - recipe.SetResult(this); - recipe.AddTile(114); - recipe.AddRecipe(); - } -}} + public class NecromancerBelt : ModItem + { + + public override void SetDefaults() + { + + item.width = 30; + item.height = 24; + item.value = 30000; + item.rare = 2; + item.accessory = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Necromancer Belt"); + Tooltip.SetDefault("Increases minion knockback by 20%\nIncreases your maximum number of minions"); + } + + + public override void UpdateAccessory(Player player, bool hideVisual) + + { + player.minionKB += 0.2f; + player.maxMinions += 1; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "StrongBelt"); + recipe.AddIngredient(1158, 1); + recipe.AddIngredient(null, "UntreatedFlesh", 25); + recipe.AddIngredient(ItemID.Bone, 25); + recipe.SetResult(this); + recipe.AddTile(114); + recipe.AddRecipe(); + } + } +} diff --git a/Items/NecromancerClaymore.cs b/Items/NecromancerClaymore.cs index 4cc6e776..e213a9ba 100644 --- a/Items/NecromancerClaymore.cs +++ b/Items/NecromancerClaymore.cs @@ -5,39 +5,40 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class NecromancerClaymore : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class NecromancerClaymore : ModItem + { + public override void SetDefaults() + { - item.damage = 20; - item.melee = true; - item.width = 50; - item.height = 55; - item.useTime = 25; - item.useAnimation = 25; - item.useStyle = 1; - item.shoot = mod.ProjectileType("BoneSpike"); - item.shootSpeed = 6f; - item.knockBack = 4; - item.value = 66600; - item.rare = 3; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 20; + item.melee = true; + item.width = 50; + item.height = 55; + item.useTime = 25; + item.useAnimation = 25; + item.useStyle = 1; + item.shoot = mod.ProjectileType("BoneSpike"); + item.shootSpeed = 6f; + item.knockBack = 4; + item.value = 66600; + item.rare = 3; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Necromancer Claymore"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Necromancer Claymore"); + Tooltip.SetDefault(""); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 26); - } -} + public override void MeleeEffects(Player player, Rectangle hitbox) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 26); + } + } } diff --git a/Items/Necronomicon.cs b/Items/Necronomicon.cs index 5cdcd60f..c43edf82 100644 --- a/Items/Necronomicon.cs +++ b/Items/Necronomicon.cs @@ -31,26 +31,26 @@ public override void SetDefaults() item.buffTime = 3600; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Necronomicon"); - Tooltip.SetDefault("Summons a skeleton to fight for you."); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Necronomicon"); + Tooltip.SetDefault("Summons a skeleton to fight for you."); + } public override bool AltFunctionUse(Player player) { return true; } - + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { return player.altFunctionUse != 2; } - + public override bool UseItem(Player player) { - if(player.altFunctionUse == 2) + if (player.altFunctionUse == 2) { player.MinionNPCTargetAim(); } diff --git a/Items/NightCombination.cs b/Items/NightCombination.cs index 954312cf..beecb610 100644 --- a/Items/NightCombination.cs +++ b/Items/NightCombination.cs @@ -4,51 +4,53 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class NightCombination : ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 24; - item.height = 28; - item.value = 50000; - item.rare = 1; - item.accessory = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nightly Combination"); - Tooltip.SetDefault("Increases life regeneration, melee damage\nMakes you glow during night"); - } - - - public override void UpdateAccessory(Player player, bool hideVisual) - - { - if (!Main.dayTime) - { - player.AddBuff(11, 10); - player.AddBuff(12, 10); - player.lifeRegen +=1; - player.meleeDamage +=0.1f; - player.rangedDamage +=0.1f; - player.thrownDamage +=0.1f; - player.minionDamage +=0.1f; - player.magicDamage +=0.1f; - } - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Bloomstone"); - recipe.AddIngredient(null, "DragonGem"); - recipe.AddIngredient(null, "TwilightHorns"); - recipe.SetResult(this); - recipe.AddTile(114); - recipe.AddRecipe(); - } -}} + public class NightCombination : ModItem + { + + public override void SetDefaults() + { + + item.width = 24; + item.height = 28; + item.value = 50000; + item.rare = 1; + item.accessory = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nightly Combination"); + Tooltip.SetDefault("Increases life regeneration, melee damage\nMakes you glow during night"); + } + + + public override void UpdateAccessory(Player player, bool hideVisual) + + { + if (!Main.dayTime) + { + player.AddBuff(11, 10); + player.AddBuff(12, 10); + player.lifeRegen += 1; + player.meleeDamage += 0.1f; + player.rangedDamage += 0.1f; + player.thrownDamage += 0.1f; + player.minionDamage += 0.1f; + player.magicDamage += 0.1f; + } + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Bloomstone"); + recipe.AddIngredient(null, "DragonGem"); + recipe.AddIngredient(null, "TwilightHorns"); + recipe.SetResult(this); + recipe.AddTile(114); + recipe.AddRecipe(); + } + } +} diff --git a/Items/NightCore.cs b/Items/NightCore.cs index 047c955c..478011b3 100644 --- a/Items/NightCore.cs +++ b/Items/NightCore.cs @@ -6,26 +6,27 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class NightCore : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class NightCore : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 22; - item.maxStack = 999; - item.value = 100; - item.rare = 10; - ItemID.Sets.ItemNoGravity[item.type] = true; + item.width = 22; + item.height = 22; + item.maxStack = 999; + item.value = 100; + item.rare = 10; + ItemID.Sets.ItemNoGravity[item.type] = true; ItemID.Sets.ItemIconPulse[item.type] = true; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Night Core"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Night Core"); + Tooltip.SetDefault(""); + } public override Color? GetAlpha(Color lightColor) @@ -33,4 +34,5 @@ public override void SetStaticDefaults() return Color.Purple; } -}} + } +} diff --git a/Items/NightDusk.cs b/Items/NightDusk.cs index 7f334b4f..69681a33 100644 --- a/Items/NightDusk.cs +++ b/Items/NightDusk.cs @@ -6,53 +6,55 @@ using Terraria.ModLoader; -namespace Tremor.Items { -public class NightDusk : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.damage = 9; - item.melee = true; - item.width = 46; - item.height = 46; - item.useTime = 12; - item.useAnimation = 22; - item.pick = 100; - item.useStyle = 1; - item.knockBack = 5; - item.value = 600; - item.useTurn = true; - item.rare = 3; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Night Dusk"); - Tooltip.SetDefault(""); - } - - - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if(Main.rand.Next(5) == 0) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 27); - } - } - - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.MoltenPickaxe, 1); - recipe.AddIngredient(ItemID.BonePickaxe, 1); - recipe.AddIngredient(null, "PickaxeofBloom", 1); - recipe.AddIngredient(ItemID.NightmarePickaxe, 1); - recipe.AddTile(26); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public class NightDusk : ModItem + { + public override void SetDefaults() + { + + item.damage = 9; + item.melee = true; + item.width = 46; + item.height = 46; + item.useTime = 12; + item.useAnimation = 22; + item.pick = 100; + item.useStyle = 1; + item.knockBack = 5; + item.value = 600; + item.useTurn = true; + item.rare = 3; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Night Dusk"); + Tooltip.SetDefault(""); + } + + + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.Next(5) == 0) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 27); + } + } + + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.MoltenPickaxe, 1); + recipe.AddIngredient(ItemID.BonePickaxe, 1); + recipe.AddIngredient(null, "PickaxeofBloom", 1); + recipe.AddIngredient(ItemID.NightmarePickaxe, 1); + recipe.AddTile(26); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/NightFury.cs b/Items/NightFury.cs index 38ec3b6d..3802f97d 100644 --- a/Items/NightFury.cs +++ b/Items/NightFury.cs @@ -7,47 +7,47 @@ namespace Tremor.Items { - public class NightFury : ModItem - { - public override void SetDefaults() - { + public class NightFury : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 10; - item.value = Item.sellPrice(2, 0, 0, 0); - item.rare = 4; - item.noMelee = true; - item.useStyle = 5; - item.useAnimation = 40; - item.useTime = 40; - item.knockBack = 7.5F; - item.damage = 36; - item.scale = 1.1F; - item.noUseGraphic = true; - item.shoot = mod.ProjectileType("NightFuryPro"); - item.shootSpeed = 15.9F; - item.UseSound = SoundID.Item1; - item.melee = true; - item.channel = true; - } + item.width = 30; + item.height = 10; + item.value = Item.sellPrice(2, 0, 0, 0); + item.rare = 4; + item.noMelee = true; + item.useStyle = 5; + item.useAnimation = 40; + item.useTime = 40; + item.knockBack = 7.5F; + item.damage = 36; + item.scale = 1.1F; + item.noUseGraphic = true; + item.shoot = mod.ProjectileType("NightFuryPro"); + item.shootSpeed = 15.9F; + item.UseSound = SoundID.Item1; + item.melee = true; + item.channel = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Night Fury"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Night Fury"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Sunfury, 1); - recipe.AddIngredient(null, "LeafBall", 1); - recipe.AddIngredient(ItemID.BallOHurt, 1); - recipe.AddIngredient(ItemID.BlueMoon, 1); - recipe.SetResult(this); - recipe.AddTile(26); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Sunfury, 1); + recipe.AddIngredient(null, "LeafBall", 1); + recipe.AddIngredient(ItemID.BallOHurt, 1); + recipe.AddIngredient(ItemID.BlueMoon, 1); + recipe.SetResult(this); + recipe.AddTile(26); + recipe.AddRecipe(); + } + } } diff --git a/Items/NightTerrorBanner.cs b/Items/NightTerrorBanner.cs index 767595ef..3b2453f6 100644 --- a/Items/NightTerrorBanner.cs +++ b/Items/NightTerrorBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class NightTerrorBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class NightTerrorBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 79; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 79; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Night Terror Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Night Terror Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/NightingaleChestplate.cs b/Items/NightingaleChestplate.cs index a91d3cd0..44f9bee1 100644 --- a/Items/NightingaleChestplate.cs +++ b/Items/NightingaleChestplate.cs @@ -7,44 +7,45 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class NightingaleChestplate : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + [AutoloadEquip(EquipType.Body)] + public class NightingaleChestplate : ModItem + { + public override void SetDefaults() + { - item.defense = 7; - item.width = 22; - item.height = 30; - item.value = 3025; - item.rare = 2; - } + item.defense = 7; + item.width = 22; + item.height = 30; + item.value = 3025; + item.rare = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nightingale Chestplate"); - Tooltip.SetDefault("5% increased all damage"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nightingale Chestplate"); + Tooltip.SetDefault("5% increased all damage"); + } - public override void UpdateEquip(Player player) - { - player.meleeDamage += 0.05f; - player.thrownDamage += 0.05f; - player.rangedDamage += 0.05f; - player.magicDamage += 0.05f; - player.minionDamage += 0.05f; - } + public override void UpdateEquip(Player player) + { + player.meleeDamage += 0.05f; + player.thrownDamage += 0.05f; + player.rangedDamage += 0.05f; + player.magicDamage += 0.05f; + player.minionDamage += 0.05f; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "SteelBar", 15); - recipe.AddIngredient(null, "PhantomSoul", 4); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "SteelBar", 15); + recipe.AddIngredient(null, "PhantomSoul", 4); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } } diff --git a/Items/NightingaleGreaves.cs b/Items/NightingaleGreaves.cs index fa8ba6eb..e1c50299 100644 --- a/Items/NightingaleGreaves.cs +++ b/Items/NightingaleGreaves.cs @@ -7,40 +7,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class NightingaleGreaves : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Legs)] + public class NightingaleGreaves : ModItem + { - public override void SetDefaults() - { - item.defense = 6; - item.width = 22; - item.height = 18; - item.value = 2500; - item.rare = 2; - } + public override void SetDefaults() + { + item.defense = 6; + item.width = 22; + item.height = 18; + item.value = 2500; + item.rare = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nightingale Greaves"); - Tooltip.SetDefault("Increases movement speed by 10%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nightingale Greaves"); + Tooltip.SetDefault("Increases movement speed by 10%"); + } - public override void UpdateEquip(Player player) - { - player.moveSpeed += 0.10f; - } + public override void UpdateEquip(Player player) + { + player.moveSpeed += 0.10f; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "SteelBar", 10); - recipe.AddIngredient(null, "PhantomSoul", 3); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "SteelBar", 10); + recipe.AddIngredient(null, "PhantomSoul", 3); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } } diff --git a/Items/NightingaleHood.cs b/Items/NightingaleHood.cs index f27a458d..ed6408ac 100644 --- a/Items/NightingaleHood.cs +++ b/Items/NightingaleHood.cs @@ -7,59 +7,61 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class NightingaleHood : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class NightingaleHood : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.defense = 5; - item.width = 26; - item.height = 32; - item.value = 2000; - item.rare = 2; - } + item.defense = 5; + item.width = 26; + item.height = 32; + item.value = 2000; + item.rare = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nightingale Hood"); - Tooltip.SetDefault("Increases life regeneration"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nightingale Hood"); + Tooltip.SetDefault("Increases life regeneration"); + } - public override void UpdateEquip(Player player) - { + public override void UpdateEquip(Player player) + { player.lifeRegen += 1; - } + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == mod.ItemType("NightingaleChestplate") && legs.type == mod.ItemType("NightingaleGreaves"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("NightingaleChestplate") && legs.type == mod.ItemType("NightingaleGreaves"); + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Reduced enemy agression"; - player.AddBuff(106, 300, true); - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Reduced enemy agression"; + player.AddBuff(106, 300, true); + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawShadowLokis = true; + player.armorEffectDrawShadowLokis = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "SteelBar", 5); - recipe.AddIngredient(ItemID.Silk, 15); - recipe.AddIngredient(null, "PhantomSoul", 3); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "SteelBar", 5); + recipe.AddIngredient(ItemID.Silk, 15); + recipe.AddIngredient(null, "PhantomSoul", 3); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } } diff --git a/Items/NightmareArrow.cs b/Items/NightmareArrow.cs index eb2f27af..4f276fef 100644 --- a/Items/NightmareArrow.cs +++ b/Items/NightmareArrow.cs @@ -5,41 +5,43 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class NightmareArrow : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class NightmareArrow : ModItem + { + public override void SetDefaults() + { - item.damage = 18; - item.ranged = true; - item.width = 26; - item.maxStack = 999; - item.consumable = true; - item.height = 30; + item.damage = 18; + item.ranged = true; + item.width = 26; + item.maxStack = 999; + item.consumable = true; + item.height = 30; - item.shoot = mod.ProjectileType("NightmareArrowPro"); - item.shootSpeed = 22f; - item.knockBack = 4; - item.value = 10; - item.rare = 11; - item.ammo = AmmoID.Arrow; - } + item.shoot = mod.ProjectileType("NightmareArrowPro"); + item.shootSpeed = 22f; + item.knockBack = 4; + item.value = 10; + item.rare = 11; + item.ammo = AmmoID.Arrow; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nightmare Arrow"); - Tooltip.SetDefault("'Enemies die... from fear.'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nightmare Arrow"); + Tooltip.SetDefault("'Enemies die... from fear.'"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "NightmareBar", 1); - recipe.AddIngredient(ItemID.WoodenArrow, 150); - recipe.SetResult(this, 150); - recipe.AddTile(412); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "NightmareBar", 1); + recipe.AddIngredient(ItemID.WoodenArrow, 150); + recipe.SetResult(this, 150); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } +} diff --git a/Items/NightmareBar.cs b/Items/NightmareBar.cs index cfc50d2b..245fcab7 100644 --- a/Items/NightmareBar.cs +++ b/Items/NightmareBar.cs @@ -4,38 +4,40 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class NightmareBar : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class NightmareBar : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 15000; - item.rare = 11; - item.createTile = mod.TileType("NightmareBarTile"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 15000; + item.rare = 11; + item.createTile = mod.TileType("NightmareBarTile"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nightmare Bar"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nightmare Bar"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "NightmareOre", 6); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "NightmareOre", 6); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } +} diff --git a/Items/NightmareBreastplate.cs b/Items/NightmareBreastplate.cs index f3bff5c6..a28b2ca0 100644 --- a/Items/NightmareBreastplate.cs +++ b/Items/NightmareBreastplate.cs @@ -7,36 +7,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class NightmareBreastplate : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Body)] + public class NightmareBreastplate : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.defense = 35; - item.width = 22; - item.height = 30; - item.value = 25000; - item.rare = 10; - } + item.defense = 35; + item.width = 22; + item.height = 30; + item.value = 25000; + item.rare = 10; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nightmare Breastplate"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nightmare Breastplate"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "NightmareBar", 25); - recipe.AddIngredient(null, "Phantaplasm", 10); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "NightmareBar", 25); + recipe.AddIngredient(null, "Phantaplasm", 10); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } } diff --git a/Items/NightmareBrick.cs b/Items/NightmareBrick.cs index a96db34a..d0e61af5 100644 --- a/Items/NightmareBrick.cs +++ b/Items/NightmareBrick.cs @@ -15,37 +15,38 @@ public override void SetDefaults() item.height = 12; item.maxStack = 999; item.useTurn = true; - item.value = 10000; + item.value = 10000; item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.rare = 11; + item.rare = 11; item.useStyle = 1; item.consumable = true; item.createTile = mod.TileType("NightmareBrickTile"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nightmare Brick"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nightmare Brick"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "NightmareBrickWall", 4); - recipe.SetResult(this, 1); - recipe.AddTile(17); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "NightmareBrickWall", 4); + recipe.SetResult(this, 1); + recipe.AddTile(17); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "NightmareOre", 1); - recipe.AddIngredient(ItemID.StoneBlock, 1); - recipe.SetResult(this, 2); - recipe.AddTile(17); - recipe.AddRecipe(); - } -}} + recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "NightmareOre", 1); + recipe.AddIngredient(ItemID.StoneBlock, 1); + recipe.SetResult(this, 2); + recipe.AddTile(17); + recipe.AddRecipe(); + } + } +} diff --git a/Items/NightmareBrickWall.cs b/Items/NightmareBrickWall.cs index b447ee5c..e6c7efcf 100644 --- a/Items/NightmareBrickWall.cs +++ b/Items/NightmareBrickWall.cs @@ -4,38 +4,40 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class NightmareBrickWall : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class NightmareBrickWall : ModItem + { + public override void SetDefaults() + { - item.width = 12; - item.height = 12; - item.maxStack = 999; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 7; - item.useStyle = 1; - item.rare = 11; - item.consumable = true; - item.createWall = mod.WallType("NightmareBrickWall"); - } + item.width = 12; + item.height = 12; + item.maxStack = 999; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 7; + item.useStyle = 1; + item.rare = 11; + item.consumable = true; + item.createWall = mod.WallType("NightmareBrickWall"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nightmare Brick Wall"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nightmare Brick Wall"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "NightmareBrick", 1); - recipe.SetResult(this, 4); - recipe.AddTile(17); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "NightmareBrick", 1); + recipe.SetResult(this, 4); + recipe.AddTile(17); + recipe.AddRecipe(); + } + } +} diff --git a/Items/NightmareBullet.cs b/Items/NightmareBullet.cs index 0a08172a..b146334c 100644 --- a/Items/NightmareBullet.cs +++ b/Items/NightmareBullet.cs @@ -27,11 +27,11 @@ public override void SetDefaults() item.ammo = AmmoID.Bullet; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nightmare Bullet"); - Tooltip.SetDefault("'Can bounce off blocks.'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nightmare Bullet"); + Tooltip.SetDefault("'Can bounce off blocks.'"); + } public override void AddRecipes() diff --git a/Items/NightmareGlove.cs b/Items/NightmareGlove.cs index 21c793f6..591f0477 100644 --- a/Items/NightmareGlove.cs +++ b/Items/NightmareGlove.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class NightmareGlove : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class NightmareGlove : ModItem + { + public override void SetDefaults() + { - item.damage = 125; - item.melee = true; - item.width = 36; - item.height = 36; - item.useTime = 11; - item.useAnimation = 11; - item.useStyle = 1; - item.knockBack = 3; - item.value = 100000; - item.rare = 11; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 125; + item.melee = true; + item.width = 36; + item.height = 36; + item.useTime = 11; + item.useAnimation = 11; + item.useStyle = 1; + item.knockBack = 3; + item.value = 100000; + item.rare = 11; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nightmare Glove"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nightmare Glove"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/NightmareHelmet.cs b/Items/NightmareHelmet.cs index 6cf8cf4b..ffb7af6b 100644 --- a/Items/NightmareHelmet.cs +++ b/Items/NightmareHelmet.cs @@ -7,55 +7,57 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class NightmareHelmet : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class NightmareHelmet : ModItem + { - public override void SetDefaults() - { - - item.defense = 24; - item.width = 26; - item.height = 32; - item.value = 25000; - item.rare = 10; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nightmare Helmet"); - Tooltip.SetDefault(""); - } - - - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == mod.ItemType("NightmareBreastplate") && legs.type == mod.ItemType("NightmarePants"); - } - - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Minor improvements to all stats when health below 50"; - if (player.statLife < 50) - { - player.AddBuff(mod.BuffType("ConcentrationofFear"), 2); - } - } + public override void SetDefaults() + { + + item.defense = 24; + item.width = 26; + item.height = 32; + item.value = 25000; + item.rare = 10; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nightmare Helmet"); + Tooltip.SetDefault(""); + } + + + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("NightmareBreastplate") && legs.type == mod.ItemType("NightmarePants"); + } + + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Minor improvements to all stats when health below 50"; + if (player.statLife < 50) + { + player.AddBuff(mod.BuffType("ConcentrationofFear"), 2); + } + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawShadowLokis = true; + player.armorEffectDrawShadowLokis = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "NightmareBar", 15); - recipe.AddIngredient(null, "PurpleQuartz", 5); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "NightmareBar", 15); + recipe.AddIngredient(null, "PurpleQuartz", 5); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } } diff --git a/Items/NightmareOre.cs b/Items/NightmareOre.cs index 0e449ae2..3467cc08 100644 --- a/Items/NightmareOre.cs +++ b/Items/NightmareOre.cs @@ -12,24 +12,24 @@ public override void SetDefaults() { item.width = 12; - item.value = 10000; + item.value = 10000; item.height = 12; item.maxStack = 999; item.useTurn = true; item.autoReuse = true; item.useAnimation = 15; item.useTime = 10; - item.rare = 11; + item.rare = 11; item.useStyle = 1; item.consumable = true; item.createTile = mod.TileType("NightmareOreTile"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nightmare Ore"); - Tooltip.SetDefault("'Concentrated nightmares.'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nightmare Ore"); + Tooltip.SetDefault("'Concentrated nightmares.'"); + } } } diff --git a/Items/NightmarePants.cs b/Items/NightmarePants.cs index c09e7961..ba8afbbf 100644 --- a/Items/NightmarePants.cs +++ b/Items/NightmarePants.cs @@ -7,36 +7,38 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class NightmarePants : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Legs)] + public class NightmarePants : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.defense = 22; - item.width = 22; - item.height = 18; - item.value = 25000; - item.rare = 10; - } + item.defense = 22; + item.width = 22; + item.height = 18; + item.value = 25000; + item.rare = 10; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nightmare Pants"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nightmare Pants"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "NightmareBar", 20); - recipe.AddIngredient(null, "PurpleQuartz", 8); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "NightmareBar", 20); + recipe.AddIngredient(null, "PurpleQuartz", 8); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } } diff --git a/Items/NightmareSprayer.cs b/Items/NightmareSprayer.cs index e2eb9dfc..306ef1a7 100644 --- a/Items/NightmareSprayer.cs +++ b/Items/NightmareSprayer.cs @@ -7,139 +7,139 @@ namespace Tremor.Items { - public class NightmareSprayer : AlchemistItem - { + public class NightmareSprayer : AlchemistItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.damage = 120; - item.width = 80; - item.height = 36; - item.useTime = 14; - item.useAnimation = 14; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 4; - item.value = 10000; - item.rare = 11; - item.UseSound = SoundID.Item20; - item.autoReuse = false; - item.shoot = 10; - item.shootSpeed = 6f; - item.crit = 4; - item.useAmmo = mod.ItemType("BoomFlask"); + item.damage = 120; + item.width = 80; + item.height = 36; + item.useTime = 14; + item.useAnimation = 14; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 4; + item.value = 10000; + item.rare = 11; + item.UseSound = SoundID.Item20; + item.autoReuse = false; + item.shoot = 10; + item.shootSpeed = 6f; + item.crit = 4; + item.useAmmo = mod.ItemType("BoomFlask"); - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nightmare Sprayer"); - Tooltip.SetDefault("Uses flasks as ammo\nSprays alchemical clouds"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nightmare Sprayer"); + Tooltip.SetDefault("Uses flasks as ammo\nSprays alchemical clouds"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BasicSprayer", 1); - recipe.AddIngredient(null, "BasicFlask", 8); - recipe.AddIngredient(null, "NightmareBar", 25); - recipe.AddIngredient(null, "SteelBar", 14); - recipe.AddIngredient(ItemID.Wire, 15); - recipe.AddIngredient(3467, 8); - recipe.AddIngredient(null, "VoidBar", 5); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "BasicSprayer", 1); + recipe.AddIngredient(null, "BasicFlask", 8); + recipe.AddIngredient(null, "NightmareBar", 25); + recipe.AddIngredient(null, "SteelBar", 14); + recipe.AddIngredient(ItemID.Wire, 15); + recipe.AddIngredient(3467, 8); + recipe.AddIngredient(null, "VoidBar", 5); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } - public override bool ConsumeAmmo(Player player) - { - if (player.FindBuffIndex(mod.BuffType("EnchantmentSolution")) != -1) - { - if (Main.rand.Next(0, 100) <= 50) - return false; - } - if (player.FindBuffIndex(mod.BuffType("AmplifiedEnchantmentSolution")) != -1) - { - if (Main.rand.Next(0, 100) <= 70) - return false; - } - return true; - } + public override bool ConsumeAmmo(Player player) + { + if (player.FindBuffIndex(mod.BuffType("EnchantmentSolution")) != -1) + { + if (Main.rand.Next(0, 100) <= 50) + return false; + } + if (player.FindBuffIndex(mod.BuffType("AmplifiedEnchantmentSolution")) != -1) + { + if (Main.rand.Next(0, 100) <= 70) + return false; + } + return true; + } - public override Vector2? HoldoutOffset() - { - return new Vector2(-12, -4); - } + public override Vector2? HoldoutOffset() + { + return new Vector2(-12, -4); + } - public override void UpdateInventory(Player player) - { - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) - { - item.autoReuse = true; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) - { - item.autoReuse = false; - } - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) - { - item.shootSpeed = 14f; - } - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) - { - item.shootSpeed = 6f; - } - } + public override void UpdateInventory(Player player) + { + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) + { + item.autoReuse = true; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) + { + item.autoReuse = false; + } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) + { + item.shootSpeed = 14f; + } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) + { + item.shootSpeed = 6f; + } + } - public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - MPlayer modPlayer = player.GetModPlayer(mod); - if (modPlayer.glove) - { - for (int i = 0; i < 1; ++i) - { - if (player.FindBuffIndex(mod.BuffType("BottledSpirit")) != -1) - { - Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 297, damage, knockBack, Main.myPlayer); - } - if (player.FindBuffIndex(mod.BuffType("BigBottledSpirit")) != -1) - { - Projectile.NewProjectile(position.X, position.Y, speedX + 3, speedY + 3, 297, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 297, damage, knockBack, Main.myPlayer); - } - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - int k = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Main.projectile[k].friendly = true; - } - return false; - } - if (player.FindBuffIndex(mod.BuffType("BottledSpirit")) != -1 && !modPlayer.glove) - { - for (int i = 0; i < 1; ++i) - { - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, 297, damage, knockBack, Main.myPlayer); - int k = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Main.projectile[k].friendly = true; - } - return false; - } - if (player.FindBuffIndex(mod.BuffType("BigBottledSpirit")) != -1 && !modPlayer.glove) - { - for (int i = 0; i < 1; ++i) - { - Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 297, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, 297, damage, knockBack, Main.myPlayer); - int k = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Main.projectile[k].friendly = true; - } - return false; - } - return true; - } - } + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + MPlayer modPlayer = player.GetModPlayer(mod); + if (modPlayer.glove) + { + for (int i = 0; i < 1; ++i) + { + if (player.FindBuffIndex(mod.BuffType("BottledSpirit")) != -1) + { + Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 297, damage, knockBack, Main.myPlayer); + } + if (player.FindBuffIndex(mod.BuffType("BigBottledSpirit")) != -1) + { + Projectile.NewProjectile(position.X, position.Y, speedX + 3, speedY + 3, 297, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 297, damage, knockBack, Main.myPlayer); + } + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + int k = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Main.projectile[k].friendly = true; + } + return false; + } + if (player.FindBuffIndex(mod.BuffType("BottledSpirit")) != -1 && !modPlayer.glove) + { + for (int i = 0; i < 1; ++i) + { + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, 297, damage, knockBack, Main.myPlayer); + int k = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Main.projectile[k].friendly = true; + } + return false; + } + if (player.FindBuffIndex(mod.BuffType("BigBottledSpirit")) != -1 && !modPlayer.glove) + { + for (int i = 0; i < 1; ++i) + { + Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 297, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, 297, damage, knockBack, Main.myPlayer); + int k = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Main.projectile[k].friendly = true; + } + return false; + } + return true; + } + } } diff --git a/Items/NightsWatch.cs b/Items/NightsWatch.cs index 6650a135..664fe18c 100644 --- a/Items/NightsWatch.cs +++ b/Items/NightsWatch.cs @@ -4,47 +4,49 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class NightsWatch : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class NightsWatch : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 44; - item.value = 10000; - item.rare = 3; - item.defense = 6; - item.accessory = true; - } + item.width = 22; + item.height = 44; + item.value = 10000; + item.rare = 3; + item.defense = 6; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Night's Watch"); - Tooltip.SetDefault("8% increased magic, melee and minion damage\nIncreases maximum mana and health by 60\nIncreases melee and magic critical strike chance by 10"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Night's Watch"); + Tooltip.SetDefault("8% increased magic, melee and minion damage\nIncreases maximum mana and health by 60\nIncreases melee and magic critical strike chance by 10"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.magicDamage += 0.08f; - player.minionDamage += 0.08f; - player.meleeDamage += 0.08f; - player.statManaMax2 += 60; - player.statLifeMax2 += 60; - player.meleeCrit += 10; - player.magicCrit += 10; - } + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.magicDamage += 0.08f; + player.minionDamage += 0.08f; + player.meleeDamage += 0.08f; + player.statManaMax2 += 60; + player.statLifeMax2 += 60; + player.meleeCrit += 10; + player.magicCrit += 10; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "JungleWrath", 1); - recipe.AddIngredient(null, "DemoniteProtector", 1); - recipe.AddIngredient(null, "WaterStorm", 1); - recipe.AddIngredient(null, "Candent", 1); - recipe.SetResult(this); - recipe.AddTile(null, "GreatAnvilTile"); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "JungleWrath", 1); + recipe.AddIngredient(null, "DemoniteProtector", 1); + recipe.AddIngredient(null, "WaterStorm", 1); + recipe.AddIngredient(null, "Candent", 1); + recipe.SetResult(this); + recipe.AddTile(null, "GreatAnvilTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Nitro.cs b/Items/Nitro.cs index 37587721..6a8446d5 100644 --- a/Items/Nitro.cs +++ b/Items/Nitro.cs @@ -4,44 +4,46 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Nitro : ModItem +namespace Tremor.Items { - public override bool CanEquipAccessory(Player player, int slot) - { - for(int i=0; i < player.armor.Length; i++) - { - MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - if(modPlayer.nitro == true) - { - return false; - } - } - return true; - } + public class Nitro : ModItem + { + public override bool CanEquipAccessory(Player player, int slot) + { + for (int i = 0; i < player.armor.Length; i++) + { + MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); + if (modPlayer.nitro == true) + { + return false; + } + } + return true; + } - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 44; + item.width = 22; + item.height = 44; - item.value = 250000; - item.rare = 6; - item.accessory = true; - } + item.value = 250000; + item.rare = 6; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("The Nitro"); - Tooltip.SetDefault("Alchemical flasks leave death flames"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("The Nitro"); + Tooltip.SetDefault("Alchemical flasks leave death flames"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - player.AddBuff(mod.BuffType("NitroBuff"), 2); - modPlayer.nitro = true; - } -}} + public override void UpdateAccessory(Player player, bool hideVisual) + { + MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); + player.AddBuff(mod.BuffType("NitroBuff"), 2); + modPlayer.nitro = true; + } + } +} diff --git a/Items/NorthAxe.cs b/Items/NorthAxe.cs index 0f9c6193..78b16834 100644 --- a/Items/NorthAxe.cs +++ b/Items/NorthAxe.cs @@ -4,32 +4,34 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class NorthAxe : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class NorthAxe : ModItem + { + public override void SetDefaults() + { - item.damage = 5; - item.melee = true; - item.width = 36; - item.height = 36; - item.useTime = 20; - item.useAnimation = 20; - item.axe = 9; - item.useStyle = 1; - item.knockBack = 3; - item.value = 100; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 5; + item.melee = true; + item.width = 36; + item.height = 36; + item.useTime = 20; + item.useAnimation = 20; + item.axe = 9; + item.useStyle = 1; + item.knockBack = 3; + item.value = 100; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("North Axe"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("North Axe"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/NorthCutlass.cs b/Items/NorthCutlass.cs index fee8a4a6..417b0b9e 100644 --- a/Items/NorthCutlass.cs +++ b/Items/NorthCutlass.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class NorthCutlass : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class NorthCutlass : ModItem + { + public override void SetDefaults() + { - item.damage = 16; - item.melee = true; - item.width = 36; - item.height = 36; - item.useTime = 20; - item.useAnimation = 20; - item.useStyle = 1; - item.knockBack = 3; - item.value = 100; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 16; + item.melee = true; + item.width = 36; + item.height = 36; + item.useTime = 20; + item.useAnimation = 20; + item.useStyle = 1; + item.knockBack = 3; + item.value = 100; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("North Cutlass"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("North Cutlass"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/NorthHammer.cs b/Items/NorthHammer.cs index 0953bacf..daab64df 100644 --- a/Items/NorthHammer.cs +++ b/Items/NorthHammer.cs @@ -4,32 +4,34 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class NorthHammer : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class NorthHammer : ModItem + { + public override void SetDefaults() + { - item.damage = 8; - item.melee = true; - item.width = 36; - item.height = 36; - item.useTime = 20; - item.useAnimation = 20; - item.hammer = 40; - item.useStyle = 1; - item.knockBack = 3; - item.value = 100; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 8; + item.melee = true; + item.width = 36; + item.height = 36; + item.useTime = 20; + item.useAnimation = 20; + item.hammer = 40; + item.useStyle = 1; + item.knockBack = 3; + item.value = 100; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("North Hammer"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("North Hammer"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/NorthStaff.cs b/Items/NorthStaff.cs index 30ca85d7..2c62bed1 100644 --- a/Items/NorthStaff.cs +++ b/Items/NorthStaff.cs @@ -31,26 +31,26 @@ public override void SetDefaults() item.buffTime = 3600; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("North Staff"); - Tooltip.SetDefault("Summons a north wind to fight for you."); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("North Staff"); + Tooltip.SetDefault("Summons a north wind to fight for you."); + } public override bool AltFunctionUse(Player player) { return true; } - + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { return player.altFunctionUse != 2; } - + public override bool UseItem(Player player) { - if(player.altFunctionUse == 2) + if (player.altFunctionUse == 2) { player.MinionNPCTargetAim(); } diff --git a/Items/NovaBand.cs b/Items/NovaBand.cs index 6133714a..0de11aa3 100644 --- a/Items/NovaBand.cs +++ b/Items/NovaBand.cs @@ -13,20 +13,20 @@ public override void SetDefaults() { item.CloneDefaults(ItemID.Carrot); - item.rare = 11; - item.value = 380000; - item.useTime = 25; - item.useAnimation = 25; + item.rare = 11; + item.value = 380000; + item.useTime = 25; + item.useAnimation = 25; item.shoot = mod.ProjectileType("Warkee"); item.buffType = mod.BuffType("WarkeeBuff"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nova Band"); - Tooltip.SetDefault("Summons a warkee"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nova Band"); + Tooltip.SetDefault("Summons a warkee"); + } public override void UseStyle(Player player) @@ -37,14 +37,14 @@ public override void UseStyle(Player player) } } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "UnchargedBand"); - recipe.AddIngredient(null, "NovaFragment", 10); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "UnchargedBand"); + recipe.AddIngredient(null, "NovaFragment", 10); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } } } diff --git a/Items/NovaRing.cs b/Items/NovaRing.cs index 6659c8eb..5d15317b 100644 --- a/Items/NovaRing.cs +++ b/Items/NovaRing.cs @@ -4,42 +4,44 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class NovaRing : ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 30; - item.height = 24; - item.value = 250000; - item.rare = 8; - item.accessory = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nova Ring "); - Tooltip.SetDefault("20% increased alchemic damage\nIncreases alchemic critical strike chance by 14"); - } - - - public override void UpdateAccessory(Player player, bool hideVisual) - - { - player.GetModPlayer(mod).alchemistDamage += 0.2f; - player.GetModPlayer(mod).alchemistCrit += 14; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "NovaFragment", 10); - recipe.AddIngredient(3467, 15); - recipe.AddIngredient(null, "Band"); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } -}} + public class NovaRing : ModItem + { + + public override void SetDefaults() + { + + item.width = 30; + item.height = 24; + item.value = 250000; + item.rare = 8; + item.accessory = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nova Ring "); + Tooltip.SetDefault("20% increased alchemic damage\nIncreases alchemic critical strike chance by 14"); + } + + + public override void UpdateAccessory(Player player, bool hideVisual) + + { + player.GetModPlayer(mod).alchemistDamage += 0.2f; + player.GetModPlayer(mod).alchemistCrit += 14; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "NovaFragment", 10); + recipe.AddIngredient(3467, 15); + recipe.AddIngredient(null, "Band"); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } +} diff --git a/Items/NuclearStar.cs b/Items/NuclearStar.cs index 0a71bfbb..5483e275 100644 --- a/Items/NuclearStar.cs +++ b/Items/NuclearStar.cs @@ -8,67 +8,69 @@ using Terraria.ModLoader; using Tremor.Items; -namespace Tremor.Items { -public class NuclearStar : ModItem +namespace Tremor.Items { - - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + public class NuclearStar : ModItem { - float spread = 45f * 0.0174f; - double startAngle = Math.Atan2(speedX, speedY)- spread/2; - double deltaAngle = spread/8f; - double offsetAngle; - int i; - for (i = 0; i < 4; i++ ) - { - offsetAngle = (startAngle + deltaAngle * ( i + i * i ) / 2f ) + 32f * i; - Terraria.Projectile.NewProjectile(position.X, position.Y, (float)( Math.Sin(offsetAngle) * 5f ), (float)( Math.Cos(offsetAngle) * 5f ), item.shoot, damage, knockBack, item.owner); - Terraria.Projectile.NewProjectile(position.X, position.Y, (float)( -Math.Sin(offsetAngle) * 5f ), (float)( -Math.Cos(offsetAngle) * 5f ), item.shoot, damage, knockBack, item.owner); - } - return false; - } - public override void SetDefaults() - { + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + float spread = 45f * 0.0174f; + double startAngle = Math.Atan2(speedX, speedY) - spread / 2; + double deltaAngle = spread / 8f; + double offsetAngle; + int i; + for (i = 0; i < 4; i++) + { + offsetAngle = (startAngle + deltaAngle * (i + i * i) / 2f) + 32f * i; + Terraria.Projectile.NewProjectile(position.X, position.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), item.shoot, damage, knockBack, item.owner); + Terraria.Projectile.NewProjectile(position.X, position.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), item.shoot, damage, knockBack, item.owner); + } + return false; + } + + public override void SetDefaults() + { - item.damage = 500; - item.magic = true; - item.mana = 50; - item.useTime = 60; - item.useAnimation = 60; - item.knockBack = 5; - item.value = 2500000; - item.rare = 9; - item.UseSound = SoundID.Item84; - item.autoReuse = true; - item.width = 28; - item.height = 30; - item.useStyle = 5; + item.damage = 500; + item.magic = true; + item.mana = 50; + item.useTime = 60; + item.useAnimation = 60; + item.knockBack = 5; + item.value = 2500000; + item.rare = 9; + item.UseSound = SoundID.Item84; + item.autoReuse = true; + item.width = 28; + item.height = 30; + item.useStyle = 5; - item.noMelee = true; - item.shoot = mod.ProjectileType("NuclearStarPro"); - item.shootSpeed = 20f; - } + item.noMelee = true; + item.shoot = mod.ProjectileType("NuclearStarPro"); + item.shootSpeed = 20f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nuclear Star"); - Tooltip.SetDefault("Creates nuclear beams."); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nuclear Star"); + Tooltip.SetDefault("Creates nuclear beams."); + } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "StarBar", 25); - recipe.AddIngredient(null, "SoulofFight", 25); - recipe.AddIngredient(ItemID.LunarBar, 30); - recipe.AddIngredient(ItemID.Amber, 16); - recipe.AddIngredient(null, "Blasticyde", 10); - recipe.AddIngredient(null, "AngryShard", 15); - recipe.AddTile(null, "StarvilTile"); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "StarBar", 25); + recipe.AddIngredient(null, "SoulofFight", 25); + recipe.AddIngredient(ItemID.LunarBar, 30); + recipe.AddIngredient(ItemID.Amber, 16); + recipe.AddIngredient(null, "Blasticyde", 10); + recipe.AddIngredient(null, "AngryShard", 15); + recipe.AddTile(null, "StarvilTile"); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Obscuritron.cs b/Items/Obscuritron.cs index d19af679..a46d26fc 100644 --- a/Items/Obscuritron.cs +++ b/Items/Obscuritron.cs @@ -5,41 +5,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Obscuritron : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.autoReuse = true; + public class Obscuritron : ModItem + { + public override void SetDefaults() + { + item.autoReuse = true; - item.useStyle = 1; - item.useAnimation = 25; - item.useTime = 25; - item.knockBack = 5.5f; - item.width = 40; - item.height = 40; - item.damage = 260; - item.scale = 1.15f; - item.UseSound = SoundID.Item1; - item.rare = 11; - item.value = 430000; - item.melee = true; - } + item.useStyle = 1; + item.useAnimation = 25; + item.useTime = 25; + item.knockBack = 5.5f; + item.width = 40; + item.height = 40; + item.damage = 260; + item.scale = 1.15f; + item.UseSound = SoundID.Item1; + item.rare = 11; + item.value = 430000; + item.melee = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Obscuritron"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Obscuritron"); + Tooltip.SetDefault(""); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if(Main.rand.Next(3) == 0) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, mod.DustType("NightmareFlame")); - } - } + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.Next(3) == 0) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, mod.DustType("NightmareFlame")); + } + } public override void AddRecipes() { @@ -52,4 +53,5 @@ public override void AddRecipes() recipe.SetResult(this); recipe.AddRecipe(); } -}} + } +} diff --git a/Items/ObserverBanner.cs b/Items/ObserverBanner.cs index 7afb1466..2a578083 100644 --- a/Items/ObserverBanner.cs +++ b/Items/ObserverBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ObserverBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ObserverBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 36; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 36; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Observer Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Observer Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/ObsidianHeart.cs b/Items/ObsidianHeart.cs index 61b084e8..15b144a5 100644 --- a/Items/ObsidianHeart.cs +++ b/Items/ObsidianHeart.cs @@ -4,42 +4,44 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ObsidianHeart : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.width = 22; - item.height = 44; - - - item.value = 1200; - item.rare = 2; - item.accessory = true; - item.defense = 4; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Obsidian Heart"); - Tooltip.SetDefault("Increases life regeneration\nGrants immunity to fire blocks"); - } - - - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.lifeRegen +=1; - player.fireWalk = true; - } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "HeartofAtis", 1); - recipe.AddIngredient(ItemID.ObsidianSkull, 1); - recipe.SetResult(this); - recipe.AddTile(114); - recipe.AddRecipe(); - } - -}} + public class ObsidianHeart : ModItem + { + public override void SetDefaults() + { + + item.width = 22; + item.height = 44; + + + item.value = 1200; + item.rare = 2; + item.accessory = true; + item.defense = 4; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Obsidian Heart"); + Tooltip.SetDefault("Increases life regeneration\nGrants immunity to fire blocks"); + } + + + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.lifeRegen += 1; + player.fireWalk = true; + } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "HeartofAtis", 1); + recipe.AddIngredient(ItemID.ObsidianSkull, 1); + recipe.SetResult(this); + recipe.AddTile(114); + recipe.AddRecipe(); + } + + } +} diff --git a/Items/ObsidianSaber.cs b/Items/ObsidianSaber.cs index a2a3b1a4..4b65b424 100644 --- a/Items/ObsidianSaber.cs +++ b/Items/ObsidianSaber.cs @@ -18,11 +18,11 @@ public override void SetDefaults() } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Obsidian Saber"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Obsidian Saber"); + Tooltip.SetDefault(""); + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) @@ -31,15 +31,15 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX return base.Shoot(player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Obsidian, 100); - recipe.AddIngredient(ItemID.SoulofNight, 15); - recipe.AddIngredient(ItemID.SoulofLight, 15); - recipe.SetResult(this); - recipe.AddTile(null, "GreatAnvilTile"); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Obsidian, 100); + recipe.AddIngredient(ItemID.SoulofNight, 15); + recipe.AddIngredient(ItemID.SoulofLight, 15); + recipe.SetResult(this); + recipe.AddTile(null, "GreatAnvilTile"); + recipe.AddRecipe(); + } } } diff --git a/Items/OceanAmulet.cs b/Items/OceanAmulet.cs index cb30ac6d..c998cfaf 100644 --- a/Items/OceanAmulet.cs +++ b/Items/OceanAmulet.cs @@ -6,32 +6,34 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class OceanAmulet : ModItem +namespace Tremor.Items { + public class OceanAmulet : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 38; - item.height = 34; + item.width = 38; + item.height = 34; - item.rare = 5; - item.accessory = true; - item.value = 50000; - } + item.rare = 5; + item.accessory = true; + item.value = 50000; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ocean Amulet"); - Tooltip.SetDefault("Extends underwater breathing\nIncreases fishing skill by 12 and allows to detect catched fish"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ocean Amulet"); + Tooltip.SetDefault("Extends underwater breathing\nIncreases fishing skill by 12 and allows to detect catched fish"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.fishingSkill += 12; - player.accDivingHelm = true; - player.AddBuff(122, 60, true); - } -}} + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.fishingSkill += 12; + player.accDivingHelm = true; + player.AddBuff(122, 60, true); + } + } +} diff --git a/Items/OceanBate.cs b/Items/OceanBate.cs index 8d4f16c9..40403824 100644 --- a/Items/OceanBate.cs +++ b/Items/OceanBate.cs @@ -5,36 +5,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class OceanBate : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class OceanBate : ModItem + { + public override void SetDefaults() + { - item.damage = 168; - item.ranged = true; - item.melee = false; - item.width = 28; - item.height = 52; - item.useTime = 15; - item.useAnimation = 15; - item.useAmmo = AmmoID.Arrow; - item.useStyle = 5; - item.shootSpeed = 30f; - item.knockBack = 3; - item.value = 85000; - item.rare = 10; - item.shoot = 408; - item.shootSpeed = 19f; - item.UseSound = SoundID.Item5; - item.autoReuse = true; - } + item.damage = 168; + item.ranged = true; + item.melee = false; + item.width = 28; + item.height = 52; + item.useTime = 15; + item.useAnimation = 15; + item.useAmmo = AmmoID.Arrow; + item.useStyle = 5; + item.shootSpeed = 30f; + item.knockBack = 3; + item.value = 85000; + item.rare = 10; + item.shoot = 408; + item.shootSpeed = 19f; + item.UseSound = SoundID.Item5; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ocean Bate"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ocean Bate"); + Tooltip.SetDefault(""); + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) @@ -43,17 +44,17 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX return base.Shoot(player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "SeaFragment", 25); - recipe.AddIngredient(ItemID.Coral, 20); - recipe.AddIngredient(ItemID.SharkFin, 8); - recipe.AddIngredient(null, "ConcentratedEther", 25); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "SeaFragment", 25); + recipe.AddIngredient(ItemID.Coral, 20); + recipe.AddIngredient(ItemID.SharkFin, 8); + recipe.AddIngredient(null, "ConcentratedEther", 25); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } -} + } } diff --git a/Items/OgreBanner.cs b/Items/OgreBanner.cs index d3e5f6d2..b1b4a37a 100644 --- a/Items/OgreBanner.cs +++ b/Items/OgreBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class OgreBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class OgreBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 104; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 104; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ogre Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ogre Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/OldInvarPlate.cs b/Items/OldInvarPlate.cs index 26206c5e..415451a0 100644 --- a/Items/OldInvarPlate.cs +++ b/Items/OldInvarPlate.cs @@ -4,24 +4,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class OldInvarPlate : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class OldInvarPlate : ModItem + { + public override void SetDefaults() + { - item.width = 28; - item.height = 30; - item.maxStack = 99; - item.value = 25; - item.rare = 1; - } + item.width = 28; + item.height = 30; + item.maxStack = 99; + item.value = 25; + item.rare = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Old Invar Plate"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Old Invar Plate"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/OmegaWolfBanner.cs b/Items/OmegaWolfBanner.cs index fc585427..9afa80b7 100644 --- a/Items/OmegaWolfBanner.cs +++ b/Items/OmegaWolfBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class OmegaWolfBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class OmegaWolfBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 21; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 21; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Omega Wolf Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Omega Wolf Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/OmnikronBar.cs b/Items/OmnikronBar.cs index 2818b15b..0ea411be 100644 --- a/Items/OmnikronBar.cs +++ b/Items/OmnikronBar.cs @@ -6,30 +6,32 @@ using Microsoft.Xna.Framework; using Terraria.DataStructures; -namespace Tremor.Items { -public class OmnikronBar : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class OmnikronBar : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 10000; - item.rare = 0; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 10000; + item.rare = 0; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Omnikron Bar"); - Tooltip.SetDefault(""); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(8, 4)); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Omnikron Bar"); + Tooltip.SetDefault(""); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(8, 4)); + } - - public override void ModifyTooltips(System.Collections.Generic.List tooltips) - { - tooltips[0].overrideColor = new Color(238, 194, 73); - } - -}} + + public override void ModifyTooltips(System.Collections.Generic.List tooltips) + { + tooltips[0].overrideColor = new Color(238, 194, 73); + } + + } +} diff --git a/Items/OmnikronBreastplate.cs b/Items/OmnikronBreastplate.cs index 2ef5529d..0773dfc8 100644 --- a/Items/OmnikronBreastplate.cs +++ b/Items/OmnikronBreastplate.cs @@ -7,8 +7,8 @@ using System.Collections.Generic; namespace Tremor.Items -{ -[AutoloadEquip(EquipType.Body)] +{ + [AutoloadEquip(EquipType.Body)] public class OmnikronBreastplate : ModItem { public override void SetDefaults() @@ -22,35 +22,35 @@ public override void SetDefaults() item.defense = 40; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Omnikron Breastplate"); - Tooltip.SetDefault("Increases all damage by 20%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Omnikron Breastplate"); + Tooltip.SetDefault("Increases all damage by 20%"); + } + - public override void ModifyTooltips(System.Collections.Generic.List tooltips) - { - tooltips[0].overrideColor = new Color(238, 194, 73); - } - + { + tooltips[0].overrideColor = new Color(238, 194, 73); + } + public override void UpdateEquip(Player player) { - player.magicDamage += 0.2f; - player.minionDamage += 0.2f; - player.meleeDamage += 0.2f; - player.rangedDamage += 0.2f; - player.thrownDamage += 0.2f; - player.GetModPlayer(mod).alchemistDamage += 0.2f; + player.magicDamage += 0.2f; + player.minionDamage += 0.2f; + player.meleeDamage += 0.2f; + player.rangedDamage += 0.2f; + player.thrownDamage += 0.2f; + player.GetModPlayer(mod).alchemistDamage += 0.2f; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "OmnikronBar", 26); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "OmnikronBar", 26); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } } } diff --git a/Items/OmnikronGreaves.cs b/Items/OmnikronGreaves.cs index 60a2d536..6dc062dc 100644 --- a/Items/OmnikronGreaves.cs +++ b/Items/OmnikronGreaves.cs @@ -6,51 +6,54 @@ using Microsoft.Xna.Framework; using System.Collections.Generic; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class OmnikronGreaves : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Legs)] + public class OmnikronGreaves : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { + + item.width = 38; + item.height = 22; - item.width = 38; - item.height = 22; + item.value = 0; + item.rare = 0; + item.defense = 24; + } - item.value = 0; - item.rare = 0; - item.defense = 24; - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Omnikron Greaves"); + Tooltip.SetDefault("50% increased movement speed\nIncreases all critical strike chances by 15"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Omnikron Greaves"); - Tooltip.SetDefault("50% increased movement speed\nIncreases all critical strike chances by 15"); - } - - public override void ModifyTooltips(System.Collections.Generic.List tooltips) - { - tooltips[0].overrideColor = new Color(238, 194, 73); - } + public override void ModifyTooltips(System.Collections.Generic.List tooltips) + { + tooltips[0].overrideColor = new Color(238, 194, 73); + } public override void UpdateEquip(Player player) { player.moveSpeed += 0.5f; - player.meleeCrit += 15; - player.magicCrit += 15; - player.rangedCrit += 15; - player.thrownCrit += 15; - player.GetModPlayer(mod).alchemistCrit += 15; + player.meleeCrit += 15; + player.magicCrit += 15; + player.rangedCrit += 15; + player.thrownCrit += 15; + player.GetModPlayer(mod).alchemistCrit += 15; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "OmnikronBar", 18); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "OmnikronBar", 18); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } -}} + } +} diff --git a/Items/OmnikronHeadgear.cs b/Items/OmnikronHeadgear.cs index 6c4c75b6..4a7b46e5 100644 --- a/Items/OmnikronHeadgear.cs +++ b/Items/OmnikronHeadgear.cs @@ -6,75 +6,78 @@ using Microsoft.Xna.Framework; using System.Collections.Generic; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class OmnikronHeadgear : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class OmnikronHeadgear : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 38; - item.height = 22; + item.width = 38; + item.height = 22; - item.value = 0; - item.rare = 0; - item.defense = 22; - } + item.value = 0; + item.rare = 0; + item.defense = 22; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Omnikron Headgear"); - Tooltip.SetDefault("Increases max health and mana by 100"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Omnikron Headgear"); + Tooltip.SetDefault("Increases max health and mana by 100"); + } - - public override void ModifyTooltips(System.Collections.Generic.List tooltips) - { - tooltips[0].overrideColor = new Color(238, 194, 73); - } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("OmnikronBreastplate") && legs.type == mod.ItemType("OmnikronGreaves"); - } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Calls ancient soul to protect you"; - player.AddBuff(mod.BuffType("Omnibuff"), 2); - if(Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y) > 1f && !player.rocketFrame) // Makes sure the player is actually moving - { - for (int k = 0; k < 2; k++) - { - int index= Dust.NewDust(new Vector2(player.position.X - player.velocity.X * 2f, player.position.Y - 2f - player.velocity.Y * 2f), player.width, player.height, 60, 0f, 0f, 100, default(Color), 2f); - Main.dust[index].noGravity = true; - Main.dust[index].noLight = true; - Dust dust = Main.dust[index]; - dust.velocity.X = dust.velocity.X - player.velocity.X * 0.5f; - dust.velocity.Y = dust.velocity.Y - player.velocity.Y * 0.5f; - } - } - } + public override void ModifyTooltips(System.Collections.Generic.List tooltips) + { + tooltips[0].overrideColor = new Color(238, 194, 73); + } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("OmnikronBreastplate") && legs.type == mod.ItemType("OmnikronGreaves"); + } + + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Calls ancient soul to protect you"; + player.AddBuff(mod.BuffType("Omnibuff"), 2); + if (Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y) > 1f && !player.rocketFrame) // Makes sure the player is actually moving + { + for (int k = 0; k < 2; k++) + { + int index = Dust.NewDust(new Vector2(player.position.X - player.velocity.X * 2f, player.position.Y - 2f - player.velocity.Y * 2f), player.width, player.height, 60, 0f, 0f, 100, default(Color), 2f); + Main.dust[index].noGravity = true; + Main.dust[index].noLight = true; + Dust dust = Main.dust[index]; + dust.velocity.X = dust.velocity.X - player.velocity.X * 0.5f; + dust.velocity.Y = dust.velocity.Y - player.velocity.Y * 0.5f; + } + } + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawOutlines=true; + player.armorEffectDrawOutlines = true; } public override void UpdateEquip(Player player) { - player.statLifeMax2 += 100; - player.statManaMax2 += 100; + player.statLifeMax2 += 100; + player.statManaMax2 += 100; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "OmnikronBar", 15); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "OmnikronBar", 15); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } +} diff --git a/Items/OmnikronHelmet.cs b/Items/OmnikronHelmet.cs index 3a08ae7c..91c548e7 100644 --- a/Items/OmnikronHelmet.cs +++ b/Items/OmnikronHelmet.cs @@ -6,78 +6,81 @@ using Microsoft.Xna.Framework; using System.Collections.Generic; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class OmnikronHelmet : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class OmnikronHelmet : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 38; - item.height = 22; + item.width = 38; + item.height = 22; - item.value = 0; - item.rare = 0; - item.defense = 22; - } + item.value = 0; + item.rare = 0; + item.defense = 22; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Omnikron Helmet"); - Tooltip.SetDefault("Increased all critical strike chances by 25%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Omnikron Helmet"); + Tooltip.SetDefault("Increased all critical strike chances by 25%"); + } - - public override void ModifyTooltips(System.Collections.Generic.List tooltips) - { - tooltips[0].overrideColor = new Color(238, 194, 73); - } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("OmnikronBreastplate") && legs.type == mod.ItemType("OmnikronGreaves"); - } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Calls ancient soul to protect you"; - player.AddBuff(mod.BuffType("Omnibuff"), 2); - if(Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y) > 1f && !player.rocketFrame) // Makes sure the player is actually moving - { - for (int k = 0; k < 2; k++) - { - int index= Dust.NewDust(new Vector2(player.position.X - player.velocity.X * 2f, player.position.Y - 2f - player.velocity.Y * 2f), player.width, player.height, 60, 0f, 0f, 100, default(Color), 2f); - Main.dust[index].noGravity = true; - Main.dust[index].noLight = true; - Dust dust = Main.dust[index]; - dust.velocity.X = dust.velocity.X - player.velocity.X * 0.5f; - dust.velocity.Y = dust.velocity.Y - player.velocity.Y * 0.5f; - } - } - } + public override void ModifyTooltips(System.Collections.Generic.List tooltips) + { + tooltips[0].overrideColor = new Color(238, 194, 73); + } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("OmnikronBreastplate") && legs.type == mod.ItemType("OmnikronGreaves"); + } + + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Calls ancient soul to protect you"; + player.AddBuff(mod.BuffType("Omnibuff"), 2); + if (Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y) > 1f && !player.rocketFrame) // Makes sure the player is actually moving + { + for (int k = 0; k < 2; k++) + { + int index = Dust.NewDust(new Vector2(player.position.X - player.velocity.X * 2f, player.position.Y - 2f - player.velocity.Y * 2f), player.width, player.height, 60, 0f, 0f, 100, default(Color), 2f); + Main.dust[index].noGravity = true; + Main.dust[index].noLight = true; + Dust dust = Main.dust[index]; + dust.velocity.X = dust.velocity.X - player.velocity.X * 0.5f; + dust.velocity.Y = dust.velocity.Y - player.velocity.Y * 0.5f; + } + } + } public override void UpdateEquip(Player player) { - player.meleeCrit += 25; - player.magicCrit += 25; - player.rangedCrit += 25; - player.thrownCrit += 25; - player.GetModPlayer(mod).alchemistCrit += 25; + player.meleeCrit += 25; + player.magicCrit += 25; + player.rangedCrit += 25; + player.thrownCrit += 25; + player.GetModPlayer(mod).alchemistCrit += 25; } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawOutlines=true; + player.armorEffectDrawOutlines = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "OmnikronBar", 15); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "OmnikronBar", 15); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } +} diff --git a/Items/OmnikronMask.cs b/Items/OmnikronMask.cs index 73dc7683..dc0fcb88 100644 --- a/Items/OmnikronMask.cs +++ b/Items/OmnikronMask.cs @@ -6,79 +6,82 @@ using Microsoft.Xna.Framework; using System.Collections.Generic; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class OmnikronMask : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class OmnikronMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 38; - item.height = 22; + item.width = 38; + item.height = 22; - item.value = 0; - item.rare = 0; - item.defense = 22; - } + item.value = 0; + item.rare = 0; + item.defense = 22; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Omnikron Mask"); - Tooltip.SetDefault("20% increased all damage"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Omnikron Mask"); + Tooltip.SetDefault("20% increased all damage"); + } - - public override void ModifyTooltips(System.Collections.Generic.List tooltips) - { - tooltips[0].overrideColor = new Color(238, 194, 73); - } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("OmnikronBreastplate") && legs.type == mod.ItemType("OmnikronGreaves"); - } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Calls ancient soul to protect you"; - player.AddBuff(mod.BuffType("Omnibuff"), 2); - if(Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y) > 1f && !player.rocketFrame) // Makes sure the player is actually moving - { - for (int k = 0; k < 2; k++) - { - int index= Dust.NewDust(new Vector2(player.position.X - player.velocity.X * 2f, player.position.Y - 2f - player.velocity.Y * 2f), player.width, player.height, 60, 0f, 0f, 100, default(Color), 2f); - Main.dust[index].noGravity = true; - Main.dust[index].noLight = true; - Dust dust = Main.dust[index]; - dust.velocity.X = dust.velocity.X - player.velocity.X * 0.5f; - dust.velocity.Y = dust.velocity.Y - player.velocity.Y * 0.5f; - } - } - } + public override void ModifyTooltips(System.Collections.Generic.List tooltips) + { + tooltips[0].overrideColor = new Color(238, 194, 73); + } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("OmnikronBreastplate") && legs.type == mod.ItemType("OmnikronGreaves"); + } + + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Calls ancient soul to protect you"; + player.AddBuff(mod.BuffType("Omnibuff"), 2); + if (Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y) > 1f && !player.rocketFrame) // Makes sure the player is actually moving + { + for (int k = 0; k < 2; k++) + { + int index = Dust.NewDust(new Vector2(player.position.X - player.velocity.X * 2f, player.position.Y - 2f - player.velocity.Y * 2f), player.width, player.height, 60, 0f, 0f, 100, default(Color), 2f); + Main.dust[index].noGravity = true; + Main.dust[index].noLight = true; + Dust dust = Main.dust[index]; + dust.velocity.X = dust.velocity.X - player.velocity.X * 0.5f; + dust.velocity.Y = dust.velocity.Y - player.velocity.Y * 0.5f; + } + } + } public override void UpdateEquip(Player player) { - player.magicDamage += 0.2f; - player.minionDamage += 0.2f; - player.meleeDamage += 0.2f; - player.rangedDamage += 0.2f; - player.thrownDamage += 0.2f; - player.GetModPlayer(mod).alchemistDamage += 0.2f; + player.magicDamage += 0.2f; + player.minionDamage += 0.2f; + player.meleeDamage += 0.2f; + player.rangedDamage += 0.2f; + player.thrownDamage += 0.2f; + player.GetModPlayer(mod).alchemistDamage += 0.2f; } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawOutlines=true; + player.armorEffectDrawOutlines = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "OmnikronBar", 15); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "OmnikronBar", 15); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Opal.cs b/Items/Opal.cs index f8209156..46323805 100644 --- a/Items/Opal.cs +++ b/Items/Opal.cs @@ -6,37 +6,39 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Opal : ModItem +namespace Tremor.Items { + public class Opal : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; -item.maxStack = 99; - item.height = 26; + item.width = 26; + item.maxStack = 99; + item.height = 26; - item.rare = 3; - } + item.rare = 3; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Opal"); - Tooltip.SetDefault("'The king of all gems'"); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 6)); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Opal"); + Tooltip.SetDefault("'The king of all gems'"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 6)); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Topaz, 1); - recipe.AddIngredient(ItemID.Amethyst, 1); - recipe.AddIngredient(ItemID.Emerald, 1); - recipe.AddIngredient(ItemID.Sapphire, 1); - recipe.AddIngredient(ItemID.Ruby, 1); - recipe.AddIngredient(ItemID.Diamond, 1); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Topaz, 1); + recipe.AddIngredient(ItemID.Amethyst, 1); + recipe.AddIngredient(ItemID.Emerald, 1); + recipe.AddIngredient(ItemID.Sapphire, 1); + recipe.AddIngredient(ItemID.Ruby, 1); + recipe.AddIngredient(ItemID.Diamond, 1); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Oppressor.cs b/Items/Oppressor.cs index 6cb35ad8..850d0cd6 100644 --- a/Items/Oppressor.cs +++ b/Items/Oppressor.cs @@ -7,31 +7,31 @@ namespace Tremor.Items { - public class Oppressor : ModItem - { - public override void SetDefaults() - { + public class Oppressor : ModItem + { + public override void SetDefaults() + { - item.damage = 67; - item.melee = true; - item.width = 35; - item.height = 20; - item.useTime = 20; - item.useAnimation = 20; - item.useStyle = 1; - item.knockBack = 20; - item.value = 150000; - item.rare = 8; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 67; + item.melee = true; + item.width = 35; + item.height = 20; + item.useTime = 20; + item.useAnimation = 20; + item.useStyle = 1; + item.knockBack = 20; + item.value = 150000; + item.rare = 8; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Oppressor"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Oppressor"); + Tooltip.SetDefault(""); + } + + } +} - } - } - diff --git a/Items/OrangeKnightBreastplate.cs b/Items/OrangeKnightBreastplate.cs index e6adadda..a52727b6 100644 --- a/Items/OrangeKnightBreastplate.cs +++ b/Items/OrangeKnightBreastplate.cs @@ -6,8 +6,8 @@ using Terraria.ModLoader; namespace Tremor.Items -{ -[AutoloadEquip(EquipType.Body)] +{ + [AutoloadEquip(EquipType.Body)] public class OrangeKnightBreastplate : ModItem { @@ -21,21 +21,21 @@ public override void SetDefaults() item.vanity = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Orange Knight Breastplate"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Orange Knight Breastplate"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GrayKnightBreastplate", 3); - recipe.AddIngredient(ItemID.Amber, 1); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GrayKnightBreastplate", 3); + recipe.AddIngredient(ItemID.Amber, 1); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } } } diff --git a/Items/OrangeKnightHelmet.cs b/Items/OrangeKnightHelmet.cs index 2a585b27..376783ab 100644 --- a/Items/OrangeKnightHelmet.cs +++ b/Items/OrangeKnightHelmet.cs @@ -7,7 +7,7 @@ namespace Tremor.Items { -[AutoloadEquip(EquipType.Head)] + [AutoloadEquip(EquipType.Head)] public class OrangeKnightHelmet : ModItem { @@ -21,21 +21,21 @@ public override void SetDefaults() item.vanity = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Orange Knight Helmet"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Orange Knight Helmet"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GrayKnightHelmet", 3); - recipe.AddIngredient(ItemID.Amber, 1); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GrayKnightHelmet", 3); + recipe.AddIngredient(ItemID.Amber, 1); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } } } diff --git a/Items/OrangeShelmet.cs b/Items/OrangeShelmet.cs index 5d424b86..6d9cef24 100644 --- a/Items/OrangeShelmet.cs +++ b/Items/OrangeShelmet.cs @@ -7,7 +7,7 @@ namespace Tremor.Items { -[AutoloadEquip(EquipType.Head)] + [AutoloadEquip(EquipType.Head)] public class OrangeShelmet : ModItem { @@ -21,11 +21,11 @@ public override void SetDefaults() item.defense = 6; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Orange Shelmet"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Orange Shelmet"); + Tooltip.SetDefault(""); + } } } diff --git a/Items/OrcBanner.cs b/Items/OrcBanner.cs index 46a57492..0e2dbd87 100644 --- a/Items/OrcBanner.cs +++ b/Items/OrcBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class OrcBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class OrcBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 8; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 8; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Orc Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Orc Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/OrcSkeletonBanner.cs b/Items/OrcSkeletonBanner.cs index 2658dd3d..cee737c7 100644 --- a/Items/OrcSkeletonBanner.cs +++ b/Items/OrcSkeletonBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class OrcSkeletonBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class OrcSkeletonBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 28; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 28; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Orc Skeleton Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Orc Skeleton Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/OrcWarriorBanner.cs b/Items/OrcWarriorBanner.cs index 4d53203e..37fcfe43 100644 --- a/Items/OrcWarriorBanner.cs +++ b/Items/OrcWarriorBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class OrcWarriorBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class OrcWarriorBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 9; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 9; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Orc Warrior Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Orc Warrior Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/OrcishBreastplate.cs b/Items/OrcishBreastplate.cs index dacdb022..4dbe6b6e 100644 --- a/Items/OrcishBreastplate.cs +++ b/Items/OrcishBreastplate.cs @@ -5,32 +5,34 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class OrcishBreastplate : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Body)] + public class OrcishBreastplate : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 18; + item.width = 26; + item.height = 18; - item.value = 600; - item.rare = 1; - item.defense = 4; - } + item.value = 600; + item.rare = 1; + item.defense = 4; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Orcish Breastplate"); - Tooltip.SetDefault("15% increased melee speed"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Orcish Breastplate"); + Tooltip.SetDefault("15% increased melee speed"); + } - public override void UpdateEquip(Player player) - { - player.meleeSpeed += 0.15f; - } + public override void UpdateEquip(Player player) + { + player.meleeSpeed += 0.15f; + } -}} + } +} diff --git a/Items/OrcishBroadsword.cs b/Items/OrcishBroadsword.cs index 9a96d9ee..2e475c80 100644 --- a/Items/OrcishBroadsword.cs +++ b/Items/OrcishBroadsword.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class OrcishBroadsword : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class OrcishBroadsword : ModItem + { + public override void SetDefaults() + { - item.damage = 20; - item.melee = true; - item.width = 48; - item.height = 48; - item.useTime = 30; - item.useAnimation = 20; - item.useStyle = 1; - item.knockBack = 2; - item.value = 2200; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 20; + item.melee = true; + item.width = 48; + item.height = 48; + item.useTime = 30; + item.useAnimation = 20; + item.useStyle = 1; + item.knockBack = 2; + item.value = 2200; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Orcish Broadsword"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Orcish Broadsword"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/OrcishGreaves.cs b/Items/OrcishGreaves.cs index 7a06418a..e5477731 100644 --- a/Items/OrcishGreaves.cs +++ b/Items/OrcishGreaves.cs @@ -4,32 +4,35 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class OrcishGreaves : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Legs)] + public class OrcishGreaves : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 18; - item.value = 500; + item.width = 22; + item.height = 18; + item.value = 500; - item.rare = 1; - item.defense = 3; - } + item.rare = 1; + item.defense = 3; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Orcish Greaves"); - Tooltip.SetDefault("7% increased melee damage"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Orcish Greaves"); + Tooltip.SetDefault("7% increased melee damage"); + } - public override void UpdateEquip(Player player) - { - player.meleeDamage += 0.07f; - } + public override void UpdateEquip(Player player) + { + player.meleeDamage += 0.07f; + } -}} + } +} diff --git a/Items/OrcishHelmet.cs b/Items/OrcishHelmet.cs index 50e0ecaf..88c1b0a2 100644 --- a/Items/OrcishHelmet.cs +++ b/Items/OrcishHelmet.cs @@ -4,44 +4,47 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class OrcishHelmet : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class OrcishHelmet : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 32; - item.height = 26; + item.width = 32; + item.height = 26; - item.value = 400; - item.rare = 1; - item.defense = 3; - } + item.value = 400; + item.rare = 1; + item.defense = 3; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Orcish Helmet"); - Tooltip.SetDefault("7% increased melee damage"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Orcish Helmet"); + Tooltip.SetDefault("7% increased melee damage"); + } - public override void UpdateEquip(Player player) - { - player.meleeDamage += 0.07f; - } + public override void UpdateEquip(Player player) + { + player.meleeDamage += 0.07f; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("OrcishBreastplate") && legs.type == mod.ItemType("OrcishGreaves"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("OrcishBreastplate") && legs.type == mod.ItemType("OrcishGreaves"); + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increased maximum defense by 2"; - player.statDefense += 2; - player.moveSpeed -= 0.1f; - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increased maximum defense by 2"; + player.statDefense += 2; + player.moveSpeed -= 0.1f; + } -}} + } +} diff --git a/Items/OrcishKnife.cs b/Items/OrcishKnife.cs index 863d1f8e..81670725 100644 --- a/Items/OrcishKnife.cs +++ b/Items/OrcishKnife.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class OrcishKnife : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class OrcishKnife : ModItem + { + public override void SetDefaults() + { - item.damage = 12; - item.melee = true; - item.width = 32; - item.height = 32; - item.useTime = 28; - item.useAnimation = 9; - item.useStyle = 3; - item.knockBack = 2; - item.value = 2200; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 12; + item.melee = true; + item.width = 32; + item.height = 32; + item.useTime = 28; + item.useAnimation = 9; + item.useStyle = 3; + item.knockBack = 2; + item.value = 2200; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Orcish Knife"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Orcish Knife"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/OrcishShield.cs b/Items/OrcishShield.cs index 1ddb594d..41dd8885 100644 --- a/Items/OrcishShield.cs +++ b/Items/OrcishShield.cs @@ -5,25 +5,27 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Shield)] -public class OrcishShield : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + [AutoloadEquip(EquipType.Shield)] + public class OrcishShield : ModItem + { + public override void SetDefaults() + { - item.width = 24; - item.height = 30; - item.value = 110; - item.rare = 1; - item.accessory = true; - item.defense = 2; - } + item.width = 24; + item.height = 30; + item.value = 110; + item.rare = 1; + item.accessory = true; + item.defense = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Orcish Shield"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Orcish Shield"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/OrganicShield.cs b/Items/OrganicShield.cs index 4efc81f2..d1695868 100644 --- a/Items/OrganicShield.cs +++ b/Items/OrganicShield.cs @@ -5,51 +5,53 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Shield)] -public class OrganicShield : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + [AutoloadEquip(EquipType.Shield)] + public class OrganicShield : ModItem + { + public override void SetDefaults() + { - item.width = 26; - item.height = 26; + item.width = 26; + item.height = 26; - item.value = 12600; - item.rare = 8; - item.accessory = true; - item.defense = 12; - } + item.value = 12600; + item.rare = 8; + item.accessory = true; + item.defense = 12; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Organic Shield"); - Tooltip.SetDefault("Gives health when in Corruption and Crimson"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Organic Shield"); + Tooltip.SetDefault("Gives health when in Corruption and Crimson"); + } - public override void UpdateEquip(Player player) - { - player.moveSpeed -= 0.30f; - player.aggro += 300; - if (player.ZoneCorrupt || player.ZoneCrimson) - { - player.statLifeMax2 += 100; - } - } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "MeatShield", 1); - recipe.AddIngredient(null, "DarkAbsorber", 1); - recipe.SetResult(this); - recipe.AddTile(114); - recipe.AddRecipe(); + public override void UpdateEquip(Player player) + { + player.moveSpeed -= 0.30f; + player.aggro += 300; + if (player.ZoneCorrupt || player.ZoneCrimson) + { + player.statLifeMax2 += 100; + } + } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "MeatShield", 1); + recipe.AddIngredient(null, "DarkAbsorber", 1); + recipe.SetResult(this); + recipe.AddTile(114); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "MeatShield", 1); - recipe.AddIngredient(null, "PatronoftheMind", 1); - recipe.SetResult(this); - recipe.AddTile(114); - recipe.AddRecipe(); - } -}} + recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "MeatShield", 1); + recipe.AddIngredient(null, "PatronoftheMind", 1); + recipe.SetResult(this); + recipe.AddTile(114); + recipe.AddRecipe(); + } + } +} diff --git a/Items/OrichalcumDisc.cs b/Items/OrichalcumDisc.cs index 35c21711..63785059 100644 --- a/Items/OrichalcumDisc.cs +++ b/Items/OrichalcumDisc.cs @@ -4,53 +4,55 @@ using Terraria.ModLoader; using Terraria.ID; -namespace Tremor.Items { -public class OrichalcumDisc : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class OrichalcumDisc : ModItem + { + public override void SetDefaults() + { - item.damage = 41; - item.thrown = true; - item.width = 48; - item.height = 48; - item.useTime = 20; - item.shootSpeed = 12f; - item.useAnimation = 20; - item.useStyle = 1; - item.knockBack = 3f; - item.shoot = mod.ProjectileType("OrichalcumDiscPro"); - item.value = 27600; - item.rare = 4; - item.noUseGraphic = true; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 41; + item.thrown = true; + item.width = 48; + item.height = 48; + item.useTime = 20; + item.shootSpeed = 12f; + item.useAnimation = 20; + item.useStyle = 1; + item.knockBack = 3f; + item.shoot = mod.ProjectileType("OrichalcumDiscPro"); + item.value = 27600; + item.rare = 4; + item.noUseGraphic = true; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Orichalcum Disc"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Orichalcum Disc"); + Tooltip.SetDefault(""); + } -public override bool CanUseItem(Player player) -{ - for (int i = 0; i < 1000; ++i) - { - if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) - { - return false; - } - } - return true; + public override bool CanUseItem(Player player) + { + for (int i = 0; i < 1000; ++i) + { + if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) + { + return false; + } + } + return true; + } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.OrichalcumBar, 12); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.OrichalcumBar, 12); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} diff --git a/Items/OrichalcumHeader.cs b/Items/OrichalcumHeader.cs index 2b848d56..a9f648eb 100644 --- a/Items/OrichalcumHeader.cs +++ b/Items/OrichalcumHeader.cs @@ -5,58 +5,61 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class OrichalcumHeader : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class OrichalcumHeader : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 26; + item.width = 22; + item.height = 26; - item.value = 400; - item.rare = 4; - item.defense = 6; - } + item.value = 400; + item.rare = 4; + item.defense = 6; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Orichalcum Header"); - Tooltip.SetDefault("Increases thrown damage by 20%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Orichalcum Header"); + Tooltip.SetDefault("Increases thrown damage by 20%"); + } - public override void UpdateEquip(Player player) - { - player.thrownDamage += 0.20f; - } + public override void UpdateEquip(Player player) + { + player.thrownDamage += 0.20f; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == 1213 && legs.type == 1214; - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == 1213 && legs.type == 1214; + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increases thrown weapon velocity and flower petals will fall on your target for extra damage"; - player.thrownVelocity +=0.25f; -player.onHitPetal = true; - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increases thrown weapon velocity and flower petals will fall on your target for extra damage"; + player.thrownVelocity += 0.25f; + player.onHitPetal = true; + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawShadowSubtle=true; + player.armorEffectDrawShadowSubtle = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.OrichalcumBar, 12); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.OrichalcumBar, 12); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/OrichalcumHeadgear.cs b/Items/OrichalcumHeadgear.cs index aefb93fd..bdf5f66a 100644 --- a/Items/OrichalcumHeadgear.cs +++ b/Items/OrichalcumHeadgear.cs @@ -5,58 +5,61 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class OrichalcumHeadgear : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class OrichalcumHeadgear : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 26; + item.width = 22; + item.height = 26; - item.value = 400; - item.rare = 4; - item.defense = 6; - } + item.value = 400; + item.rare = 4; + item.defense = 6; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Orichalcum Headgear"); - Tooltip.SetDefault("Increases minion damage by 20%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Orichalcum Headgear"); + Tooltip.SetDefault("Increases minion damage by 20%"); + } - public override void UpdateEquip(Player player) - { - player.minionDamage += 0.20f; - } + public override void UpdateEquip(Player player) + { + player.minionDamage += 0.20f; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == 1213 && legs.type == 1214; - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == 1213 && legs.type == 1214; + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increases your max number of minions and flower petals will fall on your target for extra damage"; - player.maxMinions += 2; -player.onHitPetal = true; - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increases your max number of minions and flower petals will fall on your target for extra damage"; + player.maxMinions += 2; + player.onHitPetal = true; + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawShadowSubtle=true; + player.armorEffectDrawShadowSubtle = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.OrichalcumBar, 12); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.OrichalcumBar, 12); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/OrichalcumRifle.cs b/Items/OrichalcumRifle.cs index 2e532329..1900e41f 100644 --- a/Items/OrichalcumRifle.cs +++ b/Items/OrichalcumRifle.cs @@ -5,47 +5,49 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class OrichalcumRifle : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class OrichalcumRifle : ModItem + { + public override void SetDefaults() + { - item.damage = 40; - item.ranged = true; - item.width = 40; - item.height = 20; - item.useTime = 15; - item.useAnimation = 15; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 6; - item.value = 10000; - item.rare = 4; - item.UseSound = SoundID.Item11; - item.autoReuse = true; - item.shoot = 10; - item.shootSpeed = 12f; - item.useAmmo = AmmoID.Bullet; - } + item.damage = 40; + item.ranged = true; + item.width = 40; + item.height = 20; + item.useTime = 15; + item.useAnimation = 15; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 6; + item.value = 10000; + item.rare = 4; + item.UseSound = SoundID.Item11; + item.autoReuse = true; + item.shoot = 10; + item.shootSpeed = 12f; + item.useAmmo = AmmoID.Bullet; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Orichalcum Rifle"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Orichalcum Rifle"); + Tooltip.SetDefault(""); + } - public override Vector2? HoldoutOffset() - { - return new Vector2(-15, 0); - } + public override Vector2? HoldoutOffset() + { + return new Vector2(-15, 0); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.OrichalcumBar, 15); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.OrichalcumBar, 15); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/OrichalcumStaff.cs b/Items/OrichalcumStaff.cs index e4b72113..cfeddd22 100644 --- a/Items/OrichalcumStaff.cs +++ b/Items/OrichalcumStaff.cs @@ -5,54 +5,56 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class OrichalcumStaff : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class OrichalcumStaff : ModItem + { + public override void SetDefaults() + { - item.damage = 30; - item.magic = true; - item.mana = 8; - item.width = 40; - item.height = 40; - item.useTime = 38; - item.useAnimation = 38; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 3; - item.value = 18440; - item.rare = 4; - item.UseSound = SoundID.Item91; - item.autoReuse = true; - Item.staff[item.type] = true; //this makes the useStyle animate as a staff instead of as a gun - item.shoot = mod.ProjectileType("OrichalcumBolt"); - item.shootSpeed = 15f; - } + item.damage = 30; + item.magic = true; + item.mana = 8; + item.width = 40; + item.height = 40; + item.useTime = 38; + item.useAnimation = 38; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 3; + item.value = 18440; + item.rare = 4; + item.UseSound = SoundID.Item91; + item.autoReuse = true; + Item.staff[item.type] = true; //this makes the useStyle animate as a staff instead of as a gun + item.shoot = mod.ProjectileType("OrichalcumBolt"); + item.shootSpeed = 15f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Orichalcum Staff"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Orichalcum Staff"); + Tooltip.SetDefault(""); + } -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) -{ - for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. - { - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); - } - return false; + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. + { + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); + } + return false; + } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.OrichalcumBar, 12); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.OrichalcumBar, 12); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} diff --git a/Items/OrichalcumVisage.cs b/Items/OrichalcumVisage.cs index 660b647e..8868e097 100644 --- a/Items/OrichalcumVisage.cs +++ b/Items/OrichalcumVisage.cs @@ -7,52 +7,52 @@ namespace Tremor.Items { -[AutoloadEquip(EquipType.Head)] - public class OrichalcumVisage : ModItem - { - - public override void SetDefaults() - { - - item.width = 22; - item.height = 26; - - item.value = 400; - item.rare = 4; - item.defense = 7; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Orichalcum Visage"); - Tooltip.SetDefault("Increases alchemic damage by 20%"); - } - - - public override void UpdateEquip(Player player) - { - player.GetModPlayer(mod).alchemistDamage += 0.20f; - } - - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == 1213 && legs.type == 1214; - } - - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increases alchemic critical strike chance by 16% and flower petals will fall on your target for extra damage"; - player.GetModPlayer(mod).alchemistCrit += 16; - player.onHitPetal = true; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.OrichalcumBar, 12); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } - } + [AutoloadEquip(EquipType.Head)] + public class OrichalcumVisage : ModItem + { + + public override void SetDefaults() + { + + item.width = 22; + item.height = 26; + + item.value = 400; + item.rare = 4; + item.defense = 7; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Orichalcum Visage"); + Tooltip.SetDefault("Increases alchemic damage by 20%"); + } + + + public override void UpdateEquip(Player player) + { + player.GetModPlayer(mod).alchemistDamage += 0.20f; + } + + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == 1213 && legs.type == 1214; + } + + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increases alchemic critical strike chance by 16% and flower petals will fall on your target for extra damage"; + player.GetModPlayer(mod).alchemistCrit += 16; + player.onHitPetal = true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.OrichalcumBar, 12); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } } diff --git a/Items/OrichalcumWarhammer.cs b/Items/OrichalcumWarhammer.cs index 06e8d4af..e6967165 100644 --- a/Items/OrichalcumWarhammer.cs +++ b/Items/OrichalcumWarhammer.cs @@ -4,40 +4,42 @@ using Terraria.ModLoader; using Terraria.ID; -namespace Tremor.Items { -public class OrichalcumWarhammer : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class OrichalcumWarhammer : ModItem + { + public override void SetDefaults() + { - item.damage = 44; - item.melee = true; - item.width = 42; - item.height = 46; - item.useTime = 37; - item.useAnimation = 37; - item.hammer = 83; - item.useStyle = 1; - item.knockBack = 6; - item.value = 25300; - item.rare = 4; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 44; + item.melee = true; + item.width = 42; + item.height = 46; + item.useTime = 37; + item.useAnimation = 37; + item.hammer = 83; + item.useStyle = 1; + item.knockBack = 6; + item.value = 25300; + item.rare = 4; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Orichalcum Warhammer"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Orichalcum Warhammer"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.OrichalcumBar, 12); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.OrichalcumBar, 12); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/PainWheel.cs b/Items/PainWheel.cs index 8d71396e..a2c5736b 100644 --- a/Items/PainWheel.cs +++ b/Items/PainWheel.cs @@ -7,47 +7,47 @@ namespace Tremor.Items { - public class PainWheel : ModItem - { - public override void SetDefaults() - { + public class PainWheel : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 10; - item.value = Item.sellPrice(2, 0, 0, 0); - item.rare = 4; - item.noMelee = true; - item.useStyle = 5; - item.useAnimation = 40; - item.useTime = 40; - item.knockBack = 7.5F; - item.damage = 39; - item.scale = 1.1F; - item.noUseGraphic = true; - item.shoot = mod.ProjectileType("PainWheelPro"); - item.shootSpeed = 15.9F; - item.UseSound = SoundID.Item1; - item.melee = true; - item.channel = true; - } + item.width = 30; + item.height = 10; + item.value = Item.sellPrice(2, 0, 0, 0); + item.rare = 4; + item.noMelee = true; + item.useStyle = 5; + item.useAnimation = 40; + item.useTime = 40; + item.knockBack = 7.5F; + item.damage = 39; + item.scale = 1.1F; + item.noUseGraphic = true; + item.shoot = mod.ProjectileType("PainWheelPro"); + item.shootSpeed = 15.9F; + item.UseSound = SoundID.Item1; + item.melee = true; + item.channel = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Pain Wheel"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Pain Wheel"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Sunfury, 1); - recipe.AddIngredient(null, "LeafBall", 1); - recipe.AddIngredient(ItemID.TheMeatball, 1); - recipe.AddIngredient(ItemID.BlueMoon, 1); - recipe.SetResult(this); - recipe.AddTile(26); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Sunfury, 1); + recipe.AddIngredient(null, "LeafBall", 1); + recipe.AddIngredient(ItemID.TheMeatball, 1); + recipe.AddIngredient(ItemID.BlueMoon, 1); + recipe.SetResult(this); + recipe.AddTile(26); + recipe.AddRecipe(); + } + } } diff --git a/Items/PaladinBreastplate.cs b/Items/PaladinBreastplate.cs index d8509b21..acc267a6 100644 --- a/Items/PaladinBreastplate.cs +++ b/Items/PaladinBreastplate.cs @@ -6,32 +6,32 @@ using Terraria.ModLoader; namespace Tremor.Items -{ -[AutoloadEquip(EquipType.Body)] - public class PaladinBreastplate : ModItem - { +{ + [AutoloadEquip(EquipType.Body)] + public class PaladinBreastplate : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 18; + item.width = 26; + item.height = 18; - item.value = 600000; - item.rare = 10; - item.defense = 32; - } + item.value = 600000; + item.rare = 10; + item.defense = 32; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Paladin Breastplate"); - Tooltip.SetDefault("25% increased melee critical strike chance"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Paladin Breastplate"); + Tooltip.SetDefault("25% increased melee critical strike chance"); + } - public override void UpdateEquip(Player player) - { - player.meleeCrit += 25; - } - } + public override void UpdateEquip(Player player) + { + player.meleeCrit += 25; + } + } } diff --git a/Items/PaladinGreaves.cs b/Items/PaladinGreaves.cs index f86a553a..fc8cc3aa 100644 --- a/Items/PaladinGreaves.cs +++ b/Items/PaladinGreaves.cs @@ -4,33 +4,35 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] - public class PaladinGreaves : ModItem - { - - public override void SetDefaults() - { - - item.width = 22; - item.height = 18; - item.value = 500000; - - item.rare = 10; - item.defense = 28; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Paladin Greaves"); - Tooltip.SetDefault("22% increased melee damage"); - } - - - public override void UpdateEquip(Player player) - { - player.meleeDamage += 0.22f; - } - } +namespace Tremor.Items +{ + [AutoloadEquip(EquipType.Legs)] + public class PaladinGreaves : ModItem + { + + public override void SetDefaults() + { + + item.width = 22; + item.height = 18; + item.value = 500000; + + item.rare = 10; + item.defense = 28; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Paladin Greaves"); + Tooltip.SetDefault("22% increased melee damage"); + } + + + public override void UpdateEquip(Player player) + { + player.meleeDamage += 0.22f; + } + } } diff --git a/Items/PaladinHelmet.cs b/Items/PaladinHelmet.cs index cbac3900..5c674650 100644 --- a/Items/PaladinHelmet.cs +++ b/Items/PaladinHelmet.cs @@ -6,47 +6,47 @@ namespace Tremor.Items { -[AutoloadEquip(EquipType.Head)] - public class PaladinHelmet : ModItem - { + [AutoloadEquip(EquipType.Head)] + public class PaladinHelmet : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 32; - item.height = 26; + item.width = 32; + item.height = 26; - item.value = 400; - item.rare = 10; - item.defense = 22; - } + item.value = 400; + item.rare = 10; + item.defense = 22; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Paladin Helmet"); - Tooltip.SetDefault("30% increased melee speed"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Paladin Helmet"); + Tooltip.SetDefault("30% increased melee speed"); + } - public override void UpdateEquip(Player player) - { - player.meleeSpeed += 0.30f; - } + public override void UpdateEquip(Player player) + { + player.meleeSpeed += 0.30f; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == mod.ItemType("PaladinBreastplate") && legs.type == mod.ItemType("PaladinGreaves"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("PaladinBreastplate") && legs.type == mod.ItemType("PaladinGreaves"); + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Summons a paladin hammer to protect you!"; - player.AddBuff(mod.BuffType("PaladinBuff"), 2); - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Summons a paladin hammer to protect you!"; + player.AddBuff(mod.BuffType("PaladinBuff"), 2); + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawOutlines=true; + player.armorEffectDrawOutlines = true; } - } + } } diff --git a/Items/PalladiumDisc.cs b/Items/PalladiumDisc.cs index 04003d7c..2f8c36c9 100644 --- a/Items/PalladiumDisc.cs +++ b/Items/PalladiumDisc.cs @@ -4,53 +4,55 @@ using Terraria.ModLoader; using Terraria.ID; -namespace Tremor.Items { -public class PalladiumDisc : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class PalladiumDisc : ModItem + { + public override void SetDefaults() + { - item.damage = 36; - item.thrown = true; - item.width = 48; - item.height = 48; - item.useTime = 20; - item.shootSpeed = 12f; - item.useAnimation = 20; - item.useStyle = 1; - item.knockBack = 3f; - item.shoot = mod.ProjectileType("PalladiumDiscPro"); - item.value = 27600; - item.rare = 4; - item.noUseGraphic = true; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 36; + item.thrown = true; + item.width = 48; + item.height = 48; + item.useTime = 20; + item.shootSpeed = 12f; + item.useAnimation = 20; + item.useStyle = 1; + item.knockBack = 3f; + item.shoot = mod.ProjectileType("PalladiumDiscPro"); + item.value = 27600; + item.rare = 4; + item.noUseGraphic = true; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Palladium Disc"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Palladium Disc"); + Tooltip.SetDefault(""); + } -public override bool CanUseItem(Player player) -{ - for (int i = 0; i < 1000; ++i) - { - if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) - { - return false; - } - } - return true; + public override bool CanUseItem(Player player) + { + for (int i = 0; i < 1000; ++i) + { + if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) + { + return false; + } + } + return true; + } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.PalladiumBar, 12); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.PalladiumBar, 12); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} diff --git a/Items/PalladiumHat.cs b/Items/PalladiumHat.cs index 3011ae09..cfb70185 100644 --- a/Items/PalladiumHat.cs +++ b/Items/PalladiumHat.cs @@ -5,58 +5,61 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class PalladiumHat : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class PalladiumHat : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 20; - item.height = 24; + item.width = 20; + item.height = 24; - item.value = 400; - item.rare = 4; - item.defense = 4; - } + item.value = 400; + item.rare = 4; + item.defense = 4; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Palladium Hat"); - Tooltip.SetDefault("Increases minion damage by 18%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Palladium Hat"); + Tooltip.SetDefault("Increases minion damage by 18%"); + } - public override void UpdateEquip(Player player) - { - player.minionDamage += 0.18f; - } + public override void UpdateEquip(Player player) + { + player.minionDamage += 0.18f; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == 1208 && legs.type == 1209; - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == 1208 && legs.type == 1209; + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increases your max number of minions and greatly increases life regeneration after striking an enemy"; - player.maxMinions += 1; -player.onHitRegen = true; - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increases your max number of minions and greatly increases life regeneration after striking an enemy"; + player.maxMinions += 1; + player.onHitRegen = true; + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawShadow=true; + player.armorEffectDrawShadow = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.PalladiumBar, 12); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.PalladiumBar, 12); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/PalladiumHeader.cs b/Items/PalladiumHeader.cs index 746e9817..5baf7489 100644 --- a/Items/PalladiumHeader.cs +++ b/Items/PalladiumHeader.cs @@ -5,58 +5,61 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class PalladiumHeader : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class PalladiumHeader : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 20; - item.height = 24; + item.width = 20; + item.height = 24; - item.value = 400; - item.rare = 4; - item.defense = 4; - } + item.value = 400; + item.rare = 4; + item.defense = 4; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Palladium Header"); - Tooltip.SetDefault("Increases thrown damage by 18%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Palladium Header"); + Tooltip.SetDefault("Increases thrown damage by 18%"); + } - public override void UpdateEquip(Player player) - { - player.thrownDamage += 0.18f; - } + public override void UpdateEquip(Player player) + { + player.thrownDamage += 0.18f; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == 1208 && legs.type == 1209; - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == 1208 && legs.type == 1209; + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increases thrown weapon velocity and greatly increases life regeneration after striking an enemy"; - player.thrownVelocity +=0.25f; -player.onHitRegen = true; - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increases thrown weapon velocity and greatly increases life regeneration after striking an enemy"; + player.thrownVelocity += 0.25f; + player.onHitRegen = true; + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawShadow=true; + player.armorEffectDrawShadow = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.PalladiumBar, 12); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.PalladiumBar, 12); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/PalladiumRifle.cs b/Items/PalladiumRifle.cs index ffb251b9..97ac8e3e 100644 --- a/Items/PalladiumRifle.cs +++ b/Items/PalladiumRifle.cs @@ -5,47 +5,49 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class PalladiumRifle : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class PalladiumRifle : ModItem + { + public override void SetDefaults() + { - item.damage = 38; - item.ranged = true; - item.width = 40; - item.height = 20; - item.useTime = 15; - item.useAnimation = 15; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 6; - item.value = 10000; - item.rare = 4; - item.UseSound = SoundID.Item11; - item.autoReuse = true; - item.shoot = 10; - item.shootSpeed = 12f; - item.useAmmo = AmmoID.Bullet; - } + item.damage = 38; + item.ranged = true; + item.width = 40; + item.height = 20; + item.useTime = 15; + item.useAnimation = 15; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 6; + item.value = 10000; + item.rare = 4; + item.UseSound = SoundID.Item11; + item.autoReuse = true; + item.shoot = 10; + item.shootSpeed = 12f; + item.useAmmo = AmmoID.Bullet; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Palladium Rifle"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Palladium Rifle"); + Tooltip.SetDefault(""); + } - public override Vector2? HoldoutOffset() - { - return new Vector2(-15, 0); - } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.PalladiumBar, 15); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override Vector2? HoldoutOffset() + { + return new Vector2(-15, 0); + } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.PalladiumBar, 15); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/PalladiumStaff.cs b/Items/PalladiumStaff.cs index fb955e50..8dbc88f5 100644 --- a/Items/PalladiumStaff.cs +++ b/Items/PalladiumStaff.cs @@ -5,44 +5,46 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class PalladiumStaff : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class PalladiumStaff : ModItem + { + public override void SetDefaults() + { - item.damage = 35; - item.magic = true; - item.mana = 8; - item.width = 40; - item.height = 40; - item.useTime = 28; - item.useAnimation = 28; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 3; - item.value = 18440; - item.rare = 4; - item.UseSound = SoundID.Item101; - item.autoReuse = true; - Item.staff[item.type] = true; //this makes the useStyle animate as a staff instead of as a gun - item.shoot = mod.ProjectileType("PalladiumBolt"); - item.shootSpeed = 13f; - } + item.damage = 35; + item.magic = true; + item.mana = 8; + item.width = 40; + item.height = 40; + item.useTime = 28; + item.useAnimation = 28; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 3; + item.value = 18440; + item.rare = 4; + item.UseSound = SoundID.Item101; + item.autoReuse = true; + Item.staff[item.type] = true; //this makes the useStyle animate as a staff instead of as a gun + item.shoot = mod.ProjectileType("PalladiumBolt"); + item.shootSpeed = 13f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Palladium Staff"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Palladium Staff"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.PalladiumBar, 12); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.PalladiumBar, 12); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/PalladiumVisage.cs b/Items/PalladiumVisage.cs index e5030114..be920d11 100644 --- a/Items/PalladiumVisage.cs +++ b/Items/PalladiumVisage.cs @@ -7,57 +7,57 @@ namespace Tremor.Items { -[AutoloadEquip(EquipType.Head)] - public class PalladiumVisage : ModItem - { - - public override void SetDefaults() - { - - item.width = 26; - item.height = 20; - - item.value = 400; - item.rare = 4; - item.defense = 4; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Palladium Visage"); - Tooltip.SetDefault("Increases alchemic damage by 18%"); - } - - - public override void UpdateEquip(Player player) - { - player.GetModPlayer(mod).alchemistDamage += 0.18f; - } - - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == 1208 && legs.type == 1209; - } - - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increases alchemic critical strike chance by 12% and greatly increases life regeneration after striking an enemy"; - player.GetModPlayer(mod).alchemistCrit += 12; - player.onHitRegen = true; - } - - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawShadow = true; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.PalladiumBar, 10); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } - } + [AutoloadEquip(EquipType.Head)] + public class PalladiumVisage : ModItem + { + + public override void SetDefaults() + { + + item.width = 26; + item.height = 20; + + item.value = 400; + item.rare = 4; + item.defense = 4; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Palladium Visage"); + Tooltip.SetDefault("Increases alchemic damage by 18%"); + } + + + public override void UpdateEquip(Player player) + { + player.GetModPlayer(mod).alchemistDamage += 0.18f; + } + + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == 1208 && legs.type == 1209; + } + + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increases alchemic critical strike chance by 12% and greatly increases life regeneration after striking an enemy"; + player.GetModPlayer(mod).alchemistCrit += 12; + player.onHitRegen = true; + } + + public override void ArmorSetShadows(Player player) + { + player.armorEffectDrawShadow = true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.PalladiumBar, 10); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } } diff --git a/Items/PalladiumWarhammer.cs b/Items/PalladiumWarhammer.cs index 0f629e9d..0ececd38 100644 --- a/Items/PalladiumWarhammer.cs +++ b/Items/PalladiumWarhammer.cs @@ -4,40 +4,42 @@ using Terraria.ModLoader; using Terraria.ID; -namespace Tremor.Items { -public class PalladiumWarhammer : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class PalladiumWarhammer : ModItem + { + public override void SetDefaults() + { - item.damage = 41; - item.melee = true; - item.width = 38; - item.height = 38; - item.useTime = 39; - item.useAnimation = 39; - item.hammer = 80; - item.useStyle = 1; - item.knockBack = 5; - item.value = 15300; - item.rare = 4; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 41; + item.melee = true; + item.width = 38; + item.height = 38; + item.useTime = 39; + item.useAnimation = 39; + item.hammer = 80; + item.useStyle = 1; + item.knockBack = 5; + item.value = 15300; + item.rare = 4; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Palladium Warhammer"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Palladium Warhammer"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.PalladiumBar, 10); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.PalladiumBar, 10); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/PalmWoodArmchair.cs b/Items/PalmWoodArmchair.cs index a0bddfd2..c54d408f 100644 --- a/Items/PalmWoodArmchair.cs +++ b/Items/PalmWoodArmchair.cs @@ -4,40 +4,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class PalmWoodArmchair : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class PalmWoodArmchair : ModItem + { + public override void SetDefaults() + { - item.width = 42; - item.height = 32; - item.maxStack = 99; - item.value = 100; - item.rare = 1; - item.createTile = mod.TileType("PalmWoodArmchair"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - } + item.width = 42; + item.height = 32; + item.maxStack = 99; + item.value = 100; + item.rare = 1; + item.createTile = mod.TileType("PalmWoodArmchair"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Palm Wood Armchair"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Palm Wood Armchair"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.PalmWood, 15); - recipe.AddIngredient(ItemID.Silk, 6); - recipe.SetResult(this); - recipe.AddTile(106); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.PalmWood, 15); + recipe.AddIngredient(ItemID.Silk, 6); + recipe.SetResult(this); + recipe.AddTile(106); + recipe.AddRecipe(); + } + } +} diff --git a/Items/PalmwoodShield.cs b/Items/PalmwoodShield.cs index d661a7fa..9853ee66 100644 --- a/Items/PalmwoodShield.cs +++ b/Items/PalmwoodShield.cs @@ -5,34 +5,36 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Shield)] -public class PalmwoodShield : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Shield)] + public class PalmwoodShield : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 24; - item.height = 28; - item.value = 110; - item.rare = 0; - item.accessory = true; - item.defense = 1; - } + item.width = 24; + item.height = 28; + item.value = 110; + item.rare = 0; + item.accessory = true; + item.defense = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Palm Wood Shield"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Palm Wood Shield"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.PalmWood, 15); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.PalmWood, 15); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } + } } -}} diff --git a/Items/Pandemonium.cs b/Items/Pandemonium.cs index f21f0b69..64139841 100644 --- a/Items/Pandemonium.cs +++ b/Items/Pandemonium.cs @@ -7,56 +7,56 @@ namespace Tremor.Items { - public class Pandemonium : ModItem - { - public override void SetDefaults() - { + public class Pandemonium : ModItem + { + public override void SetDefaults() + { - item.damage = 320; - item.ranged = true; - item.width = 52; - item.height = 34; - item.useTime = 3; - item.useAnimation = 12; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 4f; - item.value = 600000; - item.rare = 0; - item.UseSound = SoundID.Item92; - item.autoReuse = false; - item.shootSpeed = 25f; - item.shoot = mod.ProjectileType("PandemoniumBullet"); - item.useAmmo = AmmoID.Bullet; - } + item.damage = 320; + item.ranged = true; + item.width = 52; + item.height = 34; + item.useTime = 3; + item.useAnimation = 12; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 4f; + item.value = 600000; + item.rare = 0; + item.UseSound = SoundID.Item92; + item.autoReuse = false; + item.shootSpeed = 25f; + item.shoot = mod.ProjectileType("PandemoniumBullet"); + item.useAmmo = AmmoID.Bullet; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Pandemonium"); - Tooltip.SetDefault("Shoots a burst of bullets\nBullets explode into firebals\n75% chance not to consume ammo"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Pandemonium"); + Tooltip.SetDefault("Shoots a burst of bullets\nBullets explode into firebals\n75% chance not to consume ammo"); + } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) - { - tooltips[0].overrideColor = new Color(238, 194, 73); - } + public override void ModifyTooltips(System.Collections.Generic.List tooltips) + { + tooltips[0].overrideColor = new Color(238, 194, 73); + } - public override bool ConsumeAmmo(Player player) - { - if (Main.rand.Next(0, 100) <= 75) - return false; - return true; - } + public override bool ConsumeAmmo(Player player) + { + if (Main.rand.Next(0, 100) <= 75) + return false; + return true; + } - public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - float SpeedX = speedX + (float)Main.rand.Next(-15, 16) * 0.05f; - float SpeedY = speedY + (float)Main.rand.Next(-15, 16) * 0.05f; - Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f); - if (Main.rand.Next(2) == 0) - Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, mod.ProjectileType("PandemoniumBullet"), damage, knockBack, player.whoAmI, 0.0f, 0.0f); - return false; - } - } + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + float SpeedX = speedX + (float)Main.rand.Next(-15, 16) * 0.05f; + float SpeedY = speedY + (float)Main.rand.Next(-15, 16) * 0.05f; + Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f); + if (Main.rand.Next(2) == 0) + Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, mod.ProjectileType("PandemoniumBullet"), damage, knockBack, player.whoAmI, 0.0f, 0.0f); + return false; + } + } } diff --git a/Items/ParaspriteBanner.cs b/Items/ParaspriteBanner.cs index 97a4893a..7ee5e0fe 100644 --- a/Items/ParaspriteBanner.cs +++ b/Items/ParaspriteBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ParaspriteBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ParaspriteBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 4; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 4; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Parasprite Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Parasprite Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/ParatrooperLens.cs b/Items/ParatrooperLens.cs index 8e84ed37..30649262 100644 --- a/Items/ParatrooperLens.cs +++ b/Items/ParatrooperLens.cs @@ -5,30 +5,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ParatrooperLens : ModItem +namespace Tremor.Items { + public class ParatrooperLens : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 27; - item.height = 26; - item.rare = 11; - item.value = 3000000; + item.width = 27; + item.height = 26; + item.rare = 11; + item.value = 3000000; - item.accessory = true; - } + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Paratrooper's Lens"); - Tooltip.SetDefault("Increases projectile's speed twice"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Paratrooper's Lens"); + Tooltip.SetDefault("Increases projectile's speed twice"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.AddBuff(mod.BuffType("ShootSpeedBuff2"), 2); - } -}} + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.AddBuff(mod.BuffType("ShootSpeedBuff2"), 2); + } + } +} diff --git a/Items/ParatrooperShotgun.cs b/Items/ParatrooperShotgun.cs index 6a262054..f6c8c345 100644 --- a/Items/ParatrooperShotgun.cs +++ b/Items/ParatrooperShotgun.cs @@ -5,58 +5,60 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class ParatrooperShotgun : ModItem -{ - public override void SetDefaults() - { - - item.damage = 300; - item.ranged = true; - item.width = 46; - item.height = 28; - item.useTime = 40; - item.useAnimation = 40; - item.useStyle = 5; - item.knockBack = 6; - item.value = 651000; - item.rare = 11; - item.useStyle = 5; - item.UseSound = SoundID.Item36; - item.noMelee = true; - item.autoReuse = false; - item.shoot = 10; - item.shootSpeed = 23f; - item.useAmmo = AmmoID.Bullet; - - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Paratrooper Shotgun"); - Tooltip.SetDefault("Has 33% chance not to consume ammo"); - } - - - public override Vector2? HoldoutOffset() - { - return new Vector2(-10, 0); - } - -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) +namespace Tremor.Items { - for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. - { - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); - } - return false; -} - public override bool ConsumeAmmo(Player p) + public class ParatrooperShotgun : ModItem + { + public override void SetDefaults() + { + + item.damage = 300; + item.ranged = true; + item.width = 46; + item.height = 28; + item.useTime = 40; + item.useAnimation = 40; + item.useStyle = 5; + item.knockBack = 6; + item.value = 651000; + item.rare = 11; + item.useStyle = 5; + item.UseSound = SoundID.Item36; + item.noMelee = true; + item.autoReuse = false; + item.shoot = 10; + item.shootSpeed = 23f; + item.useAmmo = AmmoID.Bullet; + + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Paratrooper Shotgun"); + Tooltip.SetDefault("Has 33% chance not to consume ammo"); + } + + + public override Vector2? HoldoutOffset() + { + return new Vector2(-10, 0); + } + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. + { + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); + } + return false; + } + + public override bool ConsumeAmmo(Player p) { return Main.rand.Next(3) == 0; } -}} + } +} diff --git a/Items/ParaxydeAxe.cs b/Items/ParaxydeAxe.cs index e386c915..4c88df27 100644 --- a/Items/ParaxydeAxe.cs +++ b/Items/ParaxydeAxe.cs @@ -5,50 +5,52 @@ using Terraria.ModLoader; using Microsoft.Xna.Framework; -namespace Tremor.Items { -public class ParaxydeAxe : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ParaxydeAxe : ModItem + { + public override void SetDefaults() + { - item.damage = 66; - item.melee = true; - item.width = 36; - item.height = 36; - item.useTime = 16; - item.useAnimation = 16; - item.axe = 24; - item.useStyle = 1; - item.knockBack = 5; - item.value = 216000; - item.rare = 5; - item.tileBoost++; - item.scale = 1.25f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 66; + item.melee = true; + item.width = 36; + item.height = 36; + item.useTime = 16; + item.useAnimation = 16; + item.axe = 24; + item.useStyle = 1; + item.knockBack = 5; + item.value = 216000; + item.rare = 5; + item.tileBoost++; + item.scale = 1.25f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Paraxyde Axe"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Paraxyde Axe"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ParaxydeShard", 12); - recipe.SetResult(this); - recipe.AddTile(null, "AlchematorTile"); - recipe.AddRecipe(); -} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ParaxydeShard", 12); + recipe.SetResult(this); + recipe.AddTile(null, "AlchematorTile"); + recipe.AddRecipe(); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if(Main.rand.Next(2) == 0) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 27); - } - } -}} + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.Next(2) == 0) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 27); + } + } + } +} diff --git a/Items/ParaxydeBreastplate.cs b/Items/ParaxydeBreastplate.cs index 220b5409..909eb732 100644 --- a/Items/ParaxydeBreastplate.cs +++ b/Items/ParaxydeBreastplate.cs @@ -5,41 +5,43 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class ParaxydeBreastplate : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.width = 38; - item.height = 22; - - item.value = 10000; - item.rare = 5; - item.defense = 22; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Paraxyde Breastplate"); - Tooltip.SetDefault("Increases melee and magic criticals strike chance by 15"); - } - - - public override void UpdateEquip(Player player) - { - player.magicCrit += 15; - player.meleeCrit += 15; - } - - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ParaxydeShard", 18); - recipe.SetResult(this); - recipe.AddTile(null, "AlchematorTile"); - recipe.AddRecipe(); - } -}} + [AutoloadEquip(EquipType.Body)] + public class ParaxydeBreastplate : ModItem + { + public override void SetDefaults() + { + + item.width = 38; + item.height = 22; + + item.value = 10000; + item.rare = 5; + item.defense = 22; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Paraxyde Breastplate"); + Tooltip.SetDefault("Increases melee and magic criticals strike chance by 15"); + } + + + public override void UpdateEquip(Player player) + { + player.magicCrit += 15; + player.meleeCrit += 15; + } + + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ParaxydeShard", 18); + recipe.SetResult(this); + recipe.AddTile(null, "AlchematorTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/ParaxydeCleaver.cs b/Items/ParaxydeCleaver.cs index b7fe34d7..d8823bc5 100644 --- a/Items/ParaxydeCleaver.cs +++ b/Items/ParaxydeCleaver.cs @@ -5,50 +5,52 @@ using Terraria.ModLoader; using Microsoft.Xna.Framework; -namespace Tremor.Items { -public class ParaxydeCleaver : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ParaxydeCleaver : ModItem + { + public override void SetDefaults() + { - item.damage = 66; - item.melee = true; - item.width = 50; - item.height = 60; - item.useTime = 25; - item.useAnimation = 25; - item.useStyle = 1; - item.knockBack = 5; - item.value = 216000; - item.rare = 5; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.shoot = 522; - item.shootSpeed = 23f; - } + item.damage = 66; + item.melee = true; + item.width = 50; + item.height = 60; + item.useTime = 25; + item.useAnimation = 25; + item.useStyle = 1; + item.knockBack = 5; + item.value = 216000; + item.rare = 5; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.shoot = 522; + item.shootSpeed = 23f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Paraxyde Cleaver"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Paraxyde Cleaver"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ParaxydeShard", 15); - recipe.AddIngredient(426, 1); - recipe.SetResult(this); - recipe.AddTile(null, "AlchematorTile"); - recipe.AddRecipe(); -} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ParaxydeShard", 15); + recipe.AddIngredient(426, 1); + recipe.SetResult(this); + recipe.AddTile(null, "AlchematorTile"); + recipe.AddRecipe(); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if(Main.rand.Next(2) == 0) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 27); - } - } -}} + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.Next(2) == 0) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 27); + } + } + } +} diff --git a/Items/ParaxydeGreaves.cs b/Items/ParaxydeGreaves.cs index a2f64004..1043427a 100644 --- a/Items/ParaxydeGreaves.cs +++ b/Items/ParaxydeGreaves.cs @@ -5,41 +5,44 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class ParaxydeGreaves : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Legs)] + public class ParaxydeGreaves : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 38; - item.height = 22; + item.width = 38; + item.height = 22; - item.value = 10000; - item.rare = 5; - item.defense = 17; - } + item.value = 10000; + item.rare = 5; + item.defense = 17; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Paraxyde Greaves"); - Tooltip.SetDefault("Increases maximum mana by 40"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Paraxyde Greaves"); + Tooltip.SetDefault("Increases maximum mana by 40"); + } - public override void UpdateEquip(Player player) - { - player.statManaMax2 += 40; - } + public override void UpdateEquip(Player player) + { + player.statManaMax2 += 40; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ParaxydeShard", 15); - recipe.SetResult(this); - recipe.AddTile(null, "AlchematorTile"); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ParaxydeShard", 15); + recipe.SetResult(this); + recipe.AddTile(null, "AlchematorTile"); + recipe.AddRecipe(); + } -}} + } +} diff --git a/Items/ParaxydeHammer.cs b/Items/ParaxydeHammer.cs index b6a8c185..0899aad1 100644 --- a/Items/ParaxydeHammer.cs +++ b/Items/ParaxydeHammer.cs @@ -5,50 +5,52 @@ using Terraria.ModLoader; using Microsoft.Xna.Framework; -namespace Tremor.Items { -public class ParaxydeHammer : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ParaxydeHammer : ModItem + { + public override void SetDefaults() + { - item.damage = 54; - item.melee = true; - item.width = 40; - item.height = 40; - item.useTime = 16; - item.useAnimation = 16; - item.hammer = 90; - item.useStyle = 1; - item.knockBack = 5; - item.value = 216000; - item.rare = 5; - item.tileBoost++; - item.scale = 1.25f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 54; + item.melee = true; + item.width = 40; + item.height = 40; + item.useTime = 16; + item.useAnimation = 16; + item.hammer = 90; + item.useStyle = 1; + item.knockBack = 5; + item.value = 216000; + item.rare = 5; + item.tileBoost++; + item.scale = 1.25f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Paraxyde Hammer"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Paraxyde Hammer"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ParaxydeShard", 12); - recipe.SetResult(this); - recipe.AddTile(null, "AlchematorTile"); - recipe.AddRecipe(); -} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ParaxydeShard", 12); + recipe.SetResult(this); + recipe.AddTile(null, "AlchematorTile"); + recipe.AddRecipe(); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if(Main.rand.Next(2) == 0) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 27); - } - } -}} + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.Next(2) == 0) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 27); + } + } + } +} diff --git a/Items/ParaxydeHelmet.cs b/Items/ParaxydeHelmet.cs index 7b984043..c59852b3 100644 --- a/Items/ParaxydeHelmet.cs +++ b/Items/ParaxydeHelmet.cs @@ -6,47 +6,49 @@ using Terraria.ModLoader; using Microsoft.Xna.Framework; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class ParaxydeHelmet : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class ParaxydeHelmet : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 38; - item.height = 22; + item.width = 38; + item.height = 22; - item.value = 10000; - item.rare = 5; - item.defense = 15; - } + item.value = 10000; + item.rare = 5; + item.defense = 15; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Paraxyde Helmet"); - Tooltip.SetDefault("Increases magic damage by 12%\nIncreases melee damage by 16%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Paraxyde Helmet"); + Tooltip.SetDefault("Increases magic damage by 12%\nIncreases melee damage by 16%"); + } - public override void UpdateEquip(Player player) - { - player.magicDamage += 0.12f; - player.meleeDamage += 0.16f; - } + public override void UpdateEquip(Player player) + { + player.magicDamage += 0.12f; + player.meleeDamage += 0.16f; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("ParaxydeBreastplate") && legs.type == mod.ItemType("ParaxydeGreaves"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("ParaxydeBreastplate") && legs.type == mod.ItemType("ParaxydeGreaves"); + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Shadow knives will fall on your target for extra damage"; - player.GetModPlayer(mod).onHitShadaggers = true; - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Shadow knives will fall on your target for extra damage"; + player.GetModPlayer(mod).onHitShadaggers = true; + } public override void ArmorSetShadows(Player player) { @@ -54,12 +56,13 @@ public override void ArmorSetShadows(Player player) player.armorEffectDrawShadow = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ParaxydeShard", 12); - recipe.SetResult(this); - recipe.AddTile(null, "AlchematorTile"); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ParaxydeShard", 12); + recipe.SetResult(this); + recipe.AddTile(null, "AlchematorTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/ParaxydePickaxe.cs b/Items/ParaxydePickaxe.cs index 2c033498..31cca6be 100644 --- a/Items/ParaxydePickaxe.cs +++ b/Items/ParaxydePickaxe.cs @@ -5,49 +5,51 @@ using Terraria.ModLoader; using Microsoft.Xna.Framework; -namespace Tremor.Items { -public class ParaxydePickaxe : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ParaxydePickaxe : ModItem + { + public override void SetDefaults() + { - item.damage = 42; - item.melee = true; - item.width = 36; - item.height = 36; - item.useTime = 15; - item.useAnimation = 15; - item.pick = 200; - item.useStyle = 1; - item.knockBack = 5; - item.value = 216000; - item.rare = 5; - item.scale = 1.25f; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 42; + item.melee = true; + item.width = 36; + item.height = 36; + item.useTime = 15; + item.useAnimation = 15; + item.pick = 200; + item.useStyle = 1; + item.knockBack = 5; + item.value = 216000; + item.rare = 5; + item.scale = 1.25f; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Paraxyde Pickaxe"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Paraxyde Pickaxe"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ParaxydeShard", 12); - recipe.SetResult(this); - recipe.AddTile(null, "AlchematorTile"); - recipe.AddRecipe(); -} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ParaxydeShard", 12); + recipe.SetResult(this); + recipe.AddTile(null, "AlchematorTile"); + recipe.AddRecipe(); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if(Main.rand.Next(2) == 0) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 27); - } - } -}} + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.Next(2) == 0) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 27); + } + } + } +} diff --git a/Items/ParaxydeShard.cs b/Items/ParaxydeShard.cs index b38c2424..d2c41722 100644 --- a/Items/ParaxydeShard.cs +++ b/Items/ParaxydeShard.cs @@ -4,33 +4,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ParaxydeShard : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ParaxydeShard : ModItem + { + public override void SetDefaults() + { - item.width = 14; - item.height = 22; - item.maxStack = 999; - item.rare = 5; - item.value = Item.buyPrice(0, 0, 3, 0); - } + item.width = 14; + item.height = 22; + item.maxStack = 999; + item.rare = 5; + item.value = Item.buyPrice(0, 0, 3, 0); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Paraxyde Shard"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Paraxyde Shard"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.HallowedBar, 1); - recipe.AddIngredient(null, "Jellyxir", 1); - recipe.SetResult(this); - recipe.AddTile(null, "AlchematorTile"); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.HallowedBar, 1); + recipe.AddIngredient(null, "Jellyxir", 1); + recipe.SetResult(this); + recipe.AddTile(null, "AlchematorTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/ParaxydeStave.cs b/Items/ParaxydeStave.cs index f36d2e27..62a23c9e 100644 --- a/Items/ParaxydeStave.cs +++ b/Items/ParaxydeStave.cs @@ -5,49 +5,50 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ParaxydeStave : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.CloneDefaults(ItemID.Starfury); + public class ParaxydeStave : ModItem + { + public override void SetDefaults() + { + item.CloneDefaults(ItemID.Starfury); - item.damage = 68; - item.melee = false; - item.magic = true; - item.width = 42; - item.height = 46; - item.useTime = 20; - item.mana = 10; + item.damage = 68; + item.melee = false; + item.magic = true; + item.width = 42; + item.height = 46; + item.useTime = 20; + item.mana = 10; - item.useAnimation = 20; - item.useStyle = 1; - item.shootSpeed = 10f; - Item.staff[item.type] = true; - item.knockBack = 3; - item.value = 15000; - item.rare = 5; - item.UseSound = SoundID.Item43; - item.autoReuse = true; - } + item.useAnimation = 20; + item.useStyle = 1; + item.shootSpeed = 10f; + Item.staff[item.type] = true; + item.knockBack = 3; + item.value = 15000; + item.rare = 5; + item.UseSound = SoundID.Item43; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Paraxyde Stave"); - Tooltip.SetDefault("Summons paraxyde crystals to fall from the sky\n"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Paraxyde Stave"); + Tooltip.SetDefault("Summons paraxyde crystals to fall from the sky\n"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ParaxydeShard", 11); - recipe.AddIngredient(ItemID.FallenStar, 5); - recipe.SetResult(this); - recipe.AddTile(null, "AlchematorTile"); - recipe.AddRecipe(); -} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ParaxydeShard", 11); + recipe.AddIngredient(ItemID.FallenStar, 5); + recipe.SetResult(this); + recipe.AddTile(null, "AlchematorTile"); + recipe.AddRecipe(); + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { @@ -55,12 +56,12 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX return base.Shoot(player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack); } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if(Main.rand.Next(2) == 0) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 27); - } - } -} + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.Next(2) == 0) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 27); + } + } + } } diff --git a/Items/ParaxydeStormbow.cs b/Items/ParaxydeStormbow.cs index d9504e7e..d5eeac6f 100644 --- a/Items/ParaxydeStormbow.cs +++ b/Items/ParaxydeStormbow.cs @@ -5,61 +5,63 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ParaxydeStormbow : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ParaxydeStormbow : ModItem + { + public override void SetDefaults() + { - item.damage = 68; - item.noMelee = true; - item.ranged = true; - item.width = 16; - item.height = 32; - item.useTime = 15; - item.shoot = 1; - item.shootSpeed = 11f; - item.useAnimation = 15; - item.useStyle = 5; - item.knockBack = 1; - item.useAmmo = AmmoID.Arrow; - item.value = 216000; - item.rare = 5; - item.UseSound = SoundID.Item5; - item.autoReuse = true; + item.damage = 68; + item.noMelee = true; + item.ranged = true; + item.width = 16; + item.height = 32; + item.useTime = 15; + item.shoot = 1; + item.shootSpeed = 11f; + item.useAnimation = 15; + item.useStyle = 5; + item.knockBack = 1; + item.useAmmo = AmmoID.Arrow; + item.value = 216000; + item.rare = 5; + item.UseSound = SoundID.Item5; + item.autoReuse = true; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Paraxyde Stormbow"); - Tooltip.SetDefault("Has 33% chance to shoot paraxyde crystal"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Paraxyde Stormbow"); + Tooltip.SetDefault("Has 33% chance to shoot paraxyde crystal"); + } - public override Vector2? HoldoutOffset() - { - return new Vector2(-8, -2); - } + public override Vector2? HoldoutOffset() + { + return new Vector2(-8, -2); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ParaxydeShard", 13); - recipe.SetResult(this); - recipe.AddTile(null, "AlchematorTile"); - recipe.AddRecipe(); -} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ParaxydeShard", 13); + recipe.SetResult(this); + recipe.AddTile(null, "AlchematorTile"); + recipe.AddRecipe(); + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { //type = 1; - if(Main.rand.Next(3) == 0) - { - type = 522; - } + if (Main.rand.Next(3) == 0) + { + type = 522; + } return base.Shoot(player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack); } -}} + } +} diff --git a/Items/ParrotFish.cs b/Items/ParrotFish.cs index 72abf9f7..f5dc2143 100644 --- a/Items/ParrotFish.cs +++ b/Items/ParrotFish.cs @@ -21,11 +21,11 @@ public override void SetDefaults() item.rare = -11; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Parrot Fish"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Parrot Fish"); + Tooltip.SetDefault(""); + } public override bool IsQuestFish() @@ -35,7 +35,7 @@ public override bool IsQuestFish() //public override bool IsAnglerQuestAvailable() //{ - //return Main.downedInvasion3; + //return Main.downedInvasion3; //} public override void AnglerQuestChat(ref string description, ref string catchLocation) diff --git a/Items/PartyOver.cs b/Items/PartyOver.cs index 100e5e64..251810f8 100644 --- a/Items/PartyOver.cs +++ b/Items/PartyOver.cs @@ -29,26 +29,26 @@ public override void SetDefaults() item.crit = 7; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Party Over"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Party Over"); + Tooltip.SetDefault(""); + } -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) -{ - for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. - { - Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 2, speedY - 2, type, damage, knockBack, Main.myPlayer); - } - return false; -} + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. + { + Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 2, speedY - 2, type, damage, knockBack, Main.myPlayer); + } + return false; + } public override Vector2? HoldoutOffset() { diff --git a/Items/PatronoftheMind.cs b/Items/PatronoftheMind.cs index c2e941ca..2e2edbba 100644 --- a/Items/PatronoftheMind.cs +++ b/Items/PatronoftheMind.cs @@ -5,45 +5,47 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Shield)] -public class PatronoftheMind : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + [AutoloadEquip(EquipType.Shield)] + public class PatronoftheMind : ModItem + { + public override void SetDefaults() + { - item.width = 24; - item.height = 28; + item.width = 24; + item.height = 28; - item.value = 45000; - item.rare = 5; - item.accessory = true; - item.defense = 3; - } + item.value = 45000; + item.rare = 5; + item.accessory = true; + item.defense = 3; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Patron of the Mind"); - Tooltip.SetDefault("Gives health when in Crimson"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Patron of the Mind"); + Tooltip.SetDefault("Gives health when in Crimson"); + } -public override void UpdateAccessory(Player player, bool hideVisual) -{ - if (player.ZoneCrimson) - { - player.statLifeMax2 += 100; - } -} + public override void UpdateAccessory(Player player, bool hideVisual) + { + if (player.ZoneCrimson) + { + player.statLifeMax2 += 100; + } + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.CrimtaneBar, 28); - recipe.AddIngredient(ItemID.TissueSample, 45); - recipe.AddIngredient(ItemID.SoulofNight, 15); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.CrimtaneBar, 28); + recipe.AddIngredient(ItemID.TissueSample, 45); + recipe.AddIngredient(ItemID.SoulofNight, 15); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/PearlwoodArmchair.cs b/Items/PearlwoodArmchair.cs index c6bf82dc..9d6eb587 100644 --- a/Items/PearlwoodArmchair.cs +++ b/Items/PearlwoodArmchair.cs @@ -4,40 +4,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class PearlwoodArmchair : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class PearlwoodArmchair : ModItem + { + public override void SetDefaults() + { - item.width = 42; - item.height = 32; - item.maxStack = 99; - item.value = 100; - item.rare = 1; - item.createTile = mod.TileType("PearlwoodArmchair"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - } + item.width = 42; + item.height = 32; + item.maxStack = 99; + item.value = 100; + item.rare = 1; + item.createTile = mod.TileType("PearlwoodArmchair"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Pearlwood Armchair"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Pearlwood Armchair"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Pearlwood, 15); - recipe.AddIngredient(ItemID.Silk, 6); - recipe.SetResult(this); - recipe.AddTile(106); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Pearlwood, 15); + recipe.AddIngredient(ItemID.Silk, 6); + recipe.SetResult(this); + recipe.AddTile(106); + recipe.AddRecipe(); + } + } +} diff --git a/Items/PearlwoodShield.cs b/Items/PearlwoodShield.cs index 9e8a994e..c3b772d0 100644 --- a/Items/PearlwoodShield.cs +++ b/Items/PearlwoodShield.cs @@ -5,34 +5,36 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Shield)] -public class PearlwoodShield : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Shield)] + public class PearlwoodShield : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 24; - item.height = 24; - item.value = 110; - item.rare = 0; - item.accessory = true; - item.defense = 1; - } + item.width = 24; + item.height = 24; + item.value = 110; + item.rare = 0; + item.accessory = true; + item.defense = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Pearlwood Shield"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Pearlwood Shield"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Pearlwood, 15); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Pearlwood, 15); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } + } +} diff --git a/Items/PeepersBanner.cs b/Items/PeepersBanner.cs index 7aaa6798..72ad0d92 100644 --- a/Items/PeepersBanner.cs +++ b/Items/PeepersBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class PeepersBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class PeepersBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 37; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 37; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Peepers Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Peepers Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/PerfectBehemoth.cs b/Items/PerfectBehemoth.cs index 174c7353..a3df095d 100644 --- a/Items/PerfectBehemoth.cs +++ b/Items/PerfectBehemoth.cs @@ -5,33 +5,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class PerfectBehemoth : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class PerfectBehemoth : ModItem + { + public override void SetDefaults() + { - item.damage = 30; - item.thrown = true; - item.width = 40; - item.height = 40; - item.useTime = 40; - item.useAnimation = 40; - item.useStyle = 5; - item.knockBack = 3; - item.value = 50000; - item.rare = 3; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - item.noUseGraphic = true; - item.shoot = mod.ProjectileType("PerfectBehemothPro"); - item.shootSpeed = 8f; - } + item.damage = 30; + item.thrown = true; + item.width = 40; + item.height = 40; + item.useTime = 40; + item.useAnimation = 40; + item.useStyle = 5; + item.knockBack = 3; + item.value = 50000; + item.rare = 3; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + item.noUseGraphic = true; + item.shoot = mod.ProjectileType("PerfectBehemothPro"); + item.shootSpeed = 8f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Perfect Behemoth"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Perfect Behemoth"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/Permafrost.cs b/Items/Permafrost.cs index e7a4df8c..728d8a6e 100644 --- a/Items/Permafrost.cs +++ b/Items/Permafrost.cs @@ -7,54 +7,54 @@ namespace Tremor.Items { - public class Permafrost : ModItem - { - public override void SetDefaults() - { + public class Permafrost : ModItem + { + public override void SetDefaults() + { - item.damage = 123; - item.melee = true; - item.width = 38; - item.height = 20; - item.useTime = 20; - item.useAnimation = 34; - item.useStyle = 1; - item.knockBack = 10; - item.value = 160000; - item.rare = 10; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.shoot = 263; - item.shootSpeed = 10f; - } + item.damage = 123; + item.melee = true; + item.width = 38; + item.height = 20; + item.useTime = 20; + item.useAnimation = 34; + item.useStyle = 1; + item.knockBack = 10; + item.value = 160000; + item.rare = 10; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.shoot = 263; + item.shootSpeed = 10f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Permafrost"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Permafrost"); + Tooltip.SetDefault(""); + } -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) -{ - for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. - { - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); - } - return false; -} + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. + { + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); + } + return false; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "FrostoneBar", 10); - recipe.AddIngredient(null, "IceSoul", 12); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "FrostoneBar", 10); + recipe.AddIngredient(null, "IceSoul", 12); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } } diff --git a/Items/PetalBand.cs b/Items/PetalBand.cs index 6896d44b..e101363a 100644 --- a/Items/PetalBand.cs +++ b/Items/PetalBand.cs @@ -22,11 +22,11 @@ public override void SetDefaults() item.consumable = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Petal Band"); - Tooltip.SetDefault("Summons the Plantera"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Petal Band"); + Tooltip.SetDefault("Summons the Plantera"); + } public override bool CanUseItem(Player player) @@ -41,16 +41,16 @@ public override bool UseItem(Player player) return true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "EssenseofJungle", 1); - recipe.AddIngredient(ItemID.ChlorophyteBar, 5); - recipe.AddIngredient(ItemID.Vine, 5); - recipe.AddIngredient(ItemID.Stinger, 5); - recipe.SetResult(this); - recipe.AddTile(26); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "EssenseofJungle", 1); + recipe.AddIngredient(ItemID.ChlorophyteBar, 5); + recipe.AddIngredient(ItemID.Vine, 5); + recipe.AddIngredient(ItemID.Stinger, 5); + recipe.SetResult(this); + recipe.AddTile(26); + recipe.AddRecipe(); + } } } diff --git a/Items/PetrifiedSpike.cs b/Items/PetrifiedSpike.cs index da6a8f3b..481e1878 100644 --- a/Items/PetrifiedSpike.cs +++ b/Items/PetrifiedSpike.cs @@ -4,23 +4,25 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class PetrifiedSpike : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class PetrifiedSpike : ModItem + { + public override void SetDefaults() + { - item.height = 16; - item.maxStack = 99; - item.value = 10; - item.rare = 1; - } + item.height = 16; + item.maxStack = 99; + item.value = 10; + item.rare = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Petrified Spike"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Petrified Spike"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/Phantablast.cs b/Items/Phantablast.cs index 301fb779..d5283fc5 100644 --- a/Items/Phantablast.cs +++ b/Items/Phantablast.cs @@ -5,70 +5,72 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class Phantablast : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.damage = 83; - item.ranged = true; - item.width = 20; - item.height = 12; - item.useTime = 12; - item.useAnimation = 20; - item.useStyle = 5; - item.knockBack = 6; - item.value = 210000; - item.rare = 10; - item.useStyle = 5; - item.UseSound = SoundID.Item36; - item.noMelee = true; - item.autoReuse = false; - item.shoot = 10; - item.shootSpeed = 23f; - item.useAmmo = AmmoID.Bullet; - } + public class Phantablast : ModItem + { + public override void SetDefaults() + { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Phantablast"); - Tooltip.SetDefault(""); - } + item.damage = 83; + item.ranged = true; + item.width = 20; + item.height = 12; + item.useTime = 12; + item.useAnimation = 20; + item.useStyle = 5; + item.knockBack = 6; + item.value = 210000; + item.rare = 10; + item.useStyle = 5; + item.UseSound = SoundID.Item36; + item.noMelee = true; + item.autoReuse = false; + item.shoot = 10; + item.shootSpeed = 23f; + item.useAmmo = AmmoID.Bullet; + } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Phantablast"); + Tooltip.SetDefault(""); + } - public override Vector2? HoldoutOffset() - { - return new Vector2(-18, -4); - } -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) -{ - for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. - { - Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 3, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 2, speedY - 3, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 4, speedY - 2, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX + 4, speedY + 2, type, damage, knockBack, Main.myPlayer); - } - return false; -} + public override Vector2? HoldoutOffset() + { + return new Vector2(-18, -4); + } + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. + { + Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 3, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 2, speedY - 3, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 4, speedY - 2, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX + 4, speedY + 2, type, damage, knockBack, Main.myPlayer); + } + return false; + } - public override bool ConsumeAmmo(Player p) + public override bool ConsumeAmmo(Player p) { return Main.rand.Next(2) == 0; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "AncientTechnology", 1); - recipe.AddIngredient(3456, 30); - recipe.AddIngredient(null, "AirFragment", 25); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "AncientTechnology", 1); + recipe.AddIngredient(3456, 30); + recipe.AddIngredient(null, "AirFragment", 25); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Phantaplasm.cs b/Items/Phantaplasm.cs index a665e9ac..00d4d07b 100644 --- a/Items/Phantaplasm.cs +++ b/Items/Phantaplasm.cs @@ -6,26 +6,28 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Phantaplasm : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Phantaplasm : ModItem + { + public override void SetDefaults() + { - item.width = 36; - item.height = 52; - item.maxStack = 99; - item.value = 15000; - item.rare = 10; - ItemID.Sets.ItemNoGravity[item.type] = true; - } + item.width = 36; + item.height = 52; + item.maxStack = 99; + item.value = 15000; + item.rare = 10; + ItemID.Sets.ItemNoGravity[item.type] = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Alphaplasm"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Alphaplasm"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/PhantomBanner.cs b/Items/PhantomBanner.cs index b060a248..dc1b8579 100644 --- a/Items/PhantomBanner.cs +++ b/Items/PhantomBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class PhantomBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class PhantomBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 3; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 3; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Phantom Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Phantom Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/PhantomFlask.cs b/Items/PhantomFlask.cs index ef149a20..bd6e5aae 100644 --- a/Items/PhantomFlask.cs +++ b/Items/PhantomFlask.cs @@ -9,73 +9,74 @@ namespace Tremor.Items { public class PhantomFlask : AlchemistItem - { + { - public override void SetDefaults() - { - item.crit = 4; - item.damage = 60; - //item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("PhantomFlaskPro"); - item.shootSpeed = 8f; - item.useStyle = 1; - item.knockBack = 1; - item.UseSound = SoundID.Item106; - item.value = 120; - item.rare = 1; - item.autoReuse = false; + public override void SetDefaults() + { + item.crit = 4; + item.damage = 60; + //item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("PhantomFlaskPro"); + item.shootSpeed = 8f; + item.useStyle = 1; + item.knockBack = 1; + item.UseSound = SoundID.Item106; + item.value = 120; + item.rare = 1; + item.autoReuse = false; - item.ammo = mod.ItemType("BoomFlask"); - } + item.ammo = mod.ItemType("BoomFlask"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Phantom Flask"); - Tooltip.SetDefault("Throws a flask that explodes into clouds\nClouds deal damage to enemies and burn them with shadowflames"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Phantom Flask"); + Tooltip.SetDefault("Throws a flask that explodes into clouds\nClouds deal damage to enemies and burn them with shadowflames"); + } - public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) - { - type = mod.ProjectileType("ShadowCloudPro"); - } + public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) + { + type = mod.ProjectileType("ShadowCloudPro"); + } - public override void UpdateInventory(Player player) - { - MPlayer modPlayer = player.GetModPlayer(mod); - if (modPlayer.novaHelmet) - { - item.autoReuse = true; - } - if (!modPlayer.novaHelmet) - { - item.autoReuse = false; - } - - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) - { - item.shootSpeed = 11f; - } - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) - { - item.shootSpeed = 8f; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) - { - item.autoReuse = true; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) - { - item.autoReuse = false; - } - } + public override void UpdateInventory(Player player) + { + MPlayer modPlayer = player.GetModPlayer(mod); + if (modPlayer.novaHelmet) + { + item.autoReuse = true; + } + if (!modPlayer.novaHelmet) + { + item.autoReuse = false; + } -}} + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) + { + item.shootSpeed = 11f; + } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) + { + item.shootSpeed = 8f; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) + { + item.autoReuse = true; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) + { + item.autoReuse = false; + } + } + + } +} diff --git a/Items/PhantomJavelin.cs b/Items/PhantomJavelin.cs index 16ab9bf8..97b9fd09 100644 --- a/Items/PhantomJavelin.cs +++ b/Items/PhantomJavelin.cs @@ -33,19 +33,19 @@ public override void SetDefaults() item.crit = 7; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Phantom Javelin"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Phantom Javelin"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "PhantomSoul", 25); - recipe.SetResult(this); - recipe.AddTile(null, "MagicWorkbenchTile"); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "PhantomSoul", 25); + recipe.SetResult(this); + recipe.AddTile(null, "MagicWorkbenchTile"); + recipe.AddRecipe(); + } } } diff --git a/Items/PhantomSoul.cs b/Items/PhantomSoul.cs index 612f7387..5812af75 100644 --- a/Items/PhantomSoul.cs +++ b/Items/PhantomSoul.cs @@ -6,25 +6,27 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class PhantomSoul : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class PhantomSoul : ModItem + { + public override void SetDefaults() + { - item.width = 32; - item.height = 58; - item.maxStack = 99; - item.value = 100; - item.rare = 2; - ItemID.Sets.ItemNoGravity[item.type] = true; - } + item.width = 32; + item.height = 58; + item.maxStack = 99; + item.value = 100; + item.rare = 2; + ItemID.Sets.ItemNoGravity[item.type] = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Phantom Soul"); - Tooltip.SetDefault(""); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(10, 4)); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Phantom Soul"); + Tooltip.SetDefault(""); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(10, 4)); + } -}} + } +} diff --git a/Items/PharaohBlade.cs b/Items/PharaohBlade.cs index eebc2f1a..4ae5046f 100644 --- a/Items/PharaohBlade.cs +++ b/Items/PharaohBlade.cs @@ -5,54 +5,55 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class PharaohBlade : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.damage = 25; - item.melee = true; - item.width = 50; - item.height = 55; - item.useTime = 25; - item.useAnimation = 25; - item.useStyle = 1; - - - item.knockBack = 4; - item.value = 10000; - item.rare = 3; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Pharaoh Blade"); - Tooltip.SetDefault("Allows you to get more coins for killing enemies\n'More gold for God of gold!'"); - } - - - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(72, 1200); - } - -public virtual void OnHitPvp(Item item, Player player, Player target, int damage, bool crit) - { - target.AddBuff(72, 1200); - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(3380, 8); - recipe.AddIngredient(ItemID.Topaz, 5); - recipe.AddIngredient(ItemID.AntlionMandible, 2); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -} + public class PharaohBlade : ModItem + { + public override void SetDefaults() + { + + item.damage = 25; + item.melee = true; + item.width = 50; + item.height = 55; + item.useTime = 25; + item.useAnimation = 25; + item.useStyle = 1; + + + item.knockBack = 4; + item.value = 10000; + item.rare = 3; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Pharaoh Blade"); + Tooltip.SetDefault("Allows you to get more coins for killing enemies\n'More gold for God of gold!'"); + } + + + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(72, 1200); + } + + public virtual void OnHitPvp(Item item, Player player, Player target, int damage, bool crit) + { + target.AddBuff(72, 1200); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(3380, 8); + recipe.AddIngredient(ItemID.Topaz, 5); + recipe.AddIngredient(ItemID.AntlionMandible, 2); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } } diff --git a/Items/PharaohCasterBanner.cs b/Items/PharaohCasterBanner.cs index 7d3217cc..fa7bc1be 100644 --- a/Items/PharaohCasterBanner.cs +++ b/Items/PharaohCasterBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class PharaohCasterBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class PharaohCasterBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 80; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 80; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Pharaoh Caster Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Pharaoh Caster Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/PhilosophersFlower.cs b/Items/PhilosophersFlower.cs index 977c0362..9c3cbb0b 100644 --- a/Items/PhilosophersFlower.cs +++ b/Items/PhilosophersFlower.cs @@ -4,39 +4,41 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class PhilosophersFlower : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.width = 22; - item.height = 44; - item.value = 100; - item.rare = 4; - item.accessory = true; - } + public class PhilosophersFlower : ModItem + { + public override void SetDefaults() + { + item.width = 22; + item.height = 44; + item.value = 100; + item.rare = 4; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Philosophers Flower"); - Tooltip.SetDefault("Reduces the cooldown of healing potions\nAutomatically uses mana potions when needed"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Philosophers Flower"); + Tooltip.SetDefault("Reduces the cooldown of healing potions\nAutomatically uses mana potions when needed"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.potionDelayTime = 2700; - player.manaFlower = true; - player.manaCost -= 0.10f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.PhilosophersStone, 1); - recipe.AddIngredient(ItemID.ManaFlower, 1); - recipe.SetResult(this); - recipe.AddTile(114); - recipe.AddRecipe(); - } -}} + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.potionDelayTime = 2700; + player.manaFlower = true; + player.manaCost -= 0.10f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.PhilosophersStone, 1); + recipe.AddIngredient(ItemID.ManaFlower, 1); + recipe.SetResult(this); + recipe.AddTile(114); + recipe.AddRecipe(); + } + } +} diff --git a/Items/PhobosBanner.cs b/Items/PhobosBanner.cs index 64bbb020..847b005e 100644 --- a/Items/PhobosBanner.cs +++ b/Items/PhobosBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class PhobosBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class PhobosBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 81; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 81; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Phobos Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Phobos Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/PhoenixShotgun.cs b/Items/PhoenixShotgun.cs index 63eb1f20..8179f59b 100644 --- a/Items/PhoenixShotgun.cs +++ b/Items/PhoenixShotgun.cs @@ -5,58 +5,60 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class PhoenixShotgun : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class PhoenixShotgun : ModItem + { + public override void SetDefaults() + { - item.damage = 26; - item.ranged = true; - item.width = 46; - item.height = 18; - item.useTime = 32; - item.useAnimation = 32; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 3; - item.value = 16000; - item.rare = 3; - item.UseSound = SoundID.Item36; - item.autoReuse = false; - item.shoot = 10; - item.shootSpeed = 5f; - item.useAmmo = AmmoID.Bullet; - } + item.damage = 26; + item.ranged = true; + item.width = 46; + item.height = 18; + item.useTime = 32; + item.useAnimation = 32; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 3; + item.value = 16000; + item.rare = 3; + item.UseSound = SoundID.Item36; + item.autoReuse = false; + item.shoot = 10; + item.shootSpeed = 5f; + item.useAmmo = AmmoID.Bullet; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Phoenix Shotgun"); - Tooltip.SetDefault("Uses bullets as ammo\nTransforms bullets into fireballs"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Phoenix Shotgun"); + Tooltip.SetDefault("Uses bullets as ammo\nTransforms bullets into fireballs"); + } -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) -{ - type = 666; - for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. - { - Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 2, speedY - 2, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); - } - return false; -} + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + type = 666; + for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. + { + Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 2, speedY - 2, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); + } + return false; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "FireFragment", 15); - recipe.AddIngredient(null, "MoltenParts", 1); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "FireFragment", 15); + recipe.AddIngredient(null, "MoltenParts", 1); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/PickaxeofBloom.cs b/Items/PickaxeofBloom.cs index 421acedf..6c7a848c 100644 --- a/Items/PickaxeofBloom.cs +++ b/Items/PickaxeofBloom.cs @@ -4,32 +4,34 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class PickaxeofBloom : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class PickaxeofBloom : ModItem + { + public override void SetDefaults() + { - item.damage = 9; - item.melee = true; - item.width = 42; - item.height = 42; - item.useTime = 15; - item.useAnimation = 20; - item.pick = 68; - item.useStyle = 1; - item.knockBack = 5; - item.value = 600; - item.rare = 3; - item.UseSound = SoundID.Item1; - item.useTurn = true; - item.autoReuse = true; - } + item.damage = 9; + item.melee = true; + item.width = 42; + item.height = 42; + item.useTime = 15; + item.useAnimation = 20; + item.pick = 68; + item.useStyle = 1; + item.knockBack = 5; + item.value = 600; + item.rare = 3; + item.UseSound = SoundID.Item1; + item.useTurn = true; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Pickaxe of Bloom"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Pickaxe of Bloom"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/PieceofFlesh.cs b/Items/PieceofFlesh.cs index 6cec9979..beb65939 100644 --- a/Items/PieceofFlesh.cs +++ b/Items/PieceofFlesh.cs @@ -4,23 +4,25 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class PieceofFlesh : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class PieceofFlesh : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 100; - item.rare = 4; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 100; + item.rare = 4; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Piece of Flesh"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Piece of Flesh"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/PiercingQuartz.cs b/Items/PiercingQuartz.cs index d23cfd2e..11ee635b 100644 --- a/Items/PiercingQuartz.cs +++ b/Items/PiercingQuartz.cs @@ -4,32 +4,34 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class PiercingQuartz : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class PiercingQuartz : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 44; + item.width = 22; + item.height = 44; - item.value = 100; - item.rare = 4; - item.accessory = true; - } + item.value = 100; + item.rare = 4; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Piercing Quartz"); - Tooltip.SetDefault("5% increased critical strike chance"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Piercing Quartz"); + Tooltip.SetDefault("5% increased critical strike chance"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.rangedCrit += 5; - player.meleeCrit += 5; - player.magicCrit += 5; - player.thrownCrit += 5; - } -}} + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.rangedCrit += 5; + player.meleeCrit += 5; + player.magicCrit += 5; + player.thrownCrit += 5; + } + } +} diff --git a/Items/PinkGelCube.cs b/Items/PinkGelCube.cs index 9dfa27b6..9e45e52f 100644 --- a/Items/PinkGelCube.cs +++ b/Items/PinkGelCube.cs @@ -3,35 +3,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class PinkGelCube : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 60; - item.rare = 1; - - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Pink Gel Cube"); - Tooltip.SetDefault("Alchemically important ingredient"); - } - - - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.PinkGel, 5); - recipe.SetResult(this); - recipe.AddTile(13); - recipe.AddRecipe(); - } - -}} + public class PinkGelCube : ModItem + { + public override void SetDefaults() + { + + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 60; + item.rare = 1; + + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Pink Gel Cube"); + Tooltip.SetDefault("Alchemically important ingredient"); + } + + + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.PinkGel, 5); + recipe.SetResult(this); + recipe.AddTile(13); + recipe.AddRecipe(); + } + + } +} diff --git a/Items/PirahnaStaff.cs b/Items/PirahnaStaff.cs index d5938f41..fe959aad 100644 --- a/Items/PirahnaStaff.cs +++ b/Items/PirahnaStaff.cs @@ -5,37 +5,38 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class PirahnaStaff : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.CloneDefaults(ItemID.Starfury); + public class PirahnaStaff : ModItem + { + public override void SetDefaults() + { + item.CloneDefaults(ItemID.Starfury); - item.damage = 18; - item.melee = false; - item.magic = true; - item.width = 50; - item.height = 55; - item.useTime = 20; - item.mana = 8; + item.damage = 18; + item.melee = false; + item.magic = true; + item.width = 50; + item.height = 55; + item.useTime = 20; + item.mana = 8; - item.useAnimation = 50; - item.useStyle = 5; - item.shootSpeed = 10f; - Item.staff[item.type] = true; - item.knockBack = 3; - item.value = 15000; - item.rare = 3; - item.UseSound = SoundID.Item9; - item.autoReuse = true; - } + item.useAnimation = 50; + item.useStyle = 5; + item.shootSpeed = 10f; + Item.staff[item.type] = true; + item.knockBack = 3; + item.value = 15000; + item.rare = 3; + item.UseSound = SoundID.Item9; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Piranha Staff"); - Tooltip.SetDefault("Causes pirahnas to fall from the sky"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Piranha Staff"); + Tooltip.SetDefault("Causes pirahnas to fall from the sky"); + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) @@ -47,22 +48,22 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GoldfishStaff", 1); - recipe.AddIngredient(null, "SeaFragment", 10); + recipe.AddIngredient(null, "GoldfishStaff", 1); + recipe.AddIngredient(null, "SeaFragment", 10); recipe.AddIngredient(ItemID.GoldBar, 8); recipe.AddIngredient(ItemID.Ruby, 6); - recipe.AddTile(null, "MagicWorkbenchTile"); + recipe.AddTile(null, "MagicWorkbenchTile"); recipe.SetResult(this); recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GoldfishStaff", 1); - recipe.AddIngredient(null, "SeaFragment", 10); + recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GoldfishStaff", 1); + recipe.AddIngredient(null, "SeaFragment", 10); recipe.AddIngredient(ItemID.PlatinumBar, 8); recipe.AddIngredient(ItemID.Ruby, 6); - recipe.AddTile(null, "MagicWorkbenchTile"); + recipe.AddTile(null, "MagicWorkbenchTile"); recipe.SetResult(this); recipe.AddRecipe(); } -} + } } diff --git a/Items/PirateChest.cs b/Items/PirateChest.cs index 8f425f94..757e5040 100644 --- a/Items/PirateChest.cs +++ b/Items/PirateChest.cs @@ -4,80 +4,82 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class PirateChest : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class PirateChest : ModItem + { + public override void SetDefaults() + { - item.maxStack = 999; - item.consumable = true; - item.width = 34; - item.height = 34; - item.value = 20000; + item.maxStack = 999; + item.consumable = true; + item.width = 34; + item.height = 34; + item.value = 20000; - item.rare = 5; - } + item.rare = 5; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Pirate Chest"); - Tooltip.SetDefault("Right click to open\n'Contains precious things'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Pirate Chest"); + Tooltip.SetDefault("Right click to open\n'Contains precious things'"); + } - public override bool CanRightClick() - { - return true; - } + public override bool CanRightClick() + { + return true; + } - public override void RightClick(Player player) - { - if(Main.rand.Next(10) == 0) - { - player.QuickSpawnItem(2854); - } - if(Main.rand.Next(5) == 0) - { - player.QuickSpawnItem(672); - } - if(Main.rand.Next(25) == 0) - { - player.QuickSpawnItem(905); - } - if(Main.rand.Next(15) == 0) - { - player.QuickSpawnItem(855);; - } - if(Main.rand.Next(10) == 0) - { - player.QuickSpawnItem(854); - } - if(Main.rand.Next(15) == 0) - { - player.QuickSpawnItem(3033); - } - if(Main.rand.Next(6) == 0) - { - player.QuickSpawnItem(mod.ItemType("HandCannon")); - } - if(Main.rand.Next(6) == 0) - { - player.QuickSpawnItem(mod.ItemType("PirateFlag")); - } - if(Main.rand.Next(1) == 0) - { - player.QuickSpawnItem(73, Main.rand.Next(9, 18)); - } - if(Main.rand.Next(2) == 0) - { - player.QuickSpawnItem(19, Main.rand.Next(14, 19));; - } - if(Main.rand.Next(2) == 0) - { - player.QuickSpawnItem(706, Main.rand.Next(14, 19));; - } - } + public override void RightClick(Player player) + { + if (Main.rand.Next(10) == 0) + { + player.QuickSpawnItem(2854); + } + if (Main.rand.Next(5) == 0) + { + player.QuickSpawnItem(672); + } + if (Main.rand.Next(25) == 0) + { + player.QuickSpawnItem(905); + } + if (Main.rand.Next(15) == 0) + { + player.QuickSpawnItem(855); ; + } + if (Main.rand.Next(10) == 0) + { + player.QuickSpawnItem(854); + } + if (Main.rand.Next(15) == 0) + { + player.QuickSpawnItem(3033); + } + if (Main.rand.Next(6) == 0) + { + player.QuickSpawnItem(mod.ItemType("HandCannon")); + } + if (Main.rand.Next(6) == 0) + { + player.QuickSpawnItem(mod.ItemType("PirateFlag")); + } + if (Main.rand.Next(1) == 0) + { + player.QuickSpawnItem(73, Main.rand.Next(9, 18)); + } + if (Main.rand.Next(2) == 0) + { + player.QuickSpawnItem(19, Main.rand.Next(14, 19)); ; + } + if (Main.rand.Next(2) == 0) + { + player.QuickSpawnItem(706, Main.rand.Next(14, 19)); ; + } + } -}} + } +} diff --git a/Items/PirateFlag.cs b/Items/PirateFlag.cs index aeafe3de..4d08bc5c 100644 --- a/Items/PirateFlag.cs +++ b/Items/PirateFlag.cs @@ -25,11 +25,11 @@ public override void SetDefaults() item.mountType = mod.MountType("FlyingDutchman"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Pirate Flag"); - Tooltip.SetDefault("Summons a rideable Flying Dutchman"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Pirate Flag"); + Tooltip.SetDefault("Summons a rideable Flying Dutchman"); + } } } diff --git a/Items/Pitchfork.cs b/Items/Pitchfork.cs index fff1c175..9252ca3b 100644 --- a/Items/Pitchfork.cs +++ b/Items/Pitchfork.cs @@ -4,33 +4,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Pitchfork : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Pitchfork : ModItem + { + public override void SetDefaults() + { - item.damage = 22; - item.width = 14; - item.height = 84; - item.noUseGraphic = true; - item.melee = true; - item.useTime = 25; - item.shoot = mod.ProjectileType("PitchforkPro"); - item.shootSpeed = 3f; - item.useAnimation = 25; - item.useStyle = 5; - item.knockBack = 4; - item.value = 50000; - item.rare = 2; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 22; + item.width = 14; + item.height = 84; + item.noUseGraphic = true; + item.melee = true; + item.useTime = 25; + item.shoot = mod.ProjectileType("PitchforkPro"); + item.shootSpeed = 3f; + item.useAnimation = 25; + item.useStyle = 5; + item.knockBack = 4; + item.value = 50000; + item.rare = 2; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Pitchfork"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Pitchfork"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/PixiePulse.cs b/Items/PixiePulse.cs index 70909528..1052bb29 100644 --- a/Items/PixiePulse.cs +++ b/Items/PixiePulse.cs @@ -5,39 +5,41 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class PixiePulse : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class PixiePulse : ModItem + { + public override void SetDefaults() + { - item.damage = 46; - item.magic = true; - item.width = 46; - item.height = 26; - item.useTime = 20; - item.useAnimation = 20; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 7; - item.value = 10000; - item.rare = 1; - item.UseSound = SoundID.Item12; - item.autoReuse = true; - item.shoot = 88; - item.shootSpeed = 5f; - item.mana = 10; - } + item.damage = 46; + item.magic = true; + item.width = 46; + item.height = 26; + item.useTime = 20; + item.useAnimation = 20; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 7; + item.value = 10000; + item.rare = 1; + item.UseSound = SoundID.Item12; + item.autoReuse = true; + item.shoot = 88; + item.shootSpeed = 5f; + item.mana = 10; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Pixie Pulse"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Pixie Pulse"); + Tooltip.SetDefault(""); + } - public override Vector2? HoldoutOffset() - { - return new Vector2(-1, 0); - } -}} + public override Vector2? HoldoutOffset() + { + return new Vector2(-1, 0); + } + } +} diff --git a/Items/PixieQueenBag.cs b/Items/PixieQueenBag.cs index b37c4d18..0f16223b 100644 --- a/Items/PixieQueenBag.cs +++ b/Items/PixieQueenBag.cs @@ -4,59 +4,61 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class PixieQueenBag : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.maxStack = 999; - item.consumable = true; - item.width = 24; - item.height = 24; - - item.rare = 9; - item.expert = true; - bossBagNPC = mod.NPCType("PixieQueen"); - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Treasure Bag"); - Tooltip.SetDefault("Right click to open"); - } - - - public override bool CanRightClick() - { - return true; - } - - public override void OpenBossBag(Player player) - { - if(Main.rand.Next(7) == 0) - { - player.QuickSpawnItem(mod.ItemType("PixieQueenMask")); - } - if(Main.rand.Next(6) == 0) - { - player.QuickSpawnItem(mod.ItemType("EtherealFeather")); - } - if(Main.rand.Next(6) == 0) - { - player.QuickSpawnItem(mod.ItemType("PixiePulse")); - } - if(Main.rand.Next(6) == 0) - { - player.QuickSpawnItem(mod.ItemType("HeartMagnet")); - } - if(Main.rand.Next(6) == 0) - { - player.QuickSpawnItem(mod.ItemType("DopelgangerCandle")); - } - player.QuickSpawnItem(mod.ItemType("GlorianaWrath")); - player.TryGettingDevArmor(); - player.QuickSpawnItem(mod.ItemType("ChaosBar"), Main.rand.Next(15,25)); - } - -}} + public class PixieQueenBag : ModItem + { + public override void SetDefaults() + { + + item.maxStack = 999; + item.consumable = true; + item.width = 24; + item.height = 24; + + item.rare = 9; + item.expert = true; + bossBagNPC = mod.NPCType("PixieQueen"); + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Treasure Bag"); + Tooltip.SetDefault("Right click to open"); + } + + + public override bool CanRightClick() + { + return true; + } + + public override void OpenBossBag(Player player) + { + if (Main.rand.Next(7) == 0) + { + player.QuickSpawnItem(mod.ItemType("PixieQueenMask")); + } + if (Main.rand.Next(6) == 0) + { + player.QuickSpawnItem(mod.ItemType("EtherealFeather")); + } + if (Main.rand.Next(6) == 0) + { + player.QuickSpawnItem(mod.ItemType("PixiePulse")); + } + if (Main.rand.Next(6) == 0) + { + player.QuickSpawnItem(mod.ItemType("HeartMagnet")); + } + if (Main.rand.Next(6) == 0) + { + player.QuickSpawnItem(mod.ItemType("DopelgangerCandle")); + } + player.QuickSpawnItem(mod.ItemType("GlorianaWrath")); + player.TryGettingDevArmor(); + player.QuickSpawnItem(mod.ItemType("ChaosBar"), Main.rand.Next(15, 25)); + } + + } +} diff --git a/Items/PixieQueenMask.cs b/Items/PixieQueenMask.cs index 8950b97f..d3e855ff 100644 --- a/Items/PixieQueenMask.cs +++ b/Items/PixieQueenMask.cs @@ -4,25 +4,28 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class PixieQueenMask : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class PixieQueenMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 20; - item.height = 22; - item.rare = 1; - item.vanity = true; - } + item.width = 20; + item.height = 22; + item.rare = 1; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Pixie Queen Mask"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Pixie Queen Mask"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/PixieQueenTrophy.cs b/Items/PixieQueenTrophy.cs index d835d8a6..e19860fc 100644 --- a/Items/PixieQueenTrophy.cs +++ b/Items/PixieQueenTrophy.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class PixieQueenTrophy : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class PixieQueenTrophy : ModItem + { + public override void SetDefaults() + { - item.width = 32; - item.height = 32; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 50000; - item.createTile = mod.TileType("PixieQueenTrophy"); - item.placeStyle = 0; - } + item.width = 32; + item.height = 32; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 50000; + item.createTile = mod.TileType("PixieQueenTrophy"); + item.placeStyle = 0; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Pixie Queen Trophy"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Pixie Queen Trophy"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/PixieinaJar.cs b/Items/PixieinaJar.cs index ea8c1e55..246f87a2 100644 --- a/Items/PixieinaJar.cs +++ b/Items/PixieinaJar.cs @@ -4,37 +4,38 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class PixieinaJar : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class PixieinaJar : ModItem + { - item.width = 20; - item.height = 30; - item.maxStack = 20; + public override void SetDefaults() + { + item.width = 20; + item.height = 30; + item.maxStack = 20; - item.rare = 5; - item.useAnimation = 45; - item.useTime = 45; - item.useStyle = 4; - item.consumable = true; - } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Pixie in a Jar"); - Tooltip.SetDefault("Summons the Pixie Queen\n'I think something wants to get out of the jar...'"); - } + item.rare = 5; + item.useAnimation = 45; + item.useTime = 45; + item.useStyle = 4; + item.consumable = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Pixie in a Jar"); + Tooltip.SetDefault("Summons the Pixie Queen\n'I think something wants to get out of the jar...'"); + } - public override bool CanUseItem(Player player) - { - return NPC.downedMechBossAny && !Main.dayTime && !NPC.AnyNPCs(mod.NPCType("PixieQueen")) && player.ZoneHoly; - } + public override bool CanUseItem(Player player) + { + return NPC.downedMechBossAny && !Main.dayTime && !NPC.AnyNPCs(mod.NPCType("PixieQueen")) && player.ZoneHoly; + } public override bool UseItem(Player player) { @@ -43,16 +44,17 @@ public override bool UseItem(Player player) return true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Bottle, 1); - recipe.AddIngredient(ItemID.PixieDust, 25); - recipe.AddIngredient(ItemID.SoulofLight, 15); - recipe.AddIngredient(ItemID.CrystalShard, 20); - recipe.AddIngredient(ItemID.HallowedBar, 6); - recipe.AddTile(134); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Bottle, 1); + recipe.AddIngredient(ItemID.PixieDust, 25); + recipe.AddIngredient(ItemID.SoulofLight, 15); + recipe.AddIngredient(ItemID.CrystalShard, 20); + recipe.AddIngredient(ItemID.HallowedBar, 6); + recipe.AddTile(134); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/PlagueBreastplate.cs b/Items/PlagueBreastplate.cs index 2de3c766..48d7ec00 100644 --- a/Items/PlagueBreastplate.cs +++ b/Items/PlagueBreastplate.cs @@ -6,8 +6,8 @@ using Terraria.ModLoader; namespace Tremor.Items -{ -[AutoloadEquip(EquipType.Body)] +{ + [AutoloadEquip(EquipType.Body)] public class PlagueBreastplate : ModItem { @@ -22,27 +22,27 @@ public override void SetDefaults() item.defense = 5; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Plague Breastplate"); - Tooltip.SetDefault("Increases alchemic damage by 10%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Plague Breastplate"); + Tooltip.SetDefault("Increases alchemic damage by 10%"); + } public override void UpdateEquip(Player player) { - player.GetModPlayer(mod).alchemistDamage += 0.1f; + player.GetModPlayer(mod).alchemistDamage += 0.1f; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Silk, 20); - recipe.AddIngredient(null, "PhantomSoul", 5); - recipe.AddIngredient(null, "TearsofDeath", 8); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Silk, 20); + recipe.AddIngredient(null, "PhantomSoul", 5); + recipe.AddIngredient(null, "TearsofDeath", 8); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } } } diff --git a/Items/PlagueFlask.cs b/Items/PlagueFlask.cs index 1c227033..abd8f734 100644 --- a/Items/PlagueFlask.cs +++ b/Items/PlagueFlask.cs @@ -9,71 +9,72 @@ namespace Tremor.Items { public class PlagueFlask : AlchemistItem - { + { - public override void SetDefaults() - { - item.crit = 4; - item.damage = 52; - //item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("PlagueFlaskPro"); - item.shootSpeed = 8f; - item.useStyle = 1; - item.knockBack = 1; - item.UseSound = SoundID.Item106; - item.value = 120; - item.rare = 5; - item.autoReuse = false; + public override void SetDefaults() + { + item.crit = 4; + item.damage = 52; + //item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("PlagueFlaskPro"); + item.shootSpeed = 8f; + item.useStyle = 1; + item.knockBack = 1; + item.UseSound = SoundID.Item106; + item.value = 120; + item.rare = 5; + item.autoReuse = false; - item.ammo = mod.ItemType("BoomFlask"); - } + item.ammo = mod.ItemType("BoomFlask"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Plague Flask"); - Tooltip.SetDefault("Throws a flask that explodes into plague souls"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Plague Flask"); + Tooltip.SetDefault("Throws a flask that explodes into plague souls"); + } - public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) - { - type = mod.ProjectileType("PlaguePro"); - } + public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) + { + type = mod.ProjectileType("PlaguePro"); + } - public override void UpdateInventory(Player player) - { - MPlayer modPlayer = player.GetModPlayer(mod); - if (modPlayer.novaHelmet) - { - item.autoReuse = true; - } - if (!modPlayer.novaHelmet) - { - item.autoReuse = false; - } - - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) - { - item.shootSpeed = 11f; - } - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) - { - item.shootSpeed = 8f; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) - { - item.autoReuse = true; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) - { - item.autoReuse = false; - } - } -}} + public override void UpdateInventory(Player player) + { + MPlayer modPlayer = player.GetModPlayer(mod); + if (modPlayer.novaHelmet) + { + item.autoReuse = true; + } + if (!modPlayer.novaHelmet) + { + item.autoReuse = false; + } + + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) + { + item.shootSpeed = 11f; + } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) + { + item.shootSpeed = 8f; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) + { + item.autoReuse = true; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) + { + item.autoReuse = false; + } + } + } +} diff --git a/Items/PlagueGreaves.cs b/Items/PlagueGreaves.cs index 21bd8d74..cc5e7d00 100644 --- a/Items/PlagueGreaves.cs +++ b/Items/PlagueGreaves.cs @@ -5,43 +5,46 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class PlagueGreaves : ModItem +namespace Tremor.Items { - - - public override void SetDefaults() - { - - item.width = 38; - item.height = 22; - - item.value = 25000; - item.rare = 2; - item.defense = 4; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Plague Greaves"); - Tooltip.SetDefault("Increases alchemic damage by 10%"); - } - - - public override void UpdateEquip(Player player) - { - player.GetModPlayer(mod).alchemistDamage += 0.1f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Silk, 16); - recipe.AddIngredient(null, "PhantomSoul", 4); - recipe.AddIngredient(null, "TearsofDeath", 8); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } - -}} + [AutoloadEquip(EquipType.Legs)] + public class PlagueGreaves : ModItem + { + + + public override void SetDefaults() + { + + item.width = 38; + item.height = 22; + + item.value = 25000; + item.rare = 2; + item.defense = 4; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Plague Greaves"); + Tooltip.SetDefault("Increases alchemic damage by 10%"); + } + + + public override void UpdateEquip(Player player) + { + player.GetModPlayer(mod).alchemistDamage += 0.1f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Silk, 16); + recipe.AddIngredient(null, "PhantomSoul", 4); + recipe.AddIngredient(null, "TearsofDeath", 8); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + + } +} diff --git a/Items/PlagueHelmet.cs b/Items/PlagueHelmet.cs index d09befd9..ff5b6294 100644 --- a/Items/PlagueHelmet.cs +++ b/Items/PlagueHelmet.cs @@ -5,54 +5,57 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class PlagueHelmet : ModItem +namespace Tremor.Items { - - - public override void SetDefaults() - { - - item.width = 38; - item.height = 22; - - item.value = 25000; - item.rare = 2; - item.defense = 4; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Plague Helmet"); - Tooltip.SetDefault("Increases alchemic damage by 10%"); - } - - - public override void UpdateEquip(Player player) - { - player.GetModPlayer(mod).alchemistDamage += 0.1f; - } - - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("PlagueBreastplate") && legs.type == mod.ItemType("PlagueGreaves"); - } - - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increases size of alchemic clouds"; - player.AddBuff(mod.BuffType("FlaskExpansionBuff"), 2); - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Silk, 12); - recipe.AddIngredient(null, "PhantomSoul", 4); - recipe.AddIngredient(null, "TearsofDeath", 8); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } - -}} + [AutoloadEquip(EquipType.Head)] + public class PlagueHelmet : ModItem + { + + + public override void SetDefaults() + { + + item.width = 38; + item.height = 22; + + item.value = 25000; + item.rare = 2; + item.defense = 4; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Plague Helmet"); + Tooltip.SetDefault("Increases alchemic damage by 10%"); + } + + + public override void UpdateEquip(Player player) + { + player.GetModPlayer(mod).alchemistDamage += 0.1f; + } + + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("PlagueBreastplate") && legs.type == mod.ItemType("PlagueGreaves"); + } + + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increases size of alchemic clouds"; + player.AddBuff(mod.BuffType("FlaskExpansionBuff"), 2); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Silk, 12); + recipe.AddIngredient(null, "PhantomSoul", 4); + recipe.AddIngredient(null, "TearsofDeath", 8); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + + } +} diff --git a/Items/PlagueMask.cs b/Items/PlagueMask.cs index d390a28e..8e7da055 100644 --- a/Items/PlagueMask.cs +++ b/Items/PlagueMask.cs @@ -5,25 +5,28 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class PlagueMask : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class PlagueMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 24; + item.width = 26; + item.height = 24; - item.rare = 2; - item.value = 10000; - } + item.rare = 2; + item.value = 10000; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Plague Mask"); - Tooltip.SetDefault("'HEE HEE HEE'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Plague Mask"); + Tooltip.SetDefault("'HEE HEE HEE'"); + } -}} + } +} diff --git a/Items/PlagueRobe.cs b/Items/PlagueRobe.cs index 8e426e54..fd3dbd5f 100644 --- a/Items/PlagueRobe.cs +++ b/Items/PlagueRobe.cs @@ -5,25 +5,27 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class PlagueRobe : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Body)] + public class PlagueRobe : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 24; + item.width = 26; + item.height = 24; - item.rare = 2; - item.value = 10000; - } + item.rare = 2; + item.value = 10000; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Plague Robe"); - Tooltip.SetDefault("'HEE HEE HEE'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Plague Robe"); + Tooltip.SetDefault("'HEE HEE HEE'"); + } -}} + } +} diff --git a/Items/PlaguedBow.cs b/Items/PlaguedBow.cs index fe14356c..85fae720 100644 --- a/Items/PlaguedBow.cs +++ b/Items/PlaguedBow.cs @@ -5,34 +5,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class PlaguedBow : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class PlaguedBow : ModItem + { + public override void SetDefaults() + { - item.damage = 56; - item.width = 18; - item.height = 56; - item.ranged = true; - item.useTime = 30; - item.shoot = 1; - item.shootSpeed = 12f; - item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 5; - item.value = 25000; - item.useAmmo = AmmoID.Arrow; - item.rare = 3; - item.UseSound = SoundID.Item5; - item.autoReuse = true; - } + item.damage = 56; + item.width = 18; + item.height = 56; + item.ranged = true; + item.useTime = 30; + item.shoot = 1; + item.shootSpeed = 12f; + item.useAnimation = 30; + item.useStyle = 5; + item.knockBack = 5; + item.value = 25000; + item.useAmmo = AmmoID.Arrow; + item.rare = 3; + item.UseSound = SoundID.Item5; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Plagued Bow"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Plagued Bow"); + Tooltip.SetDefault(""); + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) @@ -41,12 +42,13 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX return base.Shoot(player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ParaxydeShard", 14); - recipe.AddTile(null, "AlchematorTile"); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ParaxydeShard", 14); + recipe.AddTile(null, "AlchematorTile"); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/PlatinumGlobe.cs b/Items/PlatinumGlobe.cs index 32e100e9..659e11ef 100644 --- a/Items/PlatinumGlobe.cs +++ b/Items/PlatinumGlobe.cs @@ -4,40 +4,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class PlatinumGlobe : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class PlatinumGlobe : ModItem + { + public override void SetDefaults() + { - item.width = 32; - item.height = 48; - item.maxStack = 99; - item.value = 100; - item.rare = 1; - item.createTile = mod.TileType("PlatinumGlobe"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - } + item.width = 32; + item.height = 48; + item.maxStack = 99; + item.value = 100; + item.rare = 1; + item.createTile = mod.TileType("PlatinumGlobe"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Platinum Globe"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Platinum Globe"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Wood, 15); - recipe.AddIngredient(ItemID.PlatinumBar, 5); - recipe.SetResult(this); - recipe.AddTile(106); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Wood, 15); + recipe.AddIngredient(ItemID.PlatinumBar, 5); + recipe.SetResult(this); + recipe.AddTile(106); + recipe.AddRecipe(); + } + } +} diff --git a/Items/PlatinumKunai.cs b/Items/PlatinumKunai.cs index 33227858..906b62a2 100644 --- a/Items/PlatinumKunai.cs +++ b/Items/PlatinumKunai.cs @@ -5,44 +5,46 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class PlatinumKunai : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class PlatinumKunai : ModItem + { + public override void SetDefaults() + { - item.damage = 19; - item.height = 32; - item.thrown = true; - item.width = 18; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.useTime = 17; - item.useAnimation = 17; - item.shoot = mod.ProjectileType("PlatinumKunai"); - item.shootSpeed = 17f; - item.useStyle = 1; - item.knockBack = 4; - item.value = 60; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 19; + item.height = 32; + item.thrown = true; + item.width = 18; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.useTime = 17; + item.useAnimation = 17; + item.shoot = mod.ProjectileType("PlatinumKunai"); + item.shootSpeed = 17f; + item.useStyle = 1; + item.knockBack = 4; + item.value = 60; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Platinum Kunai"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Platinum Kunai"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Kunai", 50); - recipe.AddIngredient(ItemID.PlatinumBar, 3); - recipe.SetResult(this, 50); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Kunai", 50); + recipe.AddIngredient(ItemID.PlatinumBar, 3); + recipe.SetResult(this, 50); + recipe.AddRecipe(); + } + } +} diff --git a/Items/PlatinumShield.cs b/Items/PlatinumShield.cs index 9c041114..e5a93759 100644 --- a/Items/PlatinumShield.cs +++ b/Items/PlatinumShield.cs @@ -5,37 +5,39 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Shield)] -public class PlatinumShield : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + [AutoloadEquip(EquipType.Shield)] + public class PlatinumShield : ModItem + { + public override void SetDefaults() + { - item.width = 28; - item.height = 28; - item.value = 110; - item.rare = 0; - item.accessory = true; - item.defense = 4; - } + item.width = 28; + item.height = 28; + item.value = 110; + item.rare = 0; + item.accessory = true; + item.defense = 4; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Platinum Shield"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Platinum Shield"); + Tooltip.SetDefault(""); + } - public override void UpdateEquip(Player player) - { - player.moveSpeed -= 0.40f; - } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.PlatinumBar, 15); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void UpdateEquip(Player player) + { + player.moveSpeed -= 0.40f; + } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.PlatinumBar, 15); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/PlatinumSpear.cs b/Items/PlatinumSpear.cs index 25017c5e..29c17ece 100644 --- a/Items/PlatinumSpear.cs +++ b/Items/PlatinumSpear.cs @@ -4,42 +4,44 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class PlatinumSpear : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class PlatinumSpear : ModItem + { + public override void SetDefaults() + { - item.damage = 16; - item.width = 14; - item.height = 84; - item.noUseGraphic = true; - item.melee = true; - item.useTime = 30; - item.shoot = mod.ProjectileType("PlatinumSpearPro"); - item.shootSpeed = 3f; - item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 4; - item.value = 1000; - item.rare = 0; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 16; + item.width = 14; + item.height = 84; + item.noUseGraphic = true; + item.melee = true; + item.useTime = 30; + item.shoot = mod.ProjectileType("PlatinumSpearPro"); + item.shootSpeed = 3f; + item.useAnimation = 30; + item.useStyle = 5; + item.knockBack = 4; + item.value = 1000; + item.rare = 0; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Platinum Spear"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Platinum Spear"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.PlatinumBar, 9); - recipe.AddTile(16); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.PlatinumBar, 9); + recipe.AddTile(16); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/PlazmaSword.cs b/Items/PlazmaSword.cs index 99770516..c16fcff8 100644 --- a/Items/PlazmaSword.cs +++ b/Items/PlazmaSword.cs @@ -5,40 +5,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class PlazmaSword : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class PlazmaSword : ModItem + { + public override void SetDefaults() + { - item.damage = 220; - item.melee = true; - item.width = 52; - item.height = 52; - item.useTime = 32; - item.useAnimation = 32; - item.useStyle = 1; - item.knockBack = 7; - item.value = 12500; - item.rare = 11; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 220; + item.melee = true; + item.width = 52; + item.height = 52; + item.useTime = 32; + item.useAnimation = 32; + item.useStyle = 1; + item.knockBack = 7; + item.value = 12500; + item.rare = 11; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Plazma Sword"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Plazma Sword"); + Tooltip.SetDefault(""); + } - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(44, 120); - } + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(44, 120); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 15); - } -}} + public override void MeleeEffects(Player player, Rectangle hitbox) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 15); + } + } +} diff --git a/Items/PoisonJavelin.cs b/Items/PoisonJavelin.cs index a69a2bee..a832b85f 100644 --- a/Items/PoisonJavelin.cs +++ b/Items/PoisonJavelin.cs @@ -5,46 +5,48 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class PoisonJavelin : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class PoisonJavelin : ModItem + { + public override void SetDefaults() + { - item.damage = 23; - item.thrown = true; - item.width = 18; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 38; - item.useTime = 32; - item.useAnimation = 32; - item.shoot = mod.ProjectileType("PoisonJavelinPro"); - item.shootSpeed = 16f; - item.useStyle = 1; - item.knockBack = 4; - item.value = 60; - item.rare = 3; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 23; + item.thrown = true; + item.width = 18; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 38; + item.useTime = 32; + item.useAnimation = 32; + item.shoot = mod.ProjectileType("PoisonJavelinPro"); + item.shootSpeed = 16f; + item.useStyle = 1; + item.knockBack = 4; + item.value = 60; + item.rare = 3; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Poison Javelin"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Poison Javelin"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "JungleAlloy", 1); - recipe.AddIngredient(ItemID.Stinger, 1); - recipe.AddIngredient(ItemID.Vine, 1); - recipe.SetResult(this, 50); - recipe.AddTile(null, "GreatAnvilTile"); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "JungleAlloy", 1); + recipe.AddIngredient(ItemID.Stinger, 1); + recipe.AddIngredient(ItemID.Vine, 1); + recipe.SetResult(this, 50); + recipe.AddTile(null, "GreatAnvilTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/PoisonRod.cs b/Items/PoisonRod.cs index 6ffe8536..229f8bdf 100644 --- a/Items/PoisonRod.cs +++ b/Items/PoisonRod.cs @@ -5,35 +5,36 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class PoisonRod : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class PoisonRod : ModItem + { + public override void SetDefaults() + { - item.damage = 21; - item.melee = true; - item.width = 50; - item.height = 52; - item.useTime = 25; - item.useAnimation = 25; - item.useStyle = 1; - item.shoot = 265; - item.shootSpeed = 10f; - item.knockBack = 4; - item.value = 40000; - item.rare = 3; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 21; + item.melee = true; + item.width = 50; + item.height = 52; + item.useTime = 25; + item.useAnimation = 25; + item.useStyle = 1; + item.shoot = 265; + item.shootSpeed = 10f; + item.knockBack = 4; + item.value = 40000; + item.rare = 3; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Poison Rod"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Poison Rod"); + Tooltip.SetDefault(""); + } -} + } } diff --git a/Items/Popcorn.cs b/Items/Popcorn.cs index 10027f1c..cde45206 100644 --- a/Items/Popcorn.cs +++ b/Items/Popcorn.cs @@ -4,39 +4,39 @@ namespace Tremor.Items { - public class Popcorn : ModItem - { - const int Heal = 1; // Хилл в 1 хп - const float grabRangeMulti = 0.0f; // Множитель диÑтанции Ð¿Ð¾Ð´Ð±Ð¸Ñ€Ð°Ð½Ð¸Ñ Ð¿Ñ€ÐµÐ´Ð¼ÐµÑ‚Ð° (1.0f - 100%) + public class Popcorn : ModItem + { + const int Heal = 1; // Хилл в 1 хп + const float grabRangeMulti = 0.0f; // Множитель диÑтанции Ð¿Ð¾Ð´Ð±Ð¸Ñ€Ð°Ð½Ð¸Ñ Ð¿Ñ€ÐµÐ´Ð¼ÐµÑ‚Ð° (1.0f - 100%) - public override void SetDefaults() - { + public override void SetDefaults() + { - item.maxStack = 0; - item.width = 22; - item.height = 22; - item.rare = -1; - } + item.maxStack = 0; + item.width = 22; + item.height = 22; + item.rare = -1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Popcorn"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Popcorn"); + Tooltip.SetDefault(""); + } - public override void GrabRange(Player player, ref int grabRange) - { - grabRange = (int)(grabRange * grabRangeMulti); - base.GrabRange(player, ref grabRange); - } + public override void GrabRange(Player player, ref int grabRange) + { + grabRange = (int)(grabRange * grabRangeMulti); + base.GrabRange(player, ref grabRange); + } - public override bool OnPickup(Player player) - { - player.HealEffect(Heal); - player.statLife += Heal; - item.active = false; - return true; - } - } + public override bool OnPickup(Player player) + { + player.HealEffect(Heal); + player.statLife += Heal; + item.active = false; + return true; + } + } } diff --git a/Items/PopcornAmmo.cs b/Items/PopcornAmmo.cs index 5df6d0c1..0aa7d20d 100644 --- a/Items/PopcornAmmo.cs +++ b/Items/PopcornAmmo.cs @@ -26,20 +26,20 @@ public override void SetDefaults() item.ammo = item.type; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Popcorn"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Popcorn"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Corn", 1); - recipe.SetResult(this, 25); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Corn", 1); + recipe.SetResult(this, 25); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/Poseidon.cs b/Items/Poseidon.cs index 517859fe..5465477b 100644 --- a/Items/Poseidon.cs +++ b/Items/Poseidon.cs @@ -5,40 +5,41 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Poseidon : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Poseidon : ModItem + { + public override void SetDefaults() + { - item.damage = 26; - item.width = 16; - item.height = 32; - item.useTime = 27; - item.ranged = true; - item.shoot = 1; - item.shootSpeed = 15f; - item.useAnimation = 27; - item.useStyle = 5; - item.knockBack = 5; - item.value = 12540; - item.useAmmo = AmmoID.Arrow; - item.rare = 3; - item.UseSound = SoundID.Item5; - item.autoReuse = true; - } + item.damage = 26; + item.width = 16; + item.height = 32; + item.useTime = 27; + item.ranged = true; + item.shoot = 1; + item.shootSpeed = 15f; + item.useAnimation = 27; + item.useStyle = 5; + item.knockBack = 5; + item.value = 12540; + item.useAmmo = AmmoID.Arrow; + item.rare = 3; + item.UseSound = SoundID.Item5; + item.autoReuse = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Poseidon"); + Tooltip.SetDefault(""); + } + + public override Vector2? HoldoutOffset() + { + return new Vector2(-8, 0); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Poseidon"); - Tooltip.SetDefault(""); - } - - public override Vector2? HoldoutOffset() - { - return new Vector2(-8, 0); - } - //public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) //{ // type = mod.ProjectileType("ElectricBolt"); @@ -46,4 +47,5 @@ public override void SetStaticDefaults() //} -}} + } +} diff --git a/Items/PossessedChestplate.cs b/Items/PossessedChestplate.cs index 48cba98b..ea61db7c 100644 --- a/Items/PossessedChestplate.cs +++ b/Items/PossessedChestplate.cs @@ -5,24 +5,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class PossessedChestplate : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Body)] + public class PossessedChestplate : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 30; - item.height = 18; - item.value = 100; - item.rare = 1; - } + item.width = 30; + item.height = 18; + item.value = 100; + item.rare = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Possessed Chestplate"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Possessed Chestplate"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/PossessedGreaves.cs b/Items/PossessedGreaves.cs index 9d2f0ce0..7e121e83 100644 --- a/Items/PossessedGreaves.cs +++ b/Items/PossessedGreaves.cs @@ -5,24 +5,27 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class PossessedGreaves : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Legs)] + public class PossessedGreaves : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 18; - item.value = 100; - item.rare = 1; - } + item.width = 22; + item.height = 18; + item.value = 100; + item.rare = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Possessed Greaves"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Possessed Greaves"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/PossessedHelmet.cs b/Items/PossessedHelmet.cs index bf3c3380..3d4c89c9 100644 --- a/Items/PossessedHelmet.cs +++ b/Items/PossessedHelmet.cs @@ -5,29 +5,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class PossessedHelmet : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class PossessedHelmet : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 20; - item.height = 18; - item.value = 100; - item.rare = 1; - } + item.width = 20; + item.height = 18; + item.value = 100; + item.rare = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Possessed Helmet"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Possessed Helmet"); + Tooltip.SetDefault(""); + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("PossessedChestplate") && legs.type == mod.ItemType("PossessedGreaves"); - } -}} + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("PossessedChestplate") && legs.type == mod.ItemType("PossessedGreaves"); + } + } +} diff --git a/Items/PossessedHornetBanner.cs b/Items/PossessedHornetBanner.cs index 5295e128..1527b884 100644 --- a/Items/PossessedHornetBanner.cs +++ b/Items/PossessedHornetBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class PossessedHornetBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class PossessedHornetBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 82; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 82; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Possessed Hornet Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Possessed Hornet Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/PossessedHoundBanner.cs b/Items/PossessedHoundBanner.cs index a911a268..477856e4 100644 --- a/Items/PossessedHoundBanner.cs +++ b/Items/PossessedHoundBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class PossessedHoundBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class PossessedHoundBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 83; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 83; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Possessed Hound Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Possessed Hound Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/PowerShield.cs b/Items/PowerShield.cs index 32199b50..4ab38eed 100644 --- a/Items/PowerShield.cs +++ b/Items/PowerShield.cs @@ -5,64 +5,66 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Shield)] -public class PowerShield : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Shield)] + public class PowerShield : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 26; - item.value = 34600; - item.rare = 9; - item.accessory = true; - item.defense = 15; - } + item.width = 26; + item.height = 26; + item.value = 34600; + item.rare = 9; + item.accessory = true; + item.defense = 15; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Power Shield"); - Tooltip.SetDefault("Grants immunity to most debuffs\nGrants immunity to knockback and fire blocks\nProlonged after hit invicibility\nGives health when in Corruption or Crimson"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Power Shield"); + Tooltip.SetDefault("Grants immunity to most debuffs\nGrants immunity to knockback and fire blocks\nProlonged after hit invicibility\nGives health when in Corruption or Crimson"); + } - public override void UpdateEquip(Player p) - { - p.aggro += 150; - if (p.ZoneCorrupt || p.ZoneCrimson) - { - p.statLifeMax2 += 100; - } -//p.paladinBuff = true; - p.noKnockback = true; - p.fireWalk = true; - p.longInvince = true; - p.buffImmune[44] = true; //Frostburn - p.buffImmune[46] = true; //Chilled - p.buffImmune[47] = true; //Frozen - p.buffImmune[20] = true; //Poisoned - p.buffImmune[22] = true; //Darkness - p.buffImmune[24] = true; //Fire - p.buffImmune[23] = true; //Cursed - p.buffImmune[30] = true; //Bleeding - p.buffImmune[31] = true; //Confused - p.buffImmune[32] = true; //Slowed - p.buffImmune[33] = true; //Weak - p.buffImmune[35] = true; //Silenced - p.buffImmune[36] = true; //Broken Armor - p.buffImmune[69] = true; //Ichor - p.buffImmune[70] = true; //Venom - p.buffImmune[80] = true; //Black Out - } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "OrganicShield", 1); - recipe.AddIngredient(null, "HeroShield", 1); - recipe.AddIngredient(null, "NightmareBar", 18); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } -}} + public override void UpdateEquip(Player p) + { + p.aggro += 150; + if (p.ZoneCorrupt || p.ZoneCrimson) + { + p.statLifeMax2 += 100; + } + //p.paladinBuff = true; + p.noKnockback = true; + p.fireWalk = true; + p.longInvince = true; + p.buffImmune[44] = true; //Frostburn + p.buffImmune[46] = true; //Chilled + p.buffImmune[47] = true; //Frozen + p.buffImmune[20] = true; //Poisoned + p.buffImmune[22] = true; //Darkness + p.buffImmune[24] = true; //Fire + p.buffImmune[23] = true; //Cursed + p.buffImmune[30] = true; //Bleeding + p.buffImmune[31] = true; //Confused + p.buffImmune[32] = true; //Slowed + p.buffImmune[33] = true; //Weak + p.buffImmune[35] = true; //Silenced + p.buffImmune[36] = true; //Broken Armor + p.buffImmune[69] = true; //Ichor + p.buffImmune[70] = true; //Venom + p.buffImmune[80] = true; //Black Out + } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "OrganicShield", 1); + recipe.AddIngredient(null, "HeroShield", 1); + recipe.AddIngredient(null, "NightmareBar", 18); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } +} diff --git a/Items/PrimeBlade.cs b/Items/PrimeBlade.cs index a203be6c..f28030d7 100644 --- a/Items/PrimeBlade.cs +++ b/Items/PrimeBlade.cs @@ -5,33 +5,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class PrimeBlade : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class PrimeBlade : ModItem + { + public override void SetDefaults() + { - item.damage = 52; - item.melee = true; - item.width = 40; - item.height = 40; + item.damage = 52; + item.melee = true; + item.width = 40; + item.height = 40; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = 503; - item.shootSpeed = 12f; - item.useStyle = 1; - item.knockBack = 6; - item.value = 60000; - item.rare = 5; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.useTime = 20; + item.useAnimation = 20; + item.shoot = 503; + item.shootSpeed = 12f; + item.useStyle = 1; + item.knockBack = 6; + item.value = 60000; + item.rare = 5; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Prime Blade"); - Tooltip.SetDefault("'Mechanical rage!'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Prime Blade"); + Tooltip.SetDefault("'Mechanical rage!'"); + } -}} + } +} diff --git a/Items/PrimitiveTurtleBanner.cs b/Items/PrimitiveTurtleBanner.cs index 0826f3c8..5f89f157 100644 --- a/Items/PrimitiveTurtleBanner.cs +++ b/Items/PrimitiveTurtleBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class PrimitiveTurtleBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class PrimitiveTurtleBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 106; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 106; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Primitive Turtle Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Primitive Turtle Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/PrizmaticSword.cs b/Items/PrizmaticSword.cs index 5141d0bb..11ab4cda 100644 --- a/Items/PrizmaticSword.cs +++ b/Items/PrizmaticSword.cs @@ -7,47 +7,47 @@ namespace Tremor.Items { - public class PrizmaticSword : ModItem - { - public override void SetDefaults() - { - - item.damage = 65; - item.melee = true; - item.width = 35; - item.height = 20; - - item.useTime = 20; - item.useAnimation = 30; - item.useStyle = 1; - item.knockBack = 10; - item.value = 120000; - item.rare = 5; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Prizmatic Fang"); - Tooltip.SetDefault("Grants mana upon hitting an enemy"); - } - - - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) - { - player.statMana += (int)damage / 6; - player.ManaEffect((int)damage / 6); - } - - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if(Main.rand.Next(2) == 0) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 27); - } - } - } - } - - + public class PrizmaticSword : ModItem + { + public override void SetDefaults() + { + + item.damage = 65; + item.melee = true; + item.width = 35; + item.height = 20; + + item.useTime = 20; + item.useAnimation = 30; + item.useStyle = 1; + item.knockBack = 10; + item.value = 120000; + item.rare = 5; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Prizmatic Fang"); + Tooltip.SetDefault("Grants mana upon hitting an enemy"); + } + + + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + { + player.statMana += (int)damage / 6; + player.ManaEffect((int)damage / 6); + } + + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.Next(2) == 0) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 27); + } + } + } +} + + diff --git a/Items/ProfessorGlasses.cs b/Items/ProfessorGlasses.cs index 4f2d88e8..1e6eb2fd 100644 --- a/Items/ProfessorGlasses.cs +++ b/Items/ProfessorGlasses.cs @@ -5,30 +5,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class ProfessorGlasses : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class ProfessorGlasses : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 10; - item.value = 100; - item.rare = 2; - item.vanity = true; - } + item.width = 22; + item.height = 10; + item.value = 100; + item.rare = 2; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Professor Glasses"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Professor Glasses"); + Tooltip.SetDefault(""); + } -public override void DrawHair(ref bool drawHair, ref bool drawAltHair) -{ - drawHair = true; + public override void DrawHair(ref bool drawHair, ref bool drawAltHair) + { + drawHair = true; + } + } } -}} diff --git a/Items/Pumpfish.cs b/Items/Pumpfish.cs index 8cd505e1..ed5443d5 100644 --- a/Items/Pumpfish.cs +++ b/Items/Pumpfish.cs @@ -21,11 +21,11 @@ public override void SetDefaults() item.rare = -11; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Pumfish"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Pumfish"); + Tooltip.SetDefault(""); + } public override bool IsQuestFish() diff --git a/Items/PumpkingMask.cs b/Items/PumpkingMask.cs index 0a4c0960..553c7d80 100644 --- a/Items/PumpkingMask.cs +++ b/Items/PumpkingMask.cs @@ -4,25 +4,28 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class PumpkingMask : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class PumpkingMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 28; - item.height = 30; - item.rare = 1; - item.vanity = true; - } + item.width = 28; + item.height = 30; + item.rare = 1; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Pumpking Mask"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Pumpking Mask"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/Pumpspell.cs b/Items/Pumpspell.cs index caf206de..f4e4e4c8 100644 --- a/Items/Pumpspell.cs +++ b/Items/Pumpspell.cs @@ -5,34 +5,36 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Pumpspell : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Pumpspell : ModItem + { + public override void SetDefaults() + { - item.damage = 26; - item.magic = true; - item.width = 28; - item.height = 30; - item.useTime = 14; - item.useAnimation = 14; - item.shoot = mod.ProjectileType("PumpkinPro"); - item.shootSpeed = 10f; - item.noUseGraphic = true; - item.mana = 16; - item.useStyle = 5; - item.knockBack = 3; - item.value = 66666; - item.rare = 4; - item.UseSound = SoundID.Item21; - item.autoReuse = true; - } + item.damage = 26; + item.magic = true; + item.width = 28; + item.height = 30; + item.useTime = 14; + item.useAnimation = 14; + item.shoot = mod.ProjectileType("PumpkinPro"); + item.shootSpeed = 10f; + item.noUseGraphic = true; + item.mana = 16; + item.useStyle = 5; + item.knockBack = 3; + item.value = 66666; + item.rare = 4; + item.UseSound = SoundID.Item21; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Pumpspell"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Pumpspell"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/PurpleCrossguardPhasesaber.cs b/Items/PurpleCrossguardPhasesaber.cs index f03036ed..d80a971c 100644 --- a/Items/PurpleCrossguardPhasesaber.cs +++ b/Items/PurpleCrossguardPhasesaber.cs @@ -5,48 +5,50 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class PurpleCrossguardPhasesaber : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class PurpleCrossguardPhasesaber : ModItem + { + public override void SetDefaults() + { - item.damage = 71; - item.melee = true; - item.width = 46; - item.height = 48; - item.useTime = 25; - item.useAnimation = 25; - item.useStyle = 1; - item.knockBack = 3; - item.value = 54000; - item.rare = 5; - item.UseSound = SoundID.Item15; - item.autoReuse = true; - item.useTurn = true; - } + item.damage = 71; + item.melee = true; + item.width = 46; + item.height = 48; + item.useTime = 25; + item.useAnimation = 25; + item.useStyle = 1; + item.knockBack = 3; + item.value = 54000; + item.rare = 5; + item.UseSound = SoundID.Item15; + item.autoReuse = true; + item.useTurn = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Purple Crossguard Phasesaber"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Purple Crossguard Phasesaber"); + Tooltip.SetDefault(""); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 62); - } + public override void MeleeEffects(Player player, Rectangle hitbox) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 62); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(3767); - recipe.AddIngredient(ItemID.SoulofMight, 8); - recipe.AddIngredient(null, "SoulofMind", 8); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(3767); + recipe.AddIngredient(ItemID.SoulofMight, 8); + recipe.AddIngredient(null, "SoulofMind", 8); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/PurpleKnightBreastplate.cs b/Items/PurpleKnightBreastplate.cs index 4857bfe5..a747a6dd 100644 --- a/Items/PurpleKnightBreastplate.cs +++ b/Items/PurpleKnightBreastplate.cs @@ -6,8 +6,8 @@ using Terraria.ModLoader; namespace Tremor.Items -{ -[AutoloadEquip(EquipType.Body)] +{ + [AutoloadEquip(EquipType.Body)] public class PurpleKnightBreastplate : ModItem { @@ -21,21 +21,21 @@ public override void SetDefaults() item.vanity = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Purple Knight Breastplate"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Purple Knight Breastplate"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GrayKnightBreastplate", 3); - recipe.AddIngredient(ItemID.Amethyst, 1); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GrayKnightBreastplate", 3); + recipe.AddIngredient(ItemID.Amethyst, 1); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } } } diff --git a/Items/PurpleKnightHelmet.cs b/Items/PurpleKnightHelmet.cs index 40f0181b..3b24ad33 100644 --- a/Items/PurpleKnightHelmet.cs +++ b/Items/PurpleKnightHelmet.cs @@ -7,7 +7,7 @@ namespace Tremor.Items { -[AutoloadEquip(EquipType.Head)] + [AutoloadEquip(EquipType.Head)] public class PurpleKnightHelmet : ModItem { @@ -21,21 +21,21 @@ public override void SetDefaults() item.vanity = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Purple Knight Helmet"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Purple Knight Helmet"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GrayKnightHelmet", 3); - recipe.AddIngredient(ItemID.Amethyst, 1); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GrayKnightHelmet", 3); + recipe.AddIngredient(ItemID.Amethyst, 1); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } } } diff --git a/Items/PurplePuzzleFragment.cs b/Items/PurplePuzzleFragment.cs index 9cda0640..f9c1c5af 100644 --- a/Items/PurplePuzzleFragment.cs +++ b/Items/PurplePuzzleFragment.cs @@ -4,35 +4,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class PurplePuzzleFragment : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class PurplePuzzleFragment : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 10000; - item.rare = 3; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 10000; + item.rare = 3; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Purple Puzzle Fragment"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Purple Puzzle Fragment"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "PhantomSoul", 4); - recipe.AddIngredient(ItemID.Amethyst, 8); - recipe.AddIngredient(ItemID.SoulofNight, 2); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "PhantomSoul", 4); + recipe.AddIngredient(ItemID.Amethyst, 8); + recipe.AddIngredient(ItemID.SoulofNight, 2); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } -}} + } +} diff --git a/Items/PurpleQuartz.cs b/Items/PurpleQuartz.cs index 9c2c8327..31d39076 100644 --- a/Items/PurpleQuartz.cs +++ b/Items/PurpleQuartz.cs @@ -4,24 +4,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class PurpleQuartz : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class PurpleQuartz : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 12000; - item.rare = 9; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 12000; + item.rare = 9; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Purple Quartz"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Purple Quartz"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/PurpleShelmet.cs b/Items/PurpleShelmet.cs index dfdafd48..ba9167bd 100644 --- a/Items/PurpleShelmet.cs +++ b/Items/PurpleShelmet.cs @@ -7,7 +7,7 @@ namespace Tremor.Items { -[AutoloadEquip(EquipType.Head)] + [AutoloadEquip(EquipType.Head)] public class PurpleShelmet : ModItem { @@ -21,11 +21,11 @@ public override void SetDefaults() item.defense = 6; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Purple Shelmet"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Purple Shelmet"); + Tooltip.SetDefault(""); + } } } diff --git a/Items/PusheenMask.cs b/Items/PusheenMask.cs index f6b53a0c..a8691bbf 100644 --- a/Items/PusheenMask.cs +++ b/Items/PusheenMask.cs @@ -5,34 +5,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class PusheenMask : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class PusheenMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 20; + item.width = 26; + item.height = 20; - item.rare = 1; - } + item.rare = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Pusheen Mask"); - Tooltip.SetDefault("'Meow?'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Pusheen Mask"); + Tooltip.SetDefault("'Meow?'"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Silk, 15); - recipe.SetResult(this); - recipe.AddTile(86); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Silk, 15); + recipe.SetResult(this); + recipe.AddTile(86); + recipe.AddRecipe(); + } -}} + } +} diff --git a/Items/PyramidHat.cs b/Items/PyramidHat.cs index 3290ba31..eed72472 100644 --- a/Items/PyramidHat.cs +++ b/Items/PyramidHat.cs @@ -5,24 +5,27 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class PyramidHat : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class PyramidHat : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 24; - item.rare = 2; - } + item.width = 26; + item.height = 24; + item.rare = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Pyramid Hat"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Pyramid Hat"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/PyramidHeadBanner.cs b/Items/PyramidHeadBanner.cs index 044e1abb..3843014e 100644 --- a/Items/PyramidHeadBanner.cs +++ b/Items/PyramidHeadBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class PyramidHeadBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class PyramidHeadBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("PyramidHeadBanner"); - item.placeStyle = 38; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("PyramidHeadBanner"); + item.placeStyle = 38; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Pyramid Head Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Pyramid Head Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/Pyro.cs b/Items/Pyro.cs index 333f41a6..da6d1d77 100644 --- a/Items/Pyro.cs +++ b/Items/Pyro.cs @@ -4,45 +4,47 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Pyro : ModItem +namespace Tremor.Items { - - public override bool CanEquipAccessory(Player player, int slot) - { - for(int i=0; i < player.armor.Length; i++) - { - MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - if(modPlayer.pyro == true) - { - return false; - } - } - return true; - } - - public override void SetDefaults() - { - - item.width = 22; - item.height = 44; - - item.value = 300000; - item.rare = 5; - item.accessory = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("The Pyro"); - Tooltip.SetDefault("Alchemical flasks leaves an explosion"); - } - - - public override void UpdateAccessory(Player player, bool hideVisual) - { - MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - player.AddBuff(mod.BuffType("PyroBuff"), 2); - modPlayer.pyro = true; - } -}} + public class Pyro : ModItem + { + + public override bool CanEquipAccessory(Player player, int slot) + { + for (int i = 0; i < player.armor.Length; i++) + { + MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); + if (modPlayer.pyro == true) + { + return false; + } + } + return true; + } + + public override void SetDefaults() + { + + item.width = 22; + item.height = 44; + + item.value = 300000; + item.rare = 5; + item.accessory = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("The Pyro"); + Tooltip.SetDefault("Alchemical flasks leaves an explosion"); + } + + + public override void UpdateAccessory(Player player, bool hideVisual) + { + MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); + player.AddBuff(mod.BuffType("PyroBuff"), 2); + modPlayer.pyro = true; + } + } +} diff --git a/Items/Quadratron.cs b/Items/Quadratron.cs index 26ef1a9b..966efe8c 100644 --- a/Items/Quadratron.cs +++ b/Items/Quadratron.cs @@ -5,66 +5,68 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class Quadratron : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.damage = 72; - item.ranged = true; - item.width = 20; - item.height = 12; - item.useTime = 20; - item.useAnimation = 20; - item.useStyle = 5; - item.knockBack = 6; - item.value = Item.buyPrice(0, 12, 5, 0); - item.rare = 9; - item.useStyle = 5; - item.UseSound = SoundID.Item36; - item.noMelee = true; - item.autoReuse = false; - item.shoot = 10; - item.shootSpeed = 23f; - item.useAmmo = AmmoID.Bullet; - } + public class Quadratron : ModItem + { + public override void SetDefaults() + { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Quadratron"); - Tooltip.SetDefault(""); - } + item.damage = 72; + item.ranged = true; + item.width = 20; + item.height = 12; + item.useTime = 20; + item.useAnimation = 20; + item.useStyle = 5; + item.knockBack = 6; + item.value = Item.buyPrice(0, 12, 5, 0); + item.rare = 9; + item.useStyle = 5; + item.UseSound = SoundID.Item36; + item.noMelee = true; + item.autoReuse = false; + item.shoot = 10; + item.shootSpeed = 23f; + item.useAmmo = AmmoID.Bullet; + } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Quadratron"); + Tooltip.SetDefault(""); + } -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) -{ - for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. - { - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); - } - return false; -} - public override bool ConsumeAmmo(Player p) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. + { + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); + } + return false; + } + + public override bool ConsumeAmmo(Player p) { return Main.rand.Next(2) == 0; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GolemCore", 1); - recipe.AddIngredient(ItemID.ClockworkAssaultRifle, 1); - recipe.AddIngredient(ItemID.TacticalShotgun, 1); - recipe.AddIngredient(null, "ChlorophyteDeadshooter", 1); - recipe.AddIngredient(ItemID.SoulofLight, 25); - recipe.AddIngredient(ItemID.SoulofNight, 25); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GolemCore", 1); + recipe.AddIngredient(ItemID.ClockworkAssaultRifle, 1); + recipe.AddIngredient(ItemID.TacticalShotgun, 1); + recipe.AddIngredient(null, "ChlorophyteDeadshooter", 1); + recipe.AddIngredient(ItemID.SoulofLight, 25); + recipe.AddIngredient(ItemID.SoulofNight, 25); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/QuartzBeetleBanner.cs b/Items/QuartzBeetleBanner.cs index ca715745..db51c138 100644 --- a/Items/QuartzBeetleBanner.cs +++ b/Items/QuartzBeetleBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class QuartzBeetleBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class QuartzBeetleBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 84; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 84; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Quartz Beetle Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Quartz Beetle Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/QuetzalcoatlStave.cs b/Items/QuetzalcoatlStave.cs index 592a6846..8528b1bb 100644 --- a/Items/QuetzalcoatlStave.cs +++ b/Items/QuetzalcoatlStave.cs @@ -22,7 +22,7 @@ public override void SetDefaults() item.useStyle = 1; item.noMelee = true; item.knockBack = 3; - item.value = 1000000; + item.value = 1000000; item.rare = 11; item.UseSound = SoundID.Item44; item.shoot = mod.ProjectileType("QuetzalcoatlPro"); @@ -31,26 +31,26 @@ public override void SetDefaults() item.buffTime = 3600; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Baby Quetzalcoatl Stave"); - Tooltip.SetDefault("Summons a baby quetzalcoatl to fight for you."); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Baby Quetzalcoatl Stave"); + Tooltip.SetDefault("Summons a baby quetzalcoatl to fight for you."); + } public override bool AltFunctionUse(Player player) { return true; } - + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { return player.altFunctionUse != 2; } - + public override bool UseItem(Player player) { - if(player.altFunctionUse == 2) + if (player.altFunctionUse == 2) { player.MinionNPCTargetAim(); } diff --git a/Items/Quiver.cs b/Items/Quiver.cs index 2b0ba932..8018f240 100644 --- a/Items/Quiver.cs +++ b/Items/Quiver.cs @@ -4,32 +4,34 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Quiver : ModItem +namespace Tremor.Items { + public class Quiver : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 24; - item.height = 28; - item.value = 12000; + item.width = 24; + item.height = 28; + item.value = 12000; - item.rare = 1; - item.accessory = true; - item.defense = 1; - } + item.rare = 1; + item.accessory = true; + item.defense = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Quiver"); - Tooltip.SetDefault("20% chance not to consume ammo"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Quiver"); + Tooltip.SetDefault("20% chance not to consume ammo"); + } - public override void UpdateAccessory(Player player, bool hideVisual) + public override void UpdateAccessory(Player player, bool hideVisual) - { - player.ammoCost80 = true; - } -}} + { + player.ammoCost80 = true; + } + } +} diff --git a/Items/RainStaff.cs b/Items/RainStaff.cs index f8703b76..9d8324d1 100644 --- a/Items/RainStaff.cs +++ b/Items/RainStaff.cs @@ -6,59 +6,59 @@ namespace Tremor.Items { - public class RainStaff : ModItem - { - const float RainTimeInMinuts = 15; // Кол-во минут - const float DistortPercent = 0.1f; // Процент Ð¾Ñ‚ÐºÐ»Ð¾Ð½ÐµÐ½Ð¸Ñ Ð²Ñ€ÐµÐ¼ÐµÐ½Ð¸ (разброÑа) + public class RainStaff : ModItem + { + const float RainTimeInMinuts = 15; // Кол-во минут + const float DistortPercent = 0.1f; // Процент Ð¾Ñ‚ÐºÐ»Ð¾Ð½ÐµÐ½Ð¸Ñ Ð²Ñ€ÐµÐ¼ÐµÐ½Ð¸ (разброÑа) - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 44; - item.height = 48; + item.width = 44; + item.height = 48; - item.useTime = 30; - item.useAnimation = 30; - item.useStyle = 1; - item.knockBack = 0; - item.shoot = 1; - item.value = 12000; - item.rare = 8; - item.UseSound = SoundID.Item8; - item.shoot = 1; - item.shootSpeed = 0; - } + item.useTime = 30; + item.useAnimation = 30; + item.useStyle = 1; + item.knockBack = 0; + item.shoot = 1; + item.value = 12000; + item.rare = 8; + item.UseSound = SoundID.Item8; + item.shoot = 1; + item.shootSpeed = 0; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Rain Staff"); - Tooltip.SetDefault("Allows you to call and revoke precipitation"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Rain Staff"); + Tooltip.SetDefault("Allows you to call and revoke precipitation"); + } - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - if (Main.raining) - Main.raining = false; - - else - { - Main.rainTime = (int)Helper.DistortFloat(RainTimeInMinuts * 60 * 60, DistortPercent); - Main.raining = true; - Main.maxRaining *= 2; - } - return false; - } + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + if (Main.raining) + Main.raining = false; - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Wood, 12); - recipe.AddIngredient(ItemID.RainCloud, 9); - recipe.AddIngredient(null, "SeaFragment", 10); - recipe.SetResult(this); - recipe.AddTile(null, "MagicWorkbenchTile"); - recipe.AddRecipe(); - } - } + else + { + Main.rainTime = (int)Helper.DistortFloat(RainTimeInMinuts * 60 * 60, DistortPercent); + Main.raining = true; + Main.maxRaining *= 2; + } + return false; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Wood, 12); + recipe.AddIngredient(ItemID.RainCloud, 9); + recipe.AddIngredient(null, "SeaFragment", 10); + recipe.SetResult(this); + recipe.AddTile(null, "MagicWorkbenchTile"); + recipe.AddRecipe(); + } + } } diff --git a/Items/RavenBreastplate.cs b/Items/RavenBreastplate.cs index 79083750..e57655d0 100644 --- a/Items/RavenBreastplate.cs +++ b/Items/RavenBreastplate.cs @@ -6,8 +6,8 @@ using Terraria.ModLoader; namespace Tremor.Items -{ -[AutoloadEquip(EquipType.Body)] +{ + [AutoloadEquip(EquipType.Body)] public class RavenBreastplate : ModItem { @@ -20,39 +20,39 @@ public override void SetDefaults() item.rare = 4; - item.defense = 10; + item.defense = 10; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Raven Breastplate"); - Tooltip.SetDefault("8% increased melee damage\nIncreases melee critical strike chance by 5"); - } - - - public override void UpdateEquip(Player player) - { - player.meleeDamage += 0.08f; - player.meleeCrit += 5; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.MoltenBreastplate); - recipe.AddIngredient(ItemID.IronBar, 8); - recipe.AddIngredient(null, "RavenFeather", 12); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.MoltenBreastplate); - recipe.AddIngredient(ItemID.LeadBar, 8); - recipe.AddIngredient(null, "RavenFeather", 12); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Raven Breastplate"); + Tooltip.SetDefault("8% increased melee damage\nIncreases melee critical strike chance by 5"); + } + + + public override void UpdateEquip(Player player) + { + player.meleeDamage += 0.08f; + player.meleeCrit += 5; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.MoltenBreastplate); + recipe.AddIngredient(ItemID.IronBar, 8); + recipe.AddIngredient(null, "RavenFeather", 12); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.MoltenBreastplate); + recipe.AddIngredient(ItemID.LeadBar, 8); + recipe.AddIngredient(null, "RavenFeather", 12); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } } } diff --git a/Items/RavenClaymore.cs b/Items/RavenClaymore.cs index 63b48cf2..c5273d64 100644 --- a/Items/RavenClaymore.cs +++ b/Items/RavenClaymore.cs @@ -5,54 +5,56 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class RavenClaymore : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class RavenClaymore : ModItem + { + public override void SetDefaults() + { - item.damage = 42; - item.melee = true; - item.width = 48; - item.height = 48; - item.useTime = 45; - item.useAnimation =25; - item.useStyle = 1; - item.knockBack = 3; - item.value = 6400; - item.rare = 4; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.useTurn = true; - item.shoot = mod.ProjectileType("RavenFeather"); - item.shootSpeed = 8f; - } + item.damage = 42; + item.melee = true; + item.width = 48; + item.height = 48; + item.useTime = 45; + item.useAnimation = 25; + item.useStyle = 1; + item.knockBack = 3; + item.value = 6400; + item.rare = 4; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.useTurn = true; + item.shoot = mod.ProjectileType("RavenFeather"); + item.shootSpeed = 8f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Raven Claymore"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Raven Claymore"); + Tooltip.SetDefault(""); + } -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) -{ - for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. - { - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); - } - return false; -} + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. + { + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); + } + return false; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.FieryGreatsword); - recipe.AddIngredient(null, "RavenFeather", 15); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.FieryGreatsword); + recipe.AddIngredient(null, "RavenFeather", 15); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/RavenClutches.cs b/Items/RavenClutches.cs index 9eaeff4f..5fa34ec6 100644 --- a/Items/RavenClutches.cs +++ b/Items/RavenClutches.cs @@ -5,50 +5,52 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class RavenClutches : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class RavenClutches : ModItem + { + public override void SetDefaults() + { - item.damage = 29; - item.melee = true; - item.width = 28; - item.height = 18; - item.useTime = 9; - item.useAnimation = 9; - item.useStyle = 1; - item.knockBack = 3; - item.value = 6400; - item.rare = 4; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.useTurn = true; - } + item.damage = 29; + item.melee = true; + item.width = 28; + item.height = 18; + item.useTime = 9; + item.useAnimation = 9; + item.useStyle = 1; + item.knockBack = 3; + item.value = 6400; + item.rare = 4; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.useTurn = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Raven Clutches"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Raven Clutches"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.SilverBar, 10); - recipe.AddIngredient(null, "Opal", 1); - recipe.AddIngredient(null, "RavenFeather", 13); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.SilverBar, 10); + recipe.AddIngredient(null, "Opal", 1); + recipe.AddIngredient(null, "RavenFeather", 13); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.TungstenBar, 10); - recipe.AddIngredient(null, "Opal", 1); - recipe.AddIngredient(null, "RavenFeather", 13); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.TungstenBar, 10); + recipe.AddIngredient(null, "Opal", 1); + recipe.AddIngredient(null, "RavenFeather", 13); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/RavenFeather.cs b/Items/RavenFeather.cs index 6f314c0b..63f2ab70 100644 --- a/Items/RavenFeather.cs +++ b/Items/RavenFeather.cs @@ -5,22 +5,24 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class RavenFeather : ModItem +namespace Tremor.Items { + public class RavenFeather : ModItem + { public override void SetDefaults() { item.width = 18; item.height = 18; item.rare = 4; - item.maxStack = 999; + item.maxStack = 999; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Raven Feather"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Raven Feather"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/RavenGreaves.cs b/Items/RavenGreaves.cs index 93697a8f..528466f1 100644 --- a/Items/RavenGreaves.cs +++ b/Items/RavenGreaves.cs @@ -5,9 +5,11 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class RavenGreaves : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Legs)] + public class RavenGreaves : ModItem + { public override void SetDefaults() @@ -19,39 +21,40 @@ public override void SetDefaults() item.rare = 4; - item.defense = 9; + item.defense = 9; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Raven Greaves"); - Tooltip.SetDefault("5% increased melee damage\nIncreases melee critical strike chance by 5"); - } - - - public override void UpdateEquip(Player player) - { - player.meleeDamage += 0.05f; - player.meleeCrit += 5; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.MoltenGreaves); - recipe.AddIngredient(ItemID.IronBar, 7); - recipe.AddIngredient(null, "RavenFeather", 10); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.MoltenGreaves); - recipe.AddIngredient(ItemID.LeadBar, 7); - recipe.AddIngredient(null, "RavenFeather", 10); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } - -}} + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Raven Greaves"); + Tooltip.SetDefault("5% increased melee damage\nIncreases melee critical strike chance by 5"); + } + + + public override void UpdateEquip(Player player) + { + player.meleeDamage += 0.05f; + player.meleeCrit += 5; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.MoltenGreaves); + recipe.AddIngredient(ItemID.IronBar, 7); + recipe.AddIngredient(null, "RavenFeather", 10); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.MoltenGreaves); + recipe.AddIngredient(ItemID.LeadBar, 7); + recipe.AddIngredient(null, "RavenFeather", 10); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + + } +} diff --git a/Items/RavenHeadgear.cs b/Items/RavenHeadgear.cs index 1e7aa879..4e1ed08c 100644 --- a/Items/RavenHeadgear.cs +++ b/Items/RavenHeadgear.cs @@ -5,9 +5,11 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class RavenHeadgear : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class RavenHeadgear : ModItem + { public override void SetDefaults() @@ -19,52 +21,53 @@ public override void SetDefaults() item.rare = 4; - item.defense = 9; + item.defense = 9; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Raven Headgear"); - Tooltip.SetDefault("5% increased melee damage\nIncreases melee critical strike chance by 5"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Raven Headgear"); + Tooltip.SetDefault("5% increased melee damage\nIncreases melee critical strike chance by 5"); + } - public override void UpdateEquip(Player player) - { - player.meleeDamage += 0.05f; - player.meleeCrit += 5; - } + public override void UpdateEquip(Player player) + { + player.meleeDamage += 0.05f; + player.meleeCrit += 5; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("RavenBreastplate") && legs.type == mod.ItemType("RavenGreaves"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("RavenBreastplate") && legs.type == mod.ItemType("RavenGreaves"); + } - public override void UpdateArmorSet(Player p) - { - p.setBonus = "Increases player defense by 3, 8% increased melee speed, increases melee critical strike chance by 6"; - p.statDefense += 3; - p.meleeCrit += 6; - p.meleeSpeed += 0.8f; - } + public override void UpdateArmorSet(Player p) + { + p.setBonus = "Increases player defense by 3, 8% increased melee speed, increases melee critical strike chance by 6"; + p.statDefense += 3; + p.meleeCrit += 6; + p.meleeSpeed += 0.8f; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.MoltenHelmet); - recipe.AddIngredient(ItemID.IronBar, 8); - recipe.AddIngredient(null, "RavenFeather", 11); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.MoltenHelmet); + recipe.AddIngredient(ItemID.IronBar, 8); + recipe.AddIngredient(null, "RavenFeather", 11); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.MoltenHelmet); - recipe.AddIngredient(ItemID.LeadBar, 8); - recipe.AddIngredient(null, "RavenFeather", 11); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.MoltenHelmet); + recipe.AddIngredient(ItemID.LeadBar, 8); + recipe.AddIngredient(null, "RavenFeather", 11); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } -}} + } +} diff --git a/Items/RazorleavesTome.cs b/Items/RazorleavesTome.cs index af1fe441..96e7b679 100644 --- a/Items/RazorleavesTome.cs +++ b/Items/RazorleavesTome.cs @@ -5,33 +5,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class RazorleavesTome : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class RazorleavesTome : ModItem + { + public override void SetDefaults() + { - item.damage = 5; - item.magic = true; - item.width = 28; - item.height = 30; - item.useTime = 12; - item.useAnimation = 12; - item.shoot = 206; - item.shootSpeed = 11f; - item.mana = 6; - item.useStyle = 5; - item.knockBack = 3; - item.value = 10000; - item.rare = 2; - item.UseSound = SoundID.Item20; - item.autoReuse = true; - } + item.damage = 5; + item.magic = true; + item.width = 28; + item.height = 30; + item.useTime = 12; + item.useAnimation = 12; + item.shoot = 206; + item.shootSpeed = 11f; + item.mana = 6; + item.useStyle = 5; + item.knockBack = 3; + item.value = 10000; + item.rare = 2; + item.UseSound = SoundID.Item20; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Razorleaves Tome"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Razorleaves Tome"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/ReaperBreastplate.cs b/Items/ReaperBreastplate.cs index a06ac3b9..37686903 100644 --- a/Items/ReaperBreastplate.cs +++ b/Items/ReaperBreastplate.cs @@ -6,8 +6,8 @@ using Terraria.ModLoader; namespace Tremor.Items -{ -[AutoloadEquip(EquipType.Body)] +{ + [AutoloadEquip(EquipType.Body)] public class ReaperBreastplate : ModItem { @@ -22,16 +22,16 @@ public override void SetDefaults() item.defense = 9; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Reaper Breastplate"); - Tooltip.SetDefault("Increases alchemic damage by 15%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Reaper Breastplate"); + Tooltip.SetDefault("Increases alchemic damage by 15%"); + } public override void UpdateEquip(Player player) { - player.GetModPlayer(mod).alchemistDamage += 0.15f; + player.GetModPlayer(mod).alchemistDamage += 0.15f; } } diff --git a/Items/ReaperGreaves.cs b/Items/ReaperGreaves.cs index c02f3e85..1b56774f 100644 --- a/Items/ReaperGreaves.cs +++ b/Items/ReaperGreaves.cs @@ -5,32 +5,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class ReaperGreaves : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Legs)] + public class ReaperGreaves : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 38; - item.height = 22; + item.width = 38; + item.height = 22; - item.value = 10000; - item.rare = 2; - item.defense = 2; - } + item.value = 10000; + item.rare = 2; + item.defense = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Reaper Greaves"); - Tooltip.SetDefault("Increases alchemic damage by 15%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Reaper Greaves"); + Tooltip.SetDefault("Increases alchemic damage by 15%"); + } - public override void UpdateEquip(Player player) - { - player.GetModPlayer(mod).alchemistDamage += 0.15f; - } + public override void UpdateEquip(Player player) + { + player.GetModPlayer(mod).alchemistDamage += 0.15f; + } -}} + } +} diff --git a/Items/ReaperHood.cs b/Items/ReaperHood.cs index c5e89255..f599fa46 100644 --- a/Items/ReaperHood.cs +++ b/Items/ReaperHood.cs @@ -5,44 +5,47 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class ReaperHood : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class ReaperHood : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 38; - item.height = 22; + item.width = 38; + item.height = 22; - item.value = 10000; - item.rare = 5; - item.defense = 8; - } + item.value = 10000; + item.rare = 5; + item.defense = 8; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Reaper Hood"); - Tooltip.SetDefault("Increases alchemic damage by 15%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Reaper Hood"); + Tooltip.SetDefault("Increases alchemic damage by 15%"); + } - public override void UpdateEquip(Player player) - { - player.GetModPlayer(mod).alchemistDamage += 0.15f; - } + public override void UpdateEquip(Player player) + { + player.GetModPlayer(mod).alchemistDamage += 0.15f; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("ReaperBreastplate") && legs.type == mod.ItemType("ReaperGreaves"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("ReaperBreastplate") && legs.type == mod.ItemType("ReaperGreaves"); + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increases alchemic critical strike chance by 30%"; - player.GetModPlayer(mod).alchemistCrit += 30; - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increases alchemic critical strike chance by 30%"; + player.GetModPlayer(mod).alchemistCrit += 30; + } -}} + } +} diff --git a/Items/RecyclerofMatter.cs b/Items/RecyclerofMatter.cs index 55bf1743..2df90be6 100644 --- a/Items/RecyclerofMatter.cs +++ b/Items/RecyclerofMatter.cs @@ -4,42 +4,44 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class RecyclerofMatter : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class RecyclerofMatter : ModItem + { + public override void SetDefaults() + { - item.width = 46; - item.height = 46; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 150; - item.createTile = mod.TileType("RecyclerofMatterTile"); - } + item.width = 46; + item.height = 46; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 150; + item.createTile = mod.TileType("RecyclerofMatterTile"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Recycler of Matter"); - Tooltip.SetDefault("Allows to convert hardmode metals to their alternatives"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Recycler of Matter"); + Tooltip.SetDefault("Allows to convert hardmode metals to their alternatives"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.StoneBlock, 50); - recipe.AddIngredient(ItemID.TitaniumBar, 1); - recipe.AddIngredient(ItemID.AdamantiteBar, 1); - recipe.AddIngredient(ItemID.Glass, 20); - recipe.AddIngredient(ItemID.LavaBucket, 1); - recipe.SetResult(this); - recipe.AddTile(null, "MagicWorkbenchTile"); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.StoneBlock, 50); + recipe.AddIngredient(ItemID.TitaniumBar, 1); + recipe.AddIngredient(ItemID.AdamantiteBar, 1); + recipe.AddIngredient(ItemID.Glass, 20); + recipe.AddIngredient(ItemID.LavaBucket, 1); + recipe.SetResult(this); + recipe.AddTile(null, "MagicWorkbenchTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/RedBrickChimney.cs b/Items/RedBrickChimney.cs index 3f6b95b3..3aeffd7a 100644 --- a/Items/RedBrickChimney.cs +++ b/Items/RedBrickChimney.cs @@ -4,38 +4,40 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class RedBrickChimney : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class RedBrickChimney : ModItem + { + public override void SetDefaults() + { - item.width = 20; - item.height = 20; - item.maxStack = 99; - item.rare = 1; - item.createTile = mod.TileType("RedBrickChimney"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - } + item.width = 20; + item.height = 20; + item.maxStack = 99; + item.rare = 1; + item.createTile = mod.TileType("RedBrickChimney"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Red Brick Chimney"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Red Brick Chimney"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.RedBrick, 10); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.RedBrick, 10); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } + } +} diff --git a/Items/RedChristmasStocking.cs b/Items/RedChristmasStocking.cs index c621a3dd..c12f54eb 100644 --- a/Items/RedChristmasStocking.cs +++ b/Items/RedChristmasStocking.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class RedChristmasStocking : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class RedChristmasStocking : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 26; - item.maxStack = 99; - item.rare = 1; - item.createTile = mod.TileType("RedChristmasStocking"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.value = 100; - item.consumable = true; - } + item.width = 22; + item.height = 26; + item.maxStack = 99; + item.rare = 1; + item.createTile = mod.TileType("RedChristmasStocking"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.value = 100; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Red Christmas Stocking"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Red Christmas Stocking"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/RedClaw.cs b/Items/RedClaw.cs index d4c88d90..c3e6d2bc 100644 --- a/Items/RedClaw.cs +++ b/Items/RedClaw.cs @@ -3,31 +3,33 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { -public class RedClaw : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class RedClaw : ModItem + { + public override void SetDefaults() + { - item.useStyle = 3; - item.useTurn = false; - item.useAnimation = 12; - item.useTime = 12; - item.width = 24; - item.height = 28; - item.damage = 19; - item.knockBack = 4f; - item.scale = 0.9f; - item.UseSound = SoundID.Item1; - item.useTurn = true; - item.value = 8400; - item.melee = true; - } + item.useStyle = 3; + item.useTurn = false; + item.useAnimation = 12; + item.useTime = 12; + item.width = 24; + item.height = 28; + item.damage = 19; + item.knockBack = 4f; + item.scale = 0.9f; + item.UseSound = SoundID.Item1; + item.useTurn = true; + item.value = 8400; + item.melee = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Red Claw"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Red Claw"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/RedCrossguardPhasesaber.cs b/Items/RedCrossguardPhasesaber.cs index 1e2a745a..7cca3599 100644 --- a/Items/RedCrossguardPhasesaber.cs +++ b/Items/RedCrossguardPhasesaber.cs @@ -5,48 +5,50 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class RedCrossguardPhasesaber : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class RedCrossguardPhasesaber : ModItem + { + public override void SetDefaults() + { - item.damage = 71; - item.melee = true; - item.width = 46; - item.height = 48; - item.useTime = 25; - item.useAnimation = 25; - item.useStyle = 1; - item.knockBack = 3; - item.value = 54000; - item.rare = 5; - item.UseSound = SoundID.Item15; - item.autoReuse = true; - item.useTurn = true; - } + item.damage = 71; + item.melee = true; + item.width = 46; + item.height = 48; + item.useTime = 25; + item.useAnimation = 25; + item.useStyle = 1; + item.knockBack = 3; + item.value = 54000; + item.rare = 5; + item.UseSound = SoundID.Item15; + item.autoReuse = true; + item.useTurn = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Red Crossguard Phasesaber"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Red Crossguard Phasesaber"); + Tooltip.SetDefault(""); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 60); - } + public override void MeleeEffects(Player player, Rectangle hitbox) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 60); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(3765); - recipe.AddIngredient(ItemID.SoulofMight, 8); - recipe.AddIngredient(null, "SoulofMind", 8); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(3765); + recipe.AddIngredient(ItemID.SoulofMight, 8); + recipe.AddIngredient(null, "SoulofMind", 8); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/RedFeather.cs b/Items/RedFeather.cs index d3827e05..01536f19 100644 --- a/Items/RedFeather.cs +++ b/Items/RedFeather.cs @@ -4,24 +4,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class RedFeather : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class RedFeather : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 3000; - item.rare = 4; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 3000; + item.rare = 4; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Red Feather"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Red Feather"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/RedFeatherWings.cs b/Items/RedFeatherWings.cs index 86f495f7..a35b1332 100644 --- a/Items/RedFeatherWings.cs +++ b/Items/RedFeatherWings.cs @@ -5,57 +5,59 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Wings)] -public class RedFeatherWings : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Wings)] + public class RedFeatherWings : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 20; + item.width = 22; + item.height = 20; - item.value = 100000; - item.rare = 5; - item.accessory = true; - } + item.value = 100000; + item.rare = 5; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Red Feather Wings"); - Tooltip.SetDefault("The wings made of red feathers."); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Red Feather Wings"); + Tooltip.SetDefault("The wings made of red feathers."); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.wingTimeMax = 140; - } + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.wingTimeMax = 140; + } public override void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend) - { - ascentWhenFalling = 0.85f; - ascentWhenRising = 0.15f; - maxCanAscendMultiplier = 1f; - maxAscentMultiplier = 3f; - constantAscend = 0.135f; - } - - public override void HorizontalWingSpeeds(Player player, ref float speed, ref float acceleration) - { - speed = 6f; - acceleration *= 2.5f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "RedFeather", 1); - recipe.AddIngredient(ItemID.SoulofFlight, 20); - recipe.AddTile(134); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + { + ascentWhenFalling = 0.85f; + ascentWhenRising = 0.15f; + maxCanAscendMultiplier = 1f; + maxAscentMultiplier = 3f; + constantAscend = 0.135f; + } + + public override void HorizontalWingSpeeds(Player player, ref float speed, ref float acceleration) + { + speed = 6f; + acceleration *= 2.5f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "RedFeather", 1); + recipe.AddIngredient(ItemID.SoulofFlight, 20); + recipe.AddTile(134); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/RedKnightBreastplate.cs b/Items/RedKnightBreastplate.cs index 8b0fec5a..7f1493c4 100644 --- a/Items/RedKnightBreastplate.cs +++ b/Items/RedKnightBreastplate.cs @@ -6,8 +6,8 @@ using Terraria.ModLoader; namespace Tremor.Items -{ -[AutoloadEquip(EquipType.Body)] +{ + [AutoloadEquip(EquipType.Body)] public class RedKnightBreastplate : ModItem { @@ -21,21 +21,21 @@ public override void SetDefaults() item.vanity = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Red Knight Breastplate"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Red Knight Breastplate"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GrayKnightBreastplate", 3); - recipe.AddIngredient(ItemID.Ruby, 1); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GrayKnightBreastplate", 3); + recipe.AddIngredient(ItemID.Ruby, 1); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } } } diff --git a/Items/RedKnightHelmet.cs b/Items/RedKnightHelmet.cs index 8ad34edf..5941d3c5 100644 --- a/Items/RedKnightHelmet.cs +++ b/Items/RedKnightHelmet.cs @@ -7,7 +7,7 @@ namespace Tremor.Items { -[AutoloadEquip(EquipType.Head)] + [AutoloadEquip(EquipType.Head)] public class RedKnightHelmet : ModItem { @@ -21,21 +21,21 @@ public override void SetDefaults() item.vanity = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Red Knight Helmet"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Red Knight Helmet"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GrayKnightHelmet", 3); - recipe.AddIngredient(ItemID.Ruby, 1); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GrayKnightHelmet", 3); + recipe.AddIngredient(ItemID.Ruby, 1); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } } } diff --git a/Items/RedMask.cs b/Items/RedMask.cs index 45491a1d..0c72bf2a 100644 --- a/Items/RedMask.cs +++ b/Items/RedMask.cs @@ -5,25 +5,28 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class RedMask: ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class RedMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 22; - item.value = 1000; - item.rare = 1; - item.vanity = true; - } + item.width = 22; + item.height = 22; + item.value = 1000; + item.rare = 1; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Red's Mask"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Red's Mask"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/RedPuzzleFragment.cs b/Items/RedPuzzleFragment.cs index ff7d72b7..08414b28 100644 --- a/Items/RedPuzzleFragment.cs +++ b/Items/RedPuzzleFragment.cs @@ -4,24 +4,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class RedPuzzleFragment : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class RedPuzzleFragment : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 50000; - item.rare = 3; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 50000; + item.rare = 3; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Red Puzzle Fragment"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Red Puzzle Fragment"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/RedSteelArmorPiece.cs b/Items/RedSteelArmorPiece.cs index 75fb3b3b..4fca4a04 100644 --- a/Items/RedSteelArmorPiece.cs +++ b/Items/RedSteelArmorPiece.cs @@ -4,24 +4,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class RedSteelArmorPiece : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class RedSteelArmorPiece : ModItem + { + public override void SetDefaults() + { - item.width = 24; - item.height = 18; - item.maxStack = 99; - item.value = 50; - item.rare = 1; - } + item.width = 24; + item.height = 18; + item.maxStack = 99; + item.value = 50; + item.rare = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Red Steel Armor Piece"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Red Steel Armor Piece"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/RedSteelBar.cs b/Items/RedSteelBar.cs index a18b3e9f..d8340d4a 100644 --- a/Items/RedSteelBar.cs +++ b/Items/RedSteelBar.cs @@ -4,51 +4,53 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class RedSteelBar : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class RedSteelBar : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 300; - item.rare = 1; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.createTile = mod.TileType("RedSteelBar"); - item.useStyle = 1; - item.consumable = true; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 300; + item.rare = 1; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.createTile = mod.TileType("RedSteelBar"); + item.useStyle = 1; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Red Steel Bar"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Red Steel Bar"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ChippyRedSteelSword"); - recipe.SetResult(this, 2); - recipe.AddTile(17); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ChippyRedSteelSword"); + recipe.SetResult(this, 2); + recipe.AddTile(17); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "FaultyRedSteelShield"); - recipe.SetResult(this, 3); - recipe.AddTile(17); - recipe.AddRecipe(); + recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "FaultyRedSteelShield"); + recipe.SetResult(this, 3); + recipe.AddTile(17); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "RedSteelArmorPiece"); - recipe.SetResult(this, 2); - recipe.AddTile(17); - recipe.AddRecipe(); - } -}} + recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "RedSteelArmorPiece"); + recipe.SetResult(this, 2); + recipe.AddTile(17); + recipe.AddRecipe(); + } + } +} diff --git a/Items/RedSteelBroadsword.cs b/Items/RedSteelBroadsword.cs index 6fea9418..4e68f29b 100644 --- a/Items/RedSteelBroadsword.cs +++ b/Items/RedSteelBroadsword.cs @@ -4,50 +4,52 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class RedSteelBroadsword : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.damage = 16; - item.melee = true; - item.width = 34; - item.height = 36; - item.useTime = 20; - item.useAnimation = 20; - item.useStyle = 1; - item.knockBack = 5; - - item.value = 600; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Red Steel Broadsword"); - Tooltip.SetDefault("25% chance to confuse enemy"); - } - - - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) - { - if(Main.rand.Next(4) == 0) - { - target.AddBuff(31, 600); - } - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ChippyRedSteelSword", 1); - recipe.AddIngredient(null, "RedSteelBar", 11); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } - -}} + public class RedSteelBroadsword : ModItem + { + public override void SetDefaults() + { + + item.damage = 16; + item.melee = true; + item.width = 34; + item.height = 36; + item.useTime = 20; + item.useAnimation = 20; + item.useStyle = 1; + item.knockBack = 5; + + item.value = 600; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Red Steel Broadsword"); + Tooltip.SetDefault("25% chance to confuse enemy"); + } + + + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + { + if (Main.rand.Next(4) == 0) + { + target.AddBuff(31, 600); + } + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ChippyRedSteelSword", 1); + recipe.AddIngredient(null, "RedSteelBar", 11); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + + } +} diff --git a/Items/RedSteelChestplate.cs b/Items/RedSteelChestplate.cs index e552ea70..d94a4648 100644 --- a/Items/RedSteelChestplate.cs +++ b/Items/RedSteelChestplate.cs @@ -5,26 +5,27 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class RedSteelChestplate : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + [AutoloadEquip(EquipType.Body)] + public class RedSteelChestplate : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 18; - item.value = 200; + item.width = 22; + item.height = 18; + item.value = 200; - item.rare = 2; - item.defense = 8; - } + item.rare = 2; + item.defense = 8; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Red Steel Chestplate"); - Tooltip.SetDefault("10% increased melee speed"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Red Steel Chestplate"); + Tooltip.SetDefault("10% increased melee speed"); + } @@ -33,13 +34,14 @@ public override void UpdateEquip(Player player) player.meleeSpeed += 0.1f; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "RedSteelArmorPiece", 5); - recipe.AddIngredient(null, "RedSteelBar", 8); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "RedSteelArmorPiece", 5); + recipe.AddIngredient(null, "RedSteelBar", 8); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/RedSteelGreaves.cs b/Items/RedSteelGreaves.cs index fc94809d..58011655 100644 --- a/Items/RedSteelGreaves.cs +++ b/Items/RedSteelGreaves.cs @@ -5,27 +5,29 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class RedSteelGreaves : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Legs)] + public class RedSteelGreaves : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 18; - item.value = 360; + item.width = 22; + item.height = 18; + item.value = 360; - item.rare = 2; - item.defense = 5; - } + item.rare = 2; + item.defense = 5; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Red Steel Greaves"); - Tooltip.SetDefault("20% increased movement speed"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Red Steel Greaves"); + Tooltip.SetDefault("20% increased movement speed"); + } @@ -34,14 +36,15 @@ public override void UpdateEquip(Player player) player.moveSpeed += 0.2f; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "RedSteelArmorPiece", 5); - recipe.AddIngredient(null, "RedSteelBar", 6); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } - -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "RedSteelArmorPiece", 5); + recipe.AddIngredient(null, "RedSteelBar", 6); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + + } +} diff --git a/Items/RedSteelGuardian.cs b/Items/RedSteelGuardian.cs index 3291258a..1781a5e3 100644 --- a/Items/RedSteelGuardian.cs +++ b/Items/RedSteelGuardian.cs @@ -5,128 +5,129 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Shield)] -public class RedSteelGuardian : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + [AutoloadEquip(EquipType.Shield)] + public class RedSteelGuardian : ModItem + { + public override void SetDefaults() + { + + item.width = 30; + item.height = 32; + item.value = 250; + item.rare = 1; + item.accessory = true; + item.defense = 4; + } - item.width = 30; - item.height = 32; - item.value = 250; - item.rare = 1; - item.accessory = true; - item.defense = 4; - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Red Steel Guardian"); + Tooltip.SetDefault("10% increased movement speed"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Red Steel Guardian"); - Tooltip.SetDefault("10% increased movement speed"); - } + public override void UpdateEquip(Player player) + { + player.moveSpeed += 0.2f; + } + /* + public override bool CanEquipAccessory(Player player, int slot) + { + bool canequip = true; + for (int l = 3; l < 8 + player.extraAccessorySlots; l++) + { + if (player.armor[l].type == mod.ItemType("BorealwoodShield")) + { + canequip = false; + break; + } + if (player.armor[l].type == mod.ItemType("CopperShield")) + { + canequip = false; + break; + } + if (player.armor[l].type == mod.ItemType("EbonwoodShield")) + { + canequip = false; + break; + } + if (player.armor[l].type == mod.ItemType("EnchantedShield")) + { + canequip = false; + break; + } + if (player.armor[l].type == mod.ItemType("GoldShield")) + { + canequip = false; + break; + } + if (player.armor[l].type == mod.ItemType("IronShield")) + { + canequip = false; + break; + } + if (player.armor[l].type == mod.ItemType("LeadShield")) + { + canequip = false; + break; + } + if (player.armor[l].type == mod.ItemType("OrcishShield")) + { + canequip = false; + break; + } + if (player.armor[l].type == mod.ItemType("PalmwoodShield")) + { + canequip = false; + break; + } + if (player.armor[l].type == mod.ItemType("PearlwoodShield")) + { + canequip = false; + break; + } + if (player.armor[l].type == mod.ItemType("PlatinumGuardian")) + { + canequip = false; + break; + } + if (player.armor[l].type == mod.ItemType("RichMahoganyShield")) + { + canequip = false; + break; + } + if (player.armor[l].type == mod.ItemType("ShadewoodShield")) + { + canequip = false; + break; + } + if (player.armor[l].type == mod.ItemType("SilverShield")) + { + canequip = false; + break; + } + if (player.armor[l].type == mod.ItemType("TinShield")) + { + canequip = false; + break; + } + if (player.armor[l].type == mod.ItemType("TungstenShield")) + { + canequip = false; + break; + } + if (player.armor[l].type == mod.ItemType("WoodenShield")) + { + canequip = false; + break; + } + } + return canequip; - public override void UpdateEquip(Player player) - { - player.moveSpeed += 0.2f; - } -/* -public override bool CanEquipAccessory(Player player, int slot) - { - bool canequip = true; - for (int l = 3; l < 8 + player.extraAccessorySlots; l++) - { - if (player.armor[l].type == mod.ItemType("BorealwoodShield")) - { - canequip = false; - break; - } - if (player.armor[l].type == mod.ItemType("CopperShield")) - { - canequip = false; - break; - } - if (player.armor[l].type == mod.ItemType("EbonwoodShield")) - { - canequip = false; - break; - } - if (player.armor[l].type == mod.ItemType("EnchantedShield")) - { - canequip = false; - break; - } - if (player.armor[l].type == mod.ItemType("GoldShield")) - { - canequip = false; - break; - } - if (player.armor[l].type == mod.ItemType("IronShield")) - { - canequip = false; - break; - } - if (player.armor[l].type == mod.ItemType("LeadShield")) - { - canequip = false; - break; - } - if (player.armor[l].type == mod.ItemType("OrcishShield")) - { - canequip = false; - break; - } - if (player.armor[l].type == mod.ItemType("PalmwoodShield")) - { - canequip = false; - break; - } - if (player.armor[l].type == mod.ItemType("PearlwoodShield")) - { - canequip = false; - break; - } - if (player.armor[l].type == mod.ItemType("PlatinumGuardian")) - { - canequip = false; - break; - } - if (player.armor[l].type == mod.ItemType("RichMahoganyShield")) - { - canequip = false; - break; - } - if (player.armor[l].type == mod.ItemType("ShadewoodShield")) - { - canequip = false; - break; - } - if (player.armor[l].type == mod.ItemType("SilverShield")) - { - canequip = false; - break; - } - if (player.armor[l].type == mod.ItemType("TinShield")) - { - canequip = false; - break; - } - if (player.armor[l].type == mod.ItemType("TungstenShield")) - { - canequip = false; - break; - } - if (player.armor[l].type == mod.ItemType("WoodenShield")) - { - canequip = false; - break; - } - } - return canequip; - - } -*/ + } + */ public override void AddRecipes() { @@ -136,5 +137,6 @@ public override void AddRecipes() recipe.AddTile(16); recipe.SetResult(this); recipe.AddRecipe(); - } -}} + } + } +} diff --git a/Items/RedSteelHeadgear.cs b/Items/RedSteelHeadgear.cs index d2d1ea9a..d30251e9 100644 --- a/Items/RedSteelHeadgear.cs +++ b/Items/RedSteelHeadgear.cs @@ -5,53 +5,56 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class RedSteelHeadgear : ModItem +namespace Tremor.Items { - - - public override void SetDefaults() - { - - item.width = 26; - item.height = 20; - item.value = 200; - item.rare = 1; - - item.defense = 8; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Red Steel Headgear"); - Tooltip.SetDefault("10% increased melee damage"); - } - - - public override void UpdateEquip(Player player) - { - player.meleeDamage += 0.1f; - } - - - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("RedSteelChestplate") && legs.type == mod.ItemType("RedSteelGreaves"); - } - - public override void UpdateArmorSet(Player p) - { - p.setBonus = "Grants chance to dodge attack"; - p.blackBelt = true; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "RedSteelArmorPiece", 5); - recipe.AddIngredient(null, "RedSteelBar", 7); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + [AutoloadEquip(EquipType.Head)] + public class RedSteelHeadgear : ModItem + { + + + public override void SetDefaults() + { + + item.width = 26; + item.height = 20; + item.value = 200; + item.rare = 1; + + item.defense = 8; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Red Steel Headgear"); + Tooltip.SetDefault("10% increased melee damage"); + } + + + public override void UpdateEquip(Player player) + { + player.meleeDamage += 0.1f; + } + + + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("RedSteelChestplate") && legs.type == mod.ItemType("RedSteelGreaves"); + } + + public override void UpdateArmorSet(Player p) + { + p.setBonus = "Grants chance to dodge attack"; + p.blackBelt = true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "RedSteelArmorPiece", 5); + recipe.AddIngredient(null, "RedSteelBar", 7); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/RedStorm.cs b/Items/RedStorm.cs index 920c8376..e1555db7 100644 --- a/Items/RedStorm.cs +++ b/Items/RedStorm.cs @@ -5,104 +5,105 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class RedStorm : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.CloneDefaults(ItemID.Starfury); + public class RedStorm : ModItem + { + public override void SetDefaults() + { + item.CloneDefaults(ItemID.Starfury); - item.damage = 64; - item.ranged = true; - item.melee = false; - item.width = 22; - item.height = 46; + item.damage = 64; + item.ranged = true; + item.melee = false; + item.width = 22; + item.height = 46; - item.useTime = 7; - item.useAnimation = 30; - item.useStyle = 5; - item.shootSpeed = 30f; - item.shoot = 1; - item.knockBack = 3; - item.useAmmo = AmmoID.Arrow; - item.value = 85000; - item.rare = 11; - item.UseSound = SoundID.Item5; - item.autoReuse = true; - } + item.useTime = 7; + item.useAnimation = 30; + item.useStyle = 5; + item.shootSpeed = 30f; + item.shoot = 1; + item.knockBack = 3; + item.useAmmo = AmmoID.Arrow; + item.value = 85000; + item.rare = 11; + item.UseSound = SoundID.Item5; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Red Storm"); - Tooltip.SetDefault("Causes red lasers to fall from sky\n"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Red Storm"); + Tooltip.SetDefault("Causes red lasers to fall from sky\n"); + } - public override bool ConsumeAmmo(Player p) + public override bool ConsumeAmmo(Player p) { return Main.rand.Next(2) == 0; } - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - int i = Main.myPlayer; - float num72 = item.shootSpeed; - int num73 = item.damage; - float num74 = item.knockBack; - num74 = player.GetWeaponKnockback(item, num74); - player.itemTime = item.useTime; - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default(Vector2)); - Vector2 vector3 = Main.MouseWorld - vector2; - float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (player.gravDir == -1f) - { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; - } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - float num81 = num80; - if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - num78 = (float)player.direction; - num79 = 0f; - num80 = num72; - } - else - { - num80 = num72 / num80; - } - num78 *= num80; - num79 *= num80; - int num107 = 3; - for (int num108 = 0; num108 < num107; num108++) - { - vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); - vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); - vector2.Y -= (float)(100 * num108); - num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (num79 < 0f) + int i = Main.myPlayer; + float num72 = item.shootSpeed; + int num73 = item.damage; + float num74 = item.knockBack; + num74 = player.GetWeaponKnockback(item, num74); + player.itemTime = item.useTime; + Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); + Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default(Vector2)); + Vector2 vector3 = Main.MouseWorld - vector2; + float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (player.gravDir == -1f) + { + num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + } + float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + float num81 = num80; + if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) { - num79 *= -1f; + num78 = (float)player.direction; + num79 = 0f; + num80 = num72; } - if (num79 < 20f) + else { - num79 = 20f; + num80 = num72 / num80; } - num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - num80 = num72 / num80; num78 *= num80; num79 *= num80; - float speedX4 = num78 + (float)Main.rand.Next(-40, 41) * 0.02f; - float speedY5 = num79 + (float)Main.rand.Next(-40, 41) * 0.02f; - Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, 606, num73, num74, i, 0f, (float)Main.rand.Next(5)); - Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, 606, num73, num74, i, 0f, (float)Main.rand.Next(3)); - Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, 606, num73, num74, i, 0f, (float)Main.rand.Next(1)); + int num107 = 3; + for (int num108 = 0; num108 < num107; num108++) + { + vector2 = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f); + vector2.X = (vector2.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); + vector2.Y -= (float)(100 * num108); + num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (num79 < 0f) + { + num79 *= -1f; + } + if (num79 < 20f) + { + num79 = 20f; + } + num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + num80 = num72 / num80; + num78 *= num80; + num79 *= num80; + float speedX4 = num78 + (float)Main.rand.Next(-40, 41) * 0.02f; + float speedY5 = num79 + (float)Main.rand.Next(-40, 41) * 0.02f; + Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, 606, num73, num74, i, 0f, (float)Main.rand.Next(5)); + Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, 606, num73, num74, i, 0f, (float)Main.rand.Next(3)); + Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, 606, num73, num74, i, 0f, (float)Main.rand.Next(1)); + } + return false; } - return false; } } -} diff --git a/Items/ReinforcedBurst.cs b/Items/ReinforcedBurst.cs index dc5c8274..0db6f940 100644 --- a/Items/ReinforcedBurst.cs +++ b/Items/ReinforcedBurst.cs @@ -4,56 +4,58 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ReinforcedBurst : ModItem +namespace Tremor.Items { - public override bool CanEquipAccessory(Player player, int slot) - { - for(int i=0; i < player.armor.Length; i++) - { - MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - if(modPlayer.nitro == true) - { - return false; - } - } - return true; - } - - public override void SetDefaults() - { - - item.width = 22; - item.height = 44; - - item.value = 500000; - item.rare = 6; - item.accessory = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Reinforced Burst"); - Tooltip.SetDefault("Alchemical flasks leave three death flames"); - } - - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Obsidian, 10); - recipe.AddIngredient(null, "Nitro", 1); - recipe.AddIngredient(null, "ArgiteBar", 15); - recipe.AddIngredient(ItemID.Hellstone); - recipe.SetResult(this); - recipe.AddTile(114); - recipe.AddRecipe(); - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - player.AddBuff(mod.BuffType("ReinforcedBurstBuff"), 2); - modPlayer.nitro = true; - } -}} + public class ReinforcedBurst : ModItem + { + public override bool CanEquipAccessory(Player player, int slot) + { + for (int i = 0; i < player.armor.Length; i++) + { + MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); + if (modPlayer.nitro == true) + { + return false; + } + } + return true; + } + + public override void SetDefaults() + { + + item.width = 22; + item.height = 44; + + item.value = 500000; + item.rare = 6; + item.accessory = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Reinforced Burst"); + Tooltip.SetDefault("Alchemical flasks leave three death flames"); + } + + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Obsidian, 10); + recipe.AddIngredient(null, "Nitro", 1); + recipe.AddIngredient(null, "ArgiteBar", 15); + recipe.AddIngredient(ItemID.Hellstone); + recipe.SetResult(this); + recipe.AddTile(114); + recipe.AddRecipe(); + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); + player.AddBuff(mod.BuffType("ReinforcedBurstBuff"), 2); + modPlayer.nitro = true; + } + } +} diff --git a/Items/RetributionofAbraxas.cs b/Items/RetributionofAbraxas.cs index 6e374733..a5bbcd3f 100644 --- a/Items/RetributionofAbraxas.cs +++ b/Items/RetributionofAbraxas.cs @@ -5,52 +5,54 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class RetributionofAbraxas : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class RetributionofAbraxas : ModItem + { + public override void SetDefaults() + { - item.damage = 185; - item.melee = true; - item.width = 50; - item.height = 50; - item.scale = 1.3f; - item.useTime = 18; - item.useAnimation = 18; - item.useStyle = 1; - item.knockBack = 2; - item.value = 10000; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 185; + item.melee = true; + item.width = 50; + item.height = 50; + item.scale = 1.3f; + item.useTime = 18; + item.useAnimation = 18; + item.useStyle = 1; + item.knockBack = 2; + item.value = 10000; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Retribution of Abraxas"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Retribution of Abraxas"); + Tooltip.SetDefault(""); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if(Main.rand.Next(2) == 0) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 27); - } - } + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.Next(2) == 0) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 27); + } + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Obsidian, 50); - recipe.AddIngredient(ItemID.CrystalShard, 50); - recipe.AddIngredient(null, "NightmareBar", 25); - recipe.AddIngredient(null, "ToothofAbraxas", 12); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Obsidian, 50); + recipe.AddIngredient(ItemID.CrystalShard, 50); + recipe.AddIngredient(null, "NightmareBar", 25); + recipe.AddIngredient(null, "ToothofAbraxas", 12); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Revolwar.cs b/Items/Revolwar.cs index f59a3257..377734d5 100644 --- a/Items/Revolwar.cs +++ b/Items/Revolwar.cs @@ -7,43 +7,45 @@ using Microsoft.Xna.Framework; using Terraria.DataStructures; -namespace Tremor.Items { -public class Revolwar : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.useStyle = 5; - item.useAnimation = 16; - item.useTime = 16; + public class Revolwar : ModItem + { + public override void SetDefaults() + { + item.useStyle = 5; + item.useAnimation = 16; + item.useTime = 16; - item.width = 24; - item.height = 28; - item.shoot = 14; - item.useAmmo = AmmoID.Bullet; - item.UseSound = SoundID.Item11; - item.damage = 450; - item.shootSpeed = 12f; - item.noMelee = true; - item.value = 500000; - item.scale = 0.9f; - item.rare = 0; - item.ranged = true; - } + item.width = 24; + item.height = 28; + item.shoot = 14; + item.useAmmo = AmmoID.Bullet; + item.UseSound = SoundID.Item11; + item.damage = 450; + item.shootSpeed = 12f; + item.noMelee = true; + item.value = 500000; + item.scale = 0.9f; + item.rare = 0; + item.ranged = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Revolwar"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Revolwar"); + Tooltip.SetDefault(""); + } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) - { - tooltips[0].overrideColor = new Color(238, 194, 73); - } + public override void ModifyTooltips(System.Collections.Generic.List tooltips) + { + tooltips[0].overrideColor = new Color(238, 194, 73); + } - public override Vector2? HoldoutOffset() - { - return new Vector2(-12, -2); - } -}} + public override Vector2? HoldoutOffset() + { + return new Vector2(-12, -2); + } + } +} diff --git a/Items/RichMahoganyArmchair.cs b/Items/RichMahoganyArmchair.cs index 5e938985..f2da82a5 100644 --- a/Items/RichMahoganyArmchair.cs +++ b/Items/RichMahoganyArmchair.cs @@ -4,40 +4,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class RichMahoganyArmchair : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class RichMahoganyArmchair : ModItem + { + public override void SetDefaults() + { - item.width = 42; - item.height = 32; - item.maxStack = 99; - item.value = 100; - item.rare = 1; - item.createTile = mod.TileType("RichMahoganyArmchair"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - } + item.width = 42; + item.height = 32; + item.maxStack = 99; + item.value = 100; + item.rare = 1; + item.createTile = mod.TileType("RichMahoganyArmchair"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Rich Mahogany Armchair"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Rich Mahogany Armchair"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.RichMahogany, 15); - recipe.AddIngredient(ItemID.Silk, 6); - recipe.SetResult(this); - recipe.AddTile(106); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.RichMahogany, 15); + recipe.AddIngredient(ItemID.Silk, 6); + recipe.SetResult(this); + recipe.AddTile(106); + recipe.AddRecipe(); + } + } +} diff --git a/Items/RichMahoganySeed.cs b/Items/RichMahoganySeed.cs index 9025623e..8cb6736e 100644 --- a/Items/RichMahoganySeed.cs +++ b/Items/RichMahoganySeed.cs @@ -18,7 +18,7 @@ public override void SetDefaults() item.height = 28; item.useTime = 36; - item.channel = true; + item.channel = true; item.useAnimation = 36; item.useStyle = 4; item.noMelee = true; @@ -32,26 +32,26 @@ public override void SetDefaults() item.buffTime = 3600; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Rich Mahogany Seed"); - Tooltip.SetDefault("Summons a lil' snatcher to fight for you."); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Rich Mahogany Seed"); + Tooltip.SetDefault("Summons a lil' snatcher to fight for you."); + } public override bool AltFunctionUse(Player player) { return true; } - + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { return player.altFunctionUse != 2; } - + public override bool UseItem(Player player) { - if(player.altFunctionUse == 2) + if (player.altFunctionUse == 2) { player.MinionNPCTargetAim(); } diff --git a/Items/RichMahoganyShield.cs b/Items/RichMahoganyShield.cs index 636d6d4c..0bb7fc03 100644 --- a/Items/RichMahoganyShield.cs +++ b/Items/RichMahoganyShield.cs @@ -5,36 +5,38 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Shield)] -public class RichMahoganyShield : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Shield)] + public class RichMahoganyShield : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 24; - item.height = 24; - item.value = 110; - item.rare = 0; - item.accessory = true; - item.defense = 1; - } + item.width = 24; + item.height = 24; + item.value = 110; + item.rare = 0; + item.accessory = true; + item.defense = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Rich Mahogany Shield"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Rich Mahogany Shield"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.RichMahogany, 15); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.RichMahogany, 15); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } + } } -}} diff --git a/Items/RipperKnife.cs b/Items/RipperKnife.cs index bd57218a..e42bc32c 100644 --- a/Items/RipperKnife.cs +++ b/Items/RipperKnife.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class RipperKnife : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class RipperKnife : ModItem + { + public override void SetDefaults() + { - item.damage = 6; - item.melee = true; - item.width = 32; - item.height = 32; - item.useTime = 9; - item.useAnimation = 9; - item.useStyle = 3; - item.knockBack = 2; - item.value = 600; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 6; + item.melee = true; + item.width = 32; + item.height = 32; + item.useTime = 9; + item.useAnimation = 9; + item.useStyle = 3; + item.knockBack = 2; + item.value = 600; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ripper Knife"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ripper Knife"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/Rock.cs b/Items/Rock.cs index f698bfd8..94952412 100644 --- a/Items/Rock.cs +++ b/Items/Rock.cs @@ -5,41 +5,43 @@ using Terraria.ModLoader; using Microsoft.Xna.Framework; -namespace Tremor.Items { -public class Rock : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Rock : ModItem + { + public override void SetDefaults() + { - item.damage = 9; - item.thrown = true; - item.width = 18; - item.height = 18; - item.useTime = 14; - item.useAnimation = 14; - item.useStyle = 1; - item.knockBack = 5; - item.rare = 0; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - item.shoot = mod.ProjectileType("Rock"); - item.shootSpeed = 10f; - item.maxStack = 999; - item.consumable = true; - } + item.damage = 9; + item.thrown = true; + item.width = 18; + item.height = 18; + item.useTime = 14; + item.useAnimation = 14; + item.useStyle = 1; + item.knockBack = 5; + item.rare = 0; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + item.shoot = mod.ProjectileType("Rock"); + item.shootSpeed = 10f; + item.maxStack = 999; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Rock"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Rock"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.StoneBlock, 1); - recipe.SetResult(this, 15); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.StoneBlock, 1); + recipe.SetResult(this, 15); + recipe.AddRecipe(); + } + } } -}} diff --git a/Items/RockClimberPotion.cs b/Items/RockClimberPotion.cs index c7f56744..487e6719 100644 --- a/Items/RockClimberPotion.cs +++ b/Items/RockClimberPotion.cs @@ -4,46 +4,48 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class RockClimberPotion : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.width = 38; - item.height = 32; - item.maxStack = 20; - - item.rare = 1; - item.useAnimation = 15; - item.useTime = 15; - item.useStyle = 2; - item.UseSound = SoundID.Item3; - item.consumable = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Rock Climber Potion"); - Tooltip.SetDefault("Grants ability to climb walls"); - } - - - public override bool UseItem(Player player) - { - player.AddBuff(mod.BuffType("RockClimberBuff"), 3600); - return true; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.BottledWater, 1); - recipe.AddIngredient(ItemID.StoneBlock, 15); - recipe.AddIngredient(ItemID.Blinkroot, 1); - recipe.AddTile(13); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + + public class RockClimberPotion : ModItem + { + public override void SetDefaults() + { + + item.width = 38; + item.height = 32; + item.maxStack = 20; + + item.rare = 1; + item.useAnimation = 15; + item.useTime = 15; + item.useStyle = 2; + item.UseSound = SoundID.Item3; + item.consumable = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Rock Climber Potion"); + Tooltip.SetDefault("Grants ability to climb walls"); + } + + + public override bool UseItem(Player player) + { + player.AddBuff(mod.BuffType("RockClimberBuff"), 3600); + return true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.BottledWater, 1); + recipe.AddIngredient(ItemID.StoneBlock, 15); + recipe.AddIngredient(ItemID.Blinkroot, 1); + recipe.AddTile(13); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/RockHorn.cs b/Items/RockHorn.cs index 4cf63d2e..53ebea69 100644 --- a/Items/RockHorn.cs +++ b/Items/RockHorn.cs @@ -4,23 +4,25 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class RockHorn : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class RockHorn : ModItem + { + public override void SetDefaults() + { - item.width = 14; - item.height = 22; - item.maxStack = 999; - item.rare = 3; - item.value = Item.buyPrice(0, 0, 5, 0); - } + item.width = 14; + item.height = 22; + item.maxStack = 999; + item.rare = 3; + item.value = Item.buyPrice(0, 0, 5, 0); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Rock Horn"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Rock Horn"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/RockStompers.cs b/Items/RockStompers.cs index 5f519892..c1ad3e1f 100644 --- a/Items/RockStompers.cs +++ b/Items/RockStompers.cs @@ -5,42 +5,44 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class RockStompers: ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 26; - item.height = 20; - item.value = 110000; - item.rare = 3; - - item.accessory = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Rock Stompers"); - Tooltip.SetDefault("Increases your knockback effect"); - } - - - public override void UpdateAccessory(Player player, bool hideVisual) - - { - player.kbBuff = true; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.StoneBlock, 25); - recipe.AddIngredient(ItemID.Leather, 10); - recipe.AddIngredient(null, "RockHorn", 10); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public class RockStompers : ModItem + { + + public override void SetDefaults() + { + + item.width = 26; + item.height = 20; + item.value = 110000; + item.rare = 3; + + item.accessory = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Rock Stompers"); + Tooltip.SetDefault("Increases your knockback effect"); + } + + + public override void UpdateAccessory(Player player, bool hideVisual) + + { + player.kbBuff = true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.StoneBlock, 25); + recipe.AddIngredient(ItemID.Leather, 10); + recipe.AddIngredient(null, "RockHorn", 10); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Rockmine.cs b/Items/Rockmine.cs index 3780d156..a4c6ca20 100644 --- a/Items/Rockmine.cs +++ b/Items/Rockmine.cs @@ -5,45 +5,47 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Rockmine : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Rockmine : ModItem + { + public override void SetDefaults() + { - item.damage = 26; - item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 25; - item.useAnimation = 25; - item.shoot = mod.ProjectileType("RockminePro"); - item.shootSpeed = 11f; - item.useStyle = 1; - item.knockBack = 4; - item.value = 7; - item.rare = 3; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 26; + item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 25; + item.useAnimation = 25; + item.shoot = mod.ProjectileType("RockminePro"); + item.shootSpeed = 11f; + item.useStyle = 1; + item.knockBack = 4; + item.value = 7; + item.rare = 3; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Rockmine"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Rockmine"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.StoneBlock, 15); - recipe.AddIngredient(null, "RockHorn", 3); - recipe.SetResult(this, 25); - recipe.AddTile(14); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.StoneBlock, 15); + recipe.AddIngredient(null, "RockHorn", 3); + recipe.SetResult(this, 25); + recipe.AddTile(14); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Rockspear.cs b/Items/Rockspear.cs index b09b19d7..6832fc5d 100644 --- a/Items/Rockspear.cs +++ b/Items/Rockspear.cs @@ -4,46 +4,48 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Rockspear : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Rockspear : ModItem + { + public override void SetDefaults() + { - item.damage = 30; - item.width = 14; - item.height = 84; - item.noUseGraphic = true; - item.melee = true; - item.useTime = 35; - item.shoot = mod.ProjectileType("RockspearPro"); - item.shootSpeed = 3f; - item.useAnimation = 35; - item.useStyle = 5; - item.knockBack = 4; - item.value = 900; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 30; + item.width = 14; + item.height = 84; + item.noUseGraphic = true; + item.melee = true; + item.useTime = 35; + item.shoot = mod.ProjectileType("RockspearPro"); + item.shootSpeed = 3f; + item.useAnimation = 35; + item.useStyle = 5; + item.knockBack = 4; + item.value = 900; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Rockspear"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Rockspear"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Wood, 20); - recipe.AddIngredient(ItemID.Rope, 20); - recipe.AddIngredient(ItemID.StoneBlock, 5); - recipe.AddIngredient(null, "Gloomstone", 25); - recipe.AddIngredient(null, "RockHorn", 3); - recipe.AddTile(16); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Wood, 20); + recipe.AddIngredient(ItemID.Rope, 20); + recipe.AddIngredient(ItemID.StoneBlock, 5); + recipe.AddIngredient(null, "Gloomstone", 25); + recipe.AddIngredient(null, "RockHorn", 3); + recipe.AddTile(16); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/RogueBanner.cs b/Items/RogueBanner.cs index 22ad7f09..65094f7d 100644 --- a/Items/RogueBanner.cs +++ b/Items/RogueBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class RogueBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class RogueBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 85; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 85; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Rogue Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Rogue Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/RottenBat.cs b/Items/RottenBat.cs index 47ad7d22..781491c7 100644 --- a/Items/RottenBat.cs +++ b/Items/RottenBat.cs @@ -4,40 +4,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class RottenBat : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class RottenBat : ModItem + { + public override void SetDefaults() + { - item.damage = 16; - item.melee = true; - item.width = 48; - item.height = 48; - item.useTime = 30; + item.damage = 16; + item.melee = true; + item.width = 48; + item.height = 48; + item.useTime = 30; - item.useAnimation = 30; - item.useStyle = 1; - item.knockBack = 9; - item.value = 100; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.useAnimation = 30; + item.useStyle = 1; + item.knockBack = 9; + item.value = 100; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Rotten Bat"); - Tooltip.SetDefault("'Sewn from pieces of flesh'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Rotten Bat"); + Tooltip.SetDefault("'Sewn from pieces of flesh'"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "UntreatedFlesh", 9); - recipe.SetResult(this); - recipe.AddTile(null, "FleshWorkstationTile"); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "UntreatedFlesh", 9); + recipe.SetResult(this); + recipe.AddTile(null, "FleshWorkstationTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/RoundBlast.cs b/Items/RoundBlast.cs index dd5881a1..f9085506 100644 --- a/Items/RoundBlast.cs +++ b/Items/RoundBlast.cs @@ -4,56 +4,58 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class RoundBlast : ModItem +namespace Tremor.Items { - public override bool CanEquipAccessory(Player player, int slot) - { - for(int i=0; i < player.armor.Length; i++) - { - MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - if(modPlayer.pyro == true) - { - return false; - } - } - return true; - } - - public override void SetDefaults() - { - - item.width = 22; - item.height = 44; - - item.value = 300000; - item.rare = 6; - item.accessory = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Round Blast"); - Tooltip.SetDefault("Alchemical projectiles leave explosions in the shape of round"); - } - - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.ExplosivePowder, 25); - recipe.AddIngredient(null, "Chemikaze", 1); - recipe.AddIngredient(null, "ChaosBar", 25); - recipe.AddIngredient(ItemID.SoulofSight, 3); - recipe.SetResult(this); - recipe.AddTile(114); - recipe.AddRecipe(); - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - player.AddBuff(mod.BuffType("RoundBlastBuff"), 2); - modPlayer.pyro = true; - } -}} + public class RoundBlast : ModItem + { + public override bool CanEquipAccessory(Player player, int slot) + { + for (int i = 0; i < player.armor.Length; i++) + { + MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); + if (modPlayer.pyro == true) + { + return false; + } + } + return true; + } + + public override void SetDefaults() + { + + item.width = 22; + item.height = 44; + + item.value = 300000; + item.rare = 6; + item.accessory = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Round Blast"); + Tooltip.SetDefault("Alchemical projectiles leave explosions in the shape of round"); + } + + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.ExplosivePowder, 25); + recipe.AddIngredient(null, "Chemikaze", 1); + recipe.AddIngredient(null, "ChaosBar", 25); + recipe.AddIngredient(ItemID.SoulofSight, 3); + recipe.SetResult(this); + recipe.AddTile(114); + recipe.AddRecipe(); + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); + player.AddBuff(mod.BuffType("RoundBlastBuff"), 2); + modPlayer.pyro = true; + } + } +} diff --git a/Items/RoyalClaymore.cs b/Items/RoyalClaymore.cs index 4ea0a6fc..c9b13e3b 100644 --- a/Items/RoyalClaymore.cs +++ b/Items/RoyalClaymore.cs @@ -4,31 +4,33 @@ using Terraria.ModLoader; using Terraria.ID; -namespace Tremor.Items { -public class RoyalClaymore : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class RoyalClaymore : ModItem + { + public override void SetDefaults() + { - item.damage = 8; - item.melee = true; - item.width = 56; - item.height = 56; - item.useTime = 22; - item.useAnimation = 30; - item.useStyle = 1; - item.knockBack = 3; - item.value = 35400; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 8; + item.melee = true; + item.width = 56; + item.height = 56; + item.useTime = 22; + item.useAnimation = 30; + item.useStyle = 1; + item.knockBack = 3; + item.value = 35400; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Royal Claymore"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Royal Claymore"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/RoyalDaggers.cs b/Items/RoyalDaggers.cs index 18020f7f..b5c819b3 100644 --- a/Items/RoyalDaggers.cs +++ b/Items/RoyalDaggers.cs @@ -5,110 +5,112 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class RoyalDaggers : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.damage = 257; - item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("WhiteGoldDagger"); - item.shootSpeed = 22f; - item.useStyle = 1; - item.knockBack = 4; - item.value = 50; - item.rare = 5; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Royal Daggers"); - Tooltip.SetDefault(""); - } - - - public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - int i = Main.myPlayer; - float num72 = item.shootSpeed; - int num73 = item.damage; - float num74 = item.knockBack; - num74 = player.GetWeaponKnockback(item, num74); - player.itemTime = item.useTime; - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default(Vector2)); - Vector2 vector3 = Main.MouseWorld - vector2; - float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (player.gravDir == -1f) - { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; - } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - float num81 = num80; - if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) - { - num78 = (float)player.direction; - num79 = 0f; - num80 = num72; - } - else - { - num80 = num72 / num80; - } - num78 *= num80; - num79 *= num80; - int num146 = 4; - if (Main.rand.Next(2) == 0) + public class RoyalDaggers : ModItem + { + public override void SetDefaults() { - num146++; - } - if (Main.rand.Next(4) == 0) - { - num146++; + + item.damage = 257; + item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("WhiteGoldDagger"); + item.shootSpeed = 22f; + item.useStyle = 1; + item.knockBack = 4; + item.value = 50; + item.rare = 5; + item.UseSound = SoundID.Item1; + item.autoReuse = true; } - if (Main.rand.Next(8) == 0) + + public override void SetStaticDefaults() { - num146++; + DisplayName.SetDefault("Royal Daggers"); + Tooltip.SetDefault(""); } - if (Main.rand.Next(16) == 0) + + + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - num146++; + int i = Main.myPlayer; + float num72 = item.shootSpeed; + int num73 = item.damage; + float num74 = item.knockBack; + num74 = player.GetWeaponKnockback(item, num74); + player.itemTime = item.useTime; + Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); + Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default(Vector2)); + Vector2 vector3 = Main.MouseWorld - vector2; + float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (player.gravDir == -1f) + { + num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + } + float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + float num81 = num80; + if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) + { + num78 = (float)player.direction; + num79 = 0f; + num80 = num72; + } + else + { + num80 = num72 / num80; + } + num78 *= num80; + num79 *= num80; + int num146 = 4; + if (Main.rand.Next(2) == 0) + { + num146++; + } + if (Main.rand.Next(4) == 0) + { + num146++; + } + if (Main.rand.Next(8) == 0) + { + num146++; + } + if (Main.rand.Next(16) == 0) + { + num146++; + } + for (int num147 = 0; num147 < num146; num147++) + { + float num148 = num78; + float num149 = num79; + float num150 = 0.05f * (float)num147; + num148 += (float)Main.rand.Next(-35, 36) * num150; + num149 += (float)Main.rand.Next(-35, 36) * num150; + num80 = (float)Math.Sqrt((double)(num148 * num148 + num149 * num149)); + num80 = num72 / num80; + num148 *= num80; + num149 *= num80; + float x4 = vector2.X; + float y4 = vector2.Y; + Projectile.NewProjectile(x4, y4, num148, num149, mod.ProjectileType("WhiteGoldKnife"), num73, num74, i, 0f, 0f); + } + return false; } - for (int num147 = 0; num147 < num146; num147++) + + public override void AddRecipes() { - float num148 = num78; - float num149 = num79; - float num150 = 0.05f * (float)num147; - num148 += (float)Main.rand.Next(-35, 36) * num150; - num149 += (float)Main.rand.Next(-35, 36) * num150; - num80 = (float)Math.Sqrt((double)(num148 * num148 + num149 * num149)); - num80 = num72 / num80; - num148 *= num80; - num149 *= num80; - float x4 = vector2.X; - float y4 = vector2.Y; - Projectile.NewProjectile(x4, y4, num148, num149, mod.ProjectileType("WhiteGoldKnife"), num73, num74, i, 0f, 0f); + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "WhiteGoldBar", 1); + recipe.SetResult(this, 75); + recipe.AddTile(null, "DivineForgeTile"); + recipe.AddRecipe(); } - return false; } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "WhiteGoldBar", 1); - recipe.SetResult(this, 75); - recipe.AddTile(null, "DivineForgeTile"); - recipe.AddRecipe(); - } -}} +} diff --git a/Items/RoyalEgg.cs b/Items/RoyalEgg.cs index cc5445b8..3b517def 100644 --- a/Items/RoyalEgg.cs +++ b/Items/RoyalEgg.cs @@ -13,29 +13,29 @@ public class RoyalEgg : ModItem public override void SetDefaults() { - item.width = 30; - item.height = 34; - item.maxStack = 20; + item.width = 30; + item.height = 34; + item.maxStack = 20; - item.rare = 11; - item.value = 150000; - item.useAnimation = 45; - item.useTime = 45; - item.useStyle = 4; - item.consumable = true; - } + item.rare = 11; + item.value = 150000; + item.useAnimation = 45; + item.useTime = 45; + item.useStyle = 4; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Royal Egg"); - Tooltip.SetDefault("Summons the Brutallisk"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Royal Egg"); + Tooltip.SetDefault("Summons the Brutallisk"); + } - public override bool CanUseItem(Player player) - { - return NPC.downedMoonlord && !NPC.AnyNPCs(mod.NPCType("Brutallisk")) && player.ZoneDesert; - } + public override bool CanUseItem(Player player) + { + return NPC.downedMoonlord && !NPC.AnyNPCs(mod.NPCType("Brutallisk")) && player.ZoneDesert; + } public override bool UseItem(Player player) { @@ -44,22 +44,22 @@ public override bool UseItem(Player player) return true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.GoldCoin, 25); - recipe.AddIngredient(ItemID.Ruby, 1); - recipe.AddIngredient(ItemID.Emerald, 1); - recipe.AddIngredient(ItemID.Topaz, 1); - recipe.AddIngredient(ItemID.Diamond, 1); - recipe.AddIngredient(ItemID.Sapphire, 1); - recipe.AddIngredient(ItemID.Amethyst, 1); - recipe.AddIngredient(null, "NightmareBar", 10); - recipe.AddIngredient(null, "ClusterShard", 5); - recipe.AddIngredient(null, "Phantaplasm", 8); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.GoldCoin, 25); + recipe.AddIngredient(ItemID.Ruby, 1); + recipe.AddIngredient(ItemID.Emerald, 1); + recipe.AddIngredient(ItemID.Topaz, 1); + recipe.AddIngredient(ItemID.Diamond, 1); + recipe.AddIngredient(ItemID.Sapphire, 1); + recipe.AddIngredient(ItemID.Amethyst, 1); + recipe.AddIngredient(null, "NightmareBar", 10); + recipe.AddIngredient(null, "ClusterShard", 5); + recipe.AddIngredient(null, "Phantaplasm", 8); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } } diff --git a/Items/RoyalStrike.cs b/Items/RoyalStrike.cs index 96abc901..8b3aa51e 100644 --- a/Items/RoyalStrike.cs +++ b/Items/RoyalStrike.cs @@ -4,44 +4,46 @@ using Terraria.ModLoader; using Terraria.ID; -namespace Tremor.Items { -public class RoyalStrike : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class RoyalStrike : ModItem + { + public override void SetDefaults() + { - item.damage = 189; - item.melee = true; - item.width = 30; - item.height = 38; - item.useTime = 26; - item.useAnimation = 26; - item.useStyle = 1; - item.knockBack = 7; - item.shoot = 160; - item.shootSpeed = 14f; - item.value = 150000; - item.rare = 11; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 189; + item.melee = true; + item.width = 30; + item.height = 38; + item.useTime = 26; + item.useAnimation = 26; + item.useStyle = 1; + item.knockBack = 7; + item.shoot = 160; + item.shootSpeed = 14f; + item.value = 150000; + item.rare = 11; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Royal Strike"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Royal Strike"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Sapphire, 8); - recipe.AddIngredient(ItemID.GoldBar, 15); - recipe.AddIngredient(null, "SteelBar", 6); - recipe.AddIngredient(null, "EvershinyBar", 12); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Sapphire, 8); + recipe.AddIngredient(ItemID.GoldBar, 15); + recipe.AddIngredient(null, "SteelBar", 6); + recipe.AddIngredient(null, "EvershinyBar", 12); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } +} diff --git a/Items/RubyBlade.cs b/Items/RubyBlade.cs index 7f14d903..f182dd95 100644 --- a/Items/RubyBlade.cs +++ b/Items/RubyBlade.cs @@ -5,46 +5,48 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class RubyBlade : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class RubyBlade : ModItem + { + public override void SetDefaults() + { - item.damage = 17; - item.melee = true; - item.width = 46; - item.height = 48; - item.useTime = 25; - item.useAnimation = 25; - item.useStyle = 1; - item.knockBack = 3; - item.value = 6400; - item.rare = 2; - item.UseSound = SoundID.Item15; - item.autoReuse = true; - item.useTurn = true; - } + item.damage = 17; + item.melee = true; + item.width = 46; + item.height = 48; + item.useTime = 25; + item.useAnimation = 25; + item.useStyle = 1; + item.knockBack = 3; + item.value = 6400; + item.rare = 2; + item.UseSound = SoundID.Item15; + item.autoReuse = true; + item.useTurn = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ruby Blade"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ruby Blade"); + Tooltip.SetDefault(""); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 60); - } + public override void MeleeEffects(Player player, Rectangle hitbox) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 60); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Ruby, 12); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Ruby, 12); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/RubyDrill.cs b/Items/RubyDrill.cs index 0273d9ef..039f5f03 100644 --- a/Items/RubyDrill.cs +++ b/Items/RubyDrill.cs @@ -4,47 +4,49 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class RubyDrill : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.damage = 9; - item.melee = true; - item.width = 20; - item.height = 12; - item.useTime = 8; - item.useAnimation = 25; - item.channel = true; - item.noUseGraphic = true; - item.noMelee = true; - item.pick = 85; - item.useStyle = 5; - item.knockBack = 6; - item.value = Item.buyPrice(0, 0, 50, 0); - item.rare = 2; - item.UseSound = SoundID.Item23; - item.autoReuse = true; - item.shoot = mod.ProjectileType("RubyDrillPro"); - item.shootSpeed = 40f; - } + public class RubyDrill : ModItem + { + public override void SetDefaults() + { + + item.damage = 9; + item.melee = true; + item.width = 20; + item.height = 12; + item.useTime = 8; + item.useAnimation = 25; + item.channel = true; + item.noUseGraphic = true; + item.noMelee = true; + item.pick = 85; + item.useStyle = 5; + item.knockBack = 6; + item.value = Item.buyPrice(0, 0, 50, 0); + item.rare = 2; + item.UseSound = SoundID.Item23; + item.autoReuse = true; + item.shoot = mod.ProjectileType("RubyDrillPro"); + item.shootSpeed = 40f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ruby Drill"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ruby Drill"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Obsidian, 25); - recipe.AddIngredient(ItemID.MeteoriteBar, 16); - recipe.AddIngredient(ItemID.Ruby, 12); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Obsidian, 25); + recipe.AddIngredient(ItemID.MeteoriteBar, 16); + recipe.AddIngredient(ItemID.Ruby, 12); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/RuinKey.cs b/Items/RuinKey.cs index 7a60c4e6..25293d3b 100644 --- a/Items/RuinKey.cs +++ b/Items/RuinKey.cs @@ -15,11 +15,11 @@ public override void SetDefaults() item.rare = 4; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ruin Key"); - Tooltip.SetDefault("Opens Ruin Chest once"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ruin Key"); + Tooltip.SetDefault("Opens Ruin Chest once"); + } } } diff --git a/Items/RuneBar.cs b/Items/RuneBar.cs index 12422088..76e49051 100644 --- a/Items/RuneBar.cs +++ b/Items/RuneBar.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class RuneBar : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class RuneBar : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 100; - item.rare = 4; - item.createTile = mod.TileType("RuneBarTile"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 100; + item.rare = 4; + item.createTile = mod.TileType("RuneBarTile"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Rune Bar"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Rune Bar"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/RustyLantern.cs b/Items/RustyLantern.cs index 854d83be..369305bc 100644 --- a/Items/RustyLantern.cs +++ b/Items/RustyLantern.cs @@ -5,51 +5,51 @@ namespace Tremor.Items { - public class RustyLantern : ModItem - { - - const int XOffset = -400; - const int YOffset = -400; - - public override void SetDefaults() - { - - item.width = 14; - item.height = 30; - item.maxStack = 1; - - - item.value = 3000; - item.rare = 2; - item.useTime = 40; - item.useAnimation = 40; - item.consumable = true; - item.maxStack = 20; - item.useStyle = 1; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Rusty Lantern"); - Tooltip.SetDefault("Summons Ancient Dragon\nCan be only used near Ruin Altar"); - } - - - public override bool CanUseItem(Player player) - { - TremorPlayer modPlayer = player.GetModPlayer(mod); - return modPlayer.ruinAltar && !NPC.AnyNPCs(mod.NPCType("Dragon_HeadB")); - } - - public override bool UseItem(Player player) - { - Main.NewText("Ancient Dragon has awoken!", 175, 75, 255); - Main.PlaySound(15, (int)player.position.X, (int)player.position.Y, 0); - //if(Main.netMode !=1) - //{ - NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y + YOffset, mod.NPCType(""), 0, NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y + YOffset, mod.NPCType("Dragon_HeadB"))); - //} - return true; - } - } + public class RustyLantern : ModItem + { + + const int XOffset = -400; + const int YOffset = -400; + + public override void SetDefaults() + { + + item.width = 14; + item.height = 30; + item.maxStack = 1; + + + item.value = 3000; + item.rare = 2; + item.useTime = 40; + item.useAnimation = 40; + item.consumable = true; + item.maxStack = 20; + item.useStyle = 1; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Rusty Lantern"); + Tooltip.SetDefault("Summons Ancient Dragon\nCan be only used near Ruin Altar"); + } + + + public override bool CanUseItem(Player player) + { + TremorPlayer modPlayer = player.GetModPlayer(mod); + return modPlayer.ruinAltar && !NPC.AnyNPCs(mod.NPCType("Dragon_HeadB")); + } + + public override bool UseItem(Player player) + { + Main.NewText("Ancient Dragon has awoken!", 175, 75, 255); + Main.PlaySound(15, (int)player.position.X, (int)player.position.Y, 0); + //if(Main.netMode !=1) + //{ + NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y + YOffset, mod.NPCType(""), 0, NPC.NewNPC((int)player.Center.X + XOffset, (int)player.Center.Y + YOffset, mod.NPCType("Dragon_HeadB"))); + //} + return true; + } + } } diff --git a/Items/RustySlasher.cs b/Items/RustySlasher.cs index 4de0f834..3d678893 100644 --- a/Items/RustySlasher.cs +++ b/Items/RustySlasher.cs @@ -4,31 +4,33 @@ using Terraria.ModLoader; using Terraria.ID; -namespace Tremor.Items { -public class RustySlasher : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class RustySlasher : ModItem + { + public override void SetDefaults() + { - item.damage = 16; - item.melee = true; - item.width = 42; - item.height = 46; - item.useTime = 13; - item.useAnimation = 13; - item.useStyle = 1; - item.knockBack = 8; - item.value = 10000; - item.rare = 2; - item.UseSound = SoundID.Item71; - item.autoReuse = true; - item.useTurn = true; - } + item.damage = 16; + item.melee = true; + item.width = 42; + item.height = 46; + item.useTime = 13; + item.useAnimation = 13; + item.useStyle = 1; + item.knockBack = 8; + item.value = 10000; + item.rare = 2; + item.UseSound = SoundID.Item71; + item.autoReuse = true; + item.useTurn = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Rusty Slasher"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Rusty Slasher"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/RustySword.cs b/Items/RustySword.cs index ea2e6d73..7e430f3c 100644 --- a/Items/RustySword.cs +++ b/Items/RustySword.cs @@ -4,36 +4,38 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { -public class RustySword : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class RustySword : ModItem + { + public override void SetDefaults() + { - item.damage = 12; - item.melee = true; - item.width = 40; - item.height = 40; + item.damage = 12; + item.melee = true; + item.width = 40; + item.height = 40; - item.useTime = 20; - item.useAnimation = 20; - item.useStyle = 1; - item.knockBack = 6; - item.value = 12000; - item.rare = 2; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.useTime = 20; + item.useAnimation = 20; + item.useStyle = 1; + item.knockBack = 6; + item.value = 12000; + item.rare = 2; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Rusty Sword"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Rusty Sword"); + Tooltip.SetDefault(""); + } - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(20, 100); - } -}} + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(20, 100); + } + } +} diff --git a/Items/SBCCannonballAmmo.cs b/Items/SBCCannonballAmmo.cs index 06927c5a..90930dc9 100644 --- a/Items/SBCCannonballAmmo.cs +++ b/Items/SBCCannonballAmmo.cs @@ -26,11 +26,11 @@ public override void SetDefaults() item.ammo = item.type; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("SBC Cannonball"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("SBC Cannonball"); + Tooltip.SetDefault(""); + } } } diff --git a/Items/SDL.cs b/Items/SDL.cs index d27e88e0..77217e56 100644 --- a/Items/SDL.cs +++ b/Items/SDL.cs @@ -5,34 +5,36 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SDL : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SDL : ModItem + { + public override void SetDefaults() + { - item.damage = 70; - item.ranged = true; - item.width = 40; - item.height = 40; + item.damage = 70; + item.ranged = true; + item.width = 40; + item.height = 40; - item.useTime = 30; - item.useAnimation = 30; - item.shoot = 135; - item.shootSpeed = 25f; - item.useAmmo = AmmoID.Rocket; - item.useStyle = 5; - item.knockBack = 4; - item.value = 60000; - item.rare = 11; - item.UseSound = SoundID.Item11; - item.autoReuse = true; - } + item.useTime = 30; + item.useAnimation = 30; + item.shoot = 135; + item.shootSpeed = 25f; + item.useAmmo = AmmoID.Rocket; + item.useStyle = 5; + item.knockBack = 4; + item.value = 60000; + item.rare = 11; + item.UseSound = SoundID.Item11; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("S.D.L."); - Tooltip.SetDefault("Uses rockets as ammo"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("S.D.L."); + Tooltip.SetDefault("Uses rockets as ammo"); + } -}} + } +} diff --git a/Items/SacredCross.cs b/Items/SacredCross.cs index e014ed3f..fe3c9d41 100644 --- a/Items/SacredCross.cs +++ b/Items/SacredCross.cs @@ -32,21 +32,21 @@ public override void SetDefaults() item.shootSpeed = 15f; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sacred Cross"); - Tooltip.SetDefault("Shoots magical crosses that heal you"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sacred Cross"); + Tooltip.SetDefault("Shoots magical crosses that heal you"); + } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "WoodenCross", 1); - recipe.AddIngredient(null, "Opal", 3); + recipe.AddIngredient(null, "WoodenCross", 1); + recipe.AddIngredient(null, "Opal", 3); recipe.AddIngredient(ItemID.HallowedBar, 12); recipe.SetResult(this); - recipe.AddTile(134); + recipe.AddTile(134); recipe.AddRecipe(); } } diff --git a/Items/SacrificalPickaxe.cs b/Items/SacrificalPickaxe.cs index 2a9e6991..0c14b912 100644 --- a/Items/SacrificalPickaxe.cs +++ b/Items/SacrificalPickaxe.cs @@ -5,52 +5,54 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SacrificalPickaxe : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SacrificalPickaxe : ModItem + { + public override void SetDefaults() + { - item.damage = 9; - item.melee = true; - item.width = 46; - item.height = 46; - item.useTime = 12; - item.useAnimation = 22; - item.pick = 100; - item.useStyle = 1; - item.knockBack = 5; - item.value = 600; - item.rare = 3; - item.useTurn = true; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 9; + item.melee = true; + item.width = 46; + item.height = 46; + item.useTime = 12; + item.useAnimation = 22; + item.pick = 100; + item.useStyle = 1; + item.knockBack = 5; + item.value = 600; + item.rare = 3; + item.useTurn = true; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sacrifical Pickaxe"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sacrifical Pickaxe"); + Tooltip.SetDefault(""); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if(Main.rand.Next(5) == 0) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 60); - } - } + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.Next(5) == 0) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 60); + } + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.MoltenPickaxe, 1); - recipe.AddIngredient(ItemID.BonePickaxe, 1); - recipe.AddIngredient(null, "PickaxeofBloom", 1); - recipe.AddIngredient(ItemID.DeathbringerPickaxe, 1); - recipe.AddTile(26); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.MoltenPickaxe, 1); + recipe.AddIngredient(ItemID.BonePickaxe, 1); + recipe.AddIngredient(null, "PickaxeofBloom", 1); + recipe.AddIngredient(ItemID.DeathbringerPickaxe, 1); + recipe.AddTile(26); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/SacrificalScythe.cs b/Items/SacrificalScythe.cs index 74b866d5..7d40ef2f 100644 --- a/Items/SacrificalScythe.cs +++ b/Items/SacrificalScythe.cs @@ -3,30 +3,32 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { -public class SacrificalScythe : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SacrificalScythe : ModItem + { + public override void SetDefaults() + { - item.damage = 16; - item.melee = true; - item.width = 42; - item.height = 42; - item.useTime = 31; - item.useAnimation = 21; - item.useStyle = 1; - item.knockBack = 10; - item.value = 26660; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 16; + item.melee = true; + item.width = 42; + item.height = 42; + item.useTime = 31; + item.useAnimation = 21; + item.useStyle = 1; + item.knockBack = 10; + item.value = 26660; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sacrifical Scythe"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sacrifical Scythe"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/SalamanderCloth.cs b/Items/SalamanderCloth.cs index 671e7b62..3119ef60 100644 --- a/Items/SalamanderCloth.cs +++ b/Items/SalamanderCloth.cs @@ -5,39 +5,41 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class SalamanderCloth : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + [AutoloadEquip(EquipType.Body)] + public class SalamanderCloth : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 26; - item.rare = 1; + item.width = 22; + item.height = 26; + item.rare = 1; - item.value = 100; - item.defense = 4; - } + item.value = 100; + item.defense = 4; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Salamander Cloth"); - Tooltip.SetDefault("Increases movement speed"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Salamander Cloth"); + Tooltip.SetDefault("Increases movement speed"); + } - public override void UpdateEquip(Player player) - { - player.moveSpeed += 0.2f; - } + public override void UpdateEquip(Player player) + { + player.moveSpeed += 0.2f; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "SalamanderSkin", 10); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "SalamanderSkin", 10); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } + } +} diff --git a/Items/SalamanderLeggings.cs b/Items/SalamanderLeggings.cs index 41494a36..cd7b788b 100644 --- a/Items/SalamanderLeggings.cs +++ b/Items/SalamanderLeggings.cs @@ -5,40 +5,43 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class SalamanderLeggings : ModItem +namespace Tremor.Items { - - - public override void SetDefaults() - { - - item.width = 22; - item.height = 18; - item.rare = 1; - - item.value = 100; - item.defense = 3; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Salamander Leggings"); - Tooltip.SetDefault("Increases movement speed"); - } - - - public override void UpdateEquip(Player player) - { - player.moveSpeed += 0.1f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "SalamanderSkin", 8); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } -}} + [AutoloadEquip(EquipType.Legs)] + public class SalamanderLeggings : ModItem + { + + + public override void SetDefaults() + { + + item.width = 22; + item.height = 18; + item.rare = 1; + + item.value = 100; + item.defense = 3; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Salamander Leggings"); + Tooltip.SetDefault("Increases movement speed"); + } + + + public override void UpdateEquip(Player player) + { + player.moveSpeed += 0.1f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "SalamanderSkin", 8); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } + } +} diff --git a/Items/SalamanderMask.cs b/Items/SalamanderMask.cs index cb1bf33b..3622c290 100644 --- a/Items/SalamanderMask.cs +++ b/Items/SalamanderMask.cs @@ -5,51 +5,54 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class SalamanderMask : ModItem +namespace Tremor.Items { - - - public override void SetDefaults() - { - - item.width = 28; - item.height = 22; - item.rare = 1; - - item.value = 100; - item.defense = 2; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Salamander Mask"); - Tooltip.SetDefault("Increases movement speed"); - } - - - public override void UpdateEquip(Player player) - { - player.moveSpeed += 0.1f; - } - - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("SalamanderCloth") && legs.type == mod.ItemType("SalamanderLeggings"); - } - - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increases armor penetration by 5"; - player.armorPenetration = 5; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "SalamanderSkin", 6); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } -}} + [AutoloadEquip(EquipType.Head)] + public class SalamanderMask : ModItem + { + + + public override void SetDefaults() + { + + item.width = 28; + item.height = 22; + item.rare = 1; + + item.value = 100; + item.defense = 2; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Salamander Mask"); + Tooltip.SetDefault("Increases movement speed"); + } + + + public override void UpdateEquip(Player player) + { + player.moveSpeed += 0.1f; + } + + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("SalamanderCloth") && legs.type == mod.ItemType("SalamanderLeggings"); + } + + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increases armor penetration by 5"; + player.armorPenetration = 5; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "SalamanderSkin", 6); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } + } +} diff --git a/Items/SalamanderSkin.cs b/Items/SalamanderSkin.cs index 59d9fb75..4c1840f1 100644 --- a/Items/SalamanderSkin.cs +++ b/Items/SalamanderSkin.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SalamanderSkin : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SalamanderSkin : ModItem + { + public override void SetDefaults() + { - item.width = 20; - item.height = 40; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 150; - item.rare = 1; - item.createTile = mod.TileType("SalamanderSkinTile"); - } + item.width = 20; + item.height = 40; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 150; + item.rare = 1; + item.createTile = mod.TileType("SalamanderSkinTile"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Salamander Skin"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Salamander Skin"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/SamuraiChestplate.cs b/Items/SamuraiChestplate.cs index 458dd37e..9c97de45 100644 --- a/Items/SamuraiChestplate.cs +++ b/Items/SamuraiChestplate.cs @@ -6,32 +6,32 @@ using Terraria.ModLoader; namespace Tremor.Items -{ -[AutoloadEquip(EquipType.Body)] - public class SamuraiChestplate : ModItem - { +{ + [AutoloadEquip(EquipType.Body)] + public class SamuraiChestplate : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 30; - item.height = 18; + item.width = 30; + item.height = 18; - item.value = 100000; - item.rare = 5; - item.defense = 14; - } + item.value = 100000; + item.rare = 5; + item.defense = 14; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Samurai Fullplate"); - Tooltip.SetDefault("Increases melee speed by 25%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Samurai Fullplate"); + Tooltip.SetDefault("Increases melee speed by 25%"); + } - public override void UpdateEquip(Player player) - { - player.meleeSpeed += 0.25f; - } - } + public override void UpdateEquip(Player player) + { + player.meleeSpeed += 0.25f; + } + } } diff --git a/Items/SamuraiGeaves.cs b/Items/SamuraiGeaves.cs index ae958c6d..eca388c8 100644 --- a/Items/SamuraiGeaves.cs +++ b/Items/SamuraiGeaves.cs @@ -4,32 +4,34 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] - public class SamuraiGeaves : ModItem - { +namespace Tremor.Items +{ + [AutoloadEquip(EquipType.Legs)] + public class SamuraiGeaves : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 18; + item.width = 22; + item.height = 18; - item.value = 100000; - item.rare = 5; - item.defense = 11; - } + item.value = 100000; + item.rare = 5; + item.defense = 11; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Samurai Legguards"); - Tooltip.SetDefault("Increases movement speed by 50%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Samurai Legguards"); + Tooltip.SetDefault("Increases movement speed by 50%"); + } - public override void UpdateEquip(Player player) - { - player.moveSpeed += 0.5f; - } - } + public override void UpdateEquip(Player player) + { + player.moveSpeed += 0.5f; + } + } } diff --git a/Items/SamuraiHead.cs b/Items/SamuraiHead.cs index 49e442f6..30e1e8c6 100644 --- a/Items/SamuraiHead.cs +++ b/Items/SamuraiHead.cs @@ -6,52 +6,52 @@ namespace Tremor.Items { -[AutoloadEquip(EquipType.Head)] - public class SamuraiHead : ModItem - { - + [AutoloadEquip(EquipType.Head)] + public class SamuraiHead : ModItem + { + public override bool AltFunctionUse(Player player) { return true; } - public override void SetDefaults() - { - - item.width = 20; - item.height = 20; - item.value = 100000; - item.rare = 5; - - item.defense = 10; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Samurai Helmet"); - Tooltip.SetDefault("Increases all damage by 9%"); - } - - - public override void UpdateEquip(Player player) - { - player.meleeDamage += 0.09f; - player.rangedDamage += 0.09f; - player.thrownDamage += 0.09f; - player.minionDamage += 0.09f; - player.magicDamage += 0.09f; - } - - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == mod.ItemType("SamuraiChestplate") && legs.type == mod.ItemType("SamuraiGeaves"); - } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Greatly increased life regeneration!"; - player.crimsonRegen = true; - - } - - } + public override void SetDefaults() + { + + item.width = 20; + item.height = 20; + item.value = 100000; + item.rare = 5; + + item.defense = 10; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Samurai Helmet"); + Tooltip.SetDefault("Increases all damage by 9%"); + } + + + public override void UpdateEquip(Player player) + { + player.meleeDamage += 0.09f; + player.rangedDamage += 0.09f; + player.thrownDamage += 0.09f; + player.minionDamage += 0.09f; + player.magicDamage += 0.09f; + } + + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("SamuraiChestplate") && legs.type == mod.ItemType("SamuraiGeaves"); + } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Greatly increased life regeneration!"; + player.crimsonRegen = true; + + } + + } } diff --git a/Items/Sanctifier.cs b/Items/Sanctifier.cs index 3ffa165e..1597d0d9 100644 --- a/Items/Sanctifier.cs +++ b/Items/Sanctifier.cs @@ -4,42 +4,44 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Sanctifier : ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 22; - item.height = 44; - - item.value = 25000; - item.rare = 5; - item.maxStack = 1; - item.defense = 3; - item.accessory = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sanctifier"); - Tooltip.SetDefault("Increases alchemic and throwing damage by 15%"); - } - - - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.GetModPlayer(mod).alchemistDamage += 0.15f; - player.thrownDamage += 0.15f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.HallowedBar, 16); - recipe.SetResult(this); - recipe.AddTile(null, "GreatAnvilTile"); - recipe.AddRecipe(); - } -}} + public class Sanctifier : ModItem + { + + public override void SetDefaults() + { + + item.width = 22; + item.height = 44; + + item.value = 25000; + item.rare = 5; + item.maxStack = 1; + item.defense = 3; + item.accessory = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sanctifier"); + Tooltip.SetDefault("Increases alchemic and throwing damage by 15%"); + } + + + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.GetModPlayer(mod).alchemistDamage += 0.15f; + player.thrownDamage += 0.15f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.HallowedBar, 16); + recipe.SetResult(this); + recipe.AddTile(null, "GreatAnvilTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/SandKnife.cs b/Items/SandKnife.cs index 22369233..1bd52688 100644 --- a/Items/SandKnife.cs +++ b/Items/SandKnife.cs @@ -4,32 +4,34 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SandKnife : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SandKnife : ModItem + { + public override void SetDefaults() + { - item.damage = 22; - item.melee = true; - item.width = 32; - item.height = 32; - item.useTime = 12; - item.useAnimation = 12; - item.useStyle = 3; - item.useTurn = false; - item.knockBack = 6f; - item.scale = 0.9f; - item.value = 2890; - item.rare = 2; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 22; + item.melee = true; + item.width = 32; + item.height = 32; + item.useTime = 12; + item.useAnimation = 12; + item.useStyle = 3; + item.useTurn = false; + item.knockBack = 6f; + item.scale = 0.9f; + item.value = 2890; + item.rare = 2; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Barkhan"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Barkhan"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/SandShuriken.cs b/Items/SandShuriken.cs index 193b3680..a137f513 100644 --- a/Items/SandShuriken.cs +++ b/Items/SandShuriken.cs @@ -5,35 +5,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SandShuriken : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SandShuriken : ModItem + { + public override void SetDefaults() + { - item.damage = 27; - item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 1; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("SandShuriken"); - item.shootSpeed = 27f; - item.useStyle = 1; - item.knockBack = 4; - item.value = 50000; - item.rare = 5; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 27; + item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 1; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("SandShuriken"); + item.shootSpeed = 27f; + item.useStyle = 1; + item.knockBack = 4; + item.value = 50000; + item.rare = 5; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sand Shuriken"); - Tooltip.SetDefault("Can be used infinitely"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sand Shuriken"); + Tooltip.SetDefault("Can be used infinitely"); + } -}} + } +} diff --git a/Items/SandStoneBreastplate.cs b/Items/SandStoneBreastplate.cs index cc950f6c..d82d8ecc 100644 --- a/Items/SandStoneBreastplate.cs +++ b/Items/SandStoneBreastplate.cs @@ -5,42 +5,44 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class SandStoneBreastplate : ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 26; - item.height = 18; - - item.value = 600; - item.rare = 2; - item.defense = 4; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dune Breastplate"); - Tooltip.SetDefault("10% increased movement speed"); - } - - - public override void UpdateEquip(Player player) - { - player.moveSpeed += 0.1f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "SandstoneBar", 12); - recipe.AddIngredient(null, "AntlionShell", 1); - recipe.AddIngredient(null, "PetrifiedSpike", 5); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + [AutoloadEquip(EquipType.Body)] + public class SandStoneBreastplate : ModItem + { + + public override void SetDefaults() + { + + item.width = 26; + item.height = 18; + + item.value = 600; + item.rare = 2; + item.defense = 4; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dune Breastplate"); + Tooltip.SetDefault("10% increased movement speed"); + } + + + public override void UpdateEquip(Player player) + { + player.moveSpeed += 0.1f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "SandstoneBar", 12); + recipe.AddIngredient(null, "AntlionShell", 1); + recipe.AddIngredient(null, "PetrifiedSpike", 5); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/SandStoneGreaves.cs b/Items/SandStoneGreaves.cs index 876ddfba..543f0801 100644 --- a/Items/SandStoneGreaves.cs +++ b/Items/SandStoneGreaves.cs @@ -4,42 +4,45 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class SandStoneGreaves : ModItem +namespace Tremor.Items { - - - public override void SetDefaults() - { - - item.width = 22; - item.height = 18; - item.value = 500; - - item.rare = 2; - item.defense = 4; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dune Greaves"); - Tooltip.SetDefault("10% increased movement speed"); - } - - - public override void UpdateEquip(Player player) - { - player.moveSpeed += 0.1f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "SandstoneBar", 10); - recipe.AddIngredient(null, "AntlionShell", 1); - recipe.AddIngredient(null, "PetrifiedSpike", 4); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + [AutoloadEquip(EquipType.Legs)] + public class SandStoneGreaves : ModItem + { + + + public override void SetDefaults() + { + + item.width = 22; + item.height = 18; + item.value = 500; + + item.rare = 2; + item.defense = 4; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dune Greaves"); + Tooltip.SetDefault("10% increased movement speed"); + } + + + public override void UpdateEquip(Player player) + { + player.moveSpeed += 0.1f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "SandstoneBar", 10); + recipe.AddIngredient(null, "AntlionShell", 1); + recipe.AddIngredient(null, "PetrifiedSpike", 4); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/SandStoneHelmet.cs b/Items/SandStoneHelmet.cs index 9a14123d..e3d06ce8 100644 --- a/Items/SandStoneHelmet.cs +++ b/Items/SandStoneHelmet.cs @@ -6,58 +6,58 @@ namespace Tremor.Items { -[AutoloadEquip(EquipType.Head)] - public class SandStoneHelmet : ModItem - { + [AutoloadEquip(EquipType.Head)] + public class SandStoneHelmet : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 32; - item.height = 26; - item.value = 400; + item.width = 32; + item.height = 26; + item.value = 400; - item.rare = 2; - item.defense = 4; - } + item.rare = 2; + item.defense = 4; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dune Helmet"); - Tooltip.SetDefault("10% increased movement speed"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dune Helmet"); + Tooltip.SetDefault("10% increased movement speed"); + } - public override void UpdateEquip(Player player) - { - player.moveSpeed += 0.1f; - } + public override void UpdateEquip(Player player) + { + player.moveSpeed += 0.1f; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == mod.ItemType("SandStoneBreastplate") && legs.type == mod.ItemType("SandStoneGreaves"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("SandStoneBreastplate") && legs.type == mod.ItemType("SandStoneGreaves"); + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "The desert winds call a sandstorm to protect you"; - player.AddBuff(mod.BuffType("SandstormMinionBuff"), 2); - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "The desert winds call a sandstorm to protect you"; + player.AddBuff(mod.BuffType("SandstormMinionBuff"), 2); + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawShadow=true; + player.armorEffectDrawShadow = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "SandstoneBar", 8); - recipe.AddIngredient(null, "AntlionShell", 1); - recipe.AddIngredient(null, "PetrifiedSpike", 4); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "SandstoneBar", 8); + recipe.AddIngredient(null, "AntlionShell", 1); + recipe.AddIngredient(null, "PetrifiedSpike", 4); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } } diff --git a/Items/SandThingBanner.cs b/Items/SandThingBanner.cs index b8b37d23..8c856360 100644 --- a/Items/SandThingBanner.cs +++ b/Items/SandThingBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SandThingBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SandThingBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 86; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 86; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sand Thing Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sand Thing Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/SandstoneAxe.cs b/Items/SandstoneAxe.cs index 44f2ea8c..1fb4a845 100644 --- a/Items/SandstoneAxe.cs +++ b/Items/SandstoneAxe.cs @@ -4,43 +4,45 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SandstoneAxe : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SandstoneAxe : ModItem + { + public override void SetDefaults() + { - item.autoReuse = true; - item.useStyle = 1; - item.useAnimation = 30; - item.knockBack = 6f; - item.useTime = 15; - item.width = 24; - item.height = 28; - item.damage = 16; - item.axe = 15; - item.scale = 1.2f; - item.UseSound = SoundID.Item1; - item.rare = 1; - item.value = 13500; - item.melee = true; - } + item.autoReuse = true; + item.useStyle = 1; + item.useAnimation = 30; + item.knockBack = 6f; + item.useTime = 15; + item.width = 24; + item.height = 28; + item.damage = 16; + item.axe = 15; + item.scale = 1.2f; + item.UseSound = SoundID.Item1; + item.rare = 1; + item.value = 13500; + item.melee = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dune Axe"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dune Axe"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "AntlionShell", 1); - recipe.AddIngredient(ItemID.Topaz, 3); - recipe.AddIngredient(ItemID.AntlionMandible, 5); - recipe.AddTile(16); - recipe.SetResult(this); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "AntlionShell", 1); + recipe.AddIngredient(ItemID.Topaz, 3); + recipe.AddIngredient(ItemID.AntlionMandible, 5); + recipe.AddTile(16); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } -}} diff --git a/Items/SandstoneBar.cs b/Items/SandstoneBar.cs index 502b8b44..d8ef3b14 100644 --- a/Items/SandstoneBar.cs +++ b/Items/SandstoneBar.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SandstoneBar : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SandstoneBar : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 200; - item.rare = 2; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.createTile = mod.TileType("SandstoneBar"); - item.useStyle = 1; - item.consumable = true; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 200; + item.rare = 2; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.createTile = mod.TileType("SandstoneBar"); + item.useStyle = 1; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dune Bar"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dune Bar"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/SandstoneBathtub.cs b/Items/SandstoneBathtub.cs index 85d9510a..5a420a0b 100644 --- a/Items/SandstoneBathtub.cs +++ b/Items/SandstoneBathtub.cs @@ -19,26 +19,26 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("SandstoneBathtub"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sandstone Bathtub"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sandstone Bathtub"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(607, 14); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(607, 14); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/SandstoneBed.cs b/Items/SandstoneBed.cs index 55c47919..ba5e9c5c 100644 --- a/Items/SandstoneBed.cs +++ b/Items/SandstoneBed.cs @@ -19,27 +19,27 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("SandstoneBed"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sandstone Bed"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sandstone Bed"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(607, 15); - recipe.AddIngredient(ItemID.Silk, 5); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(607, 15); + recipe.AddIngredient(ItemID.Silk, 5); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/SandstoneBench.cs b/Items/SandstoneBench.cs index 07bca639..f8aae7a0 100644 --- a/Items/SandstoneBench.cs +++ b/Items/SandstoneBench.cs @@ -19,26 +19,26 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("SandstoneBench"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sandstone Bench"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sandstone Bench"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(607, 8); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(607, 8); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/SandstoneBookcase.cs b/Items/SandstoneBookcase.cs index 498aa25c..051b965a 100644 --- a/Items/SandstoneBookcase.cs +++ b/Items/SandstoneBookcase.cs @@ -19,17 +19,17 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("SandstoneBookcase"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sandstone Bookcase"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sandstone Bookcase"); + Tooltip.SetDefault(""); + } } } diff --git a/Items/SandstoneCandelabra.cs b/Items/SandstoneCandelabra.cs index 41bdf06a..c93d5f9c 100644 --- a/Items/SandstoneCandelabra.cs +++ b/Items/SandstoneCandelabra.cs @@ -19,27 +19,27 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("SandstoneCandelabra"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sandstone Candelabra"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sandstone Candelabra"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(607, 5); - recipe.AddIngredient(ItemID.Torch, 3); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(607, 5); + recipe.AddIngredient(ItemID.Torch, 3); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/SandstoneCandle.cs b/Items/SandstoneCandle.cs index 4886ad7f..029f92c1 100644 --- a/Items/SandstoneCandle.cs +++ b/Items/SandstoneCandle.cs @@ -19,27 +19,27 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("SandstoneCandle"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sandstone Candle"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sandstone Candle"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(607, 4); - recipe.AddIngredient(ItemID.Torch, 1); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(607, 4); + recipe.AddIngredient(ItemID.Torch, 1); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/SandstoneChainsaw.cs b/Items/SandstoneChainsaw.cs index bbe9a114..7755045e 100644 --- a/Items/SandstoneChainsaw.cs +++ b/Items/SandstoneChainsaw.cs @@ -4,47 +4,49 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class SandstoneChainsaw : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.damage = 16; - item.melee = true; - item.width = 20; - item.height = 12; - item.useTime = 15; - item.useAnimation = 25; - item.channel = true; - item.noUseGraphic = true; - item.noMelee = true; - item.axe = 15; - item.useStyle = 5; - item.knockBack = 6; - item.value = 13500; - item.rare = 1; - item.UseSound = SoundID.Item23; - item.autoReuse = true; - item.shoot = mod.ProjectileType("SandstoneChainsawPro"); - item.shootSpeed = 40f; - } + public class SandstoneChainsaw : ModItem + { + public override void SetDefaults() + { + + item.damage = 16; + item.melee = true; + item.width = 20; + item.height = 12; + item.useTime = 15; + item.useAnimation = 25; + item.channel = true; + item.noUseGraphic = true; + item.noMelee = true; + item.axe = 15; + item.useStyle = 5; + item.knockBack = 6; + item.value = 13500; + item.rare = 1; + item.UseSound = SoundID.Item23; + item.autoReuse = true; + item.shoot = mod.ProjectileType("SandstoneChainsawPro"); + item.shootSpeed = 40f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dune Chainsaw"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dune Chainsaw"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "AntlionShell", 1); - recipe.AddIngredient(ItemID.Topaz, 3); - recipe.AddIngredient(ItemID.AntlionMandible, 5); - recipe.AddTile(16); - recipe.SetResult(this); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "AntlionShell", 1); + recipe.AddIngredient(ItemID.Topaz, 3); + recipe.AddIngredient(ItemID.AntlionMandible, 5); + recipe.AddTile(16); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } -}} diff --git a/Items/SandstoneChair.cs b/Items/SandstoneChair.cs index 312f09e4..c8389088 100644 --- a/Items/SandstoneChair.cs +++ b/Items/SandstoneChair.cs @@ -19,26 +19,26 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("SandstoneChair"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sandstone Chair"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sandstone Chair"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(607, 4); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(607, 4); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/SandstoneChandelier.cs b/Items/SandstoneChandelier.cs index 9c775a3a..53df48fc 100644 --- a/Items/SandstoneChandelier.cs +++ b/Items/SandstoneChandelier.cs @@ -19,28 +19,28 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("SandstoneChandelier"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sandstone Chandelier"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sandstone Chandelier"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(607, 4); - recipe.AddIngredient(ItemID.Torch, 4); - recipe.AddIngredient(ItemID.Chain, 1); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(607, 4); + recipe.AddIngredient(ItemID.Torch, 4); + recipe.AddIngredient(ItemID.Chain, 1); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/SandstoneChest.cs b/Items/SandstoneChest.cs index e1fb9ce7..8cd05e89 100644 --- a/Items/SandstoneChest.cs +++ b/Items/SandstoneChest.cs @@ -19,34 +19,34 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("SandstoneChest"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sandstone Chest"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sandstone Chest"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(607, 8); - recipe.AddIngredient(ItemID.IronBar, 2); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(607, 8); + recipe.AddIngredient(ItemID.IronBar, 2); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(607, 8); - recipe.AddIngredient(ItemID.LeadBar, 2); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + recipe = new ModRecipe(mod); + recipe.AddIngredient(607, 8); + recipe.AddIngredient(ItemID.LeadBar, 2); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/SandstoneDoor.cs b/Items/SandstoneDoor.cs index 1a9124a5..df0999e3 100644 --- a/Items/SandstoneDoor.cs +++ b/Items/SandstoneDoor.cs @@ -19,26 +19,26 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 10; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 150; item.createTile = mod.TileType("SandstoneDoorClosed"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sandstone Door"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sandstone Door"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(607, 6); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(607, 6); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/SandstoneDresser.cs b/Items/SandstoneDresser.cs index cde9311c..84e788e7 100644 --- a/Items/SandstoneDresser.cs +++ b/Items/SandstoneDresser.cs @@ -19,26 +19,26 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("SandstoneDresser"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sandstone Dresser"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sandstone Dresser"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(607, 16); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(607, 16); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/SandstoneDrill.cs b/Items/SandstoneDrill.cs index 45875da0..507d2f1d 100644 --- a/Items/SandstoneDrill.cs +++ b/Items/SandstoneDrill.cs @@ -4,47 +4,49 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class SandstoneDrill : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.damage = 8; - item.melee = true; - item.width = 20; - item.height = 12; - item.useTime = 21; - item.useAnimation = 25; - item.channel = true; - item.noUseGraphic = true; - item.noMelee = true; - item.pick = 46; - item.useStyle = 5; - item.knockBack = 6; - item.value = 13500; - item.rare = 1; - item.UseSound = SoundID.Item23; - item.autoReuse = true; - item.shoot = mod.ProjectileType("SandstoneDrillPro"); - item.shootSpeed = 40f; - } + public class SandstoneDrill : ModItem + { + public override void SetDefaults() + { + + item.damage = 8; + item.melee = true; + item.width = 20; + item.height = 12; + item.useTime = 21; + item.useAnimation = 25; + item.channel = true; + item.noUseGraphic = true; + item.noMelee = true; + item.pick = 46; + item.useStyle = 5; + item.knockBack = 6; + item.value = 13500; + item.rare = 1; + item.UseSound = SoundID.Item23; + item.autoReuse = true; + item.shoot = mod.ProjectileType("SandstoneDrillPro"); + item.shootSpeed = 40f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dune Drill"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dune Drill"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "AntlionShell", 1); - recipe.AddIngredient(ItemID.Topaz, 4); - recipe.AddIngredient(ItemID.AntlionMandible, 4); - recipe.AddTile(16); - recipe.SetResult(this); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "AntlionShell", 1); + recipe.AddIngredient(ItemID.Topaz, 4); + recipe.AddIngredient(ItemID.AntlionMandible, 4); + recipe.AddTile(16); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } -}} diff --git a/Items/SandstoneGrandfatherClock.cs b/Items/SandstoneGrandfatherClock.cs index 5dfbd8fd..5f149819 100644 --- a/Items/SandstoneGrandfatherClock.cs +++ b/Items/SandstoneGrandfatherClock.cs @@ -19,37 +19,37 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("SandstoneGrandfatherClock"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sandstone Grandfather Clock"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sandstone Grandfather Clock"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.IronBar, 3); - recipe.AddIngredient(ItemID.Glass, 6); - recipe.AddIngredient(607, 10); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.IronBar, 3); + recipe.AddIngredient(ItemID.Glass, 6); + recipe.AddIngredient(607, 10); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.LeadBar, 3); - recipe.AddIngredient(ItemID.Glass, 6); - recipe.AddIngredient(607, 10); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.LeadBar, 3); + recipe.AddIngredient(ItemID.Glass, 6); + recipe.AddIngredient(607, 10); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/SandstoneHammer.cs b/Items/SandstoneHammer.cs index 3a4f6e3c..0aab51f3 100644 --- a/Items/SandstoneHammer.cs +++ b/Items/SandstoneHammer.cs @@ -4,44 +4,46 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SandstoneHammer : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SandstoneHammer : ModItem + { + public override void SetDefaults() + { - item.autoReuse = true; - item.useStyle = 1; - item.useAnimation = 45; - item.useTime = 19; - item.hammer = 55; - item.width = 24; - item.height = 28; - item.damage = 18; - item.knockBack = 6f; - item.scale = 1.3f; - item.UseSound = SoundID.Item1; - item.rare = 1; - item.value = 13500; - item.melee = true; - } + item.autoReuse = true; + item.useStyle = 1; + item.useAnimation = 45; + item.useTime = 19; + item.hammer = 55; + item.width = 24; + item.height = 28; + item.damage = 18; + item.knockBack = 6f; + item.scale = 1.3f; + item.UseSound = SoundID.Item1; + item.rare = 1; + item.value = 13500; + item.melee = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dune Hammer"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dune Hammer"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "AntlionShell", 1); - recipe.AddIngredient(ItemID.Topaz, 2); - recipe.AddIngredient(ItemID.AntlionMandible, 4); - recipe.AddTile(16); - recipe.SetResult(this); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "AntlionShell", 1); + recipe.AddIngredient(ItemID.Topaz, 2); + recipe.AddIngredient(ItemID.AntlionMandible, 4); + recipe.AddTile(16); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } -}} diff --git a/Items/SandstoneLamp.cs b/Items/SandstoneLamp.cs index d4c6316a..77abdb08 100644 --- a/Items/SandstoneLamp.cs +++ b/Items/SandstoneLamp.cs @@ -19,27 +19,27 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("SandstoneLamp"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sandstone Lamp"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sandstone Lamp"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(607, 3); - recipe.AddIngredient(ItemID.Torch, 1); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(607, 3); + recipe.AddIngredient(ItemID.Torch, 1); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/SandstoneLantern.cs b/Items/SandstoneLantern.cs index 2c896466..335ba81b 100644 --- a/Items/SandstoneLantern.cs +++ b/Items/SandstoneLantern.cs @@ -19,27 +19,27 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("SandstoneLantern"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sandstone Lantern"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sandstone Lantern"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(607, 6); - recipe.AddIngredient(ItemID.Torch, 1); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(607, 6); + recipe.AddIngredient(ItemID.Torch, 1); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/SandstonePiano.cs b/Items/SandstonePiano.cs index 13856e0d..95ee4b61 100644 --- a/Items/SandstonePiano.cs +++ b/Items/SandstonePiano.cs @@ -19,28 +19,28 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("SandstonePiano"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sandstone Piano"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sandstone Piano"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(154, 4); - recipe.AddIngredient(607, 15); - recipe.AddIngredient(149); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(154, 4); + recipe.AddIngredient(607, 15); + recipe.AddIngredient(149); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/SandstonePickaxe.cs b/Items/SandstonePickaxe.cs index 85111056..2b5344bc 100644 --- a/Items/SandstonePickaxe.cs +++ b/Items/SandstonePickaxe.cs @@ -4,43 +4,45 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SandstonePickaxe : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SandstonePickaxe : ModItem + { + public override void SetDefaults() + { - item.autoReuse = true; - item.useStyle = 1; - item.useAnimation = 45; - item.useTime = 21; - item.pick = 46; - item.width = 24; - item.height = 28; - item.damage = 8; - item.knockBack = 6f; - item.scale = 1.3f; - item.UseSound = SoundID.Item1; - item.rare = 1; - item.value = 13500; - item.melee = true; - } + item.autoReuse = true; + item.useStyle = 1; + item.useAnimation = 45; + item.useTime = 21; + item.pick = 46; + item.width = 24; + item.height = 28; + item.damage = 8; + item.knockBack = 6f; + item.scale = 1.3f; + item.UseSound = SoundID.Item1; + item.rare = 1; + item.value = 13500; + item.melee = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dune Pickaxe"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dune Pickaxe"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "AntlionShell", 1); - recipe.AddIngredient(ItemID.Topaz, 4); - recipe.AddIngredient(ItemID.AntlionMandible, 4); - recipe.AddTile(16); - recipe.SetResult(this); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "AntlionShell", 1); + recipe.AddIngredient(ItemID.Topaz, 4); + recipe.AddIngredient(ItemID.AntlionMandible, 4); + recipe.AddTile(16); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } -}} diff --git a/Items/SandstonePlatform.cs b/Items/SandstonePlatform.cs index 65391920..b9e8c70e 100644 --- a/Items/SandstonePlatform.cs +++ b/Items/SandstonePlatform.cs @@ -19,26 +19,26 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("SandstonePlatform"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sandstone Platform"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sandstone Platform"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(607, 1); - recipe.SetResult(this, 2); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(607, 1); + recipe.SetResult(this, 2); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/SandstoneRing.cs b/Items/SandstoneRing.cs index 694b945c..8b825a57 100644 --- a/Items/SandstoneRing.cs +++ b/Items/SandstoneRing.cs @@ -4,34 +4,36 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SandstoneRing : ModItem +namespace Tremor.Items { + public class SandstoneRing : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 28; - item.height = 20; - item.value = 10000; + item.width = 28; + item.height = 20; + item.value = 10000; - item.rare = 1; - item.accessory = true; - item.defense = 3; - } + item.rare = 1; + item.accessory = true; + item.defense = 3; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sandstone Ring "); - Tooltip.SetDefault("5% increased melee damage\nIncreases melee critical strike chance by 5"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sandstone Ring "); + Tooltip.SetDefault("5% increased melee damage\nIncreases melee critical strike chance by 5"); + } - public override void UpdateAccessory(Player player, bool hideVisual) + public override void UpdateAccessory(Player player, bool hideVisual) - { - player.meleeDamage += 0.05f; - player.meleeCrit += 5; - } -}} + { + player.meleeDamage += 0.05f; + player.meleeCrit += 5; + } + } +} diff --git a/Items/SandstoneSink.cs b/Items/SandstoneSink.cs index 9f95c612..16012774 100644 --- a/Items/SandstoneSink.cs +++ b/Items/SandstoneSink.cs @@ -19,27 +19,27 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("SandstoneSink"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sandstone Sink"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sandstone Sink"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(607, 6); - recipe.AddIngredient(206); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(607, 6); + recipe.AddIngredient(206); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/SandstoneTable.cs b/Items/SandstoneTable.cs index 15d1ac22..f504468a 100644 --- a/Items/SandstoneTable.cs +++ b/Items/SandstoneTable.cs @@ -19,26 +19,26 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("SandstoneTable"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sandstone Table"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sandstone Table"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(607, 8); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(607, 8); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/SandstoneWorkbench.cs b/Items/SandstoneWorkbench.cs index 1813cbf7..f609b13b 100644 --- a/Items/SandstoneWorkbench.cs +++ b/Items/SandstoneWorkbench.cs @@ -19,26 +19,26 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("SandstoneWorkbench"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sandstone Workbench"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sandstone Workbench"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(607, 10); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(607, 10); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/SantaNK1Mask.cs b/Items/SantaNK1Mask.cs index a26cb44e..22b09f41 100644 --- a/Items/SantaNK1Mask.cs +++ b/Items/SantaNK1Mask.cs @@ -4,25 +4,28 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class SantaNK1Mask : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class SantaNK1Mask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 24; - item.height = 34; - item.rare = 1; - item.vanity = true; - } + item.width = 24; + item.height = 34; + item.rare = 1; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Santa-NK1 Mask"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Santa-NK1 Mask"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/SapphireBlade.cs b/Items/SapphireBlade.cs index 895ff8fe..9b4ab403 100644 --- a/Items/SapphireBlade.cs +++ b/Items/SapphireBlade.cs @@ -5,46 +5,48 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SapphireBlade : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SapphireBlade : ModItem + { + public override void SetDefaults() + { - item.damage = 15; - item.melee = true; - item.width = 46; - item.height = 48; - item.useTime = 25; - item.useAnimation = 25; - item.useStyle = 1; - item.knockBack = 3; - item.value = 6400; - item.rare = 2; - item.UseSound = SoundID.Item15; - item.autoReuse = true; - item.useTurn = true; - } + item.damage = 15; + item.melee = true; + item.width = 46; + item.height = 48; + item.useTime = 25; + item.useAnimation = 25; + item.useStyle = 1; + item.knockBack = 3; + item.value = 6400; + item.rare = 2; + item.UseSound = SoundID.Item15; + item.autoReuse = true; + item.useTurn = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sapphire Blade"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sapphire Blade"); + Tooltip.SetDefault(""); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 59); - } + public override void MeleeEffects(Player player, Rectangle hitbox) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 59); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Sapphire, 12); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Sapphire, 12); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/SapphireDrill.cs b/Items/SapphireDrill.cs index 2bb9ec95..815df8c1 100644 --- a/Items/SapphireDrill.cs +++ b/Items/SapphireDrill.cs @@ -4,47 +4,49 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class SapphireDrill : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.damage = 9; - item.melee = true; - item.width = 20; - item.height = 12; - item.useTime = 8; - item.useAnimation = 25; - item.channel = true; - item.noUseGraphic = true; - item.noMelee = true; - item.pick = 85; - item.useStyle = 5; - item.knockBack = 6; - item.value = Item.buyPrice(0, 0, 50, 0); - item.rare = 2; - item.UseSound = SoundID.Item23; - item.autoReuse = true; - item.shoot = mod.ProjectileType("SapphireDrillPro"); - item.shootSpeed = 40f; - } + public class SapphireDrill : ModItem + { + public override void SetDefaults() + { + + item.damage = 9; + item.melee = true; + item.width = 20; + item.height = 12; + item.useTime = 8; + item.useAnimation = 25; + item.channel = true; + item.noUseGraphic = true; + item.noMelee = true; + item.pick = 85; + item.useStyle = 5; + item.knockBack = 6; + item.value = Item.buyPrice(0, 0, 50, 0); + item.rare = 2; + item.UseSound = SoundID.Item23; + item.autoReuse = true; + item.shoot = mod.ProjectileType("SapphireDrillPro"); + item.shootSpeed = 40f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sapphire Drill"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sapphire Drill"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Obsidian, 25); - recipe.AddIngredient(ItemID.MeteoriteBar, 16); - recipe.AddIngredient(ItemID.Sapphire, 12); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Obsidian, 25); + recipe.AddIngredient(ItemID.MeteoriteBar, 16); + recipe.AddIngredient(ItemID.Sapphire, 12); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/SaturatedDagger.cs b/Items/SaturatedDagger.cs index 7588d6d9..49e868d7 100644 --- a/Items/SaturatedDagger.cs +++ b/Items/SaturatedDagger.cs @@ -5,44 +5,46 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SaturatedDagger : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SaturatedDagger : ModItem + { + public override void SetDefaults() + { - item.damage = 57; - item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("SaturatedDaggerPro"); - item.shootSpeed = 22f; - item.useStyle = 1; - item.knockBack = 4; - item.value = 50; - item.rare = 5; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 57; + item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("SaturatedDaggerPro"); + item.shootSpeed = 22f; + item.useStyle = 1; + item.knockBack = 4; + item.value = 50; + item.rare = 5; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Saturated Dagger"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Saturated Dagger"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ParaxydeShard", 1); - recipe.SetResult(this, 75); - recipe.AddTile(null, "AlchematorTile"); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ParaxydeShard", 1); + recipe.SetResult(this, 75); + recipe.AddTile(null, "AlchematorTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/SavingPotion.cs b/Items/SavingPotion.cs index 2a558abb..0318c796 100644 --- a/Items/SavingPotion.cs +++ b/Items/SavingPotion.cs @@ -4,47 +4,49 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class SavingPotion : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.width = 38; - item.height = 32; - item.maxStack = 20; - - item.rare = 10; - item.useAnimation = 15; - item.useTime = 15; - item.useStyle = 2; - item.UseSound = SoundID.Item3; - item.consumable = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Saving Potion"); - Tooltip.SetDefault("Greatly reduces mana cost"); - } - - - public override bool UseItem(Player player) - { - player.AddBuff(mod.BuffType("ManaSaving"), 14400); - return true; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.BottledWater, 1); - recipe.AddIngredient(314, 2); - recipe.AddIngredient(null, "ClusterShard", 1); - recipe.AddIngredient(null, "ManaFruit", 5); - recipe.AddTile(null, "AlchemyStationTile"); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + + public class SavingPotion : ModItem + { + public override void SetDefaults() + { + + item.width = 38; + item.height = 32; + item.maxStack = 20; + + item.rare = 10; + item.useAnimation = 15; + item.useTime = 15; + item.useStyle = 2; + item.UseSound = SoundID.Item3; + item.consumable = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Saving Potion"); + Tooltip.SetDefault("Greatly reduces mana cost"); + } + + + public override bool UseItem(Player player) + { + player.AddBuff(mod.BuffType("ManaSaving"), 14400); + return true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.BottledWater, 1); + recipe.AddIngredient(314, 2); + recipe.AddIngredient(null, "ClusterShard", 1); + recipe.AddIngredient(null, "ManaFruit", 5); + recipe.AddTile(null, "AlchemyStationTile"); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/ScamperPotion.cs b/Items/ScamperPotion.cs index 5f49fd62..4f7849c4 100644 --- a/Items/ScamperPotion.cs +++ b/Items/ScamperPotion.cs @@ -4,47 +4,49 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class ScamperPotion : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.width = 38; - item.height = 32; - item.maxStack = 20; - - item.rare = 10; - item.useAnimation = 15; - item.useTime = 15; - item.useStyle = 2; - item.UseSound = SoundID.Item3; - item.consumable = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Scamper Potion"); - Tooltip.SetDefault("75% increased movement speed"); - } - - - public override bool UseItem(Player player) - { - player.AddBuff(mod.BuffType("ScamperBuff"), 14400); - return true; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.BottledWater, 1); - recipe.AddIngredient(ItemID.Cactus, 5); - recipe.AddIngredient(null, "ConcentratedEther", 2); - recipe.AddIngredient(ItemID.Blinkroot, 1); - recipe.AddTile(null, "AlchemyStationTile"); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + + public class ScamperPotion : ModItem + { + public override void SetDefaults() + { + + item.width = 38; + item.height = 32; + item.maxStack = 20; + + item.rare = 10; + item.useAnimation = 15; + item.useTime = 15; + item.useStyle = 2; + item.UseSound = SoundID.Item3; + item.consumable = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Scamper Potion"); + Tooltip.SetDefault("75% increased movement speed"); + } + + + public override bool UseItem(Player player) + { + player.AddBuff(mod.BuffType("ScamperBuff"), 14400); + return true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.BottledWater, 1); + recipe.AddIngredient(ItemID.Cactus, 5); + recipe.AddIngredient(null, "ConcentratedEther", 2); + recipe.AddIngredient(ItemID.Blinkroot, 1); + recipe.AddTile(null, "AlchemyStationTile"); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Scarecrow.cs b/Items/Scarecrow.cs index e7ae79cc..65d15ae3 100644 --- a/Items/Scarecrow.cs +++ b/Items/Scarecrow.cs @@ -4,29 +4,31 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Scarecrow : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Scarecrow : ModItem + { + public override void SetDefaults() + { - item.width = 28; - item.height = 14; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 2500; - item.createTile = mod.TileType("Scarecrow"); - } + item.width = 28; + item.height = 14; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 2500; + item.createTile = mod.TileType("Scarecrow"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Scarecrow"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Scarecrow"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/ScarredReaper.cs b/Items/ScarredReaper.cs index ca06cb2e..b82f632b 100644 --- a/Items/ScarredReaper.cs +++ b/Items/ScarredReaper.cs @@ -4,46 +4,48 @@ using Terraria.ModLoader; using Terraria.ID; -namespace Tremor.Items { -public class ScarredReaper : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ScarredReaper : ModItem + { + public override void SetDefaults() + { - item.damage = 60; - item.melee = true; - item.width = 48; - item.height = 48; - item.useTime = 25; - item.shootSpeed = 10f; - item.useAnimation = 25; - item.useStyle = 1; - item.knockBack = 3f; - item.shoot = mod.ProjectileType("ScarredReaperPro"); - item.value = 200600; - item.rare = 5; - item.noUseGraphic = true; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 60; + item.melee = true; + item.width = 48; + item.height = 48; + item.useTime = 25; + item.shootSpeed = 10f; + item.useAnimation = 25; + item.useStyle = 1; + item.knockBack = 3f; + item.shoot = mod.ProjectileType("ScarredReaperPro"); + item.value = 200600; + item.rare = 5; + item.noUseGraphic = true; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Scarred Reaper"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Scarred Reaper"); + Tooltip.SetDefault(""); + } -public override bool CanUseItem(Player player) -{ - for (int i = 0; i < 1000; ++i) - { - if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) - { - return false; - } - } - return true; -} + public override bool CanUseItem(Player player) + { + for (int i = 0; i < 1000; ++i) + { + if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) + { + return false; + } + } + return true; + } -}} + } +} diff --git a/Items/ScaryBatBanner.cs b/Items/ScaryBatBanner.cs index 18a6c82d..eb007966 100644 --- a/Items/ScaryBatBanner.cs +++ b/Items/ScaryBatBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ScaryBatBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ScaryBatBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 87; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 87; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Scary Bat Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Scary Bat Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/Scorcher.cs b/Items/Scorcher.cs index 268dcca5..9296ab5d 100644 --- a/Items/Scorcher.cs +++ b/Items/Scorcher.cs @@ -4,44 +4,46 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Scorcher : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Scorcher : ModItem + { + public override void SetDefaults() + { - item.damage = 178; - item.width = 14; - item.height = 84; - item.noUseGraphic = true; - item.melee = true; - item.useTime = 30; - item.shoot = mod.ProjectileType("ScorcherPro"); - item.shootSpeed = 4f; - item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 4; - item.value = 210000; - item.rare = 10; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 178; + item.width = 14; + item.height = 84; + item.noUseGraphic = true; + item.melee = true; + item.useTime = 30; + item.shoot = mod.ProjectileType("ScorcherPro"); + item.shootSpeed = 4f; + item.useAnimation = 30; + item.useStyle = 5; + item.knockBack = 4; + item.value = 210000; + item.rare = 10; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Scorcher"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Scorcher"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "AncientTechnology", 1); - recipe.AddIngredient(3458, 30); - recipe.AddIngredient(null, "FireFragment", 25); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "AncientTechnology", 1); + recipe.AddIngredient(3458, 30); + recipe.AddIngredient(null, "FireFragment", 25); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } +} diff --git a/Items/ScorpionStinger.cs b/Items/ScorpionStinger.cs index b46ac318..e4583b5d 100644 --- a/Items/ScorpionStinger.cs +++ b/Items/ScorpionStinger.cs @@ -4,36 +4,38 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { -public class ScorpionStinger : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ScorpionStinger : ModItem + { + public override void SetDefaults() + { - item.damage = 41; - item.melee = true; - item.width = 46; - item.height = 54; + item.damage = 41; + item.melee = true; + item.width = 46; + item.height = 54; - item.useTime = 22; - item.useAnimation = 22; - item.useStyle = 1; - item.knockBack = 4; - item.value = 12000; - item.rare = 4; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.useTime = 22; + item.useAnimation = 22; + item.useStyle = 1; + item.knockBack = 4; + item.value = 12000; + item.rare = 4; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Scorpion Stinger"); - Tooltip.SetDefault("Poisons enemies"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Scorpion Stinger"); + Tooltip.SetDefault("Poisons enemies"); + } - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(70, 100); - } -}} + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(70, 100); + } + } +} diff --git a/Items/ScourgeofFlames.cs b/Items/ScourgeofFlames.cs index 37ffe41a..9f0319ff 100644 --- a/Items/ScourgeofFlames.cs +++ b/Items/ScourgeofFlames.cs @@ -5,66 +5,68 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ScourgeofFlames : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ScourgeofFlames : ModItem + { + public override void SetDefaults() + { - item.damage = 36; - item.magic = true; - item.mana = 8; - item.width = 34; - item.height = 30; - item.useTime = 28; - item.useAnimation = 28; - item.useStyle = 1; - item.noMelee = true; - item.knockBack = 3; - item.value = 13800; - item.rare = 4; - item.UseSound = SoundID.Item43; - item.autoReuse = false; - item.shoot = 668; - item.shootSpeed = 15f; + item.damage = 36; + item.magic = true; + item.mana = 8; + item.width = 34; + item.height = 30; + item.useTime = 28; + item.useAnimation = 28; + item.useStyle = 1; + item.noMelee = true; + item.knockBack = 3; + item.value = 13800; + item.rare = 4; + item.UseSound = SoundID.Item43; + item.autoReuse = false; + item.shoot = 668; + item.shootSpeed = 15f; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Scourge of Flames"); - Tooltip.SetDefault("Erupts three fire bolts"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Scourge of Flames"); + Tooltip.SetDefault("Erupts three fire bolts"); + } -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) -{ - for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. - { - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); - } - return false; -} + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. + { + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); + } + return false; + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if(Main.rand.Next(3) == 0) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 6); - } - } + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.Next(3) == 0) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 6); + } + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "FireFragment", 10); - recipe.AddIngredient(null, "Charcoal", 7); - recipe.AddIngredient(ItemID.HellstoneBar, 8); - recipe.AddIngredient(ItemID.SoulofNight, 5); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "FireFragment", 10); + recipe.AddIngredient(null, "Charcoal", 7); + recipe.AddIngredient(ItemID.HellstoneBar, 8); + recipe.AddIngredient(ItemID.SoulofNight, 5); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/SeaDawn.cs b/Items/SeaDawn.cs index 9bec37a5..468a78f5 100644 --- a/Items/SeaDawn.cs +++ b/Items/SeaDawn.cs @@ -4,33 +4,35 @@ using Terraria.ModLoader; using Terraria.ID; -namespace Tremor.Items { -public class SeaDawn : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SeaDawn : ModItem + { + public override void SetDefaults() + { - item.damage = 225; - item.melee = true; - item.width = 72; - item.height = 72; - item.useTime = 38; - item.useAnimation = 38; - item.useStyle = 1; - item.shootSpeed = 12f; - item.shoot = mod.ProjectileType("TyphoonPro"); - item.knockBack = 3; - item.value = 33000; - item.rare = 10; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 225; + item.melee = true; + item.width = 72; + item.height = 72; + item.useTime = 38; + item.useAnimation = 38; + item.useStyle = 1; + item.shootSpeed = 12f; + item.shoot = mod.ProjectileType("TyphoonPro"); + item.knockBack = 3; + item.value = 33000; + item.rare = 10; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sea Dawn"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sea Dawn"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/SeaFragment.cs b/Items/SeaFragment.cs index b5afe8b1..866c0d0e 100644 --- a/Items/SeaFragment.cs +++ b/Items/SeaFragment.cs @@ -6,24 +6,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SeaFragment : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SeaFragment : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 100; - item.rare = 1; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 100; + item.rare = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sea Fragment"); - Tooltip.SetDefault(""); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(8, 4)); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sea Fragment"); + Tooltip.SetDefault(""); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(8, 4)); + } -}} + } +} diff --git a/Items/ShadewoodArmchair.cs b/Items/ShadewoodArmchair.cs index c8dac13a..68ca4c53 100644 --- a/Items/ShadewoodArmchair.cs +++ b/Items/ShadewoodArmchair.cs @@ -4,40 +4,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ShadewoodArmchair : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ShadewoodArmchair : ModItem + { + public override void SetDefaults() + { - item.width = 42; - item.height = 32; - item.maxStack = 99; - item.value = 100; - item.rare = 1; - item.createTile = mod.TileType("ShadewoodArmchair"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - } + item.width = 42; + item.height = 32; + item.maxStack = 99; + item.value = 100; + item.rare = 1; + item.createTile = mod.TileType("ShadewoodArmchair"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Shadewood Armchair"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Shadewood Armchair"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Shadewood, 15); - recipe.AddIngredient(ItemID.Silk, 6); - recipe.SetResult(this); - recipe.AddTile(106); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Shadewood, 15); + recipe.AddIngredient(ItemID.Silk, 6); + recipe.SetResult(this); + recipe.AddTile(106); + recipe.AddRecipe(); + } + } +} diff --git a/Items/ShadewoodShield.cs b/Items/ShadewoodShield.cs index 099cd0f6..a723414e 100644 --- a/Items/ShadewoodShield.cs +++ b/Items/ShadewoodShield.cs @@ -5,33 +5,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Shield)] -public class ShadewoodShield : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + [AutoloadEquip(EquipType.Shield)] + public class ShadewoodShield : ModItem + { + public override void SetDefaults() + { - item.width = 24; - item.height = 24; - item.value = 110; - item.rare = 0; - item.accessory = true; - item.defense = 1; - } + item.width = 24; + item.height = 24; + item.value = 110; + item.rare = 0; + item.accessory = true; + item.defense = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Shadewood Shield"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Shadewood Shield"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Shadewood, 15); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Shadewood, 15); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } + } +} diff --git a/Items/ShadowBow.cs b/Items/ShadowBow.cs index d3ecbfc5..583d7458 100644 --- a/Items/ShadowBow.cs +++ b/Items/ShadowBow.cs @@ -4,43 +4,45 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ShadowBow : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ShadowBow : ModItem + { + public override void SetDefaults() + { - item.damage = 18; - item.width = 16; - item.height = 32; - item.useTime = 25; - item.ranged = true; - item.shoot = 1; - item.shootSpeed = 10f; - item.useAnimation = 25; - item.useStyle = 5; - item.knockBack = 5; - item.value = 5040; - item.useAmmo = AmmoID.Arrow; - item.rare = 3; - item.UseSound = SoundID.Item5; - item.autoReuse = true; - } + item.damage = 18; + item.width = 16; + item.height = 32; + item.useTime = 25; + item.ranged = true; + item.shoot = 1; + item.shootSpeed = 10f; + item.useAnimation = 25; + item.useStyle = 5; + item.knockBack = 5; + item.value = 5040; + item.useAmmo = AmmoID.Arrow; + item.rare = 3; + item.UseSound = SoundID.Item5; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Shadow Bow"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Shadow Bow"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "LongBow", 1); - recipe.AddIngredient(null, "PhantomSoul", 5); - recipe.AddTile(18); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "LongBow", 1); + recipe.AddIngredient(null, "PhantomSoul", 5); + recipe.AddTile(18); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/ShadowCutter.cs b/Items/ShadowCutter.cs index 15e5e0a6..d5c86854 100644 --- a/Items/ShadowCutter.cs +++ b/Items/ShadowCutter.cs @@ -4,31 +4,33 @@ using Terraria.ModLoader; using Terraria.ID; -namespace Tremor.Items { -public class ShadowCutter : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ShadowCutter : ModItem + { + public override void SetDefaults() + { - item.damage = 60; - item.melee = true; - item.width = 48; - item.height = 48; - item.useTime = 25; - item.useAnimation = 35; - item.useStyle = 1; - item.knockBack = 7; - item.value = 20150; - item.rare = 6; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 60; + item.melee = true; + item.width = 48; + item.height = 48; + item.useTime = 25; + item.useAnimation = 35; + item.useStyle = 1; + item.knockBack = 7; + item.value = 20150; + item.rare = 6; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Shadow Cutter"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Shadow Cutter"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/ShadowMasterChestplate.cs b/Items/ShadowMasterChestplate.cs index 508c02a5..d8e3a9e4 100644 --- a/Items/ShadowMasterChestplate.cs +++ b/Items/ShadowMasterChestplate.cs @@ -5,46 +5,48 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class ShadowMasterChestplate : ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 38; - item.height = 22; - - - item.value = 10000; - item.rare = 11; - item.defense = 25; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Shadow Master Chestplate"); - Tooltip.SetDefault("Increases alchemic damage by 25%\nIncreases throwing damage by 15%"); - } - - - public override void UpdateEquip(Player player) - { - player.GetModPlayer(mod).alchemistDamage += 0.25f; - player.thrownDamage += 0.15f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BrokenHeroArmorplate", 1); - recipe.AddIngredient(ItemID.Silk, 15); - recipe.AddIngredient(null, "SoulofFight", 10); - recipe.AddIngredient(null, "DarkGel", 15); - recipe.AddIngredient(null, "DarknessCloth", 8); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } -}} + [AutoloadEquip(EquipType.Body)] + public class ShadowMasterChestplate : ModItem + { + + public override void SetDefaults() + { + + item.width = 38; + item.height = 22; + + + item.value = 10000; + item.rare = 11; + item.defense = 25; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Shadow Master Chestplate"); + Tooltip.SetDefault("Increases alchemic damage by 25%\nIncreases throwing damage by 15%"); + } + + + public override void UpdateEquip(Player player) + { + player.GetModPlayer(mod).alchemistDamage += 0.25f; + player.thrownDamage += 0.15f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "BrokenHeroArmorplate", 1); + recipe.AddIngredient(ItemID.Silk, 15); + recipe.AddIngredient(null, "SoulofFight", 10); + recipe.AddIngredient(null, "DarkGel", 15); + recipe.AddIngredient(null, "DarknessCloth", 8); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } +} diff --git a/Items/ShadowMasterHood.cs b/Items/ShadowMasterHood.cs index 1ee35bc2..80a7625c 100644 --- a/Items/ShadowMasterHood.cs +++ b/Items/ShadowMasterHood.cs @@ -6,105 +6,108 @@ using Terraria.ModLoader; using Microsoft.Xna.Framework; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class ShadowMasterHood : ModItem +namespace Tremor.Items { - const int ShootType = ProjectileID.HeatRay; // ��� �������� - const float ShootRange = 600.0f; // ��������� �������� - const float ShootKN = 1.0f; // ������������ - const int ShootRate = 120; // ������� �������� (60 - 1 �������) - const int ShootCount = 2; // ������� �� ������� - const float ShootSpeed = 20f; // �������� �������� (��� ������ - ���������) - const int spread = 45; // ������� - const float spreadMult = 0.045f; // ����������� �������� - - int TimeToShoot = ShootRate; - - - - public override void SetDefaults() - { - - item.width = 38; - item.height = 22; - - - item.value = 10000; - item.rare = 11; - item.defense = 18; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Shadow Master Hood"); - Tooltip.SetDefault("Increases alchemic damage by 25%\nIncreases throwing damage by 15%"); - } - - - public override void UpdateEquip(Player player) - { - player.GetModPlayer(mod).alchemistDamage += 0.2f; - player.thrownDamage += 0.25f; - } - - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("ShadowMasterChestplate") && legs.type == mod.ItemType("ShadowMasterPants"); - } - - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Creates dangerous alchemical bubbles and increases alchemic critical strike chance by 35"; - player.GetModPlayer(mod).alchemistCrit += 35; - - if (--TimeToShoot <= 0) - { - TimeToShoot = ShootRate; - int Target = GetTarget(); - if (Target != -1) Shoot(Target, GetDamage()); - } - } - -int GetTarget() - { - int Target = -1; - for(int k = 0; k < Main.npc.Length; k++) - { - if (Main.npc[k].active && Main.npc[k].lifeMax > 5 && !Main.npc[k].dontTakeDamage && !Main.npc[k].friendly && Main.npc[k].Distance(Main.player[item.owner].Center) <= ShootRange && Collision.CanHitLine(Main.player[item.owner].Center, 4, 4, Main.npc[k].Center, 4, 4)) - { - Target = k; - break; - } - } - return Target; - } - - int GetDamage() - { - return (10 * ((int)Main.player[item.owner].magicDamage + (int)Main.player[item.owner].meleeDamage + (int)Main.player[item.owner].minionDamage + (int)Main.player[item.owner].rangedDamage + (int)Main.player[item.owner].thrownDamage)) + 15; - } - - void Shoot(int Target, int Damage) - { - Vector2 velocity = Helper.VelocityToPoint(Main.player[item.owner].Center, Main.npc[Target].Center, ShootSpeed); - for (int l = 0; l < ShootCount; l++) - { - velocity.X = velocity.X + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - velocity.Y = velocity.Y + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - int i = Projectile.NewProjectile(Main.player[item.owner].Center.X, Main.player[item.owner].Center.Y, velocity.X, velocity.Y, mod.ProjectileType("AlchemicBubble"), 100, ShootKN, item.owner); - } - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BrokenHeroArmorplate", 1); - recipe.AddIngredient(ItemID.Silk, 15); - recipe.AddIngredient(null, "SoulofFight", 10); - recipe.AddIngredient(null, "DarkGel", 15); - recipe.AddIngredient(null, "DarknessCloth", 6); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } -}} + [AutoloadEquip(EquipType.Head)] + public class ShadowMasterHood : ModItem + { + const int ShootType = ProjectileID.HeatRay; // ��� �������� + const float ShootRange = 600.0f; // ��������� �������� + const float ShootKN = 1.0f; // ������������ + const int ShootRate = 120; // ������� �������� (60 - 1 �������) + const int ShootCount = 2; // ������� �� ������� + const float ShootSpeed = 20f; // �������� �������� (��� ������ - ���������) + const int spread = 45; // ������� + const float spreadMult = 0.045f; // ����������� �������� + + int TimeToShoot = ShootRate; + + + + public override void SetDefaults() + { + + item.width = 38; + item.height = 22; + + + item.value = 10000; + item.rare = 11; + item.defense = 18; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Shadow Master Hood"); + Tooltip.SetDefault("Increases alchemic damage by 25%\nIncreases throwing damage by 15%"); + } + + + public override void UpdateEquip(Player player) + { + player.GetModPlayer(mod).alchemistDamage += 0.2f; + player.thrownDamage += 0.25f; + } + + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("ShadowMasterChestplate") && legs.type == mod.ItemType("ShadowMasterPants"); + } + + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Creates dangerous alchemical bubbles and increases alchemic critical strike chance by 35"; + player.GetModPlayer(mod).alchemistCrit += 35; + + if (--TimeToShoot <= 0) + { + TimeToShoot = ShootRate; + int Target = GetTarget(); + if (Target != -1) Shoot(Target, GetDamage()); + } + } + + int GetTarget() + { + int Target = -1; + for (int k = 0; k < Main.npc.Length; k++) + { + if (Main.npc[k].active && Main.npc[k].lifeMax > 5 && !Main.npc[k].dontTakeDamage && !Main.npc[k].friendly && Main.npc[k].Distance(Main.player[item.owner].Center) <= ShootRange && Collision.CanHitLine(Main.player[item.owner].Center, 4, 4, Main.npc[k].Center, 4, 4)) + { + Target = k; + break; + } + } + return Target; + } + + int GetDamage() + { + return (10 * ((int)Main.player[item.owner].magicDamage + (int)Main.player[item.owner].meleeDamage + (int)Main.player[item.owner].minionDamage + (int)Main.player[item.owner].rangedDamage + (int)Main.player[item.owner].thrownDamage)) + 15; + } + + void Shoot(int Target, int Damage) + { + Vector2 velocity = Helper.VelocityToPoint(Main.player[item.owner].Center, Main.npc[Target].Center, ShootSpeed); + for (int l = 0; l < ShootCount; l++) + { + velocity.X = velocity.X + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.Y = velocity.Y + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + int i = Projectile.NewProjectile(Main.player[item.owner].Center.X, Main.player[item.owner].Center.Y, velocity.X, velocity.Y, mod.ProjectileType("AlchemicBubble"), 100, ShootKN, item.owner); + } + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "BrokenHeroArmorplate", 1); + recipe.AddIngredient(ItemID.Silk, 15); + recipe.AddIngredient(null, "SoulofFight", 10); + recipe.AddIngredient(null, "DarkGel", 15); + recipe.AddIngredient(null, "DarknessCloth", 6); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } +} diff --git a/Items/ShadowMasterPants.cs b/Items/ShadowMasterPants.cs index c4851ed1..a335a535 100644 --- a/Items/ShadowMasterPants.cs +++ b/Items/ShadowMasterPants.cs @@ -5,47 +5,50 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class ShadowMasterPants : ModItem +namespace Tremor.Items { - - - public override void SetDefaults() - { - - item.width = 38; - item.height = 22; - - - item.value = 10000; - item.rare = 11; - item.defense = 20; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Shadow Master Pants"); - Tooltip.SetDefault("Increases alchemic damage by 25%\nIncreases throwing damage by 15%"); - } - - - public override void UpdateEquip(Player player) - { - player.GetModPlayer(mod).alchemistDamage += 0.25f; - player.thrownDamage += 0.15f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BrokenHeroArmorplate", 1); - recipe.AddIngredient(ItemID.Silk, 10); - recipe.AddIngredient(null, "SoulofFight", 10); - recipe.AddIngredient(null, "DarkGel", 12); - recipe.AddIngredient(null, "DarknessCloth", 7); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } - -}} + [AutoloadEquip(EquipType.Legs)] + public class ShadowMasterPants : ModItem + { + + + public override void SetDefaults() + { + + item.width = 38; + item.height = 22; + + + item.value = 10000; + item.rare = 11; + item.defense = 20; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Shadow Master Pants"); + Tooltip.SetDefault("Increases alchemic damage by 25%\nIncreases throwing damage by 15%"); + } + + + public override void UpdateEquip(Player player) + { + player.GetModPlayer(mod).alchemistDamage += 0.25f; + player.thrownDamage += 0.15f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "BrokenHeroArmorplate", 1); + recipe.AddIngredient(ItemID.Silk, 10); + recipe.AddIngredient(null, "SoulofFight", 10); + recipe.AddIngredient(null, "DarkGel", 12); + recipe.AddIngredient(null, "DarknessCloth", 7); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + + } +} diff --git a/Items/ShadowReaperBook.cs b/Items/ShadowReaperBook.cs index bd7038ba..c44fce49 100644 --- a/Items/ShadowReaperBook.cs +++ b/Items/ShadowReaperBook.cs @@ -7,35 +7,35 @@ namespace Tremor.Items { - public class ShadowReaperBook : ModItem - { - public override void SetDefaults() - { - item.CloneDefaults(165); + public class ShadowReaperBook : ModItem + { + public override void SetDefaults() + { + item.CloneDefaults(165); - item.damage = 39; - item.magic = true; - item.width = 26; - item.maxStack = 1; - item.height = 30; - item.useTime = 25; - item.useAnimation = 25; - item.shoot = mod.ProjectileType("ShadowR"); - item.shootSpeed = 11.5f; - item.useStyle = 5; - item.knockBack = 4; - item.rare = 3; - item.UseSound = SoundID.Item1; - item.autoReuse = false; + item.damage = 39; + item.magic = true; + item.width = 26; + item.maxStack = 1; + item.height = 30; + item.useTime = 25; + item.useAnimation = 25; + item.shoot = mod.ProjectileType("ShadowR"); + item.shootSpeed = 11.5f; + item.useStyle = 5; + item.knockBack = 4; + item.rare = 3; + item.UseSound = SoundID.Item1; + item.autoReuse = false; item.mana = 9; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Shadow Reaper"); - Tooltip.SetDefault("Summons homing shadow creature"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Shadow Reaper"); + Tooltip.SetDefault("Summons homing shadow creature"); + } } } diff --git a/Items/ShadowRelic.cs b/Items/ShadowRelic.cs index abd43f58..7e815504 100644 --- a/Items/ShadowRelic.cs +++ b/Items/ShadowRelic.cs @@ -8,22 +8,22 @@ namespace Tremor.Items { - public class ShadowRelic : ModItem - { - public override void SetDefaults() - { + public class ShadowRelic : ModItem + { + public override void SetDefaults() + { - item.width = 14; - item.height = 26; - item.rare = 7; - item.value = 50000; - } + item.width = 14; + item.height = 26; + item.rare = 7; + item.value = 50000; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Shadow Relic"); - Tooltip.SetDefault("'Can be used in ritual of shadows if thrown into lava in underground and the Dryad is alive...'\nSummons Wall of Shadows"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Shadow Relic"); + Tooltip.SetDefault("'Can be used in ritual of shadows if thrown into lava in underground and the Dryad is alive...'\nSummons Wall of Shadows"); + } public override void AddRecipes() @@ -32,84 +32,84 @@ public override void AddRecipes() recipe.AddIngredient(ItemID.SoulofNight, 16); recipe.AddIngredient(null, "PhantomSoul", 5); recipe.AddIngredient(null, "SteelBar", 12); - recipe.AddIngredient(ItemID.Amethyst, 7); - recipe.AddIngredient(ItemID.ChlorophyteBar, 15); + recipe.AddIngredient(ItemID.Amethyst, 7); + recipe.AddIngredient(ItemID.ChlorophyteBar, 15); recipe.AddTile(26); recipe.SetResult(this); recipe.AddRecipe(); - } + } - public override void PostUpdate() - { - if (item.lavaWet) - { - //if (Main.netMode != 1) - //{ - for (int i = 0; i < 200; ++i) - { - if (Main.npc[i].type == NPCID.Dryad && NPC.downedPlantBoss) - { - SpawnShadowWall(item.position); - Main.npc[i].StrikeNPCNoInteraction(9999, 10f, -Main.npc[i].direction, false, false, false); - item.active = false; - item.type = 0; - //item.name = ""; - item.stack = 0; - Main.NewText("The shadows are gathering around you...", 42, 10, 74); - } - } - //} - } - } + public override void PostUpdate() + { + if (item.lavaWet) + { + //if (Main.netMode != 1) + //{ + for (int i = 0; i < 200; ++i) + { + if (Main.npc[i].type == NPCID.Dryad && NPC.downedPlantBoss) + { + SpawnShadowWall(item.position); + Main.npc[i].StrikeNPCNoInteraction(9999, 10f, -Main.npc[i].direction, false, false, false); + item.active = false; + item.type = 0; + //item.name = ""; + item.stack = 0; + Main.NewText("The shadows are gathering around you...", 42, 10, 74); + } + } + //} + } + } - public void SpawnShadowWall(Vector2 pos) - { - if (pos.Y / 16.0 < (Main.maxTilesY - 205) || Main.wof >= 0 || Main.netMode == 1) - return; - int num1 = (int)Player.FindClosest(pos, 16, 16); - int num2 = 1; - if (pos.X / 16.0 > (Main.maxTilesX / 2)) - num2 = -1; - bool flag = false; - int X = (int)pos.X; - while (!flag) - { - flag = true; - for (int index = 0; index < 255; ++index) - { - if (Main.player[index].active && Main.player[index].position.X > (X - 1200) && Main.player[index].position.X < (X + 1200)) - { - X -= num2 * 16; - flag = false; - } - } - if (X / 16 < 20 || X / 16 > Main.maxTilesX - 20) - flag = true; - } - int num3 = (int)pos.Y; - int i = X / 16; - int num4 = num3 / 16; - int num5 = 0; - try - { - for (; WorldGen.SolidTile(i, num4 - num5) || (int)Main.tile[i, num4 - num5].liquid >= 100; ++num5) - { - if (!WorldGen.SolidTile(i, num4 + num5) && (int)Main.tile[i, num4 + num5].liquid < 100) - { - num4 += num5; - goto label_21; - } - } - num4 -= num5; - } - catch - { - } - label_21: - int Y = num4 * 16; - NPC.SpawnOnPlayer(Main.myPlayer, mod.NPCType("WallOfShadow")); - } + public void SpawnShadowWall(Vector2 pos) + { + if (pos.Y / 16.0 < (Main.maxTilesY - 205) || Main.wof >= 0 || Main.netMode == 1) + return; + int num1 = (int)Player.FindClosest(pos, 16, 16); + int num2 = 1; + if (pos.X / 16.0 > (Main.maxTilesX / 2)) + num2 = -1; + bool flag = false; + int X = (int)pos.X; + while (!flag) + { + flag = true; + for (int index = 0; index < 255; ++index) + { + if (Main.player[index].active && Main.player[index].position.X > (X - 1200) && Main.player[index].position.X < (X + 1200)) + { + X -= num2 * 16; + flag = false; + } + } + if (X / 16 < 20 || X / 16 > Main.maxTilesX - 20) + flag = true; + } + int num3 = (int)pos.Y; + int i = X / 16; + int num4 = num3 / 16; + int num5 = 0; + try + { + for (; WorldGen.SolidTile(i, num4 - num5) || (int)Main.tile[i, num4 - num5].liquid >= 100; ++num5) + { + if (!WorldGen.SolidTile(i, num4 + num5) && (int)Main.tile[i, num4 + num5].liquid < 100) + { + num4 += num5; + goto label_21; + } + } + num4 -= num5; + } + catch + { + } + label_21: + int Y = num4 * 16; + NPC.SpawnOnPlayer(Main.myPlayer, mod.NPCType("WallOfShadow")); + } - } + } } diff --git a/Items/ShadowRipperBanner.cs b/Items/ShadowRipperBanner.cs index deca9abd..7cb59e85 100644 --- a/Items/ShadowRipperBanner.cs +++ b/Items/ShadowRipperBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ShadowRipperBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ShadowRipperBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 88; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 88; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Shadow Ripper Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Shadow Ripper Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/ShadowStaff.cs b/Items/ShadowStaff.cs index 8ca30dca..a847b13c 100644 --- a/Items/ShadowStaff.cs +++ b/Items/ShadowStaff.cs @@ -18,7 +18,7 @@ public override void SetDefaults() item.height = 28; item.useTime = 36; - item.channel = true; + item.channel = true; item.useAnimation = 36; item.useStyle = 1; item.noMelee = true; @@ -32,41 +32,41 @@ public override void SetDefaults() item.buffTime = 3600; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Shadow Staff"); - Tooltip.SetDefault("Summons a shadow arm to fight for you."); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Shadow Staff"); + Tooltip.SetDefault("Summons a shadow arm to fight for you."); + } public override bool AltFunctionUse(Player player) { return true; } - + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { return player.altFunctionUse != 2; } - + public override bool UseItem(Player player) { - if(player.altFunctionUse == 2) + if (player.altFunctionUse == 2) { player.MinionNPCTargetAim(); } return base.UseItem(player); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.SoulofNight, 8); - recipe.AddIngredient(ItemID.SpookyWood, 15); - recipe.AddIngredient(null, "DarknessCloth", 9); - recipe.AddTile(134); - recipe.SetResult(this); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.SoulofNight, 8); + recipe.AddIngredient(ItemID.SpookyWood, 15); + recipe.AddIngredient(null, "DarknessCloth", 9); + recipe.AddTile(134); + recipe.SetResult(this); + recipe.AddRecipe(); + } } } diff --git a/Items/ShadowTooth.cs b/Items/ShadowTooth.cs index fc226189..e4d45cab 100644 --- a/Items/ShadowTooth.cs +++ b/Items/ShadowTooth.cs @@ -6,64 +6,66 @@ using Terraria.ModLoader; -namespace Tremor.Items { -public class ShadowTooth : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ShadowTooth : ModItem + { + public override void SetDefaults() + { - item.damage = 50; - item.melee = true; - item.width = 42; - item.height = 46; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = 121; - item.shootSpeed = 6f; - item.useStyle = 1; - item.knockBack = 2; - item.value = 46000; - item.rare = 8; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 50; + item.melee = true; + item.width = 42; + item.height = 46; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = 121; + item.shootSpeed = 6f; + item.useStyle = 1; + item.knockBack = 2; + item.value = 46000; + item.rare = 8; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Shadow Tooth"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Shadow Tooth"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.SoulofNight, 8); - recipe.AddIngredient(ItemID.SoulofSight, 8); - recipe.AddIngredient(null, "ColdTooth", 1); - recipe.AddTile(null, "GreatAnvilTile"); - recipe.SetResult(this); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.SoulofNight, 8); + recipe.AddIngredient(ItemID.SoulofSight, 8); + recipe.AddIngredient(null, "ColdTooth", 1); + recipe.AddTile(null, "GreatAnvilTile"); + recipe.SetResult(this); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.SoulofNight, 8); - recipe.AddIngredient(ItemID.SoulofSight, 8); - recipe.AddIngredient(null, "FlamingTooth", 1); - recipe.AddTile(null, "GreatAnvilTile"); - recipe.SetResult(this); - recipe.AddRecipe(); - } + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.SoulofNight, 8); + recipe.AddIngredient(ItemID.SoulofSight, 8); + recipe.AddIngredient(null, "FlamingTooth", 1); + recipe.AddTile(null, "GreatAnvilTile"); + recipe.SetResult(this); + recipe.AddRecipe(); + } - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(153, 120); - } + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(153, 120); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if(Main.rand.Next(1) == 0) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 65); - } - } -}} + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.Next(1) == 0) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 65); + } + } + } +} diff --git a/Items/ShadowWings.cs b/Items/ShadowWings.cs index 0acde7da..4bd7f168 100644 --- a/Items/ShadowWings.cs +++ b/Items/ShadowWings.cs @@ -5,58 +5,60 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Wings)] -public class ShadowWings : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Wings)] + public class ShadowWings : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 20; + item.width = 22; + item.height = 20; - item.value = 100000; - item.rare = 7; - item.accessory = true; - } + item.value = 100000; + item.rare = 7; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Shadow Wings"); - Tooltip.SetDefault("The wings of shadow."); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Shadow Wings"); + Tooltip.SetDefault("The wings of shadow."); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.wingTimeMax = 180; - } + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.wingTimeMax = 180; + } public override void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend) - { - ascentWhenFalling = 0.85f; - ascentWhenRising = 0.15f; - maxCanAscendMultiplier = 1f; - maxAscentMultiplier = 3f; - constantAscend = 0.135f; - } - - public override void HorizontalWingSpeeds(Player player, ref float speed, ref float acceleration) - { - speed = 6f; - acceleration *= 2.5f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.SoulofNight, 11); - recipe.AddIngredient(null, "DarknessCloth", 6); - recipe.AddIngredient(ItemID.SoulofFlight, 20); - recipe.AddTile(134); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + { + ascentWhenFalling = 0.85f; + ascentWhenRising = 0.15f; + maxCanAscendMultiplier = 1f; + maxAscentMultiplier = 3f; + constantAscend = 0.135f; + } + + public override void HorizontalWingSpeeds(Player player, ref float speed, ref float acceleration) + { + speed = 6f; + acceleration *= 2.5f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.SoulofNight, 11); + recipe.AddIngredient(null, "DarknessCloth", 6); + recipe.AddIngredient(ItemID.SoulofFlight, 20); + recipe.AddTile(134); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Sharanga.cs b/Items/Sharanga.cs index d94a62fe..e1b1eb64 100644 --- a/Items/Sharanga.cs +++ b/Items/Sharanga.cs @@ -4,45 +4,47 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Sharanga : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Sharanga : ModItem + { + public override void SetDefaults() + { - item.damage = 24; - item.width = 16; - item.height = 32; - item.ranged = true; - item.useTime = 20; - item.shoot = 1; - item.shootSpeed = 12f; - item.useAnimation = 20; - item.useStyle = 5; - item.knockBack = 5; - item.value = 8340; - item.useAmmo = AmmoID.Arrow; - item.rare = 3; - item.UseSound = SoundID.Item5; - item.autoReuse = true; - } + item.damage = 24; + item.width = 16; + item.height = 32; + item.ranged = true; + item.useTime = 20; + item.shoot = 1; + item.shootSpeed = 12f; + item.useAnimation = 20; + item.useStyle = 5; + item.knockBack = 5; + item.value = 8340; + item.useAmmo = AmmoID.Arrow; + item.rare = 3; + item.UseSound = SoundID.Item5; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sharanga"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sharanga"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ShadowBow", 1); - recipe.AddIngredient(ItemID.Obsidian, 15); - recipe.AddIngredient(null, "DemonBlood", 8); - recipe.AddIngredient(null, "MinotaurHorn", 2); - recipe.AddTile(null, "DevilForge"); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ShadowBow", 1); + recipe.AddIngredient(ItemID.Obsidian, 15); + recipe.AddIngredient(null, "DemonBlood", 8); + recipe.AddIngredient(null, "MinotaurHorn", 2); + recipe.AddTile(null, "DevilForge"); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/SharkRage.cs b/Items/SharkRage.cs index 5e976414..b77606fb 100644 --- a/Items/SharkRage.cs +++ b/Items/SharkRage.cs @@ -5,35 +5,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SharkRage : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SharkRage : ModItem + { + public override void SetDefaults() + { - item.damage = 46; - item.magic = true; - item.mana = 10; - item.width = 54; - item.height = 54; - item.useTime = 26; - item.useAnimation = 26; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 3; - item.value = 40000; - item.rare = 5; - item.UseSound = SoundID.Item43; - item.autoReuse = true; - Item.staff[item.type] = true; //this makes the useStyle animate as a staff instead of as a gun - item.shoot = 408; - item.shootSpeed = 15f; - } + item.damage = 46; + item.magic = true; + item.mana = 10; + item.width = 54; + item.height = 54; + item.useTime = 26; + item.useAnimation = 26; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 3; + item.value = 40000; + item.rare = 5; + item.UseSound = SoundID.Item43; + item.autoReuse = true; + Item.staff[item.type] = true; //this makes the useStyle animate as a staff instead of as a gun + item.shoot = 408; + item.shootSpeed = 15f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Shark Rage"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Shark Rage"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/SharkToothSword.cs b/Items/SharkToothSword.cs index 55e47f3b..d1fbfa0d 100644 --- a/Items/SharkToothSword.cs +++ b/Items/SharkToothSword.cs @@ -4,31 +4,33 @@ using Terraria.ModLoader; using Terraria.ID; -namespace Tremor.Items { -public class SharkToothSword : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SharkToothSword : ModItem + { + public override void SetDefaults() + { - item.damage = 18; - item.melee = true; - item.width = 48; - item.height = 48; - item.useTime = 35; - item.useAnimation = 35; - item.useStyle = 1; - item.knockBack = 7; - item.value = 2740; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 18; + item.melee = true; + item.width = 48; + item.height = 48; + item.useTime = 35; + item.useAnimation = 35; + item.useStyle = 1; + item.knockBack = 7; + item.value = 2740; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Shark Tooth Sword"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Shark Tooth Sword"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/Sharkhalis.cs b/Items/Sharkhalis.cs index 1b665c9c..ecf6e63d 100644 --- a/Items/Sharkhalis.cs +++ b/Items/Sharkhalis.cs @@ -17,11 +17,11 @@ public override void SetDefaults() } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sharkhalis"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sharkhalis"); + Tooltip.SetDefault(""); + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) @@ -30,15 +30,15 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX return base.Shoot(player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Arkhalis, 1); - recipe.AddIngredient(ItemID.SharkFin, 3); - recipe.AddIngredient(null, "SharpenedTooth", 6); - recipe.SetResult(this); - recipe.AddTile(null, "AltarofEnchantmentsTile"); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Arkhalis, 1); + recipe.AddIngredient(ItemID.SharkFin, 3); + recipe.AddIngredient(null, "SharpenedTooth", 6); + recipe.SetResult(this); + recipe.AddTile(null, "AltarofEnchantmentsTile"); + recipe.AddRecipe(); + } } } diff --git a/Items/Sharking.cs b/Items/Sharking.cs index 401a6610..f67f6b45 100644 --- a/Items/Sharking.cs +++ b/Items/Sharking.cs @@ -4,32 +4,34 @@ using Terraria.ModLoader; using Terraria.ID; -namespace Tremor.Items { -public class Sharking : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Sharking : ModItem + { + public override void SetDefaults() + { - item.damage = 72; - item.melee = true; - item.width = 48; - item.height = 48; - item.useTime = 45; - item.useAnimation = 35; - item.useStyle = 1; - item.knockBack = 7; - item.shoot = 408; - item.shootSpeed = 14f; - item.value = 13570; - item.rare = 5; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 72; + item.melee = true; + item.width = 48; + item.height = 48; + item.useTime = 45; + item.useAnimation = 35; + item.useStyle = 1; + item.knockBack = 7; + item.shoot = 408; + item.shootSpeed = 14f; + item.value = 13570; + item.rare = 5; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sharking"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sharking"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/SharpenedTooth.cs b/Items/SharpenedTooth.cs index ebce8991..48367cce 100644 --- a/Items/SharpenedTooth.cs +++ b/Items/SharpenedTooth.cs @@ -4,23 +4,25 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SharpenedTooth : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SharpenedTooth : ModItem + { + public override void SetDefaults() + { - item.width = 28; - item.height = 30; - item.maxStack = 99; - item.value = 100; - item.rare = 3; - } + item.width = 28; + item.height = 30; + item.maxStack = 99; + item.value = 100; + item.rare = 3; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sharpened Tooth"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sharpened Tooth"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/ShiningAxe.cs b/Items/ShiningAxe.cs index 4c3ebfff..4567d8b2 100644 --- a/Items/ShiningAxe.cs +++ b/Items/ShiningAxe.cs @@ -5,58 +5,60 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ShiningAxe : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.autoReuse = true; - item.useStyle = 1; - - item.shootSpeed = 8f; - item.shoot = mod.ProjectileType("ShiningAxePro"); - item.damage = 234; - item.width = 18; - item.height = 20; - item.UseSound = SoundID.Item1; - item.useAnimation = 14; - item.useTime = 17; - item.noUseGraphic = true; - item.noMelee = true; - item.value = 6000; - - item.knockBack = 4f; - item.melee = true; - item.rare = 3; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Shining Axe"); - Tooltip.SetDefault("Magical throwing axe!"); - } - - -public override bool CanUseItem(Player player) -{ - for (int i = 0; i < 1000; ++i) - { - if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) - { - return false; - } - } - return true; -} - - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.PossessedHatchet, 1); - recipe.AddIngredient(null, "WhiteGoldBar", 15); - recipe.SetResult(this); - recipe.AddTile(null, "DivineForgeTile"); - recipe.AddRecipe(); - } -}} + public class ShiningAxe : ModItem + { + public override void SetDefaults() + { + item.autoReuse = true; + item.useStyle = 1; + + item.shootSpeed = 8f; + item.shoot = mod.ProjectileType("ShiningAxePro"); + item.damage = 234; + item.width = 18; + item.height = 20; + item.UseSound = SoundID.Item1; + item.useAnimation = 14; + item.useTime = 17; + item.noUseGraphic = true; + item.noMelee = true; + item.value = 6000; + + item.knockBack = 4f; + item.melee = true; + item.rare = 3; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Shining Axe"); + Tooltip.SetDefault("Magical throwing axe!"); + } + + + public override bool CanUseItem(Player player) + { + for (int i = 0; i < 1000; ++i) + { + if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) + { + return false; + } + } + return true; + } + + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.PossessedHatchet, 1); + recipe.AddIngredient(null, "WhiteGoldBar", 15); + recipe.SetResult(this); + recipe.AddTile(null, "DivineForgeTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/ShockwaveClaymore.cs b/Items/ShockwaveClaymore.cs index db84022d..b11d7715 100644 --- a/Items/ShockwaveClaymore.cs +++ b/Items/ShockwaveClaymore.cs @@ -5,40 +5,41 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ShockwaveClaymore : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ShockwaveClaymore : ModItem + { + public override void SetDefaults() + { - item.damage = 86; - item.melee = true; - item.width = 50; - item.height = 52; - item.useTime = 25; - item.useAnimation = 25; - item.useStyle = 1; - item.shoot = mod.ProjectileType("ShockwavePro"); - item.shootSpeed = 7f; - item.knockBack = 4; - item.value = 10000; - item.rare = 8; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 86; + item.melee = true; + item.width = 50; + item.height = 52; + item.useTime = 25; + item.useAnimation = 25; + item.useStyle = 1; + item.shoot = mod.ProjectileType("ShockwavePro"); + item.shootSpeed = 7f; + item.knockBack = 4; + item.value = 10000; + item.rare = 8; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Shockwave Claymore"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Shockwave Claymore"); + Tooltip.SetDefault(""); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 60); - } + public override void MeleeEffects(Player player, Rectangle hitbox) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 60); + } -} + } } diff --git a/Items/Shovel.cs b/Items/Shovel.cs index eb185608..b75af4e2 100644 --- a/Items/Shovel.cs +++ b/Items/Shovel.cs @@ -4,30 +4,32 @@ using Terraria.ModLoader; using Terraria.ID; -namespace Tremor.Items { -public class Shovel : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Shovel : ModItem + { + public override void SetDefaults() + { - item.damage = 24; - item.melee = true; - item.width = 46; - item.height = 50; - item.useTime = 15; - item.useAnimation = 15; - item.useStyle = 1; - item.knockBack = 7; - item.value = 121000; - item.rare = 2; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 24; + item.melee = true; + item.width = 46; + item.height = 50; + item.useTime = 15; + item.useAnimation = 15; + item.useStyle = 1; + item.knockBack = 7; + item.value = 121000; + item.rare = 2; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Shovel"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Shovel"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/ShroomiteMagicalBoots.cs b/Items/ShroomiteMagicalBoots.cs index a48ceb7d..acd56a02 100644 --- a/Items/ShroomiteMagicalBoots.cs +++ b/Items/ShroomiteMagicalBoots.cs @@ -5,75 +5,77 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ShroomiteMagicalBoots: ModItem +namespace Tremor.Items { + public class ShroomiteMagicalBoots : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 20; - item.value = 11000; - item.rare = 9; + item.width = 26; + item.height = 20; + item.value = 11000; + item.rare = 9; - item.accessory = true; - } + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Shroomite Magical Boots"); - Tooltip.SetDefault("The less mana, the more defense...\nThe less health, the more speed..."); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Shroomite Magical Boots"); + Tooltip.SetDefault("The less mana, the more defense...\nThe less health, the more speed..."); + } - public override void UpdateAccessory(Player player, bool hideVisual) + public override void UpdateAccessory(Player player, bool hideVisual) - { - if (player.statMana < 25) - { - player.statDefense += 10; - } - if (player.statMana < 100) - { - player.statDefense += 8; - } - if (player.statMana < 200) - { - player.statDefense += 6; - } - if (player.statMana < 300) - { - player.statDefense += 3; - } - if (player.statLife < 50) - { - player.moveSpeed += 1f; - } - if (player.statLife < 100) - { - player.moveSpeed += 0.9f; - } - if (player.statLife < 200) - { - player.moveSpeed += 0.7f; - } - if (player.statLife < 300) - { - player.moveSpeed += 0.5f; - } - } + { + if (player.statMana < 25) + { + player.statDefense += 10; + } + if (player.statMana < 100) + { + player.statDefense += 8; + } + if (player.statMana < 200) + { + player.statDefense += 6; + } + if (player.statMana < 300) + { + player.statDefense += 3; + } + if (player.statLife < 50) + { + player.moveSpeed += 1f; + } + if (player.statLife < 100) + { + player.moveSpeed += 0.9f; + } + if (player.statLife < 200) + { + player.moveSpeed += 0.7f; + } + if (player.statLife < 300) + { + player.moveSpeed += 0.5f; + } + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ShroomiteMechanicalBoots", 1); - recipe.AddIngredient(null, "SpectreNecklace", 1); - recipe.SetResult(this); - recipe.AddTile(114); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ShroomiteMechanicalBoots", 1); + recipe.AddIngredient(null, "SpectreNecklace", 1); + recipe.SetResult(this); + recipe.AddTile(114); + recipe.AddRecipe(); + } + } +} diff --git a/Items/ShroomiteMechanicalBoots.cs b/Items/ShroomiteMechanicalBoots.cs index d5dbdc66..e775b65d 100644 --- a/Items/ShroomiteMechanicalBoots.cs +++ b/Items/ShroomiteMechanicalBoots.cs @@ -5,55 +5,57 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ShroomiteMechanicalBoots: ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 36; - item.height = 38; - item.value = 110; - item.rare = 8; - - item.accessory = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Shroomite Mechanical Boots"); - Tooltip.SetDefault("The less health, the more speed..."); - } - - - public override void UpdateAccessory(Player player, bool hideVisual) - - { - if (player.statLife < 50) - { - player.moveSpeed += 1f; - } - if (player.statLife < 100) - { - player.moveSpeed += 0.9f; - } - if (player.statLife < 200) - { - player.moveSpeed += 0.7f; - } - if (player.statLife < 300) - { - player.moveSpeed += 0.5f; - } - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.ShroomiteBar, 22); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public class ShroomiteMechanicalBoots : ModItem + { + + public override void SetDefaults() + { + + item.width = 36; + item.height = 38; + item.value = 110; + item.rare = 8; + + item.accessory = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Shroomite Mechanical Boots"); + Tooltip.SetDefault("The less health, the more speed..."); + } + + + public override void UpdateAccessory(Player player, bool hideVisual) + + { + if (player.statLife < 50) + { + player.moveSpeed += 1f; + } + if (player.statLife < 100) + { + player.moveSpeed += 0.9f; + } + if (player.statLife < 200) + { + player.moveSpeed += 0.7f; + } + if (player.statLife < 300) + { + player.moveSpeed += 0.5f; + } + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.ShroomiteBar, 22); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/ShroomiteMinigun.cs b/Items/ShroomiteMinigun.cs index 4ead776a..db58f41d 100644 --- a/Items/ShroomiteMinigun.cs +++ b/Items/ShroomiteMinigun.cs @@ -5,52 +5,54 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ShroomiteMinigun : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ShroomiteMinigun : ModItem + { + public override void SetDefaults() + { - item.damage = 24; - item.ranged = true; - item.width = 58; - item.height = 28; - item.useTime = 7; - item.useAnimation = 7; - item.shoot = 14; - item.shootSpeed = 8f; - item.useAmmo = AmmoID.Bullet; - item.useStyle = 5; - item.knockBack = 4; - item.value = 60000; - item.rare = 8; - item.UseSound = SoundID.Item11; - item.autoReuse = true; - } + item.damage = 24; + item.ranged = true; + item.width = 58; + item.height = 28; + item.useTime = 7; + item.useAnimation = 7; + item.shoot = 14; + item.shootSpeed = 8f; + item.useAmmo = AmmoID.Bullet; + item.useStyle = 5; + item.knockBack = 4; + item.value = 60000; + item.rare = 8; + item.UseSound = SoundID.Item11; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Shroomite Minigun"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Shroomite Minigun"); + Tooltip.SetDefault(""); + } - public override Vector2? HoldoutOffset() - { - return new Vector2(-18, -4); - } + public override Vector2? HoldoutOffset() + { + return new Vector2(-18, -4); + } - public override bool ConsumeAmmo(Player p) + public override bool ConsumeAmmo(Player p) { return Main.rand.Next(3) == 0; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.ShroomiteBar, 14); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.ShroomiteBar, 14); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/ShroomiteRepeater.cs b/Items/ShroomiteRepeater.cs index d7c00193..ea413d31 100644 --- a/Items/ShroomiteRepeater.cs +++ b/Items/ShroomiteRepeater.cs @@ -5,43 +5,45 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ShroomiteRepeater : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ShroomiteRepeater : ModItem + { + public override void SetDefaults() + { - item.damage = 36; - item.ranged = true; - item.width = 62; - item.height = 30; - item.useTime = 10; - item.useAnimation = 10; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 6; - item.value = 50000; - item.rare = 6; - item.UseSound = SoundID.Item11; - item.autoReuse = true; - item.shoot = 8; - item.shootSpeed = 30f; - item.useAmmo = AmmoID.Arrow; - } + item.damage = 36; + item.ranged = true; + item.width = 62; + item.height = 30; + item.useTime = 10; + item.useAnimation = 10; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 6; + item.value = 50000; + item.rare = 6; + item.UseSound = SoundID.Item11; + item.autoReuse = true; + item.shoot = 8; + item.shootSpeed = 30f; + item.useAmmo = AmmoID.Arrow; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Shroomite Repeater"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Shroomite Repeater"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.ShroomiteBar, 16); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.ShroomiteBar, 16); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/ShroomiteRocketLauncher.cs b/Items/ShroomiteRocketLauncher.cs index 06d1c9f2..57ea4643 100644 --- a/Items/ShroomiteRocketLauncher.cs +++ b/Items/ShroomiteRocketLauncher.cs @@ -5,52 +5,54 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ShroomiteRocketLauncher : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ShroomiteRocketLauncher : ModItem + { + public override void SetDefaults() + { - item.damage = 64; - item.ranged = true; - item.width = 66; - item.height = 32; - item.useTime = 18; - item.useAnimation = 18; - item.shoot = 134; - item.shootSpeed = 10f; - item.useAmmo = AmmoID.Rocket; - item.useStyle = 5; - item.knockBack = 4; - item.value = 60000; - item.rare = 8; - item.UseSound = SoundID.Item11; - item.autoReuse = true; - } + item.damage = 64; + item.ranged = true; + item.width = 66; + item.height = 32; + item.useTime = 18; + item.useAnimation = 18; + item.shoot = 134; + item.shootSpeed = 10f; + item.useAmmo = AmmoID.Rocket; + item.useStyle = 5; + item.knockBack = 4; + item.value = 60000; + item.rare = 8; + item.UseSound = SoundID.Item11; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Shroomite Rocket Launcher"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Shroomite Rocket Launcher"); + Tooltip.SetDefault(""); + } - public override Vector2? HoldoutOffset() - { - return new Vector2(-18, -4); - } + public override Vector2? HoldoutOffset() + { + return new Vector2(-18, -4); + } - public override bool ConsumeAmmo(Player p) + public override bool ConsumeAmmo(Player p) { return Main.rand.Next(3) == 0; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.ShroomiteBar, 16); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.ShroomiteBar, 16); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/SightedBanner.cs b/Items/SightedBanner.cs index 14079f26..dc914052 100644 --- a/Items/SightedBanner.cs +++ b/Items/SightedBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SightedBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SightedBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 89; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 89; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sighted Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sighted Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/SilkBanner.cs b/Items/SilkBanner.cs index 320b7611..8de3dd24 100644 --- a/Items/SilkBanner.cs +++ b/Items/SilkBanner.cs @@ -4,42 +4,44 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SilkBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SilkBanner : ModItem + { + public override void SetDefaults() + { - item.width = 48; - item.height = 64; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; + item.width = 48; + item.height = 64; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 50000; - item.rare = 11; - item.createTile = mod.TileType("SilkBanner"); - } + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 50000; + item.rare = 11; + item.createTile = mod.TileType("SilkBanner"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Silk Banner"); - Tooltip.SetDefault("Increases defense by 15and grants thorn effect if placed"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Silk Banner"); + Tooltip.SetDefault("Increases defense by 15and grants thorn effect if placed"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Gloomstone", 10); - recipe.AddIngredient(null, "UnstableCrystal", 2); - recipe.AddIngredient(ItemID.Silk, 25); - recipe.SetResult(this); - recipe.AddTile(106); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Gloomstone", 10); + recipe.AddIngredient(null, "UnstableCrystal", 2); + recipe.AddIngredient(ItemID.Silk, 25); + recipe.SetResult(this); + recipe.AddTile(106); + recipe.AddRecipe(); + } + } +} diff --git a/Items/SilkTent.cs b/Items/SilkTent.cs index 8389c5a7..1b4f3bbb 100644 --- a/Items/SilkTent.cs +++ b/Items/SilkTent.cs @@ -19,27 +19,27 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("SilkTentTile"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Silk Tent"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Silk Tent"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Wood, 4); - recipe.AddIngredient(ItemID.Silk, 5); - recipe.SetResult(this); - recipe.AddTile(86); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Wood, 4); + recipe.AddIngredient(ItemID.Silk, 5); + recipe.SetResult(this); + recipe.AddTile(86); + recipe.AddRecipe(); + } } } diff --git a/Items/SilverShield.cs b/Items/SilverShield.cs index 58bfa3a4..d3c51c3f 100644 --- a/Items/SilverShield.cs +++ b/Items/SilverShield.cs @@ -5,37 +5,39 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Shield)] -public class SilverShield : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + [AutoloadEquip(EquipType.Shield)] + public class SilverShield : ModItem + { + public override void SetDefaults() + { - item.width = 26; - item.height = 30; - item.value = 110; - item.rare = 0; - item.accessory = true; - item.defense = 3; - } + item.width = 26; + item.height = 30; + item.value = 110; + item.rare = 0; + item.accessory = true; + item.defense = 3; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Silver Shield"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Silver Shield"); + Tooltip.SetDefault(""); + } - public override void UpdateEquip(Player player) - { - player.moveSpeed -= 0.30f; - } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.SilverBar, 15); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void UpdateEquip(Player player) + { + player.moveSpeed -= 0.30f; + } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.SilverBar, 15); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/SilverSpear.cs b/Items/SilverSpear.cs index 4ff0734a..d70db37b 100644 --- a/Items/SilverSpear.cs +++ b/Items/SilverSpear.cs @@ -4,42 +4,44 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SilverSpear : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SilverSpear : ModItem + { + public override void SetDefaults() + { - item.damage = 12; - item.width = 14; - item.height = 84; - item.noUseGraphic = true; - item.melee = true; - item.useTime = 30; - item.shoot = mod.ProjectileType("SilverSpearPro"); - item.shootSpeed = 3f; - item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 4; - item.value = 1000; - item.rare = 0; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 12; + item.width = 14; + item.height = 84; + item.noUseGraphic = true; + item.melee = true; + item.useTime = 30; + item.shoot = mod.ProjectileType("SilverSpearPro"); + item.shootSpeed = 3f; + item.useAnimation = 30; + item.useStyle = 5; + item.knockBack = 4; + item.value = 1000; + item.rare = 0; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Silver Spear"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Silver Spear"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.SilverBar, 9); - recipe.AddTile(16); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.SilverBar, 9); + recipe.AddTile(16); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/SkeletonKnightBanner.cs b/Items/SkeletonKnightBanner.cs index 0398f7f7..eacdd154 100644 --- a/Items/SkeletonKnightBanner.cs +++ b/Items/SkeletonKnightBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SkeletonKnightBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SkeletonKnightBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 90; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 90; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Skeleton Knight Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Skeleton Knight Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/SkullTeeth.cs b/Items/SkullTeeth.cs index b7f29aa2..833bd96c 100644 --- a/Items/SkullTeeth.cs +++ b/Items/SkullTeeth.cs @@ -4,25 +4,27 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SkullTeeth : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SkullTeeth : ModItem + { + public override void SetDefaults() + { - item.width = 28; - item.height = 30; + item.width = 28; + item.height = 30; - item.maxStack = 99; - item.value = 8000; - item.rare = 6; - } + item.maxStack = 99; + item.value = 8000; + item.rare = 6; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Skull Teeth"); - Tooltip.SetDefault("'Hell yeah!'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Skull Teeth"); + Tooltip.SetDefault("'Hell yeah!'"); + } -}} + } +} diff --git a/Items/Skullheart.cs b/Items/Skullheart.cs index 163527ea..657f3aaf 100644 --- a/Items/Skullheart.cs +++ b/Items/Skullheart.cs @@ -8,76 +8,76 @@ namespace Tremor.Items { - public class Skullheart : ModItem - { - const int ShootType = 270; // ��� ����५� - const float ShootRange = 600.0f; // ���쭮��� ����५� - const float ShootKN = 1.0f; // ����뢠��� - const int ShootRate = 40; // ����� ����५� (60 - 1 ᥪ㭤�) - const int ShootCount = 1; // ����஢ �� ����५ - const float ShootSpeed = 30f; // ������� ����५� (��� ����� - ���쭮���) - const int spread = 45; // ������ - const float spreadMult = 0.045f; // ����䨪��� ࠧ��� + public class Skullheart : ModItem + { + const int ShootType = 270; // ��� ����५� + const float ShootRange = 600.0f; // ���쭮��� ����५� + const float ShootKN = 1.0f; // ����뢠��� + const int ShootRate = 40; // ����� ����५� (60 - 1 ᥪ㭤�) + const int ShootCount = 1; // ����஢ �� ����५ + const float ShootSpeed = 30f; // ������� ����५� (��� ����� - ���쭮���) + const int spread = 45; // ������ + const float spreadMult = 0.045f; // ����䨪��� ࠧ��� - int TimeToShoot = ShootRate; + int TimeToShoot = ShootRate; - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 36; - item.height = 36; + item.width = 36; + item.height = 36; - item.value = 2500000; - item.rare = 11; - item.accessory = true; - } + item.value = 2500000; + item.rare = 11; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Skullheart"); - Tooltip.SetDefault("Shoots skulls at nearby enemies"); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(8, 4)); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Skullheart"); + Tooltip.SetDefault("Shoots skulls at nearby enemies"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(8, 4)); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - if (--TimeToShoot <= 0) - { - TimeToShoot = ShootRate; - int Target = GetTarget(); - if (Target != -1) Shoot(Target, GetDamage()); - } - } - -int GetTarget() - { - int Target = -1; - for(int k = 0; k < Main.npc.Length; k++) - { - if (Main.npc[k].active && Main.npc[k].lifeMax > 5 && !Main.npc[k].dontTakeDamage && !Main.npc[k].friendly && Main.npc[k].Distance(Main.player[item.owner].Center) <= ShootRange && Collision.CanHitLine(Main.player[item.owner].Center, 4, 4, Main.npc[k].Center, 4, 4)) - { - Target = k; - break; - } - } - return Target; - } + public override void UpdateAccessory(Player player, bool hideVisual) + { + if (--TimeToShoot <= 0) + { + TimeToShoot = ShootRate; + int Target = GetTarget(); + if (Target != -1) Shoot(Target, GetDamage()); + } + } - int GetDamage() - { - return (10 * ((int)Main.player[item.owner].magicDamage + (int)Main.player[item.owner].meleeDamage + (int)Main.player[item.owner].minionDamage + (int)Main.player[item.owner].rangedDamage + (int)Main.player[item.owner].thrownDamage)) + 15; - } + int GetTarget() + { + int Target = -1; + for (int k = 0; k < Main.npc.Length; k++) + { + if (Main.npc[k].active && Main.npc[k].lifeMax > 5 && !Main.npc[k].dontTakeDamage && !Main.npc[k].friendly && Main.npc[k].Distance(Main.player[item.owner].Center) <= ShootRange && Collision.CanHitLine(Main.player[item.owner].Center, 4, 4, Main.npc[k].Center, 4, 4)) + { + Target = k; + break; + } + } + return Target; + } - void Shoot(int Target, int Damage) - { - Vector2 velocity = Helper.VelocityToPoint(Main.player[item.owner].Center, Main.npc[Target].Center, ShootSpeed); - for (int l = 0; l < ShootCount; l++) - { - velocity.X = velocity.X + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - velocity.Y = velocity.Y + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - int i = Projectile.NewProjectile(Main.player[item.owner].Center.X, Main.player[item.owner].Center.Y, velocity.X, velocity.Y, ShootType, Damage, ShootKN, item.owner); - } - } - } + int GetDamage() + { + return (10 * ((int)Main.player[item.owner].magicDamage + (int)Main.player[item.owner].meleeDamage + (int)Main.player[item.owner].minionDamage + (int)Main.player[item.owner].rangedDamage + (int)Main.player[item.owner].thrownDamage)) + 15; + } + + void Shoot(int Target, int Damage) + { + Vector2 velocity = Helper.VelocityToPoint(Main.player[item.owner].Center, Main.npc[Target].Center, ShootSpeed); + for (int l = 0; l < ShootCount; l++) + { + velocity.X = velocity.X + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.Y = velocity.Y + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + int i = Projectile.NewProjectile(Main.player[item.owner].Center.X, Main.player[item.owner].Center.Y, velocity.X, velocity.Y, ShootType, Damage, ShootKN, item.owner); + } + } + } } diff --git a/Items/SkullkerBanner.cs b/Items/SkullkerBanner.cs index ca7e5542..b1e6bbe5 100644 --- a/Items/SkullkerBanner.cs +++ b/Items/SkullkerBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SkullkerBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SkullkerBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 91; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 91; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Skullker Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Skullker Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/SlimeFlail.cs b/Items/SlimeFlail.cs index 26e3ab26..2794ce68 100644 --- a/Items/SlimeFlail.cs +++ b/Items/SlimeFlail.cs @@ -7,35 +7,35 @@ namespace Tremor.Items { - public class SlimeFlail : ModItem - { - public override void SetDefaults() - { + public class SlimeFlail : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 10; - item.value = Item.sellPrice(2, 0, 0, 0); - item.rare = 2; - item.noMelee = true; - item.useStyle = 5; - item.useAnimation = 40; - item.useTime = 40; - item.knockBack = 7.5F; - item.damage = 15; - item.scale = 1.1F; - item.noUseGraphic = true; - item.shoot = mod.ProjectileType("SlimeFlailPro"); - item.shootSpeed = 15.9F; - item.UseSound = SoundID.Item1; - item.melee = true; - item.channel = true; - } + item.width = 30; + item.height = 10; + item.value = Item.sellPrice(2, 0, 0, 0); + item.rare = 2; + item.noMelee = true; + item.useStyle = 5; + item.useAnimation = 40; + item.useTime = 40; + item.knockBack = 7.5F; + item.damage = 15; + item.scale = 1.1F; + item.noUseGraphic = true; + item.shoot = mod.ProjectileType("SlimeFlailPro"); + item.shootSpeed = 15.9F; + item.UseSound = SoundID.Item1; + item.melee = true; + item.channel = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Slime Flail"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Slime Flail"); + Tooltip.SetDefault(""); + } - } + } } diff --git a/Items/SlimeRainMusicBox.cs b/Items/SlimeRainMusicBox.cs index 8babe237..0ef3ac61 100644 --- a/Items/SlimeRainMusicBox.cs +++ b/Items/SlimeRainMusicBox.cs @@ -25,11 +25,11 @@ public override void SetDefaults() item.accessory = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Music Box (Slime Rain)"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Music Box (Slime Rain)"); + Tooltip.SetDefault(""); + } } } diff --git a/Items/SnakeDevourer.cs b/Items/SnakeDevourer.cs index 82b4ce17..9a7fba6b 100644 --- a/Items/SnakeDevourer.cs +++ b/Items/SnakeDevourer.cs @@ -5,46 +5,48 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SnakeDevourer : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SnakeDevourer : ModItem + { + public override void SetDefaults() + { - item.damage = 295; - item.ranged = true; - item.width = 58; - item.height = 26; - item.useTime = 9; - item.useAnimation = 9; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 3; + item.damage = 295; + item.ranged = true; + item.width = 58; + item.height = 26; + item.useTime = 9; + item.useAnimation = 9; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 3; - item.useAmmo = AmmoID.Bullet; - item.value = 1000000; - item.rare = 11; - item.UseSound = SoundID.Item11; - item.autoReuse = true; - item.shoot = 440; - item.shootSpeed = 6f; - } + item.useAmmo = AmmoID.Bullet; + item.value = 1000000; + item.rare = 11; + item.UseSound = SoundID.Item11; + item.autoReuse = true; + item.shoot = 440; + item.shootSpeed = 6f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Snake Devourer"); - Tooltip.SetDefault("Uses bullets as ammo"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Snake Devourer"); + Tooltip.SetDefault("Uses bullets as ammo"); + } - public override Vector2? HoldoutOffset() - { - return new Vector2(-12, -2); - } + public override Vector2? HoldoutOffset() + { + return new Vector2(-12, -2); + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { type = 440; return base.Shoot(player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack); } -}} + } +} diff --git a/Items/SniperBoots.cs b/Items/SniperBoots.cs index 3ed16fac..06c0b833 100644 --- a/Items/SniperBoots.cs +++ b/Items/SniperBoots.cs @@ -4,35 +4,38 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class SniperBoots : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Legs)] + public class SniperBoots : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 18; - item.value = 1000000; + item.width = 22; + item.height = 18; + item.value = 1000000; - item.rare = 11; - item.defense = 32; - } + item.rare = 11; + item.defense = 32; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sniper Boots"); - Tooltip.SetDefault("15% increased ranged damage\n20% decreased movement speed"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sniper Boots"); + Tooltip.SetDefault("15% increased ranged damage\n20% decreased movement speed"); + } - public override void UpdateEquip(Player player) - { - player.rangedDamage *= 1.15f; - player.moveSpeed -= 0.20f; - } + public override void UpdateEquip(Player player) + { + player.rangedDamage *= 1.15f; + player.moveSpeed -= 0.20f; + } -}} + } +} diff --git a/Items/SniperBreastplate.cs b/Items/SniperBreastplate.cs index 0dd30b19..deac5d9b 100644 --- a/Items/SniperBreastplate.cs +++ b/Items/SniperBreastplate.cs @@ -4,35 +4,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class SniperBreastplate : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Body)] + public class SniperBreastplate : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 30; - item.height = 22; + item.width = 30; + item.height = 22; - item.value = 1000000; - item.rare = 11; - item.defense = 40; - } + item.value = 1000000; + item.rare = 11; + item.defense = 40; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sniper Breastplate"); - Tooltip.SetDefault("20% increased ranged damage\n20% decreased movement speed"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sniper Breastplate"); + Tooltip.SetDefault("20% increased ranged damage\n20% decreased movement speed"); + } - public override void UpdateEquip(Player player) - { - player.rangedDamage *= 1.2f; - player.moveSpeed -= 0.20f; - } + public override void UpdateEquip(Player player) + { + player.rangedDamage *= 1.2f; + player.moveSpeed -= 0.20f; + } -}} + } +} diff --git a/Items/SniperHelmet.cs b/Items/SniperHelmet.cs index d0af6c01..fde469ae 100644 --- a/Items/SniperHelmet.cs +++ b/Items/SniperHelmet.cs @@ -4,52 +4,55 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class SniperHelmet : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class SniperHelmet : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 26; + item.width = 26; + item.height = 26; - item.value = 1000000; - item.rare = 1; - item.defense = 36; - } + item.value = 1000000; + item.rare = 1; + item.defense = 36; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sniper Helmet"); - Tooltip.SetDefault("15% increased ranged damage\n20% decreased movement speed"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sniper Helmet"); + Tooltip.SetDefault("15% increased ranged damage\n20% decreased movement speed"); + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("SniperBreastplate") && legs.type == mod.ItemType("SniperBoots"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("SniperBreastplate") && legs.type == mod.ItemType("SniperBoots"); + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increases projectile's speed twice"; - player.moveSpeed += 0.15f; - player.AddBuff(mod.BuffType("ShootSpeedBuff"), 2); - player.scope = true; - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increases projectile's speed twice"; + player.moveSpeed += 0.15f; + player.AddBuff(mod.BuffType("ShootSpeedBuff"), 2); + player.scope = true; + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawShadow = true; + player.armorEffectDrawShadow = true; } - public override void UpdateEquip(Player player) - { - player.rangedDamage *= 1.15f; - player.moveSpeed -= 0.20f; - } + public override void UpdateEquip(Player player) + { + player.rangedDamage *= 1.15f; + player.moveSpeed -= 0.20f; + } -}} + } +} diff --git a/Items/SnowShotgun.cs b/Items/SnowShotgun.cs index cb040ea8..90166a46 100644 --- a/Items/SnowShotgun.cs +++ b/Items/SnowShotgun.cs @@ -5,51 +5,53 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SnowShotgun : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SnowShotgun : ModItem + { + public override void SetDefaults() + { - item.damage = 17; - item.ranged = true; - item.width = 26; - item.maxStack = 1; - item.height = 56; - item.useTime = 32; - item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 4; - item.value = 100000; - item.rare = 2; - item.UseSound = SoundID.Item36; - item.autoReuse = false; - item.shoot = 166; - item.shootSpeed = 10f; - item.useAmmo = AmmoID.Snowball; - } + item.damage = 17; + item.ranged = true; + item.width = 26; + item.maxStack = 1; + item.height = 56; + item.useTime = 32; + item.useAnimation = 30; + item.useStyle = 5; + item.knockBack = 4; + item.value = 100000; + item.rare = 2; + item.UseSound = SoundID.Item36; + item.autoReuse = false; + item.shoot = 166; + item.shootSpeed = 10f; + item.useAmmo = AmmoID.Snowball; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Snow Shotgun"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Snow Shotgun"); + Tooltip.SetDefault(""); + } - public override Vector2? HoldoutOffset() - { - return new Vector2(-18, -4); - } + public override Vector2? HoldoutOffset() + { + return new Vector2(-18, -4); + } -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) -{ - for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. - { - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); - } - return false; -} + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. + { + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); + } + return false; + } -}} + } +} diff --git a/Items/SnowballChaingun.cs b/Items/SnowballChaingun.cs index 1c36c703..465bc8d7 100644 --- a/Items/SnowballChaingun.cs +++ b/Items/SnowballChaingun.cs @@ -5,53 +5,55 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SnowballChaingun : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SnowballChaingun : ModItem + { + public override void SetDefaults() + { - item.damage = 30; - item.ranged = true; - item.width = 40; - item.height = 20; - item.useTime = 7; - item.useAnimation = 7; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 2; - item.value = 35000; - item.rare = 3; - item.UseSound = SoundID.Item11; - item.autoReuse = true; - item.shoot = 166; - item.shootSpeed = 8f; - item.useAmmo = AmmoID.Snowball; - } + item.damage = 30; + item.ranged = true; + item.width = 40; + item.height = 20; + item.useTime = 7; + item.useAnimation = 7; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 2; + item.value = 35000; + item.rare = 3; + item.UseSound = SoundID.Item11; + item.autoReuse = true; + item.shoot = 166; + item.shootSpeed = 8f; + item.useAmmo = AmmoID.Snowball; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Snowball Chaingun"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Snowball Chaingun"); + Tooltip.SetDefault(""); + } - public override Vector2? HoldoutOffset() - { - return new Vector2(-18, -4); - } + public override Vector2? HoldoutOffset() + { + return new Vector2(-18, -4); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Minishark, 1); - recipe.AddIngredient(ItemID.SnowballCannon, 1); - recipe.AddIngredient(ItemID.IceBlock, 25); - recipe.AddIngredient(ItemID.SnowBlock, 75); - recipe.AddIngredient(ItemID.SoulofLight, 5); - recipe.AddIngredient(ItemID.SoulofNight, 5); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Minishark, 1); + recipe.AddIngredient(ItemID.SnowballCannon, 1); + recipe.AddIngredient(ItemID.IceBlock, 25); + recipe.AddIngredient(ItemID.SnowBlock, 75); + recipe.AddIngredient(ItemID.SoulofLight, 5); + recipe.AddIngredient(ItemID.SoulofNight, 5); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/SnowcopterBanner.cs b/Items/SnowcopterBanner.cs index 8fe02f08..118b625e 100644 --- a/Items/SnowcopterBanner.cs +++ b/Items/SnowcopterBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SnowcopterBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SnowcopterBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 92; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 92; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Snowcopter Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Snowcopter Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/SnowmanBomberBanner.cs b/Items/SnowmanBomberBanner.cs index ba3e9c24..d562553c 100644 --- a/Items/SnowmanBomberBanner.cs +++ b/Items/SnowmanBomberBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SnowmanBomberBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SnowmanBomberBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 93; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 93; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("SnowmanBomberBanner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("SnowmanBomberBanner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/SnowmanWarriorBanner.cs b/Items/SnowmanWarriorBanner.cs index da2a80be..bb8c133a 100644 --- a/Items/SnowmanWarriorBanner.cs +++ b/Items/SnowmanWarriorBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SnowmanWarriorBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SnowmanWarriorBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 94; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 94; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Snowman Warrior Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Snowman Warrior Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/SolarBand.cs b/Items/SolarBand.cs index 28d544f3..1e84d697 100644 --- a/Items/SolarBand.cs +++ b/Items/SolarBand.cs @@ -13,20 +13,20 @@ public override void SetDefaults() { item.CloneDefaults(ItemID.Carrot); - item.rare = 11; - item.value = 380000; - item.useTime = 25; - item.useAnimation = 25; + item.rare = 11; + item.value = 380000; + item.useTime = 25; + item.useAnimation = 25; item.shoot = mod.ProjectileType("SolarMeteor"); item.buffType = mod.BuffType("SolarMeteorBuff"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Solar Band"); - Tooltip.SetDefault("Summons a solar meteor"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Solar Band"); + Tooltip.SetDefault("Summons a solar meteor"); + } public override void UseStyle(Player player) @@ -37,14 +37,14 @@ public override void UseStyle(Player player) } } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "UnchargedBand"); - recipe.AddIngredient(3458, 10); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "UnchargedBand"); + recipe.AddIngredient(3458, 10); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } } } diff --git a/Items/SolarRing.cs b/Items/SolarRing.cs index fff839df..a431ba5d 100644 --- a/Items/SolarRing.cs +++ b/Items/SolarRing.cs @@ -4,43 +4,45 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SolarRing : ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 28; - item.height = 22; - item.value = 250000; - item.rare = 8; - item.accessory = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Solar Ring "); - Tooltip.SetDefault("20% increased melee damage\nIncreases melee critical strike chance by 15\nCasts a ring of fire"); - } - - - public override void UpdateAccessory(Player player, bool hideVisual) - - { - player.meleeDamage += 0.2f; - player.meleeCrit += 15; - player.AddBuff(116, 60, true); - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(3458, 10); - recipe.AddIngredient(3467, 15); - recipe.AddIngredient(null, "Band"); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } -}} + public class SolarRing : ModItem + { + + public override void SetDefaults() + { + + item.width = 28; + item.height = 22; + item.value = 250000; + item.rare = 8; + item.accessory = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Solar Ring "); + Tooltip.SetDefault("20% increased melee damage\nIncreases melee critical strike chance by 15\nCasts a ring of fire"); + } + + + public override void UpdateAccessory(Player player, bool hideVisual) + + { + player.meleeDamage += 0.2f; + player.meleeCrit += 15; + player.AddBuff(116, 60, true); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(3458, 10); + recipe.AddIngredient(3467, 15); + recipe.AddIngredient(null, "Band"); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } +} diff --git a/Items/SorcererFocus.cs b/Items/SorcererFocus.cs index 226753c3..9c8cf270 100644 --- a/Items/SorcererFocus.cs +++ b/Items/SorcererFocus.cs @@ -6,42 +6,44 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SorcererFocus : ModItem +namespace Tremor.Items { + public class SorcererFocus : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 22; - item.rare = 2; - item.accessory = true; - item.value = 50000; - } + item.width = 22; + item.height = 22; + item.rare = 2; + item.accessory = true; + item.value = 50000; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sorcerer Focus"); - Tooltip.SetDefault("6% increased magic damage\nIncreases magic critical strike chance by 12\nIncreases maximum mana by 40"); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 4)); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sorcerer Focus"); + Tooltip.SetDefault("6% increased magic damage\nIncreases magic critical strike chance by 12\nIncreases maximum mana by 40"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 4)); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.statManaMax2 += 40; - player.magicDamage += 0.06f; - player.magicCrit += 12; - } + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.statManaMax2 += 40; + player.magicDamage += 0.06f; + player.magicCrit += 12; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "SorcererSpark"); - recipe.AddIngredient(null, "SeaFragment", 1); - recipe.AddIngredient(ItemID.Sapphire, 16); - recipe.SetResult(this); - recipe.AddTile(null, "AltarofEnchantmentsTile"); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "SorcererSpark"); + recipe.AddIngredient(null, "SeaFragment", 1); + recipe.AddIngredient(ItemID.Sapphire, 16); + recipe.SetResult(this); + recipe.AddTile(null, "AltarofEnchantmentsTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/SorcererSoul.cs b/Items/SorcererSoul.cs index b04fdf16..9f9dc7bf 100644 --- a/Items/SorcererSoul.cs +++ b/Items/SorcererSoul.cs @@ -6,42 +6,44 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SorcererSoul : ModItem +namespace Tremor.Items { + public class SorcererSoul : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 22; - item.rare = 3; - item.accessory = true; - item.value = 100000; - } + item.width = 22; + item.height = 22; + item.rare = 3; + item.accessory = true; + item.value = 100000; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sorcerer Soul"); - Tooltip.SetDefault("10% increased magic damage\nIncreases magic critical strike chance by 15\nIncreases maximum mana by 60"); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 6)); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sorcerer Soul"); + Tooltip.SetDefault("10% increased magic damage\nIncreases magic critical strike chance by 15\nIncreases maximum mana by 60"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 6)); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.statManaMax2 += 60; - player.magicDamage += 0.1f; - player.magicCrit += 15; - } + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.statManaMax2 += 60; + player.magicDamage += 0.1f; + player.magicCrit += 15; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "SorcererFocus"); - recipe.AddIngredient(null, "Opal", 3); - recipe.AddIngredient(ItemID.SorcererEmblem, 1); - recipe.SetResult(this); - recipe.AddTile(null, "AltarofEnchantmentsTile"); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "SorcererFocus"); + recipe.AddIngredient(null, "Opal", 3); + recipe.AddIngredient(ItemID.SorcererEmblem, 1); + recipe.SetResult(this); + recipe.AddTile(null, "AltarofEnchantmentsTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/SorcererSpark.cs b/Items/SorcererSpark.cs index c34c97fe..b765b32f 100644 --- a/Items/SorcererSpark.cs +++ b/Items/SorcererSpark.cs @@ -6,39 +6,41 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SorcererSpark : ModItem +namespace Tremor.Items { + public class SorcererSpark : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 22; - item.rare = 1; - item.accessory = true; - item.value = 20000; - } + item.width = 22; + item.height = 22; + item.rare = 1; + item.accessory = true; + item.value = 20000; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sorcerer Spark"); - Tooltip.SetDefault("3% increased magic damage\nIncreases magic critical strike chance by 8\nIncreases maximum mana by 20"); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 4)); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sorcerer Spark"); + Tooltip.SetDefault("3% increased magic damage\nIncreases magic critical strike chance by 8\nIncreases maximum mana by 20"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 4)); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.statManaMax2 += 20; - player.magicDamage += 0.03f; - player.magicCrit += 8; - } + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.statManaMax2 += 20; + player.magicDamage += 0.03f; + player.magicCrit += 8; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "AdventurerSpark"); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "AdventurerSpark"); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/SoulEruption.cs b/Items/SoulEruption.cs index 8d7077e9..47173947 100644 --- a/Items/SoulEruption.cs +++ b/Items/SoulEruption.cs @@ -12,41 +12,41 @@ public class SoulEruption : ModItem public override void SetDefaults() { - item.mana = 8; - item.UseSound = SoundID.Item43; - item.useStyle = 5; - item.damage = 192; - item.autoReuse = true; - item.useAnimation = 16; - item.useTime = 16; - item.width = 40; - item.height = 40; - item.shoot = 297; - item.shootSpeed = 6f; - item.knockBack = 6f; - item.value = Item.sellPrice(0, 12, 0, 0); - item.magic = true; - item.noMelee = true; - item.rare = 10; + item.mana = 8; + item.UseSound = SoundID.Item43; + item.useStyle = 5; + item.damage = 192; + item.autoReuse = true; + item.useAnimation = 16; + item.useTime = 16; + item.width = 40; + item.height = 40; + item.shoot = 297; + item.shootSpeed = 6f; + item.knockBack = 6f; + item.value = Item.sellPrice(0, 12, 0, 0); + item.magic = true; + item.noMelee = true; + item.rare = 10; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Soul Eruption"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Soul Eruption"); + Tooltip.SetDefault(""); + } -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) -{ - for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. - { - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - } - return false; -} + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. + { + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + } + return false; + } public override void AddRecipes() { diff --git a/Items/SoulofFight.cs b/Items/SoulofFight.cs index d2a6d096..1dd763ae 100644 --- a/Items/SoulofFight.cs +++ b/Items/SoulofFight.cs @@ -6,29 +6,30 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SoulofFight : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SoulofFight : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 22; - item.maxStack = 999; - item.value = 100; - item.rare = 11; + item.width = 22; + item.height = 22; + item.maxStack = 999; + item.value = 100; + item.rare = 11; - ItemID.Sets.ItemNoGravity[item.type] = true; + ItemID.Sets.ItemNoGravity[item.type] = true; ItemID.Sets.AnimatesAsSoul[item.type] = true; ItemID.Sets.ItemIconPulse[item.type] = true; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Soul of Fight"); - Tooltip.SetDefault("'The essence of endless battle'"); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(5, 4)); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Soul of Fight"); + Tooltip.SetDefault("'The essence of endless battle'"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(5, 4)); + } public override Color? GetAlpha(Color lightColor) @@ -36,4 +37,5 @@ public override void SetStaticDefaults() return Color.White; } -}} + } +} diff --git a/Items/SoulofMind.cs b/Items/SoulofMind.cs index 97bad024..caf658a1 100644 --- a/Items/SoulofMind.cs +++ b/Items/SoulofMind.cs @@ -6,29 +6,30 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SoulofMind : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SoulofMind : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 22; - item.maxStack = 999; - item.value = 100; - item.rare = 5; + item.width = 22; + item.height = 22; + item.maxStack = 999; + item.value = 100; + item.rare = 5; - ItemID.Sets.ItemNoGravity[item.type] = true; + ItemID.Sets.ItemNoGravity[item.type] = true; ItemID.Sets.AnimatesAsSoul[item.type] = true; ItemID.Sets.ItemIconPulse[item.type] = true; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Soul of Plight"); - Tooltip.SetDefault("'The essence of perfect intellect'"); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(5, 4)); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Soul of Plight"); + Tooltip.SetDefault("'The essence of perfect intellect'"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(5, 4)); + } public override Color? GetAlpha(Color lightColor) @@ -37,12 +38,13 @@ public override void SetStaticDefaults() } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.SoulofMight, 2); - recipe.SetResult(this); - recipe.AddTile(null, "RecyclerofMatterTile"); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.SoulofMight, 2); + recipe.SetResult(this); + recipe.AddTile(null, "RecyclerofMatterTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/SpaceWhaleMask.cs b/Items/SpaceWhaleMask.cs index 01f0cce6..be04c7b5 100644 --- a/Items/SpaceWhaleMask.cs +++ b/Items/SpaceWhaleMask.cs @@ -4,25 +4,28 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class SpaceWhaleMask : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class SpaceWhaleMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 20; - item.rare = 1; - item.vanity = true; - } + item.width = 22; + item.height = 20; + item.rare = 1; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Space Whale Mask"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Space Whale Mask"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/SpaceWhaleTreasureBag.cs b/Items/SpaceWhaleTreasureBag.cs index 9b4947f7..e2a2b94e 100644 --- a/Items/SpaceWhaleTreasureBag.cs +++ b/Items/SpaceWhaleTreasureBag.cs @@ -4,67 +4,69 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SpaceWhaleTreasureBag : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SpaceWhaleTreasureBag : ModItem + { + public override void SetDefaults() + { - item.maxStack = 999; - item.consumable = true; - item.width = 24; - item.height = 24; + item.maxStack = 999; + item.consumable = true; + item.width = 24; + item.height = 24; - item.rare = 9; - item.expert = true; - bossBagNPC = mod.NPCType("SpaceWhale"); - } + item.rare = 9; + item.expert = true; + bossBagNPC = mod.NPCType("SpaceWhale"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Treasure Bag"); - Tooltip.SetDefault("Right click to open"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Treasure Bag"); + Tooltip.SetDefault("Right click to open"); + } - public override bool CanRightClick() - { - return true; - } + public override bool CanRightClick() + { + return true; + } - public override void OpenBossBag(Player player) - { - if(Main.rand.Next(7) == 0) - { - player.QuickSpawnItem(mod.ItemType("SpaceWhaleMask")); - } + public override void OpenBossBag(Player player) + { + if (Main.rand.Next(7) == 0) + { + player.QuickSpawnItem(mod.ItemType("SpaceWhaleMask")); + } - if(Main.rand.Next(5) == 0) - { - player.QuickSpawnItem(mod.ItemType("StarLantern")); - } + if (Main.rand.Next(5) == 0) + { + player.QuickSpawnItem(mod.ItemType("StarLantern")); + } - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("SDL")); - } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("SDL")); + } - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("BlackHoleCannon")); - } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("BlackHoleCannon")); + } - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("HornedWarHammer")); - } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("HornedWarHammer")); + } - if(Main.rand.Next(8) == 0) - { - player.QuickSpawnItem(mod.ItemType("WhaleFlippers")); - } - player.QuickSpawnItem(mod.ItemType("LasCannon")); + if (Main.rand.Next(8) == 0) + { + player.QuickSpawnItem(mod.ItemType("WhaleFlippers")); + } + player.QuickSpawnItem(mod.ItemType("LasCannon")); - player.QuickSpawnItem(mod.ItemType("CosmicFuel")); + player.QuickSpawnItem(mod.ItemType("CosmicFuel")); + } + } } -}} diff --git a/Items/SpaceWhaleTrophy.cs b/Items/SpaceWhaleTrophy.cs index fa9553f0..6c669e69 100644 --- a/Items/SpaceWhaleTrophy.cs +++ b/Items/SpaceWhaleTrophy.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SpaceWhaleTrophy : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SpaceWhaleTrophy : ModItem + { + public override void SetDefaults() + { - item.width = 32; - item.height = 32; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 50000; - item.createTile = mod.TileType("SpaceWhaleTrophy"); - item.placeStyle = 0; - } + item.width = 32; + item.height = 32; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 50000; + item.createTile = mod.TileType("SpaceWhaleTrophy"); + item.placeStyle = 0; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Space Whale Trophy"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Space Whale Trophy"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/SparkingFlask.cs b/Items/SparkingFlask.cs index 938ffa96..61942d9e 100644 --- a/Items/SparkingFlask.cs +++ b/Items/SparkingFlask.cs @@ -9,72 +9,73 @@ namespace Tremor.Items { public class SparkingFlask : AlchemistItem - { + { - public override void SetDefaults() - { - item.crit = 4; - item.damage = 55; - //item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("SparkingFlaskPro"); - item.shootSpeed = 8f; - item.useStyle = 1; - item.knockBack = 1; - item.UseSound = SoundID.Item106; - item.value = 120; - item.rare = 5; - item.autoReuse = false; + public override void SetDefaults() + { + item.crit = 4; + item.damage = 55; + //item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("SparkingFlaskPro"); + item.shootSpeed = 8f; + item.useStyle = 1; + item.knockBack = 1; + item.UseSound = SoundID.Item106; + item.value = 120; + item.rare = 5; + item.autoReuse = false; - item.ammo = mod.ItemType("BoomFlask"); - } + item.ammo = mod.ItemType("BoomFlask"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sparking Flask"); - Tooltip.SetDefault("Throws a flask that explodes into fiery sparks"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sparking Flask"); + Tooltip.SetDefault("Throws a flask that explodes into fiery sparks"); + } - public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) - { - type = mod.ProjectileType("SparkingBallz"); - } + public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) + { + type = mod.ProjectileType("SparkingBallz"); + } - public override void UpdateInventory(Player player) - { - MPlayer modPlayer = player.GetModPlayer(mod); - if (modPlayer.novaHelmet) - { - item.autoReuse = true; - } - if (!modPlayer.novaHelmet) - { - item.autoReuse = false; - } - - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) - { - item.shootSpeed = 11f; - } - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) - { - item.shootSpeed = 8f; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) - { - item.autoReuse = true; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) - { - item.autoReuse = false; - } - } + public override void UpdateInventory(Player player) + { + MPlayer modPlayer = player.GetModPlayer(mod); + if (modPlayer.novaHelmet) + { + item.autoReuse = true; + } + if (!modPlayer.novaHelmet) + { + item.autoReuse = false; + } -}} + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) + { + item.shootSpeed = 11f; + } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) + { + item.shootSpeed = 8f; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) + { + item.autoReuse = true; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) + { + item.autoReuse = false; + } + } + + } +} diff --git a/Items/Spearaxe.cs b/Items/Spearaxe.cs index 387fb33a..32c5da02 100644 --- a/Items/Spearaxe.cs +++ b/Items/Spearaxe.cs @@ -5,32 +5,34 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Spearaxe : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Spearaxe : ModItem + { + public override void SetDefaults() + { - item.damage = 66; - item.melee = true; - item.width = 56; - item.height = 56; - item.useTime = 26; - item.useAnimation = 26; - item.useStyle = 1; - item.knockBack = 3; - item.value = 125500; - item.axe = 22; - item.rare = 6; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 66; + item.melee = true; + item.width = 56; + item.height = 56; + item.useTime = 26; + item.useAnimation = 26; + item.useStyle = 1; + item.knockBack = 3; + item.value = 125500; + item.axe = 22; + item.rare = 6; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Spearaxe"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Spearaxe"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/SpearofJustice.cs b/Items/SpearofJustice.cs index 89883e11..3331910e 100644 --- a/Items/SpearofJustice.cs +++ b/Items/SpearofJustice.cs @@ -34,11 +34,11 @@ public override void SetDefaults() item.crit = 7; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Spear of Justice"); - Tooltip.SetDefault("'NGAAAAAHHHHHHHHHHHHHHHHH!'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Spear of Justice"); + Tooltip.SetDefault("'NGAAAAAHHHHHHHHHHHHHHHHH!'"); + } } } diff --git a/Items/SpectralBlade.cs b/Items/SpectralBlade.cs index 70c9c65d..f0521c91 100644 --- a/Items/SpectralBlade.cs +++ b/Items/SpectralBlade.cs @@ -6,41 +6,43 @@ using Terraria.ModLoader; -namespace Tremor.Items { -public class SpectralBlade : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SpectralBlade : ModItem + { + public override void SetDefaults() + { - item.damage = 92; - item.melee = true; - item.width = 42; - item.height = 46; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = 297; - item.shootSpeed = 15f; - item.useStyle = 1; - item.knockBack = 2; - item.value = 46000; - item.rare = 8; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 92; + item.melee = true; + item.width = 42; + item.height = 46; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = 297; + item.shootSpeed = 15f; + item.useStyle = 1; + item.knockBack = 2; + item.value = 46000; + item.rare = 8; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Spectral Blade"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Spectral Blade"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.SpectreBar, 18); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.SpectreBar, 18); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/SpectreFlower.cs b/Items/SpectreFlower.cs index d1513c32..1be2f41a 100644 --- a/Items/SpectreFlower.cs +++ b/Items/SpectreFlower.cs @@ -5,43 +5,45 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SpectreFlower : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SpectreFlower : ModItem + { + public override void SetDefaults() + { - item.damage = 60; - item.magic = true; - item.width = 46; - item.height = 48; - item.mana = 15; - item.useTime = 30; - item.useAnimation = 30; - item.useStyle = 1; - item.noMelee = true; - item.knockBack = 6; - item.value = 30000; - item.rare = 8; - item.UseSound = SoundID.Item43; - item.autoReuse = true; - item.shoot = mod.ProjectileType("SpectreFlower"); - item.shootSpeed = 6f; - } + item.damage = 60; + item.magic = true; + item.width = 46; + item.height = 48; + item.mana = 15; + item.useTime = 30; + item.useAnimation = 30; + item.useStyle = 1; + item.noMelee = true; + item.knockBack = 6; + item.value = 30000; + item.rare = 8; + item.UseSound = SoundID.Item43; + item.autoReuse = true; + item.shoot = mod.ProjectileType("SpectreFlower"); + item.shootSpeed = 6f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Spectre Flower"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Spectre Flower"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.SpectreBar, 17); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.SpectreBar, 17); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/SpectreNecklace.cs b/Items/SpectreNecklace.cs index 9e7a52ba..c2364a8c 100644 --- a/Items/SpectreNecklace.cs +++ b/Items/SpectreNecklace.cs @@ -5,56 +5,58 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Neck)] -public class SpectreNecklace: ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 26; - item.height = 20; - item.value = 110; - item.rare = 8; - - item.accessory = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Spectre Necklace"); - Tooltip.SetDefault("The less mana, the more defense..."); - } - - - public override void UpdateAccessory(Player player, bool hideVisual) - - { - if (player.statMana < 25) - { - player.statDefense += 10; - } - if (player.statMana < 100) - { - player.statDefense += 8; - } - if (player.statMana < 200) - { - player.statDefense += 6; - } - if (player.statMana < 300) - { - player.statDefense += 3; - } - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.SpectreBar, 25); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + [AutoloadEquip(EquipType.Neck)] + public class SpectreNecklace : ModItem + { + + public override void SetDefaults() + { + + item.width = 26; + item.height = 20; + item.value = 110; + item.rare = 8; + + item.accessory = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Spectre Necklace"); + Tooltip.SetDefault("The less mana, the more defense..."); + } + + + public override void UpdateAccessory(Player player, bool hideVisual) + + { + if (player.statMana < 25) + { + player.statDefense += 10; + } + if (player.statMana < 100) + { + player.statDefense += 8; + } + if (player.statMana < 200) + { + player.statDefense += 6; + } + if (player.statMana < 300) + { + player.statDefense += 3; + } + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.SpectreBar, 25); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/SpectreTaroCards.cs b/Items/SpectreTaroCards.cs index a8877faa..4c325d02 100644 --- a/Items/SpectreTaroCards.cs +++ b/Items/SpectreTaroCards.cs @@ -5,55 +5,57 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SpectreTaroCards : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SpectreTaroCards : ModItem + { + public override void SetDefaults() + { - item.damage = 67; - item.magic = true; - item.width = 36; - item.mana = 8; - item.height = 34; - item.useTime = 20; - item.useAnimation = 20; - item.noUseGraphic = true; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 6; - item.value = 30000; - item.rare = 6; - item.UseSound = SoundID.Item8; - item.autoReuse = true; - item.shoot = mod.ProjectileType("SpectreTaroCard"); - item.shootSpeed = 8f; - } + item.damage = 67; + item.magic = true; + item.width = 36; + item.mana = 8; + item.height = 34; + item.useTime = 20; + item.useAnimation = 20; + item.noUseGraphic = true; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 6; + item.value = 30000; + item.rare = 6; + item.UseSound = SoundID.Item8; + item.autoReuse = true; + item.shoot = mod.ProjectileType("SpectreTaroCard"); + item.shootSpeed = 8f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Spectre Taro Cards"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Spectre Taro Cards"); + Tooltip.SetDefault(""); + } -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) -{ - for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. - { - Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 2, speedY - 1, type, damage, knockBack, Main.myPlayer); - } - return false; -} + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. + { + Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 2, speedY - 1, type, damage, knockBack, Main.myPlayer); + } + return false; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.SpectreBar, 15); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.SpectreBar, 15); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/SpiK3Ball.cs b/Items/SpiK3Ball.cs index 25d381eb..8c230455 100644 --- a/Items/SpiK3Ball.cs +++ b/Items/SpiK3Ball.cs @@ -5,33 +5,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SpiK3Ball : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SpiK3Ball : ModItem + { + public override void SetDefaults() + { - item.damage = 38; - item.thrown = true; - item.width = 18; - item.height = 18; - item.maxStack = 999; - item.useTime = 12; - item.useAnimation = 12; - item.shoot = mod.ProjectileType("SpiK3Ball"); - item.shootSpeed = 7f; - item.useStyle = 1; - item.knockBack = 3; - item.value = 155; - item.rare = 8; - item.consumable = true; - item.UseSound = SoundID.Item1; - } + item.damage = 38; + item.thrown = true; + item.width = 18; + item.height = 18; + item.maxStack = 999; + item.useTime = 12; + item.useAnimation = 12; + item.shoot = mod.ProjectileType("SpiK3Ball"); + item.shootSpeed = 7f; + item.useStyle = 1; + item.knockBack = 3; + item.value = 155; + item.rare = 8; + item.consumable = true; + item.UseSound = SoundID.Item1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("SpiK-3 Ball"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("SpiK-3 Ball"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/SpiderManBanner.cs b/Items/SpiderManBanner.cs index c2028ae7..7ee25e6a 100644 --- a/Items/SpiderManBanner.cs +++ b/Items/SpiderManBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SpiderManBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SpiderManBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 39; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 39; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Spider Man Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Spider Man Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/SpiderMeat.cs b/Items/SpiderMeat.cs index 8599926a..18a87f71 100644 --- a/Items/SpiderMeat.cs +++ b/Items/SpiderMeat.cs @@ -4,37 +4,39 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class SpiderMeat : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.width = 20; - item.height = 30; - item.maxStack = 20; + public class SpiderMeat : ModItem + { + public override void SetDefaults() + { + + item.width = 20; + item.height = 30; + item.maxStack = 20; - item.rare = 1; - item.useAnimation = 15; - item.useTime = 15; - item.useStyle = 2; - item.UseSound = SoundID.Item2; - item.consumable = true; - } + item.rare = 1; + item.useAnimation = 15; + item.useTime = 15; + item.useStyle = 2; + item.UseSound = SoundID.Item2; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Spider Meat"); - Tooltip.SetDefault("'I don't see anything wrong with it, eat it!'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Spider Meat"); + Tooltip.SetDefault("'I don't see anything wrong with it, eat it!'"); + } - public override bool UseItem(Player player) - { - player.AddBuff(22, 10000, true); - player.AddBuff(32, 10000, true); - player.AddBuff(31, 10000, true); - return true; - } -}} + public override bool UseItem(Player player) + { + player.AddBuff(22, 10000, true); + player.AddBuff(32, 10000, true); + player.AddBuff(31, 10000, true); + return true; + } + } +} diff --git a/Items/SpiderPie.cs b/Items/SpiderPie.cs index 8c3519f4..ce4663c4 100644 --- a/Items/SpiderPie.cs +++ b/Items/SpiderPie.cs @@ -26,22 +26,22 @@ public override void SetDefaults() item.mountType = mod.MountType("Spider"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Spider Pie"); - Tooltip.SetDefault("Summons a rideable Fat Spider mount"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Spider Pie"); + Tooltip.SetDefault("Summons a rideable Fat Spider mount"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Bowl, 1); - recipe.AddIngredient(null, "SpiderMeat", 15); - recipe.AddIngredient(ItemID.Cobweb, 100); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Bowl, 1); + recipe.AddIngredient(null, "SpiderMeat", 15); + recipe.AddIngredient(ItemID.Cobweb, 100); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/SpikeShield.cs b/Items/SpikeShield.cs index b5f60fac..823478c0 100644 --- a/Items/SpikeShield.cs +++ b/Items/SpikeShield.cs @@ -5,31 +5,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Shield)] -public class SpikeShield : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Shield)] + public class SpikeShield : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 26; - item.value = 32000; - item.rare = 0; + item.width = 26; + item.height = 26; + item.value = 32000; + item.rare = 0; - item.accessory = true; - item.defense = 1; - } + item.accessory = true; + item.defense = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Spiky Shield"); - Tooltip.SetDefault("Allows you to prick foes"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Spiky Shield"); + Tooltip.SetDefault("Allows you to prick foes"); + } - public override void UpdateEquip(Player player) - { - player.thorns = 1; - } -}} + public override void UpdateEquip(Player player) + { + player.thorns = 1; + } + } +} diff --git a/Items/SpinalMask.cs b/Items/SpinalMask.cs index e0e89ed5..b9a18c82 100644 --- a/Items/SpinalMask.cs +++ b/Items/SpinalMask.cs @@ -5,24 +5,27 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class SpinalMask : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class SpinalMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; + item.width = 22; - item.height = 26; - item.rare = 9; - } + item.height = 26; + item.rare = 9; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Spinal111 Mask"); - Tooltip.SetDefault("'Great for impersonating YouTubers!'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Spinal111 Mask"); + Tooltip.SetDefault("'Great for impersonating YouTubers!'"); + } -}} + } +} diff --git a/Items/SpineBlade.cs b/Items/SpineBlade.cs index 2cdf5000..626450fc 100644 --- a/Items/SpineBlade.cs +++ b/Items/SpineBlade.cs @@ -4,46 +4,48 @@ using Terraria.ModLoader; using Terraria.ID; -namespace Tremor.Items { -public class SpineBlade : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SpineBlade : ModItem + { + public override void SetDefaults() + { - item.useStyle = 1; - item.useAnimation = 28; - item.useTime = 28; - item.knockBack = 5.75f; - item.width = 40; - item.height = 40; - item.damage = 165; - item.scale = 1.125f; - item.shootSpeed = 15f; - item.shoot = 524; - item.UseSound = SoundID.Item1; - item.rare = 9; - item.autoReuse = true; - item.value = Item.sellPrice(0, 5, 0, 0); - item.melee = true; - } + item.useStyle = 1; + item.useAnimation = 28; + item.useTime = 28; + item.knockBack = 5.75f; + item.width = 40; + item.height = 40; + item.damage = 165; + item.scale = 1.125f; + item.shootSpeed = 15f; + item.shoot = 524; + item.UseSound = SoundID.Item1; + item.rare = 9; + item.autoReuse = true; + item.value = Item.sellPrice(0, 5, 0, 0); + item.melee = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Spine Blade"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Spine Blade"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Bladetongue, 1); - recipe.AddIngredient(null, "NightmareBar", 15); - recipe.AddIngredient(ItemID.CrimtaneBar, 25); - recipe.AddIngredient(null, "Doomstone", 6); - recipe.AddIngredient(null, "Phantaplasm", 10); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Bladetongue, 1); + recipe.AddIngredient(null, "NightmareBar", 15); + recipe.AddIngredient(ItemID.CrimtaneBar, 25); + recipe.AddIngredient(null, "Doomstone", 6); + recipe.AddIngredient(null, "Phantaplasm", 10); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Sporaxe.cs b/Items/Sporaxe.cs index ebfb1f6e..95acd58a 100644 --- a/Items/Sporaxe.cs +++ b/Items/Sporaxe.cs @@ -5,65 +5,67 @@ using Terraria.ID; using Microsoft.Xna.Framework; -namespace Tremor.Items { -public class Sporaxe : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Sporaxe : ModItem + { + public override void SetDefaults() + { - item.damage = 18; - item.melee = true; - item.width = 54; - item.height = 48; - item.useTime = 24; - item.useAnimation = 24; - item.useStyle = 1; - item.knockBack = 5; - item.shootSpeed = 10f; - item.value = 22000; - item.shoot = 569; - item.rare = 3; - item.axe = 8; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 18; + item.melee = true; + item.width = 54; + item.height = 48; + item.useTime = 24; + item.useAnimation = 24; + item.useStyle = 1; + item.knockBack = 5; + item.shootSpeed = 10f; + item.value = 22000; + item.shoot = 569; + item.rare = 3; + item.axe = 8; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sporaxe"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sporaxe"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "JungleAlloy", 1); - recipe.AddIngredient(ItemID.Stinger, 4); - recipe.AddIngredient(ItemID.Vine, 3); - recipe.AddIngredient(ItemID.JungleSpores, 10); - recipe.SetResult(this); - recipe.AddTile(null, "GreatAnvilTile"); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "JungleAlloy", 1); + recipe.AddIngredient(ItemID.Stinger, 4); + recipe.AddIngredient(ItemID.Vine, 3); + recipe.AddIngredient(ItemID.JungleSpores, 10); + recipe.SetResult(this); + recipe.AddTile(null, "GreatAnvilTile"); + recipe.AddRecipe(); + } -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) -{ - for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. - { - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); - } - return false; -} + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. + { + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); + } + return false; + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if(Main.rand.Next(3) == 0) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 61); - } - } -}} + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.Next(3) == 0) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 61); + } + } + } +} diff --git a/Items/SporeBlade.cs b/Items/SporeBlade.cs index 674e8165..a7cb7ea0 100644 --- a/Items/SporeBlade.cs +++ b/Items/SporeBlade.cs @@ -5,33 +5,34 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SporeBlade : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SporeBlade : ModItem + { + public override void SetDefaults() + { - item.damage = 82; - item.melee = true; - item.width = 50; - item.height = 55; - item.useTime = 35; - item.useAnimation = 25; - item.useStyle = 1; - item.shoot = 228; - item.shootSpeed = 20f; - item.knockBack = 4; - item.value = 50000; - item.rare = 6; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 82; + item.melee = true; + item.width = 50; + item.height = 55; + item.useTime = 35; + item.useAnimation = 25; + item.useStyle = 1; + item.shoot = 228; + item.shootSpeed = 20f; + item.knockBack = 4; + item.value = 50000; + item.rare = 6; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Spore Blade"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Spore Blade"); + Tooltip.SetDefault(""); + } -} + } } diff --git a/Items/SporeDust.cs b/Items/SporeDust.cs index d93a126b..71572bb5 100644 --- a/Items/SporeDust.cs +++ b/Items/SporeDust.cs @@ -6,42 +6,43 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SporeDust : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SporeDust : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 36; - item.value = 12500; - item.rare = 5; - item.accessory = true; - } + item.width = 22; + item.height = 36; + item.value = 12500; + item.rare = 5; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Spore Dust"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Spore Dust"); + Tooltip.SetDefault(""); + } -public override void UpdateAccessory(Player player, bool hideVisual) -{ - if(Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y) > 1f && !player.rocketFrame) // Makes sure the player is actually moving - { - for (int k = 0; k < 2; k++) - { - int index= Dust.NewDust(new Vector2(player.position.X - player.velocity.X * 2f, player.position.Y - 2f - player.velocity.Y * 2f), player.width, player.height, 44, 0f, 0f, 100, default(Color), 2f); - Main.dust[index].noGravity = true; - Main.dust[index].noLight = true; - Dust dust = Main.dust[index]; - dust.velocity.X = dust.velocity.X - player.velocity.X * 0.5f; - dust.velocity.Y = dust.velocity.Y - player.velocity.Y * 0.5f; - } - } -} + public override void UpdateAccessory(Player player, bool hideVisual) + { + if (Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y) > 1f && !player.rocketFrame) // Makes sure the player is actually moving + { + for (int k = 0; k < 2; k++) + { + int index = Dust.NewDust(new Vector2(player.position.X - player.velocity.X * 2f, player.position.Y - 2f - player.velocity.Y * 2f), player.width, player.height, 44, 0f, 0f, 100, default(Color), 2f); + Main.dust[index].noGravity = true; + Main.dust[index].noLight = true; + Dust dust = Main.dust[index]; + dust.velocity.X = dust.velocity.X - player.velocity.X * 0.5f; + dust.velocity.Y = dust.velocity.Y - player.velocity.Y * 0.5f; + } + } + } public override void AddRecipes() { @@ -53,4 +54,5 @@ public override void AddRecipes() recipe.AddRecipe(); } -}} + } +} diff --git a/Items/SquareBlast.cs b/Items/SquareBlast.cs index cdb875bb..a5b20be0 100644 --- a/Items/SquareBlast.cs +++ b/Items/SquareBlast.cs @@ -4,56 +4,58 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SquareBlast : ModItem +namespace Tremor.Items { - public override bool CanEquipAccessory(Player player, int slot) - { - for(int i=0; i < player.armor.Length; i++) - { - MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - if(modPlayer.pyro == true) - { - return false; - } - } - return true; - } - - public override void SetDefaults() - { - - item.width = 22; - item.height = 44; - - item.value = 300000; - item.rare = 6; - item.accessory = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Square Blast"); - Tooltip.SetDefault("Alchemical projectiles leave explosions in the shape of squares"); - } - - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.ExplosivePowder, 25); - recipe.AddIngredient(null, "Chemikaze", 1); - recipe.AddIngredient(null, "ArgiteBar", 25); - recipe.AddIngredient(ItemID.SoulofFright, 3); - recipe.SetResult(this); - recipe.AddTile(114); - recipe.AddRecipe(); - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - player.AddBuff(mod.BuffType("SquareBlastBuff"), 2); - modPlayer.pyro = true; - } -}} + public class SquareBlast : ModItem + { + public override bool CanEquipAccessory(Player player, int slot) + { + for (int i = 0; i < player.armor.Length; i++) + { + MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); + if (modPlayer.pyro == true) + { + return false; + } + } + return true; + } + + public override void SetDefaults() + { + + item.width = 22; + item.height = 44; + + item.value = 300000; + item.rare = 6; + item.accessory = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Square Blast"); + Tooltip.SetDefault("Alchemical projectiles leave explosions in the shape of squares"); + } + + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.ExplosivePowder, 25); + recipe.AddIngredient(null, "Chemikaze", 1); + recipe.AddIngredient(null, "ArgiteBar", 25); + recipe.AddIngredient(ItemID.SoulofFright, 3); + recipe.SetResult(this); + recipe.AddTile(114); + recipe.AddRecipe(); + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); + player.AddBuff(mod.BuffType("SquareBlastBuff"), 2); + modPlayer.pyro = true; + } + } +} diff --git a/Items/Squasher.cs b/Items/Squasher.cs index fdc45bc2..ba1da4e7 100644 --- a/Items/Squasher.cs +++ b/Items/Squasher.cs @@ -4,51 +4,53 @@ using Terraria.ModLoader; using Terraria.ID; -namespace Tremor.Items { -public class Squasher : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Squasher : ModItem + { + public override void SetDefaults() + { - item.damage = 88; - item.melee = true; - item.width = 56; - item.height = 56; - item.useTime = 36; - item.useAnimation = 36; - item.useStyle = 1; - item.knockBack = 6; - item.value = 122000; - item.rare = 3; - item.UseSound = SoundID.Item1; + item.damage = 88; + item.melee = true; + item.width = 56; + item.height = 56; + item.useTime = 36; + item.useAnimation = 36; + item.useStyle = 1; + item.knockBack = 6; + item.value = 122000; + item.rare = 3; + item.UseSound = SoundID.Item1; - item.hammer = 100; - item.autoReuse = false; - } + item.hammer = 100; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Squasher"); - Tooltip.SetDefault("Strong enough to destroy Demon Altars"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Squasher"); + Tooltip.SetDefault("Strong enough to destroy Demon Altars"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Pwnhammer, 1); - recipe.AddIngredient(null, "DarkBulb", 15); - recipe.AddIngredient(ItemID.Bone, 100); - recipe.SetResult(this, 1); - recipe.AddTile(134); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Pwnhammer, 1); + recipe.AddIngredient(null, "DarkBulb", 15); + recipe.AddIngredient(ItemID.Bone, 100); + recipe.SetResult(this, 1); + recipe.AddTile(134); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Doomhammer", 1); - recipe.AddIngredient(null, "DarkBulb", 15); - recipe.AddIngredient(ItemID.Bone, 100); - recipe.SetResult(this, 1); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Doomhammer", 1); + recipe.AddIngredient(null, "DarkBulb", 15); + recipe.AddIngredient(ItemID.Bone, 100); + recipe.SetResult(this, 1); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/SquidHat.cs b/Items/SquidHat.cs index f2a28fe6..387abd94 100644 --- a/Items/SquidHat.cs +++ b/Items/SquidHat.cs @@ -5,24 +5,27 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class SquidHat : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class SquidHat : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 24; - item.rare = 1; - } + item.width = 26; + item.height = 24; + item.rare = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Squid Hat"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Squid Hat"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/SquidTentacle.cs b/Items/SquidTentacle.cs index 542fc48e..a23474a6 100644 --- a/Items/SquidTentacle.cs +++ b/Items/SquidTentacle.cs @@ -17,15 +17,15 @@ public override void SetDefaults() item.shoot = mod.ProjectileType("SquidTentacleProjectile"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Squid Tentacle"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Squid Tentacle"); + Tooltip.SetDefault(""); + } } - class SquidTentacleProjectile : ModProjectile + class SquidTentacleProjectile : ModProjectile { public override void SetStaticDefaults() { @@ -39,24 +39,24 @@ public override void SetDefaults() // Use this hook for hooks that can have multiple hooks midflight: Dual Hook, Web Slinger, Fish Hook, Static Hook, Lunar Hook -/* - public override bool? CanUseGrapple(Player player) - { - int hooksOut = 0; - for (int l = 0; l < 1000; l++) - { - if (Main.projectile[l].active && Main.projectile[l].owner == Main.myPlayer && Main.projectile[l].type == projectile.type) + /* + public override bool? CanUseGrapple(Player player) { - hooksOut++; + int hooksOut = 0; + for (int l = 0; l < 1000; l++) + { + if (Main.projectile[l].active && Main.projectile[l].owner == Main.myPlayer && Main.projectile[l].type == projectile.type) + { + hooksOut++; + } + } + if (hooksOut > 2) // This hook can have 3 hooks out. + { + return false; + } + return true; } - } - if (hooksOut > 2) // This hook can have 3 hooks out. - { - return false; - } - return true; - } -*/ + */ // Return true if it is like: Hook, CandyCaneHook, BatHook, GemHooks //public override bool? SingleGrappleHook(Player player) diff --git a/Items/SquidZombieBanner.cs b/Items/SquidZombieBanner.cs index ff3fb375..e417a378 100644 --- a/Items/SquidZombieBanner.cs +++ b/Items/SquidZombieBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SquidZombieBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SquidZombieBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 40; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 40; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Squid Zombie Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Squid Zombie Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/Squorb.cs b/Items/Squorb.cs index 5a2323af..e09afc56 100644 --- a/Items/Squorb.cs +++ b/Items/Squorb.cs @@ -6,27 +6,29 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Squorb : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Squorb : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 22; - item.maxStack = 999; - item.value = 100; - item.rare = 10; - ItemID.Sets.ItemNoGravity[item.type] = true; + item.width = 22; + item.height = 22; + item.maxStack = 999; + item.value = 100; + item.rare = 10; + ItemID.Sets.ItemNoGravity[item.type] = true; ItemID.Sets.AnimatesAsSoul[item.type] = true; ItemID.Sets.ItemIconPulse[item.type] = true; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Squorb"); - Tooltip.SetDefault(""); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(5, 4)); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Squorb"); + Tooltip.SetDefault(""); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(5, 4)); + } -}} + } +} diff --git a/Items/StarBar.cs b/Items/StarBar.cs index 1f7cf5c0..d48d27ae 100644 --- a/Items/StarBar.cs +++ b/Items/StarBar.cs @@ -4,40 +4,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class StarBar : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class StarBar : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 100; - item.rare = 10; - item.createTile = mod.TileType("StarBarTile"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 100; + item.rare = 10; + item.createTile = mod.TileType("StarBarTile"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Star Bar"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Star Bar"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "NightmareOre", 1); - recipe.AddIngredient(116, 1); - recipe.AddIngredient(ItemID.FallenStar, 3); - recipe.SetResult(this); - recipe.AddTile(null, "StarvilTile"); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "NightmareOre", 1); + recipe.AddIngredient(116, 1); + recipe.AddIngredient(ItemID.FallenStar, 3); + recipe.SetResult(this); + recipe.AddTile(null, "StarvilTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/StarBlaster.cs b/Items/StarBlaster.cs index 0f38c662..638110ff 100644 --- a/Items/StarBlaster.cs +++ b/Items/StarBlaster.cs @@ -5,50 +5,52 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class StarBlaster : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class StarBlaster : ModItem + { + public override void SetDefaults() + { - item.damage = 110; - item.magic = true; - item.width = 68; - item.height = 28; - item.useTime = 6; - item.useAnimation = 30; - item.mana=5; - item.shoot = 503; - item.shootSpeed = 12f; - item.useStyle = 5; - item.knockBack = 4; - item.value = 300000; - item.rare = 10; - item.UseSound = SoundID.Item114; - item.autoReuse = false; - } + item.damage = 110; + item.magic = true; + item.width = 68; + item.height = 28; + item.useTime = 6; + item.useAnimation = 30; + item.mana = 5; + item.shoot = 503; + item.shootSpeed = 12f; + item.useStyle = 5; + item.knockBack = 4; + item.value = 300000; + item.rare = 10; + item.UseSound = SoundID.Item114; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Star Blaster"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Star Blaster"); + Tooltip.SetDefault(""); + } - public override Vector2? HoldoutOffset() - { - return new Vector2(-18, -4); - } + public override Vector2? HoldoutOffset() + { + return new Vector2(-18, -4); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "StarBar", 20); - recipe.AddIngredient(null, "Phantaplasm", 6); - recipe.AddIngredient(null, "CarbonSteel", 6); - recipe.AddIngredient(ItemID.MartianConduitPlating, 50); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "StarBar", 20); + recipe.AddIngredient(null, "Phantaplasm", 6); + recipe.AddIngredient(null, "CarbonSteel", 6); + recipe.AddIngredient(ItemID.MartianConduitPlating, 50); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } +} diff --git a/Items/StarBound.cs b/Items/StarBound.cs index 205df480..99ef5d2c 100644 --- a/Items/StarBound.cs +++ b/Items/StarBound.cs @@ -5,112 +5,114 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class StarBound : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.damage = 258; - item.magic = true; - item.mana = 14; - item.width = 40; - item.height = 40; - item.useTime = 16; - item.useAnimation = 16; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 3; - item.value = 13800; - item.rare = 4; - item.UseSound = SoundID.Item43; - item.autoReuse = false; - Item.staff[item.type] = true; - item.shoot = 12; - item.shootSpeed = 15f; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Star Bound"); - Tooltip.SetDefault(""); - } - - - - public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - int i = Main.myPlayer; - float num72 = item.shootSpeed; - int num73 = item.damage; - float num74 = item.knockBack; - num74 = player.GetWeaponKnockback(item, num74); - player.itemTime = item.useTime; - Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); - Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default(Vector2)); - Vector2 vector3 = Main.MouseWorld - vector2; - float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; - float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; - if (player.gravDir == -1f) - { - num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; - } - float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); - float num81 = num80; - if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) - { - num78 = (float)player.direction; - num79 = 0f; - num80 = num72; - } - else - { - num80 = num72 / num80; - } - num78 *= num80; - num79 *= num80; - int num146 = 4; - if (Main.rand.Next(2) == 0) + public class StarBound : ModItem + { + public override void SetDefaults() { - num146++; - } - if (Main.rand.Next(4) == 0) - { - num146++; + + item.damage = 258; + item.magic = true; + item.mana = 14; + item.width = 40; + item.height = 40; + item.useTime = 16; + item.useAnimation = 16; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 3; + item.value = 13800; + item.rare = 4; + item.UseSound = SoundID.Item43; + item.autoReuse = false; + Item.staff[item.type] = true; + item.shoot = 12; + item.shootSpeed = 15f; } - if (Main.rand.Next(8) == 0) + + public override void SetStaticDefaults() { - num146++; + DisplayName.SetDefault("Star Bound"); + Tooltip.SetDefault(""); } - if (Main.rand.Next(16) == 0) + + + + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { - num146++; + int i = Main.myPlayer; + float num72 = item.shootSpeed; + int num73 = item.damage; + float num74 = item.knockBack; + num74 = player.GetWeaponKnockback(item, num74); + player.itemTime = item.useTime; + Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); + Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default(Vector2)); + Vector2 vector3 = Main.MouseWorld - vector2; + float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; + float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y; + if (player.gravDir == -1f) + { + num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y; + } + float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79)); + float num81 = num80; + if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f)) + { + num78 = (float)player.direction; + num79 = 0f; + num80 = num72; + } + else + { + num80 = num72 / num80; + } + num78 *= num80; + num79 *= num80; + int num146 = 4; + if (Main.rand.Next(2) == 0) + { + num146++; + } + if (Main.rand.Next(4) == 0) + { + num146++; + } + if (Main.rand.Next(8) == 0) + { + num146++; + } + if (Main.rand.Next(16) == 0) + { + num146++; + } + for (int num147 = 0; num147 < num146; num147++) + { + float num148 = num78; + float num149 = num79; + float num150 = 0.05f * (float)num147; + num148 += (float)Main.rand.Next(-35, 36) * num150; + num149 += (float)Main.rand.Next(-35, 36) * num150; + num80 = (float)Math.Sqrt((double)(num148 * num148 + num149 * num149)); + num80 = num72 / num80; + num148 *= num80; + num149 *= num80; + float x4 = vector2.X; + float y4 = vector2.Y; + Projectile.NewProjectile(x4, y4, num148, num149, 12, num73, num74, i, 0f, 0f); + } + return false; } - for (int num147 = 0; num147 < num146; num147++) + + public override void AddRecipes() { - float num148 = num78; - float num149 = num79; - float num150 = 0.05f * (float)num147; - num148 += (float)Main.rand.Next(-35, 36) * num150; - num149 += (float)Main.rand.Next(-35, 36) * num150; - num80 = (float)Math.Sqrt((double)(num148 * num148 + num149 * num149)); - num80 = num72 / num80; - num148 *= num80; - num149 *= num80; - float x4 = vector2.X; - float y4 = vector2.Y; - Projectile.NewProjectile(x4, y4, num148, num149, 12, num73, num74, i, 0f, 0f); + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "WhiteGoldBar", 12); + recipe.AddIngredient(ItemID.FallenStar, 16); + recipe.SetResult(this); + recipe.AddTile(null, "DivineForgeTile"); + recipe.AddRecipe(); } - return false; } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "WhiteGoldBar", 12); - recipe.AddIngredient(ItemID.FallenStar, 16); - recipe.SetResult(this); - recipe.AddTile(null, "DivineForgeTile"); - recipe.AddRecipe(); - } -}} +} diff --git a/Items/StarDrill.cs b/Items/StarDrill.cs index 380eab01..c62e4f52 100644 --- a/Items/StarDrill.cs +++ b/Items/StarDrill.cs @@ -6,57 +6,59 @@ using Microsoft.Xna.Framework; using Terraria.DataStructures; -namespace Tremor.Items { - -public class StarDrill : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.damage = 100; - item.melee = true; - item.width = 20; - item.height = 12; - item.useTime = 5; - item.useAnimation = 25; - item.channel = true; - item.noUseGraphic = true; - item.noMelee = true; - item.pick = 250; - item.tileBoost+=8; - item.useStyle = 5; - item.knockBack = 6; - item.value = Item.buyPrice(0, 12, 50, 0); - item.rare = 0; - item.UseSound = SoundID.Item23; - item.autoReuse = true; - item.shoot = mod.ProjectileType("StarDrillPro"); - item.shootSpeed = 40f; - } + public class StarDrill : ModItem + { + public override void SetDefaults() + { + + item.damage = 100; + item.melee = true; + item.width = 20; + item.height = 12; + item.useTime = 5; + item.useAnimation = 25; + item.channel = true; + item.noUseGraphic = true; + item.noMelee = true; + item.pick = 250; + item.tileBoost += 8; + item.useStyle = 5; + item.knockBack = 6; + item.value = Item.buyPrice(0, 12, 50, 0); + item.rare = 0; + item.UseSound = SoundID.Item23; + item.autoReuse = true; + item.shoot = mod.ProjectileType("StarDrillPro"); + item.shootSpeed = 40f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Star Drill"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Star Drill"); + Tooltip.SetDefault(""); + } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) - { - tooltips[0].overrideColor = new Color(238, 194, 73); - } + public override void ModifyTooltips(System.Collections.Generic.List tooltips) + { + tooltips[0].overrideColor = new Color(238, 194, 73); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "TrueEssense", 3); - recipe.AddIngredient(null, "NightCore", 3); - recipe.AddIngredient(null, "CometiteBar", 15); - recipe.AddIngredient(null, "HardCometiteBar", 3); - recipe.AddIngredient(null, "StarBar", 3); - recipe.AddIngredient(null, "LunarRoot", 25); - recipe.SetResult(this); - recipe.AddTile(null, "StarvilTile"); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "TrueEssense", 3); + recipe.AddIngredient(null, "NightCore", 3); + recipe.AddIngredient(null, "CometiteBar", 15); + recipe.AddIngredient(null, "HardCometiteBar", 3); + recipe.AddIngredient(null, "StarBar", 3); + recipe.AddIngredient(null, "LunarRoot", 25); + recipe.SetResult(this); + recipe.AddTile(null, "StarvilTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/StarLantern.cs b/Items/StarLantern.cs index d77c7203..bc1f66f8 100644 --- a/Items/StarLantern.cs +++ b/Items/StarLantern.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class StarLantern : ModItem +namespace Tremor.Items { + public class StarLantern : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 24; - item.height = 28; - item.value = 50000; - item.rare = 11; - item.accessory = true; - } + item.width = 24; + item.height = 28; + item.value = 50000; + item.rare = 11; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Star Lantern"); - Tooltip.SetDefault("25% increased magic damage\nEmits aura of light"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Star Lantern"); + Tooltip.SetDefault("25% increased magic damage\nEmits aura of light"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.AddBuff(11, 10); - player.magicDamage += 0.25f; - } -}} + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.AddBuff(11, 10); + player.magicDamage += 0.25f; + } + } +} diff --git a/Items/StarNest.cs b/Items/StarNest.cs index 74e82b1a..873e586b 100644 --- a/Items/StarNest.cs +++ b/Items/StarNest.cs @@ -4,44 +4,46 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class StarNest : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class StarNest : ModItem + { + public override void SetDefaults() + { - item.damage = 69; - item.width = 14; - item.height = 84; - item.magic = true; - item.mana = 4; - item.useTime = 30; - item.shoot = mod.ProjectileType("StarNestPro"); - item.shootSpeed = 8f; - item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 4; - item.value = 210000; - item.rare = 10; - item.UseSound = SoundID.Item11; - item.autoReuse = true; - } + item.damage = 69; + item.width = 14; + item.height = 84; + item.magic = true; + item.mana = 4; + item.useTime = 30; + item.shoot = mod.ProjectileType("StarNestPro"); + item.shootSpeed = 8f; + item.useAnimation = 30; + item.useStyle = 5; + item.knockBack = 4; + item.value = 210000; + item.rare = 10; + item.UseSound = SoundID.Item11; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Star Nest"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Star Nest"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "AncientTechnology", 1); - recipe.AddIngredient(3459, 30); - recipe.AddIngredient(null, "EarthFragment", 25); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "AncientTechnology", 1); + recipe.AddIngredient(3459, 30); + recipe.AddIngredient(null, "EarthFragment", 25); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } +} diff --git a/Items/StarSmithy.cs b/Items/StarSmithy.cs index 3fac2ad8..fec3364a 100644 --- a/Items/StarSmithy.cs +++ b/Items/StarSmithy.cs @@ -4,52 +4,54 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class StarSmithy : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class StarSmithy : ModItem + { + public override void SetDefaults() + { - item.width = 46; - item.height = 46; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 150; - item.createTile = mod.TileType("StarvilTile"); - } + item.width = 46; + item.height = 46; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 150; + item.createTile = mod.TileType("StarvilTile"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Starvil"); - Tooltip.SetDefault("Allows you to treat space materials"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Starvil"); + Tooltip.SetDefault("Allows you to treat space materials"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.MeteoriteBar, 15); - recipe.AddIngredient(ItemID.GoldBar, 15); - recipe.AddIngredient(null, "VoidBar", 15); - recipe.AddIngredient(null, "Squorb", 3); - recipe.AddIngredient(ItemID.FallenStar, 5); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.MeteoriteBar, 15); + recipe.AddIngredient(ItemID.GoldBar, 15); + recipe.AddIngredient(null, "VoidBar", 15); + recipe.AddIngredient(null, "Squorb", 3); + recipe.AddIngredient(ItemID.FallenStar, 5); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.MeteoriteBar, 15); - recipe.AddIngredient(ItemID.PlatinumBar, 15); - recipe.AddIngredient(null, "VoidBar", 15); - recipe.AddIngredient(null, "Squorb", 3); - recipe.AddIngredient(ItemID.FallenStar, 5); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } -}} + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.MeteoriteBar, 15); + recipe.AddIngredient(ItemID.PlatinumBar, 15); + recipe.AddIngredient(null, "VoidBar", 15); + recipe.AddIngredient(null, "Squorb", 3); + recipe.AddIngredient(ItemID.FallenStar, 5); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } +} diff --git a/Items/StardustBand.cs b/Items/StardustBand.cs index c5809b6a..b26432f2 100644 --- a/Items/StardustBand.cs +++ b/Items/StardustBand.cs @@ -13,20 +13,20 @@ public override void SetDefaults() { item.CloneDefaults(ItemID.Carrot); - item.rare = 11; - item.value = 380000; - item.useTime = 25; - item.useAnimation = 25; + item.rare = 11; + item.value = 380000; + item.useTime = 25; + item.useAnimation = 25; item.shoot = mod.ProjectileType("StardustSquid"); item.buffType = mod.BuffType("StardustSquidBuff"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Stardust Band"); - Tooltip.SetDefault("Summons a stardust squid"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Stardust Band"); + Tooltip.SetDefault("Summons a stardust squid"); + } public override void UseStyle(Player player) @@ -37,14 +37,14 @@ public override void UseStyle(Player player) } } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "UnchargedBand"); - recipe.AddIngredient(3459, 10); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "UnchargedBand"); + recipe.AddIngredient(3459, 10); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } } } diff --git a/Items/StardustRing.cs b/Items/StardustRing.cs index 92be6183..1d39da82 100644 --- a/Items/StardustRing.cs +++ b/Items/StardustRing.cs @@ -4,42 +4,44 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class StardustRing : ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 30; - item.height = 24; - item.value = 250000; - item.rare = 8; - item.accessory = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Stardust Ring "); - Tooltip.SetDefault("20% increased minion damage\nIncreases your maximum number of minions"); - } - - - public override void UpdateAccessory(Player player, bool hideVisual) - - { - player.minionDamage += 0.2f; - player.maxMinions += 2; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(3459, 10); - recipe.AddIngredient(3467, 15); - recipe.AddIngredient(null, "Band"); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } -}} + public class StardustRing : ModItem + { + + public override void SetDefaults() + { + + item.width = 30; + item.height = 24; + item.value = 250000; + item.rare = 8; + item.accessory = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Stardust Ring "); + Tooltip.SetDefault("20% increased minion damage\nIncreases your maximum number of minions"); + } + + + public override void UpdateAccessory(Player player, bool hideVisual) + + { + player.minionDamage += 0.2f; + player.maxMinions += 2; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(3459, 10); + recipe.AddIngredient(3467, 15); + recipe.AddIngredient(null, "Band"); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } +} diff --git a/Items/StarfallTome.cs b/Items/StarfallTome.cs index d452448f..344f1643 100644 --- a/Items/StarfallTome.cs +++ b/Items/StarfallTome.cs @@ -5,35 +5,36 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class StarfallTome : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class StarfallTome : ModItem + { + public override void SetDefaults() + { - item.damage = 25; - item.melee = false; - item.magic = true; - item.width = 50; - item.height = 55; - item.useTime = 30; - item.mana = 20; - item.useAnimation = 30; - item.useStyle = 5; - item.shoot = 9; - item.shootSpeed = 30f; - item.knockBack = 3; - item.value = 30000; - item.rare = 3; - item.UseSound = SoundID.Item4; - item.autoReuse = false; - } + item.damage = 25; + item.melee = false; + item.magic = true; + item.width = 50; + item.height = 55; + item.useTime = 30; + item.mana = 20; + item.useAnimation = 30; + item.useStyle = 5; + item.shoot = 9; + item.shootSpeed = 30f; + item.knockBack = 3; + item.value = 30000; + item.rare = 3; + item.UseSound = SoundID.Item4; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Starfall Tome"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Starfall Tome"); + Tooltip.SetDefault(""); + } -} + } } diff --git a/Items/StarlightGlimmer.cs b/Items/StarlightGlimmer.cs index 30c5162b..3d37fecc 100644 --- a/Items/StarlightGlimmer.cs +++ b/Items/StarlightGlimmer.cs @@ -11,55 +11,55 @@ public class StarlightGlimmer : ModItem { public override void SetDefaults() { - item.autoReuse = true; - item.useStyle = 5; - item.useAnimation = 12; - item.useTime = 12; + item.autoReuse = true; + item.useStyle = 5; + item.useAnimation = 12; + item.useTime = 12; - item.width = 50; - item.height = 18; - item.shoot = 12; - item.useAmmo = AmmoID.FallenStar; - item.UseSound = SoundID.Item9; - item.damage = 228; - item.shootSpeed = 14f; - item.noMelee = true; - item.value = 1000000; - item.rare = 2; + item.width = 50; + item.height = 18; + item.shoot = 12; + item.useAmmo = AmmoID.FallenStar; + item.UseSound = SoundID.Item9; + item.damage = 228; + item.shootSpeed = 14f; + item.noMelee = true; + item.value = 1000000; + item.rare = 2; - item.ranged = true; + item.ranged = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Starlight Glimmer"); - Tooltip.SetDefault("Shoots fallen stars"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Starlight Glimmer"); + Tooltip.SetDefault("Shoots fallen stars"); + } -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) -{ - for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. - { - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); - } - return false; -} + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. + { + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); + } + return false; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.StarCannon, 1); - recipe.AddIngredient(null, "Doomstone", 16); - recipe.AddIngredient(3467, 20); - recipe.AddIngredient(ItemID.MeteoriteBar, 20); - recipe.AddIngredient(ItemID.FallenStar, 25); - recipe.AddIngredient(null, "ConcentratedEther", 28); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.StarCannon, 1); + recipe.AddIngredient(null, "Doomstone", 16); + recipe.AddIngredient(3467, 20); + recipe.AddIngredient(ItemID.MeteoriteBar, 20); + recipe.AddIngredient(ItemID.FallenStar, 25); + recipe.AddIngredient(null, "ConcentratedEther", 28); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } } } diff --git a/Items/Starmine.cs b/Items/Starmine.cs index de01879d..2bfc49a4 100644 --- a/Items/Starmine.cs +++ b/Items/Starmine.cs @@ -4,36 +4,38 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Starmine : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Starmine : ModItem + { + public override void SetDefaults() + { - item.damage = 325; - item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("StarminePro"); - item.shootSpeed = 22f; - item.useStyle = 1; - item.knockBack = 4; - item.value = 10000; - item.rare = 11; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 325; + item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("StarminePro"); + item.shootSpeed = 22f; + item.useStyle = 1; + item.knockBack = 4; + item.value = 10000; + item.rare = 11; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Starmine"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Starmine"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/StartrooperFlameburstPistol.cs b/Items/StartrooperFlameburstPistol.cs index ffa605df..695857c7 100644 --- a/Items/StartrooperFlameburstPistol.cs +++ b/Items/StartrooperFlameburstPistol.cs @@ -4,36 +4,37 @@ using Terraria.ModLoader; using Microsoft.Xna.Framework; -namespace Tremor.Items { -public class StartrooperFlameburstPistol : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class StartrooperFlameburstPistol : ModItem + { + public override void SetDefaults() + { - item.damage = 248; - item.width = 30; - item.height = 20; - item.ranged = true; - item.useTime = 30; - item.shoot = 666; + item.damage = 248; + item.width = 30; + item.height = 20; + item.ranged = true; + item.useTime = 30; + item.shoot = 666; - item.shootSpeed = 20f; - item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 5; - item.value = 450000; - item.useAmmo = AmmoID.Bullet; - item.rare = 11; - item.crit = 7; - item.UseSound = SoundID.Item11; - item.autoReuse = true; - } + item.shootSpeed = 20f; + item.useAnimation = 30; + item.useStyle = 5; + item.knockBack = 5; + item.value = 450000; + item.useAmmo = AmmoID.Bullet; + item.rare = 11; + item.crit = 7; + item.UseSound = SoundID.Item11; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Startrooper Flameburst Pistol"); - Tooltip.SetDefault("Uses bullets as ammo"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Startrooper Flameburst Pistol"); + Tooltip.SetDefault("Uses bullets as ammo"); + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { @@ -41,8 +42,9 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX return base.Shoot(player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack); } - public override Vector2? HoldoutOffset() - { - return new Vector2(-2, 2); - } -}} + public override Vector2? HoldoutOffset() + { + return new Vector2(-2, 2); + } + } +} diff --git a/Items/SteelAxe.cs b/Items/SteelAxe.cs index 0f2749fe..bae19b66 100644 --- a/Items/SteelAxe.cs +++ b/Items/SteelAxe.cs @@ -4,41 +4,43 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SteelAxe : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SteelAxe : ModItem + { + public override void SetDefaults() + { - item.damage = 10; - item.melee = true; - item.width = 32; - item.height = 32; - item.useTime = 17; - item.useAnimation = 27; - item.axe = 9; - item.useStyle = 1; - item.knockBack = 4; - item.value = 600; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 10; + item.melee = true; + item.width = 32; + item.height = 32; + item.useTime = 17; + item.useAnimation = 27; + item.axe = 9; + item.useStyle = 1; + item.knockBack = 4; + item.value = 600; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Steel Axe"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Steel Axe"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "SteelBar", 11); -recipe.AddIngredient(ItemID.Wood, 3); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "SteelBar", 11); + recipe.AddIngredient(ItemID.Wood, 3); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/SteelBar.cs b/Items/SteelBar.cs index b67fb5e3..6287d3a4 100644 --- a/Items/SteelBar.cs +++ b/Items/SteelBar.cs @@ -4,47 +4,49 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SteelBar : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SteelBar : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 300; - item.rare = 1; - item.createTile = mod.TileType("SteelBar"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 300; + item.rare = 1; + item.createTile = mod.TileType("SteelBar"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Steel Bar"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Steel Bar"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.IronBar, 2); - recipe.AddIngredient(null, "Charcoal", 2); - recipe.SetResult(this); - recipe.AddTile(null, "BlastFurnace"); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.IronBar, 2); + recipe.AddIngredient(null, "Charcoal", 2); + recipe.SetResult(this); + recipe.AddTile(null, "BlastFurnace"); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.LeadBar, 2); - recipe.AddIngredient(null, "Charcoal", 2); - recipe.SetResult(this); - recipe.AddTile(null, "BlastFurnace"); - recipe.AddRecipe(); - } -}} + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.LeadBar, 2); + recipe.AddIngredient(null, "Charcoal", 2); + recipe.SetResult(this); + recipe.AddTile(null, "BlastFurnace"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/SteelBow.cs b/Items/SteelBow.cs index aac130b0..56c3b863 100644 --- a/Items/SteelBow.cs +++ b/Items/SteelBow.cs @@ -5,47 +5,49 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SteelBow : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SteelBow : ModItem + { + public override void SetDefaults() + { - item.damage = 12; - item.ranged = true; - item.width = 16; - item.height = 32; - item.useTime = 30; - item.shoot = 1; - item.shootSpeed = 11f; - item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 5; - item.value = 540; - item.useAmmo = AmmoID.Arrow; - item.rare = 1; - item.UseSound = SoundID.Item5; - item.autoReuse = false; - } + item.damage = 12; + item.ranged = true; + item.width = 16; + item.height = 32; + item.useTime = 30; + item.shoot = 1; + item.shootSpeed = 11f; + item.useAnimation = 30; + item.useStyle = 5; + item.knockBack = 5; + item.value = 540; + item.useAmmo = AmmoID.Arrow; + item.rare = 1; + item.UseSound = SoundID.Item5; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Steel Bow"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Steel Bow"); + Tooltip.SetDefault(""); + } - public override Vector2? HoldoutOffset() - { - return new Vector2(-1, 0); - } + public override Vector2? HoldoutOffset() + { + return new Vector2(-1, 0); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "SteelBar", 9); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "SteelBar", 9); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/SteelBroadsword.cs b/Items/SteelBroadsword.cs index 6b9a1b56..473676ef 100644 --- a/Items/SteelBroadsword.cs +++ b/Items/SteelBroadsword.cs @@ -3,40 +3,42 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { -public class SteelBroadsword : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SteelBroadsword : ModItem + { + public override void SetDefaults() + { - item.damage = 12; - item.melee = true; - item.width = 42; - item.height = 42; - item.useTime = 21; - item.useAnimation = 21; - item.useStyle = 1; - item.knockBack = 6; - item.value = 660; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 12; + item.melee = true; + item.width = 42; + item.height = 42; + item.useTime = 21; + item.useAnimation = 21; + item.useStyle = 1; + item.knockBack = 6; + item.value = 660; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Steel Broadsword"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Steel Broadsword"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "SteelBar", 10); - recipe.AddIngredient(ItemID.Wood,4); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "SteelBar", 10); + recipe.AddIngredient(ItemID.Wood, 4); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/SteelChestplate.cs b/Items/SteelChestplate.cs index f8e29641..4b7e4829 100644 --- a/Items/SteelChestplate.cs +++ b/Items/SteelChestplate.cs @@ -5,40 +5,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class SteelChestplate : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Body)] + public class SteelChestplate : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 18; + item.width = 26; + item.height = 18; - item.value = 600; - item.rare = 1; - item.defense = 5; - } + item.value = 600; + item.rare = 1; + item.defense = 5; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Steel Chestplate"); - Tooltip.SetDefault("3% increased ranged critical strike chance"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Steel Chestplate"); + Tooltip.SetDefault("3% increased ranged critical strike chance"); + } - public override void UpdateEquip(Player player) - { - player.rangedCrit += 3; - } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "SteelBar", 23); - recipe.AddIngredient(null, "LeatherShirt", 1); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void UpdateEquip(Player player) + { + player.rangedCrit += 3; + } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "SteelBar", 23); + recipe.AddIngredient(null, "LeatherShirt", 1); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/SteelGreaves.cs b/Items/SteelGreaves.cs index 7e240717..57339950 100644 --- a/Items/SteelGreaves.cs +++ b/Items/SteelGreaves.cs @@ -4,40 +4,43 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class SteelGreaves : ModItem +namespace Tremor.Items { - - - public override void SetDefaults() - { - - item.width = 22; - item.height = 18; - item.value = 500; - - item.rare = 1; - item.defense = 4; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Steel Greaves"); - Tooltip.SetDefault("3% increased magic critical strike chance"); - } - - - public override void UpdateEquip(Player player) - { - player.magicCrit += 3; - } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "SteelBar", 15); - recipe.AddIngredient(null, "LeatherGreaves", 1); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + [AutoloadEquip(EquipType.Legs)] + public class SteelGreaves : ModItem + { + + + public override void SetDefaults() + { + + item.width = 22; + item.height = 18; + item.value = 500; + + item.rare = 1; + item.defense = 4; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Steel Greaves"); + Tooltip.SetDefault("3% increased magic critical strike chance"); + } + + + public override void UpdateEquip(Player player) + { + player.magicCrit += 3; + } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "SteelBar", 15); + recipe.AddIngredient(null, "LeatherGreaves", 1); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/SteelHammer.cs b/Items/SteelHammer.cs index ad0d4246..c5311bcd 100644 --- a/Items/SteelHammer.cs +++ b/Items/SteelHammer.cs @@ -4,41 +4,43 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SteelHammer : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SteelHammer : ModItem + { + public override void SetDefaults() + { - item.damage = 10; - item.melee = true; - item.width = 32; - item.height = 32; - item.useTime = 17; - item.useAnimation = 27; - item.hammer = 45; - item.useStyle = 1; - item.knockBack = 4; - item.value = 600; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 10; + item.melee = true; + item.width = 32; + item.height = 32; + item.useTime = 17; + item.useAnimation = 27; + item.hammer = 45; + item.useStyle = 1; + item.knockBack = 4; + item.value = 600; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Steel Hammer"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Steel Hammer"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "SteelBar", 9); -recipe.AddIngredient(ItemID.Wood, 3); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "SteelBar", 9); + recipe.AddIngredient(ItemID.Wood, 3); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/SteelHelmet.cs b/Items/SteelHelmet.cs index 36bdc98e..6203b5ed 100644 --- a/Items/SteelHelmet.cs +++ b/Items/SteelHelmet.cs @@ -4,58 +4,61 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class SteelHelmet : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class SteelHelmet : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 32; - item.height = 26; + item.width = 32; + item.height = 26; - item.value = 400; - item.rare = 1; - item.defense = 4; - } + item.value = 400; + item.rare = 1; + item.defense = 4; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Steel Helmet"); - Tooltip.SetDefault("3% increased melee critical strike chance"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Steel Helmet"); + Tooltip.SetDefault("3% increased melee critical strike chance"); + } - public override void UpdateEquip(Player player) - { - player.meleeCrit += 3; - } + public override void UpdateEquip(Player player) + { + player.meleeCrit += 3; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("SteelChestplate") && legs.type == mod.ItemType("SteelGreaves"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("SteelChestplate") && legs.type == mod.ItemType("SteelGreaves"); + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increased maximum defense by 10"; - player.statDefense += 10; - player.moveSpeed -= 0.25f; - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increased maximum defense by 10"; + player.statDefense += 10; + player.moveSpeed -= 0.25f; + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawShadowSubtle=true; + player.armorEffectDrawShadowSubtle = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "SteelBar", 12); - recipe.AddIngredient(null, "LeatherHat", 1); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "SteelBar", 12); + recipe.AddIngredient(null, "LeatherHat", 1); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/SteelPickaxe.cs b/Items/SteelPickaxe.cs index 34ef11a1..d25df8ec 100644 --- a/Items/SteelPickaxe.cs +++ b/Items/SteelPickaxe.cs @@ -4,41 +4,43 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SteelPickaxe : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SteelPickaxe : ModItem + { + public override void SetDefaults() + { - item.damage = 6; - item.melee = true; - item.width = 32; - item.height = 32; - item.useTime = 16; - item.useAnimation = 20; - item.pick = 55; - item.useStyle = 1; - item.knockBack = 2; - item.value = 1000; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 6; + item.melee = true; + item.width = 32; + item.height = 32; + item.useTime = 16; + item.useAnimation = 20; + item.pick = 55; + item.useStyle = 1; + item.knockBack = 2; + item.value = 1000; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Steel Pickaxe"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Steel Pickaxe"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "SteelBar", 14); - recipe.AddIngredient(ItemID.Wood, 3); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "SteelBar", 14); + recipe.AddIngredient(ItemID.Wood, 3); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/SteelSpear.cs b/Items/SteelSpear.cs index 75feb4b1..d55c88a0 100644 --- a/Items/SteelSpear.cs +++ b/Items/SteelSpear.cs @@ -4,43 +4,45 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SteelSpear : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SteelSpear : ModItem + { + public override void SetDefaults() + { - item.damage = 16; - item.width = 54; - item.height = 54; - item.noUseGraphic = true; - item.melee = true; - item.useTime = 30; - item.shoot = mod.ProjectileType("SteelSpear"); - item.shootSpeed = 3f; - item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 4; - item.value = 1000; - item.rare = 0; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 16; + item.width = 54; + item.height = 54; + item.noUseGraphic = true; + item.melee = true; + item.useTime = 30; + item.shoot = mod.ProjectileType("SteelSpear"); + item.shootSpeed = 3f; + item.useAnimation = 30; + item.useStyle = 5; + item.knockBack = 4; + item.value = 1000; + item.rare = 0; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Steel Spear"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Steel Spear"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "SteelBar", 13); - recipe.AddIngredient(ItemID.Wood, 6); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "SteelBar", 13); + recipe.AddIngredient(ItemID.Wood, 6); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/StickyFlail.cs b/Items/StickyFlail.cs index cdc9f7fe..70cd23d8 100644 --- a/Items/StickyFlail.cs +++ b/Items/StickyFlail.cs @@ -7,35 +7,35 @@ namespace Tremor.Items { - public class StickyFlail : ModItem - { - public override void SetDefaults() - { + public class StickyFlail : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 10; - item.value = Item.sellPrice(0, 2, 0, 0); - item.rare = 3; - item.noMelee = true; - item.useStyle = 5; - item.useAnimation = 40; - item.useTime = 40; - item.knockBack = 7.5F; - item.damage = 22; - item.scale = 1.1F; - item.noUseGraphic = true; - item.shoot = mod.ProjectileType("StickyFlailPro"); - item.shootSpeed = 15.9F; - item.UseSound = SoundID.Item1; - item.melee = true; - item.channel = true; - } + item.width = 30; + item.height = 10; + item.value = Item.sellPrice(0, 2, 0, 0); + item.rare = 3; + item.noMelee = true; + item.useStyle = 5; + item.useAnimation = 40; + item.useTime = 40; + item.knockBack = 7.5F; + item.damage = 22; + item.scale = 1.1F; + item.noUseGraphic = true; + item.shoot = mod.ProjectileType("StickyFlailPro"); + item.shootSpeed = 15.9F; + item.UseSound = SoundID.Item1; + item.melee = true; + item.channel = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sticky Flail"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sticky Flail"); + Tooltip.SetDefault(""); + } - } + } } diff --git a/Items/Stigmata.cs b/Items/Stigmata.cs index 4bab1dd6..de2652af 100644 --- a/Items/Stigmata.cs +++ b/Items/Stigmata.cs @@ -4,55 +4,57 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Stigmata : ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 24; - item.height = 28; - - item.value = 20000; - item.rare = 2; - item.accessory = true; - item.defense = 1; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Stigmata"); - Tooltip.SetDefault("The less health, the more damage..."); - } - - - public override void UpdateAccessory(Player player, bool hideVisual) - - { - if (player.statLife < 50) - { - player.magicDamage += 0.20f; - player.meleeDamage += 0.20f; - player.rangedDamage += 0.20f; - } - if (player.statLife < 100) - { - player.magicDamage += 0.15f; - player.meleeDamage += 0.15f; - player.rangedDamage += 0.15f; - } - if (player.statLife < 200) - { - player.magicDamage += 0.10f; - player.meleeDamage += 0.10f; - player.rangedDamage += 0.10f; - } - if (player.statLife < 300) - { - player.magicDamage += 0.05f; - player.meleeDamage += 0.05f; - player.rangedDamage += 0.05f; - } - } -}} + public class Stigmata : ModItem + { + + public override void SetDefaults() + { + + item.width = 24; + item.height = 28; + + item.value = 20000; + item.rare = 2; + item.accessory = true; + item.defense = 1; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Stigmata"); + Tooltip.SetDefault("The less health, the more damage..."); + } + + + public override void UpdateAccessory(Player player, bool hideVisual) + + { + if (player.statLife < 50) + { + player.magicDamage += 0.20f; + player.meleeDamage += 0.20f; + player.rangedDamage += 0.20f; + } + if (player.statLife < 100) + { + player.magicDamage += 0.15f; + player.meleeDamage += 0.15f; + player.rangedDamage += 0.15f; + } + if (player.statLife < 200) + { + player.magicDamage += 0.10f; + player.meleeDamage += 0.10f; + player.rangedDamage += 0.10f; + } + if (player.statLife < 300) + { + player.magicDamage += 0.05f; + player.meleeDamage += 0.05f; + player.rangedDamage += 0.05f; + } + } + } +} diff --git a/Items/StoneBathtub.cs b/Items/StoneBathtub.cs index 23f773c8..f313f1cc 100644 --- a/Items/StoneBathtub.cs +++ b/Items/StoneBathtub.cs @@ -19,26 +19,26 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 0; item.createTile = mod.TileType("StoneBathtub"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Stone Bathtub"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Stone Bathtub"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(3, 14); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(3, 14); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/StoneBed.cs b/Items/StoneBed.cs index eaa0f4b7..7fdf261e 100644 --- a/Items/StoneBed.cs +++ b/Items/StoneBed.cs @@ -19,27 +19,27 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 0; item.createTile = mod.TileType("StoneBed"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Stone Bed"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Stone Bed"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(3, 15); - recipe.AddIngredient(ItemID.Silk, 5); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(3, 15); + recipe.AddIngredient(ItemID.Silk, 5); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/StoneBench.cs b/Items/StoneBench.cs index 17e4b7aa..ce4e0259 100644 --- a/Items/StoneBench.cs +++ b/Items/StoneBench.cs @@ -19,26 +19,26 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 0; item.createTile = mod.TileType("StoneBench"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Stone Bench"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Stone Bench"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(3, 8); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(3, 8); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/StoneBookcase.cs b/Items/StoneBookcase.cs index 88499eac..6ed24ce1 100644 --- a/Items/StoneBookcase.cs +++ b/Items/StoneBookcase.cs @@ -19,27 +19,27 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 0; item.createTile = mod.TileType("StoneBookcase"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Stone Bookcase"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Stone Bookcase"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(3, 20); - recipe.AddIngredient(ItemID.Book, 10); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(3, 20); + recipe.AddIngredient(ItemID.Book, 10); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/StoneChair.cs b/Items/StoneChair.cs index 3a8a9b99..41d12d58 100644 --- a/Items/StoneChair.cs +++ b/Items/StoneChair.cs @@ -19,26 +19,26 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 0; item.createTile = mod.TileType("StoneChair"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Stone Chair"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Stone Chair"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(3, 4); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(3, 4); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/StoneChest.cs b/Items/StoneChest.cs index 1836da70..ab1f5b15 100644 --- a/Items/StoneChest.cs +++ b/Items/StoneChest.cs @@ -19,34 +19,34 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 0; item.createTile = mod.TileType("StoneChest"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Stone Chest"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Stone Chest"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(3, 8); - recipe.AddIngredient(ItemID.IronBar, 2); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(3, 8); + recipe.AddIngredient(ItemID.IronBar, 2); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(3, 8); - recipe.AddIngredient(ItemID.LeadBar, 2); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + recipe = new ModRecipe(mod); + recipe.AddIngredient(3, 8); + recipe.AddIngredient(ItemID.LeadBar, 2); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/StoneChestplate.cs b/Items/StoneChestplate.cs index f2022584..b5bdc0a0 100644 --- a/Items/StoneChestplate.cs +++ b/Items/StoneChestplate.cs @@ -5,41 +5,43 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class StoneChestplate : ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 26; - item.height = 18; - - item.value = 0; - item.rare = 1; - item.defense = 3; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Stone Chestplate"); - Tooltip.SetDefault("4% increased melee damage"); - } - - - public override void UpdateEquip(Player player) - { - player.meleeDamage += 0.04f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.StoneBlock, 75); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } - -}} + [AutoloadEquip(EquipType.Body)] + public class StoneChestplate : ModItem + { + + public override void SetDefaults() + { + + item.width = 26; + item.height = 18; + + item.value = 0; + item.rare = 1; + item.defense = 3; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Stone Chestplate"); + Tooltip.SetDefault("4% increased melee damage"); + } + + + public override void UpdateEquip(Player player) + { + player.meleeDamage += 0.04f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.StoneBlock, 75); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + + } +} diff --git a/Items/StoneDoor.cs b/Items/StoneDoor.cs index b2886461..7daf92bb 100644 --- a/Items/StoneDoor.cs +++ b/Items/StoneDoor.cs @@ -19,26 +19,26 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 10; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 0; item.createTile = mod.TileType("StoneDoorClosed"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Stone Door"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Stone Door"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(3, 6); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(3, 6); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/StoneDresser.cs b/Items/StoneDresser.cs index 8a4396c2..982c33c4 100644 --- a/Items/StoneDresser.cs +++ b/Items/StoneDresser.cs @@ -19,26 +19,26 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 0; item.createTile = mod.TileType("StoneDresser"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Stone Dresser"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Stone Dresser"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(3, 16); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(3, 16); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/StoneFishBanner.cs b/Items/StoneFishBanner.cs index 583eaa32..e088959e 100644 --- a/Items/StoneFishBanner.cs +++ b/Items/StoneFishBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class StoneFishBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class StoneFishBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 0, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 102; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 0, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 102; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Stone Fish Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Stone Fish Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/StoneGrandfatherClock.cs b/Items/StoneGrandfatherClock.cs index 97deea43..8e092ad3 100644 --- a/Items/StoneGrandfatherClock.cs +++ b/Items/StoneGrandfatherClock.cs @@ -19,37 +19,37 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 0; item.createTile = mod.TileType("StoneGrandfatherClock"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Stone Grandfather Clock"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Stone Grandfather Clock"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.IronBar, 3); - recipe.AddIngredient(ItemID.Glass, 6); - recipe.AddIngredient(3, 10); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.IronBar, 3); + recipe.AddIngredient(ItemID.Glass, 6); + recipe.AddIngredient(3, 10); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.LeadBar, 3); - recipe.AddIngredient(ItemID.Glass, 6); - recipe.AddIngredient(3, 10); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.LeadBar, 3); + recipe.AddIngredient(ItemID.Glass, 6); + recipe.AddIngredient(3, 10); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/StoneHelmet.cs b/Items/StoneHelmet.cs index 4987dfab..002a9d83 100644 --- a/Items/StoneHelmet.cs +++ b/Items/StoneHelmet.cs @@ -5,51 +5,54 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class StoneHelmet : ModItem +namespace Tremor.Items { - - - public override void SetDefaults() - { - - item.width = 18; - item.height = 18; - - item.value = 0; - item.rare = 1; - item.defense = 2; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Stone Helmet"); - Tooltip.SetDefault("4% increased melee damage"); - } - - - public override void UpdateEquip(Player player) - { - player.meleeDamage += 0.04f; - } - - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("StoneChestplate") && legs.type == mod.ItemType("StoneLeggings"); - } - - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increased maximum defense by 2"; -player.statDefense += 2; - player.moveSpeed -= 0.25f; - } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.StoneBlock, 40); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + [AutoloadEquip(EquipType.Head)] + public class StoneHelmet : ModItem + { + + + public override void SetDefaults() + { + + item.width = 18; + item.height = 18; + + item.value = 0; + item.rare = 1; + item.defense = 2; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Stone Helmet"); + Tooltip.SetDefault("4% increased melee damage"); + } + + + public override void UpdateEquip(Player player) + { + player.meleeDamage += 0.04f; + } + + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("StoneChestplate") && legs.type == mod.ItemType("StoneLeggings"); + } + + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increased maximum defense by 2"; + player.statDefense += 2; + player.moveSpeed -= 0.25f; + } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.StoneBlock, 40); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/StoneLeggings.cs b/Items/StoneLeggings.cs index 1918d3a0..26b83aaa 100644 --- a/Items/StoneLeggings.cs +++ b/Items/StoneLeggings.cs @@ -5,40 +5,43 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class StoneLeggings : ModItem +namespace Tremor.Items { - - - public override void SetDefaults() - { - - item.width = 22; - item.height = 18; - item.value = 0; - - item.rare = 1; - item.defense = 2; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Stone Leggings"); - Tooltip.SetDefault("4% increased melee damage"); - } - - - public override void UpdateEquip(Player player) - { - player.meleeDamage += 0.04f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.StoneBlock, 50); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + [AutoloadEquip(EquipType.Legs)] + public class StoneLeggings : ModItem + { + + + public override void SetDefaults() + { + + item.width = 22; + item.height = 18; + item.value = 0; + + item.rare = 1; + item.defense = 2; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Stone Leggings"); + Tooltip.SetDefault("4% increased melee damage"); + } + + + public override void UpdateEquip(Player player) + { + player.meleeDamage += 0.04f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.StoneBlock, 50); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/StonePiano.cs b/Items/StonePiano.cs index 249337cf..c4d6b3c8 100644 --- a/Items/StonePiano.cs +++ b/Items/StonePiano.cs @@ -19,28 +19,28 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 0; item.createTile = mod.TileType("StonePiano"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Stone Piano"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Stone Piano"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(154, 4); - recipe.AddIngredient(3, 15); - recipe.AddIngredient(149); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(154, 4); + recipe.AddIngredient(3, 15); + recipe.AddIngredient(149); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/StonePlatform.cs b/Items/StonePlatform.cs index 71598f33..1ac8248b 100644 --- a/Items/StonePlatform.cs +++ b/Items/StonePlatform.cs @@ -19,26 +19,26 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 0; item.createTile = mod.TileType("StonePlatform"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Stone Platform"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Stone Platform"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(3, 1); - recipe.SetResult(this, 2); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(3, 1); + recipe.SetResult(this, 2); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/StoneSink.cs b/Items/StoneSink.cs index 8109bab4..f7de05a7 100644 --- a/Items/StoneSink.cs +++ b/Items/StoneSink.cs @@ -19,27 +19,27 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("StoneSink"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Stone Sink"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Stone Sink"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(3, 6); - recipe.AddIngredient(206); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(3, 6); + recipe.AddIngredient(206); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/StoneTable.cs b/Items/StoneTable.cs index c04983e1..33395759 100644 --- a/Items/StoneTable.cs +++ b/Items/StoneTable.cs @@ -19,26 +19,26 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("StoneTable"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Stone Table"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Stone Table"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(3, 8); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(3, 8); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/StoneWorkbench.cs b/Items/StoneWorkbench.cs index 057fb89a..1caf29da 100644 --- a/Items/StoneWorkbench.cs +++ b/Items/StoneWorkbench.cs @@ -19,26 +19,26 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("StoneWorkbench"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Stone Work Bench"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Stone Work Bench"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(3, 10); - recipe.SetResult(this); - recipe.AddTile(17); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(3, 10); + recipe.SetResult(this); + recipe.AddTile(17); + recipe.AddRecipe(); + } } } diff --git a/Items/StoneofKnowledge.cs b/Items/StoneofKnowledge.cs index cc749fff..b9d97370 100644 --- a/Items/StoneofKnowledge.cs +++ b/Items/StoneofKnowledge.cs @@ -4,73 +4,73 @@ namespace Tremor.Items { - public class StoneofKnowledge : ModItem - { - public override void SetDefaults() - { + public class StoneofKnowledge : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 30; - item.maxStack = 1; + item.width = 30; + item.height = 30; + item.maxStack = 1; - item.rare = 12; - item.maxStack = 20; - item.useAnimation = 45; - item.useTime = 45; - item.useStyle = 4; - item.UseSound = SoundID.Item44; - item.consumable = true; - } + item.rare = 12; + item.maxStack = 20; + item.useAnimation = 45; + item.useTime = 45; + item.useStyle = 4; + item.UseSound = SoundID.Item44; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Stone of Knowledge"); - Tooltip.SetDefault("Summons the Trinity"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Stone of Knowledge"); + Tooltip.SetDefault("Summons the Trinity"); + } - public override bool CanUseItem(Player player) - { - return !Main.dayTime && Main.hardMode && NPC.downedMechBossAny && !NPC.AnyNPCs(mod.NPCType("SoulofHope")) && !NPC.AnyNPCs(mod.NPCType("SoulofTrust")) && !NPC.AnyNPCs(mod.NPCType("SoulofTruth")); - } - public override bool UseItem(Player player) - { -Main.NewText("The Trinity has awoken!", 175, 75, 255); - Main.PlaySound(15, (int)player.position.X, (int)player.position.Y, 0); - if(Main.netMode !=1) - { - int b1ID = Terraria.NPC.NewNPC((int)player.Center.X - 300, (int)player.Center.Y - 800, mod.NPCType("SoulofHope")); - int b2ID = Terraria.NPC.NewNPC((int)player.Center.X, (int)player.Center.Y - 300, mod.NPCType("SoulofTrust")); - int b3ID = Terraria.NPC.NewNPC((int)player.Center.X + 100, (int)player.Center.Y - 500, mod.NPCType("SoulofTruth")); - Main.npc[b1ID].ai[2] = b2ID; - Main.npc[b1ID].ai[3] = b3ID; - Main.npc[b2ID].ai[2] = b1ID; - Main.npc[b2ID].ai[3] = b3ID; - Main.npc[b3ID].ai[2] = b1ID; - Main.npc[b3ID].ai[3] = b2ID; - } - return true; - } + public override bool CanUseItem(Player player) + { + return !Main.dayTime && Main.hardMode && NPC.downedMechBossAny && !NPC.AnyNPCs(mod.NPCType("SoulofHope")) && !NPC.AnyNPCs(mod.NPCType("SoulofTrust")) && !NPC.AnyNPCs(mod.NPCType("SoulofTruth")); + } + public override bool UseItem(Player player) + { + Main.NewText("The Trinity has awoken!", 175, 75, 255); + Main.PlaySound(15, (int)player.position.X, (int)player.position.Y, 0); + if (Main.netMode != 1) + { + int b1ID = Terraria.NPC.NewNPC((int)player.Center.X - 300, (int)player.Center.Y - 800, mod.NPCType("SoulofHope")); + int b2ID = Terraria.NPC.NewNPC((int)player.Center.X, (int)player.Center.Y - 300, mod.NPCType("SoulofTrust")); + int b3ID = Terraria.NPC.NewNPC((int)player.Center.X + 100, (int)player.Center.Y - 500, mod.NPCType("SoulofTruth")); + Main.npc[b1ID].ai[2] = b2ID; + Main.npc[b1ID].ai[3] = b3ID; + Main.npc[b2ID].ai[2] = b1ID; + Main.npc[b2ID].ai[3] = b3ID; + Main.npc[b3ID].ai[2] = b1ID; + Main.npc[b3ID].ai[3] = b2ID; + } + return true; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(3467, 20); - recipe.AddIngredient(null, "StoneDice", 1); - recipe.AddIngredient(ItemID.CelestialSigil, 1); - recipe.AddIngredient(null, "NightmareBar", 10); - recipe.AddIngredient(null, "EyeofOblivion", 6); - recipe.AddIngredient(null, "SoulofFight", 12); - recipe.AddIngredient(ItemID.Topaz, 5); - recipe.AddIngredient(ItemID.Ruby, 5); - recipe.AddIngredient(ItemID.Emerald, 5); - recipe.AddIngredient(null, "CarbonSteel", 6); - recipe.AddIngredient(null, "Phantaplasm", 5); - recipe.AddIngredient(null, "CosmicFuel", 1); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(3467, 20); + recipe.AddIngredient(null, "StoneDice", 1); + recipe.AddIngredient(ItemID.CelestialSigil, 1); + recipe.AddIngredient(null, "NightmareBar", 10); + recipe.AddIngredient(null, "EyeofOblivion", 6); + recipe.AddIngredient(null, "SoulofFight", 12); + recipe.AddIngredient(ItemID.Topaz, 5); + recipe.AddIngredient(ItemID.Ruby, 5); + recipe.AddIngredient(ItemID.Emerald, 5); + recipe.AddIngredient(null, "CarbonSteel", 6); + recipe.AddIngredient(null, "Phantaplasm", 5); + recipe.AddIngredient(null, "CosmicFuel", 1); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } - } + } } diff --git a/Items/StoneofLife.cs b/Items/StoneofLife.cs index bd77db62..d28cef1d 100644 --- a/Items/StoneofLife.cs +++ b/Items/StoneofLife.cs @@ -4,23 +4,25 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class StoneofLife : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class StoneofLife : ModItem + { + public override void SetDefaults() + { - item.width = 24; - item.height = 16; - item.maxStack = 99; - item.value = 500; - item.rare = 1; - } + item.width = 24; + item.height = 16; + item.maxStack = 99; + item.value = 500; + item.rare = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Stone of Life"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Stone of Life"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/StormBlade.cs b/Items/StormBlade.cs index 244e086d..775d0598 100644 --- a/Items/StormBlade.cs +++ b/Items/StormBlade.cs @@ -5,39 +5,40 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class StormBlade : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class StormBlade : ModItem + { + public override void SetDefaults() + { - item.damage = 25; - item.melee = true; - item.width = 50; - item.height = 52; - item.useTime = 25; - item.useAnimation = 25; - item.useStyle = 1; - item.shoot = mod.ProjectileType("StormBladePro"); - item.shootSpeed = 10f; - item.knockBack = 4; - item.value = 30000; - item.rare = 3; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 25; + item.melee = true; + item.width = 50; + item.height = 52; + item.useTime = 25; + item.useAnimation = 25; + item.useStyle = 1; + item.shoot = mod.ProjectileType("StormBladePro"); + item.shootSpeed = 10f; + item.knockBack = 4; + item.value = 30000; + item.rare = 3; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Storm Blade"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Storm Blade"); + Tooltip.SetDefault(""); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 15); - } -} + public override void MeleeEffects(Player player, Rectangle hitbox) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 15); + } + } } diff --git a/Items/StormJelly.cs b/Items/StormJelly.cs index 42681b0c..8196d9f2 100644 --- a/Items/StormJelly.cs +++ b/Items/StormJelly.cs @@ -6,35 +6,36 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class StormJelly : ModItem -{ - public override void SetDefaults() - { +namespace Tremor.Items +{ + public class StormJelly : ModItem + { + public override void SetDefaults() + { - item.width = 28; - item.height = 32; - item.maxStack = 20; - item.useTurn = true; - item.autoReuse = false; - item.useAnimation = 18; - item.useTime = 18; - item.useStyle = 1; - item.consumable = true; - item.value = 150; - } + item.width = 28; + item.height = 32; + item.maxStack = 20; + item.useTurn = true; + item.autoReuse = false; + item.useAnimation = 18; + item.useTime = 18; + item.useStyle = 1; + item.consumable = true; + item.value = 150; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Storm Jelly"); - Tooltip.SetDefault("Summons Storm Jellyfish"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Storm Jelly"); + Tooltip.SetDefault("Summons Storm Jellyfish"); + } - public override bool CanUseItem(Player player) - { - return NPC.downedBoss1 && !NPC.AnyNPCs(mod.NPCType("StormJellyfish")); - } + public override bool CanUseItem(Player player) + { + return NPC.downedBoss1 && !NPC.AnyNPCs(mod.NPCType("StormJellyfish")); + } public override bool UseItem(Player player) { @@ -43,15 +44,16 @@ public override bool UseItem(Player player) return true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Gel, 25); - recipe.AddIngredient(null, "SeaFragment", 12); - recipe.AddIngredient(ItemID.Glowstick, 15); - recipe.AddIngredient(ItemID.Seashell, 3); - recipe.AddTile(16); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Gel, 25); + recipe.AddIngredient(null, "SeaFragment", 12); + recipe.AddIngredient(ItemID.Glowstick, 15); + recipe.AddIngredient(ItemID.Seashell, 3); + recipe.AddTile(16); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/StormJellyfishBag.cs b/Items/StormJellyfishBag.cs index 1a4b80b5..305a3cf4 100644 --- a/Items/StormJellyfishBag.cs +++ b/Items/StormJellyfishBag.cs @@ -4,60 +4,62 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class StormJellyfishBag : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class StormJellyfishBag : ModItem + { + public override void SetDefaults() + { - item.maxStack = 999; - item.consumable = true; - item.width = 24; - item.height = 24; + item.maxStack = 999; + item.consumable = true; + item.width = 24; + item.height = 24; - item.rare = 9; - item.expert = true; - bossBagNPC = mod.NPCType("StormJellyfish"); - } + item.rare = 9; + item.expert = true; + bossBagNPC = mod.NPCType("StormJellyfish"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Treasure Bag"); - Tooltip.SetDefault("Right click to open"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Treasure Bag"); + Tooltip.SetDefault("Right click to open"); + } - public override bool CanRightClick() - { - return true; - } + public override bool CanRightClick() + { + return true; + } - public override void OpenBossBag(Player player) - { - if(Main.rand.Next(7) == 0) - { - player.QuickSpawnItem(mod.ItemType("StormJellyfishMask")); - } - if(Main.rand.Next(4) == 0) - { - player.QuickSpawnItem(mod.ItemType("StormBlade")); - } - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("Poseidon")); - } - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("JellyfishStaff")); - } - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("BoltTome")); - } - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("StickyFlail")); - } - player.QuickSpawnItem(mod.ItemType("EnchantedHourglass")); - } -}} + public override void OpenBossBag(Player player) + { + if (Main.rand.Next(7) == 0) + { + player.QuickSpawnItem(mod.ItemType("StormJellyfishMask")); + } + if (Main.rand.Next(4) == 0) + { + player.QuickSpawnItem(mod.ItemType("StormBlade")); + } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("Poseidon")); + } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("JellyfishStaff")); + } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("BoltTome")); + } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("StickyFlail")); + } + player.QuickSpawnItem(mod.ItemType("EnchantedHourglass")); + } + } +} diff --git a/Items/StormJellyfishMask.cs b/Items/StormJellyfishMask.cs index 81cac38f..0e02f684 100644 --- a/Items/StormJellyfishMask.cs +++ b/Items/StormJellyfishMask.cs @@ -4,25 +4,28 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class StormJellyfishMask : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class StormJellyfishMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 36; - item.height = 24; - item.rare = 1; - item.vanity = true; - } + item.width = 36; + item.height = 24; + item.rare = 1; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Storm Jellyfish Mask"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Storm Jellyfish Mask"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/StormJellyfishTrophy.cs b/Items/StormJellyfishTrophy.cs index 4c63708e..22b1e669 100644 --- a/Items/StormJellyfishTrophy.cs +++ b/Items/StormJellyfishTrophy.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class StormJellyfishTrophy : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class StormJellyfishTrophy : ModItem + { + public override void SetDefaults() + { - item.width = 32; - item.height = 32; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 50000; - item.createTile = mod.TileType("StormJellyfishTrophyTile"); - item.placeStyle = 0; - } + item.width = 32; + item.height = 32; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 50000; + item.createTile = mod.TileType("StormJellyfishTrophyTile"); + item.placeStyle = 0; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Storm Jellyfish Trophy"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Storm Jellyfish Trophy"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/Stormtron.cs b/Items/Stormtron.cs index 08d396e5..0710977e 100644 --- a/Items/Stormtron.cs +++ b/Items/Stormtron.cs @@ -5,69 +5,71 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class Stormtron : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.damage = 63; - item.ranged = true; - item.width = 20; - item.height = 12; - item.useTime = 12; - item.useAnimation = 20; - item.useStyle = 5; - item.knockBack = 6; - item.value = 2100000; - item.rare = 10; - item.useStyle = 5; - item.UseSound = SoundID.Item36; - item.noMelee = true; - item.autoReuse = false; - item.shoot = 10; - item.shootSpeed = 23f; - item.useAmmo = AmmoID.Bullet; - } + public class Stormtron : ModItem + { + public override void SetDefaults() + { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Stormtron"); - Tooltip.SetDefault(""); - } + item.damage = 63; + item.ranged = true; + item.width = 20; + item.height = 12; + item.useTime = 12; + item.useAnimation = 20; + item.useStyle = 5; + item.knockBack = 6; + item.value = 2100000; + item.rare = 10; + item.useStyle = 5; + item.UseSound = SoundID.Item36; + item.noMelee = true; + item.autoReuse = false; + item.shoot = 10; + item.shootSpeed = 23f; + item.useAmmo = AmmoID.Bullet; + } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Stormtron"); + Tooltip.SetDefault(""); + } -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) -{ - for (int i = 0; i < 1; ++i) - { - Projectile.NewProjectile(position.X, position.Y, speedX + -2, speedY - 4, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 4, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 3, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 2, speedY - 3, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 3, speedY - 2, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX + 3, speedY -1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX + 4, speedY + 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX + 4, speedY + 2, type, damage, knockBack, Main.myPlayer); - } - return false; -} - public override bool ConsumeAmmo(Player p) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + for (int i = 0; i < 1; ++i) + { + Projectile.NewProjectile(position.X, position.Y, speedX + -2, speedY - 4, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 4, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 3, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 2, speedY - 3, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 3, speedY - 2, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX + 3, speedY - 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX + 4, speedY + 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX + 4, speedY + 2, type, damage, knockBack, Main.myPlayer); + } + return false; + } + + public override bool ConsumeAmmo(Player p) { return Main.rand.Next(2) == 0; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "VoidBar", 22); - recipe.AddIngredient(null, "CarbonSteel", 15); - recipe.AddIngredient(null, "ClusterShard", 8); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "VoidBar", 22); + recipe.AddIngredient(null, "CarbonSteel", 15); + recipe.AddIngredient(null, "ClusterShard", 8); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } +} diff --git a/Items/StrangeEgg.cs b/Items/StrangeEgg.cs index 1529cf3b..95a077e0 100644 --- a/Items/StrangeEgg.cs +++ b/Items/StrangeEgg.cs @@ -13,19 +13,19 @@ public override void SetDefaults() { item.CloneDefaults(ItemID.Carrot); - item.useTime = 25; - item.useAnimation = 25; - item.rare = 11; + item.useTime = 25; + item.useAnimation = 25; + item.rare = 11; item.shoot = mod.ProjectileType("Brutty"); item.buffType = mod.BuffType("BruttyBuff"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Strange Egg"); - Tooltip.SetDefault("Summons an brutty"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Strange Egg"); + Tooltip.SetDefault("Summons an brutty"); + } public override void UseStyle(Player player) diff --git a/Items/StrikerBlade.cs b/Items/StrikerBlade.cs index d07e0d63..fa4caaae 100644 --- a/Items/StrikerBlade.cs +++ b/Items/StrikerBlade.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class StrikerBlade : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class StrikerBlade : ModItem + { + public override void SetDefaults() + { - item.damage = 54; - item.melee = true; - item.width = 36; - item.height = 44; - item.useTime = 11; - item.useAnimation = 11; - item.useStyle = 1; - item.useTurn = true; - item.knockBack = 6f; - item.value = 90000; - item.rare = 7; - item.UseSound = SoundID.Item71; - item.autoReuse = true; - } + item.damage = 54; + item.melee = true; + item.width = 36; + item.height = 44; + item.useTime = 11; + item.useAnimation = 11; + item.useStyle = 1; + item.useTurn = true; + item.knockBack = 6f; + item.value = 90000; + item.rare = 7; + item.UseSound = SoundID.Item71; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Striker Blade"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Striker Blade"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/StrongBelt.cs b/Items/StrongBelt.cs index c9e5aaf2..0dc0a6cc 100644 --- a/Items/StrongBelt.cs +++ b/Items/StrongBelt.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class StrongBelt : ModItem +namespace Tremor.Items { + public class StrongBelt : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.value = 25000; - item.rare = 2; - item.accessory = true; - } + item.width = 30; + item.height = 24; + item.value = 25000; + item.rare = 2; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Strong Belt"); - Tooltip.SetDefault("15% increased minion knockback"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Strong Belt"); + Tooltip.SetDefault("15% increased minion knockback"); + } - public override void UpdateAccessory(Player player, bool hideVisual) + public override void UpdateAccessory(Player player, bool hideVisual) - { - player.minionKB += 0.15f; - } -}} + { + player.minionKB += 0.15f; + } + } +} diff --git a/Items/Stynginator.cs b/Items/Stynginator.cs index d693acaf..15b92e92 100644 --- a/Items/Stynginator.cs +++ b/Items/Stynginator.cs @@ -5,65 +5,67 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class Stynginator : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.damage = 49; - item.ranged = true; - item.width = 20; - item.height = 12; - item.useTime = 20; - item.useAnimation = 20; + public class Stynginator : ModItem + { + public override void SetDefaults() + { - item.useStyle = 5; - item.knockBack = 6; - item.value = Item.buyPrice(0, 6, 0, 0); - item.rare = 8; - item.crit = 3; - item.useStyle = 5; - item.UseSound = SoundID.Item36; - item.noMelee = true; - item.autoReuse = true; - item.shoot = 10; - item.shootSpeed = 16f; - item.useAmmo = AmmoID.StyngerBolt; - } + item.damage = 49; + item.ranged = true; + item.width = 20; + item.height = 12; + item.useTime = 20; + item.useAnimation = 20; - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Stynginator"); - Tooltip.SetDefault("Uses Styngers Bolts as ammo"); - } + item.useStyle = 5; + item.knockBack = 6; + item.value = Item.buyPrice(0, 6, 0, 0); + item.rare = 8; + item.crit = 3; + item.useStyle = 5; + item.UseSound = SoundID.Item36; + item.noMelee = true; + item.autoReuse = true; + item.shoot = 10; + item.shootSpeed = 16f; + item.useAmmo = AmmoID.StyngerBolt; + } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Stynginator"); + Tooltip.SetDefault("Uses Styngers Bolts as ammo"); + } -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) -{ - for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. - { - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); - } - return false; -} - public override bool ConsumeAmmo(Player p) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. + { + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); + } + return false; + } + + public override bool ConsumeAmmo(Player p) { return Main.rand.Next(2) == 0; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GolemCore", 1); - recipe.AddIngredient(ItemID.Stynger, 1); - recipe.AddIngredient(ItemID.Ectoplasm, 18); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GolemCore", 1); + recipe.AddIngredient(ItemID.Stynger, 1); + recipe.AddIngredient(ItemID.Ectoplasm, 18); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/SummonerFocus.cs b/Items/SummonerFocus.cs index b658f336..edb4d274 100644 --- a/Items/SummonerFocus.cs +++ b/Items/SummonerFocus.cs @@ -6,43 +6,45 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SummonerFocus : ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 22; - item.height = 22; - - - item.rare = 2; - item.accessory = true; - item.value = 50000; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Summoner Focus"); - Tooltip.SetDefault("Increases minion damage by 8%\nIncreases your max number of minions"); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 4)); - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.maxMinions += 1; - player.minionDamage += 0.08f; + public class SummonerFocus : ModItem + { + + public override void SetDefaults() + { + + item.width = 22; + item.height = 22; + + + item.rare = 2; + item.accessory = true; + item.value = 50000; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Summoner Focus"); + Tooltip.SetDefault("Increases minion damage by 8%\nIncreases your max number of minions"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 4)); + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.maxMinions += 1; + player.minionDamage += 0.08f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "SummonerSpark"); + recipe.AddIngredient(null, "EarthFragment", 1); + recipe.AddIngredient(ItemID.Emerald, 16); + recipe.SetResult(this); + recipe.AddTile(null, "AltarofEnchantmentsTile"); + recipe.AddRecipe(); + } + } } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "SummonerSpark"); - recipe.AddIngredient(null, "EarthFragment", 1); - recipe.AddIngredient(ItemID.Emerald, 16); - recipe.SetResult(this); - recipe.AddTile(null, "AltarofEnchantmentsTile"); - recipe.AddRecipe(); - } -}} diff --git a/Items/SummonerSoul.cs b/Items/SummonerSoul.cs index f7acc3c0..2f3204d9 100644 --- a/Items/SummonerSoul.cs +++ b/Items/SummonerSoul.cs @@ -6,43 +6,45 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SummonerSoul : ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 22; - item.height = 22; - - - item.rare = 2; - item.accessory = true; - item.value = 100000; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Summoner Soul"); - Tooltip.SetDefault("Increases minion damage by 12%\nIncreases your max number of minions"); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 6)); - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.maxMinions += 2; - player.minionDamage += 0.12f; + public class SummonerSoul : ModItem + { + + public override void SetDefaults() + { + + item.width = 22; + item.height = 22; + + + item.rare = 2; + item.accessory = true; + item.value = 100000; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Summoner Soul"); + Tooltip.SetDefault("Increases minion damage by 12%\nIncreases your max number of minions"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 6)); + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.maxMinions += 2; + player.minionDamage += 0.12f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "SummonerFocus"); + recipe.AddIngredient(null, "Opal", 3); + recipe.AddIngredient(ItemID.SummonerEmblem, 1); + recipe.SetResult(this); + recipe.AddTile(null, "AltarofEnchantmentsTile"); + recipe.AddRecipe(); + } + } } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "SummonerFocus"); - recipe.AddIngredient(null, "Opal", 3); - recipe.AddIngredient(ItemID.SummonerEmblem, 1); - recipe.SetResult(this); - recipe.AddTile(null, "AltarofEnchantmentsTile"); - recipe.AddRecipe(); - } -}} diff --git a/Items/SummonerSpark.cs b/Items/SummonerSpark.cs index f7ed51d7..f83c8291 100644 --- a/Items/SummonerSpark.cs +++ b/Items/SummonerSpark.cs @@ -6,40 +6,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SummonerSpark : ModItem +namespace Tremor.Items { + public class SummonerSpark : ModItem + { - public override void SetDefaults() - { - - item.width = 22; - item.height = 22; - - - item.rare = 1; - item.accessory = true; - item.value = 20000; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Summoner Spark"); - Tooltip.SetDefault("Increases minion damage by 5%\nIncreases your max number of minions"); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 4)); - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.maxMinions += 1; - player.minionDamage += 0.05f; -} + public override void SetDefaults() + { + + item.width = 22; + item.height = 22; + + + item.rare = 1; + item.accessory = true; + item.value = 20000; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "AdventurerSpark"); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Summoner Spark"); + Tooltip.SetDefault("Increases minion damage by 5%\nIncreases your max number of minions"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 4)); + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.maxMinions += 1; + player.minionDamage += 0.05f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "AdventurerSpark"); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/SunflowerFish.cs b/Items/SunflowerFish.cs index 9abd5e42..9a28dfaa 100644 --- a/Items/SunflowerFish.cs +++ b/Items/SunflowerFish.cs @@ -21,11 +21,11 @@ public override void SetDefaults() item.rare = -11; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sunflower Fish"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sunflower Fish"); + Tooltip.SetDefault(""); + } public override bool IsQuestFish() diff --git a/Items/SunfuryPotion.cs b/Items/SunfuryPotion.cs index 5b15907f..754f746d 100644 --- a/Items/SunfuryPotion.cs +++ b/Items/SunfuryPotion.cs @@ -3,47 +3,49 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class SunfuryPotion : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.width = 38; - item.height = 32; - item.maxStack = 20; - - item.rare = 11; - item.useAnimation = 15; - item.useTime = 15; - item.useStyle = 2; - item.UseSound = SoundID.Item3; - item.consumable = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Sunfury Potion"); - Tooltip.SetDefault("Increases all stats during daytime"); - } - - - public override bool UseItem(Player player) - { - player.AddBuff(mod.BuffType("DayHunting"), 14400); - return true; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.BottledWater, 1); - recipe.AddIngredient(null, "AngryShard", 1); - recipe.AddIngredient(null, "AlienTongue", 1); - recipe.AddIngredient(null, "PinkGelCube", 1); - recipe.AddTile(null, "AlchemyStationTile"); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + + public class SunfuryPotion : ModItem + { + public override void SetDefaults() + { + + item.width = 38; + item.height = 32; + item.maxStack = 20; + + item.rare = 11; + item.useAnimation = 15; + item.useTime = 15; + item.useStyle = 2; + item.UseSound = SoundID.Item3; + item.consumable = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sunfury Potion"); + Tooltip.SetDefault("Increases all stats during daytime"); + } + + + public override bool UseItem(Player player) + { + player.AddBuff(mod.BuffType("DayHunting"), 14400); + return true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.BottledWater, 1); + recipe.AddIngredient(null, "AngryShard", 1); + recipe.AddIngredient(null, "AlienTongue", 1); + recipe.AddIngredient(null, "PinkGelCube", 1); + recipe.AddTile(null, "AlchemyStationTile"); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/SuperBigCannon.cs b/Items/SuperBigCannon.cs index 542fa78c..b9aa2a4b 100644 --- a/Items/SuperBigCannon.cs +++ b/Items/SuperBigCannon.cs @@ -5,40 +5,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SuperBigCannon : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SuperBigCannon : ModItem + { + public override void SetDefaults() + { - item.damage = 340; - item.ranged = true; - item.width = 70; - item.height = 34; + item.damage = 340; + item.ranged = true; + item.width = 70; + item.height = 34; - item.useTime = 35; - item.useAnimation = 35; - item.shoot = mod.ProjectileType("SuperBigCannonPro"); - item.shootSpeed = 15f; - item.useStyle = 5; - item.knockBack = 6; - item.value = 100000; - item.rare = 11; - item.UseSound = SoundID.Item11; - item.expert = true; - item.autoReuse = true; - item.useAmmo = mod.ItemType("SBCCannonballAmmo"); - } + item.useTime = 35; + item.useAnimation = 35; + item.shoot = mod.ProjectileType("SuperBigCannonPro"); + item.shootSpeed = 15f; + item.useStyle = 5; + item.knockBack = 6; + item.value = 100000; + item.rare = 11; + item.UseSound = SoundID.Item11; + item.expert = true; + item.autoReuse = true; + item.useAmmo = mod.ItemType("SBCCannonballAmmo"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("SBC"); - Tooltip.SetDefault("'Seriously big cannon!'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("SBC"); + Tooltip.SetDefault("'Seriously big cannon!'"); + } - public override Vector2? HoldoutOffset() - { - return new Vector2(-18, -4); - } -}} + public override Vector2? HoldoutOffset() + { + return new Vector2(-18, -4); + } + } +} diff --git a/Items/SuperHealingFlask.cs b/Items/SuperHealingFlask.cs index 4cef762a..2de14384 100644 --- a/Items/SuperHealingFlask.cs +++ b/Items/SuperHealingFlask.cs @@ -6,104 +6,106 @@ using System.Linq; using Terraria.ModLoader; -namespace Tremor.Items { -public class SuperHealingFlask : AlchemistItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.crit = 4; - item.damage = 96; - item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("SuperHealingFlaskPro"); - item.shootSpeed = 8f; - item.useStyle = 1; - item.knockBack = 1; - item.UseSound = SoundID.Item106; - item.value = 7; + public class SuperHealingFlask : AlchemistItem + { + public override void SetDefaults() + { + item.crit = 4; + item.damage = 96; + item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("SuperHealingFlaskPro"); + item.shootSpeed = 8f; + item.useStyle = 1; + item.knockBack = 1; + item.UseSound = SoundID.Item106; + item.value = 7; - item.rare = 8; - item.autoReuse = false; - item.ammo = mod.ItemType("BoomFlask"); - } + item.rare = 8; + item.autoReuse = false; + item.ammo = mod.ItemType("BoomFlask"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Super Healing Flask"); - Tooltip.SetDefault("Throws a flask that explodes into clouds\nClouds deal damage to enemies and restore health"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Super Healing Flask"); + Tooltip.SetDefault("Throws a flask that explodes into clouds\nClouds deal damage to enemies and restore health"); + } - public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) - { - type = mod.ProjectileType("HealingCloudPro"); - } + public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) + { + type = mod.ProjectileType("HealingCloudPro"); + } + + public override void UpdateInventory(Player player) + { + MPlayer modPlayer = player.GetModPlayer(mod); + if (modPlayer.novaHelmet) + { + item.autoReuse = true; + } + if (!modPlayer.novaHelmet) + { + item.autoReuse = false; + } - public override void UpdateInventory(Player player) - { - MPlayer modPlayer = player.GetModPlayer(mod); - if (modPlayer.novaHelmet) - { - item.autoReuse = true; - } - if (!modPlayer.novaHelmet) - { - item.autoReuse = false; - } - - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) - { - item.shootSpeed = 11f; - } - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) - { - item.shootSpeed = 8f; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) - { - item.autoReuse = true; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) - { - item.autoReuse = false; - } - } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) + { + item.shootSpeed = 11f; + } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) + { + item.shootSpeed = 8f; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) + { + item.autoReuse = true; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) + { + item.autoReuse = false; + } + } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BigHealingFlack", 20); - recipe.AddIngredient(3456, 1); - recipe.AddIngredient(null, "AngryShard", 1); + recipe.AddIngredient(null, "BigHealingFlack", 20); + recipe.AddIngredient(3456, 1); + recipe.AddIngredient(null, "AngryShard", 1); recipe.SetResult(this, 20); recipe.AddRecipe(); recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BigHealingFlack", 20); - recipe.AddIngredient(3457, 1); - recipe.AddIngredient(null, "AngryShard", 1); + recipe.AddIngredient(null, "BigHealingFlack", 20); + recipe.AddIngredient(3457, 1); + recipe.AddIngredient(null, "AngryShard", 1); recipe.SetResult(this, 20); recipe.AddRecipe(); recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BigHealingFlack", 20); - recipe.AddIngredient(3458, 1); - recipe.AddIngredient(null, "AngryShard", 1); + recipe.AddIngredient(null, "BigHealingFlack", 20); + recipe.AddIngredient(3458, 1); + recipe.AddIngredient(null, "AngryShard", 1); recipe.SetResult(this, 20); recipe.AddRecipe(); recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BigHealingFlack", 20); - recipe.AddIngredient(3459, 1); - recipe.AddIngredient(null, "AngryShard", 1); + recipe.AddIngredient(null, "BigHealingFlack", 20); + recipe.AddIngredient(3459, 1); + recipe.AddIngredient(null, "AngryShard", 1); recipe.SetResult(this, 20); recipe.AddRecipe(); } -}} + } +} diff --git a/Items/SuperManaFlask.cs b/Items/SuperManaFlask.cs index cd27ca60..05c51a15 100644 --- a/Items/SuperManaFlask.cs +++ b/Items/SuperManaFlask.cs @@ -6,104 +6,106 @@ using System.Linq; using Terraria.ModLoader; -namespace Tremor.Items { -public class SuperManaFlask : AlchemistItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.crit = 4; - item.damage = 96; - //item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("SuperManaFlaskPro"); - item.shootSpeed = 8f; - item.useStyle = 1; - item.knockBack = 1; - item.UseSound = SoundID.Item106; - item.value = 200; - item.rare = 8; - item.autoReuse = false; + public class SuperManaFlask : AlchemistItem + { + public override void SetDefaults() + { + item.crit = 4; + item.damage = 96; + //item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("SuperManaFlaskPro"); + item.shootSpeed = 8f; + item.useStyle = 1; + item.knockBack = 1; + item.UseSound = SoundID.Item106; + item.value = 200; + item.rare = 8; + item.autoReuse = false; - item.ammo = mod.ItemType("BoomFlask"); - } + item.ammo = mod.ItemType("BoomFlask"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Super Mana Flask"); - Tooltip.SetDefault("Throws a flask that explodes into clouds\nClouds deal damage to enemies and restore mana"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Super Mana Flask"); + Tooltip.SetDefault("Throws a flask that explodes into clouds\nClouds deal damage to enemies and restore mana"); + } - public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) - { - type = mod.ProjectileType("ManaCloudPro"); - } + public override void PickAmmo(Player player, ref int type, ref float speed, ref int damage, ref float knockback) + { + type = mod.ProjectileType("ManaCloudPro"); + } + + public override void UpdateInventory(Player player) + { + MPlayer modPlayer = player.GetModPlayer(mod); + if (modPlayer.novaHelmet) + { + item.autoReuse = true; + } + if (!modPlayer.novaHelmet) + { + item.autoReuse = false; + } - public override void UpdateInventory(Player player) - { - MPlayer modPlayer = player.GetModPlayer(mod); - if (modPlayer.novaHelmet) - { - item.autoReuse = true; - } - if (!modPlayer.novaHelmet) - { - item.autoReuse = false; - } - - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) - { - item.shootSpeed = 11f; - } - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) - { - item.shootSpeed = 8f; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) - { - item.autoReuse = true; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) - { - item.autoReuse = false; - } - } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) + { + item.shootSpeed = 11f; + } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) + { + item.shootSpeed = 8f; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) + { + item.autoReuse = true; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) + { + item.autoReuse = false; + } + } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BigManaFlask", 20); - recipe.AddIngredient(3456); - recipe.AddIngredient(null, "LapisLazuli", 1); + recipe.AddIngredient(null, "BigManaFlask", 20); + recipe.AddIngredient(3456); + recipe.AddIngredient(null, "LapisLazuli", 1); recipe.SetResult(this, 20); recipe.AddRecipe(); recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BigManaFlask", 20); - recipe.AddIngredient(3457); - recipe.AddIngredient(null, "LapisLazuli", 1); + recipe.AddIngredient(null, "BigManaFlask", 20); + recipe.AddIngredient(3457); + recipe.AddIngredient(null, "LapisLazuli", 1); recipe.SetResult(this, 20); recipe.AddRecipe(); recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BigManaFlask", 20); - recipe.AddIngredient(3458); - recipe.AddIngredient(null, "LapisLazuli", 1); + recipe.AddIngredient(null, "BigManaFlask", 20); + recipe.AddIngredient(3458); + recipe.AddIngredient(null, "LapisLazuli", 1); recipe.SetResult(this, 20); recipe.AddRecipe(); recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BigManaFlask", 20); - recipe.AddIngredient(3459); - recipe.AddIngredient(null, "LapisLazuli", 1); + recipe.AddIngredient(null, "BigManaFlask", 20); + recipe.AddIngredient(3459); + recipe.AddIngredient(null, "LapisLazuli", 1); recipe.SetResult(this, 20); recipe.AddRecipe(); } -}} + } +} diff --git a/Items/SupremePossessedArmorBanner.cs b/Items/SupremePossessedArmorBanner.cs index 2043216b..deb5b24f 100644 --- a/Items/SupremePossessedArmorBanner.cs +++ b/Items/SupremePossessedArmorBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SupremePossessedArmorBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SupremePossessedArmorBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 41; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 41; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Supreme Possessed Armor Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Supreme Possessed Armor Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/SuspiciousBag.cs b/Items/SuspiciousBag.cs index e9fa0921..a9bd82ba 100644 --- a/Items/SuspiciousBag.cs +++ b/Items/SuspiciousBag.cs @@ -4,80 +4,82 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SuspiciousBag : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SuspiciousBag : ModItem + { + public override void SetDefaults() + { - item.maxStack = 999; - item.consumable = true; - item.width = 34; - item.height = 34; - item.value = 20000; + item.maxStack = 999; + item.consumable = true; + item.width = 34; + item.height = 34; + item.value = 20000; - item.rare = 11; - } + item.rare = 11; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Suspicious Bag"); - Tooltip.SetDefault("Right click to open\n'Contains powerful treasures'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Suspicious Bag"); + Tooltip.SetDefault("Right click to open\n'Contains powerful treasures'"); + } - public override bool CanRightClick() - { - return true; - } + public override bool CanRightClick() + { + return true; + } - public override void RightClick(Player player) - { - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("Doomstone"), Main.rand.Next(2, 5)); - } - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("ConcentratedEther"), Main.rand.Next(3, 10)); - } - if(Main.rand.Next(4) == 0) - { - player.QuickSpawnItem(mod.ItemType("CandyBar"), Main.rand.Next(2, 6)); - } - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("VoidBar"), Main.rand.Next(2, 7)); - } - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("NightmareBar"), Main.rand.Next(2, 6)); - } - if(Main.rand.Next(5) == 0) - { - player.QuickSpawnItem(mod.ItemType("Phantaplasm"), Main.rand.Next(3, 6)); - } - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("CarbonSteel"), Main.rand.Next(1, 3)); - } - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("ClusterShard"), Main.rand.Next(3, 36)); - } - if(Main.rand.Next(8) == 0) - { - player.QuickSpawnItem(mod.ItemType("DeadTissue"), 1); - } - if(Main.rand.Next(4) == 0) - { - player.QuickSpawnItem(mod.ItemType("ToothofAbraxas"), Main.rand.Next(2, 4)); - } - if(Main.rand.Next(30) == 0) - { - player.QuickSpawnItem(mod.ItemType("Burner")); - } - } + public override void RightClick(Player player) + { + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("Doomstone"), Main.rand.Next(2, 5)); + } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("ConcentratedEther"), Main.rand.Next(3, 10)); + } + if (Main.rand.Next(4) == 0) + { + player.QuickSpawnItem(mod.ItemType("CandyBar"), Main.rand.Next(2, 6)); + } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("VoidBar"), Main.rand.Next(2, 7)); + } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("NightmareBar"), Main.rand.Next(2, 6)); + } + if (Main.rand.Next(5) == 0) + { + player.QuickSpawnItem(mod.ItemType("Phantaplasm"), Main.rand.Next(3, 6)); + } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("CarbonSteel"), Main.rand.Next(1, 3)); + } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("ClusterShard"), Main.rand.Next(3, 36)); + } + if (Main.rand.Next(8) == 0) + { + player.QuickSpawnItem(mod.ItemType("DeadTissue"), 1); + } + if (Main.rand.Next(4) == 0) + { + player.QuickSpawnItem(mod.ItemType("ToothofAbraxas"), Main.rand.Next(2, 4)); + } + if (Main.rand.Next(30) == 0) + { + player.QuickSpawnItem(mod.ItemType("Burner")); + } + } -}} + } +} diff --git a/Items/SuspiciousLookingPresent.cs b/Items/SuspiciousLookingPresent.cs index 8c96928f..63bb05b5 100644 --- a/Items/SuspiciousLookingPresent.cs +++ b/Items/SuspiciousLookingPresent.cs @@ -6,24 +6,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SuspiciousLookingPresent : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SuspiciousLookingPresent : ModItem + { + public override void SetDefaults() + { - item.width = 24; - item.height = 22; - item.maxStack = 1; - item.value = 10000; + item.width = 24; + item.height = 22; + item.maxStack = 1; + item.value = 10000; - item.rare = 3; - } + item.rare = 3; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Suspicious Looking Present"); - Tooltip.SetDefault("Allows the Elf to move in"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Suspicious Looking Present"); + Tooltip.SetDefault("Allows the Elf to move in"); + } -}} + } +} diff --git a/Items/SwampClump.cs b/Items/SwampClump.cs index b42a3b0d..7749f1ae 100644 --- a/Items/SwampClump.cs +++ b/Items/SwampClump.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SwampClump : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SwampClump : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 44; - item.value = 100; - item.rare = 7; - item.accessory = true; - } + item.width = 22; + item.height = 44; + item.value = 100; + item.rare = 7; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Swamp Clump"); - Tooltip.SetDefault("Greatly reduces movement speed\nProlonged after hit invicibility\nGreatly increases life regeneration"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Swamp Clump"); + Tooltip.SetDefault("Greatly reduces movement speed\nProlonged after hit invicibility\nGreatly increases life regeneration"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.moveSpeed -=0.4f; - player.longInvince = true; - player.lifeRegen +=5; - } -}} + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.moveSpeed -= 0.4f; + player.longInvince = true; + player.lifeRegen += 5; + } + } +} diff --git a/Items/SwampMud.cs b/Items/SwampMud.cs index c68129e5..8d82754e 100644 --- a/Items/SwampMud.cs +++ b/Items/SwampMud.cs @@ -4,29 +4,31 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class SwampMud : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class SwampMud : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 999; - item.rare = 0; - item.createTile = mod.TileType("SwampMud"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - } + item.width = 30; + item.height = 24; + item.maxStack = 999; + item.rare = 0; + item.createTile = mod.TileType("SwampMud"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Swamp Mud"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Swamp Mud"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/Swordstorm.cs b/Items/Swordstorm.cs index 59322e8d..698829f0 100644 --- a/Items/Swordstorm.cs +++ b/Items/Swordstorm.cs @@ -5,35 +5,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Swordstorm: ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Swordstorm : ModItem + { + public override void SetDefaults() + { - item.damage = 19; - item.magic = true; - item.mana = 5; - item.width = 40; - item.height = 40; - item.useTime = 21; - item.useAnimation = 21; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 6; - item.value = 3000; - item.rare = 2; - item.UseSound = SoundID.Item43; - item.autoReuse = true; - Item.staff[item.type] = true; //this makes the useStyle animate as a staff instead of as a gun - item.shoot = mod.ProjectileType("SwordstormPro"); - item.shootSpeed = 18f; - } + item.damage = 19; + item.magic = true; + item.mana = 5; + item.width = 40; + item.height = 40; + item.useTime = 21; + item.useAnimation = 21; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 6; + item.value = 3000; + item.rare = 2; + item.UseSound = SoundID.Item43; + item.autoReuse = true; + Item.staff[item.type] = true; //this makes the useStyle animate as a staff instead of as a gun + item.shoot = mod.ProjectileType("SwordstormPro"); + item.shootSpeed = 18f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Swordstorm"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Swordstorm"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/TatteredBanner.cs b/Items/TatteredBanner.cs index 58d6953c..892db5cb 100644 --- a/Items/TatteredBanner.cs +++ b/Items/TatteredBanner.cs @@ -4,42 +4,44 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TatteredBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class TatteredBanner : ModItem + { + public override void SetDefaults() + { - item.width = 48; - item.height = 64; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; + item.width = 48; + item.height = 64; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 50000; - item.rare = 11; - item.createTile = mod.TileType("TatteredBanner"); - } + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 50000; + item.rare = 11; + item.createTile = mod.TileType("TatteredBanner"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Tattered Banner"); - Tooltip.SetDefault("25% increased all damage if placed"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Tattered Banner"); + Tooltip.SetDefault("25% increased all damage if placed"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Gloomstone", 10); - recipe.AddIngredient(null, "UnstableCrystal", 2); - recipe.AddIngredient(ItemID.TatteredCloth, 25); - recipe.SetResult(this); - recipe.AddTile(106); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Gloomstone", 10); + recipe.AddIngredient(null, "UnstableCrystal", 2); + recipe.AddIngredient(ItemID.TatteredCloth, 25); + recipe.SetResult(this); + recipe.AddTile(106); + recipe.AddRecipe(); + } + } +} diff --git a/Items/TearsofDeath.cs b/Items/TearsofDeath.cs index 24af4fe7..861a915b 100644 --- a/Items/TearsofDeath.cs +++ b/Items/TearsofDeath.cs @@ -8,25 +8,25 @@ namespace Tremor.Items { - public class TearsofDeath : ModItem - { + public class TearsofDeath : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 40; - item.height = 28; - item.maxStack = 99; + item.width = 40; + item.height = 28; + item.maxStack = 99; - item.value = 100; - item.rare = 3; - } + item.value = 100; + item.rare = 3; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Tears of Death"); - Tooltip.SetDefault("Unstable ingredient"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Tears of Death"); + Tooltip.SetDefault("Unstable ingredient"); + } - } + } } diff --git a/Items/TechnologyofDionysus.cs b/Items/TechnologyofDionysus.cs index 18911752..bacd4fec 100644 --- a/Items/TechnologyofDionysus.cs +++ b/Items/TechnologyofDionysus.cs @@ -4,32 +4,34 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TechnologyofDionysus : ModItem +namespace Tremor.Items { + public class TechnologyofDionysus : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 24; - item.height = 28; + item.width = 24; + item.height = 28; - item.value = 100000; - item.rare = 6; - item.accessory = true; - item.defense = 3; - } + item.value = 100000; + item.rare = 6; + item.accessory = true; + item.defense = 3; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Technology of Dionysus"); - Tooltip.SetDefault("Enemies are less likely to target you"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Technology of Dionysus"); + Tooltip.SetDefault("Enemies are less likely to target you"); + } - public override void UpdateAccessory(Player player, bool hideVisual) + public override void UpdateAccessory(Player player, bool hideVisual) - { - player.aggro -= 400; - } -}} + { + player.aggro -= 400; + } + } +} diff --git a/Items/TempleCannon.cs b/Items/TempleCannon.cs index 015fe99e..5efecdb2 100644 --- a/Items/TempleCannon.cs +++ b/Items/TempleCannon.cs @@ -5,65 +5,67 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class TempleCannon : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.damage = 72; - item.ranged = true; - item.width = 20; - item.height = 12; - item.useTime = 12; - item.useAnimation = 20; - item.useStyle = 5; - item.knockBack = 6; - item.value = Item.buyPrice(0, 12, 5, 0); - item.rare = 9; - item.useStyle = 5; - item.UseSound = SoundID.Item36; - item.noMelee = true; - item.autoReuse = false; - item.shoot = 1; - item.shootSpeed = 23f; - item.useAmmo = AmmoID.Arrow; - } + public class TempleCannon : ModItem + { + public override void SetDefaults() + { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Temple Cannon"); - Tooltip.SetDefault(""); - } + item.damage = 72; + item.ranged = true; + item.width = 20; + item.height = 12; + item.useTime = 12; + item.useAnimation = 20; + item.useStyle = 5; + item.knockBack = 6; + item.value = Item.buyPrice(0, 12, 5, 0); + item.rare = 9; + item.useStyle = 5; + item.UseSound = SoundID.Item36; + item.noMelee = true; + item.autoReuse = false; + item.shoot = 1; + item.shootSpeed = 23f; + item.useAmmo = AmmoID.Arrow; + } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Temple Cannon"); + Tooltip.SetDefault(""); + } -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) -{ - for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. - { - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); - } - return false; -} - public override bool ConsumeAmmo(Player p) + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. + { + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); + } + return false; + } + + public override bool ConsumeAmmo(Player p) { return Main.rand.Next(2) == 0; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "GolemCore", 1); - recipe.AddIngredient(null, "Bolter", 1); - recipe.AddIngredient(ItemID.ChlorophyteShotbow, 1); - recipe.AddIngredient(ItemID.SoulofLight, 25); - recipe.AddIngredient(ItemID.SoulofNight, 25); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "GolemCore", 1); + recipe.AddIngredient(null, "Bolter", 1); + recipe.AddIngredient(ItemID.ChlorophyteShotbow, 1); + recipe.AddIngredient(ItemID.SoulofLight, 25); + recipe.AddIngredient(ItemID.SoulofNight, 25); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Tent.cs b/Items/Tent.cs index 4d360d78..2652a376 100644 --- a/Items/Tent.cs +++ b/Items/Tent.cs @@ -19,27 +19,27 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 15; item.useStyle = 1; - item.rare = 1; + item.rare = 1; item.consumable = true; item.value = 2000; item.createTile = mod.TileType("TentTile"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Tent"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Tent"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Wood, 4); - recipe.AddIngredient(ItemID.Cobweb, 30); - recipe.SetResult(this); - recipe.AddTile(86); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Wood, 4); + recipe.AddIngredient(ItemID.Cobweb, 30); + recipe.SetResult(this); + recipe.AddTile(86); + recipe.AddRecipe(); + } } } diff --git a/Items/TheArtifact.cs b/Items/TheArtifact.cs index a07bc3b5..02cbc93c 100644 --- a/Items/TheArtifact.cs +++ b/Items/TheArtifact.cs @@ -13,18 +13,18 @@ public override void SetDefaults() { item.CloneDefaults(ItemID.Carrot); - item.useTime = 25; - item.useAnimation = 25; + item.useTime = 25; + item.useAnimation = 25; item.shoot = mod.ProjectileType("AnnoyingDog"); item.buffType = mod.BuffType("AnnoyingDogBuff"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("The Artifact"); - Tooltip.SetDefault("Summons annoying dog"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("The Artifact"); + Tooltip.SetDefault("Summons annoying dog"); + } public override void UseStyle(Player player) diff --git a/Items/TheAxemanBanner.cs b/Items/TheAxemanBanner.cs index 4bde9bda..f0b7ba79 100644 --- a/Items/TheAxemanBanner.cs +++ b/Items/TheAxemanBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TheAxemanBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class TheAxemanBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 95; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 95; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("The Axeman Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("The Axeman Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/TheBooger.cs b/Items/TheBooger.cs index 15407b7f..8c5987f4 100644 --- a/Items/TheBooger.cs +++ b/Items/TheBooger.cs @@ -7,49 +7,49 @@ namespace Tremor.Items { - public class TheBooger : ModItem - { - public override void SetDefaults() - { + public class TheBooger : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 10; - item.value = Item.sellPrice(2, 0, 0, 0); - item.rare = 4; - item.noMelee = true; - item.useStyle = 5; - item.useAnimation = 40; - item.useTime = 40; - item.knockBack = 7.5F; - item.damage = 200; - item.scale = 1.1F; - item.noUseGraphic = true; - item.shoot = mod.ProjectileType("TheBoogerPro"); - item.shootSpeed = 15.9F; - item.UseSound = SoundID.Item1; - item.melee = true; - item.channel = true; - } + item.width = 30; + item.height = 10; + item.value = Item.sellPrice(2, 0, 0, 0); + item.rare = 4; + item.noMelee = true; + item.useStyle = 5; + item.useAnimation = 40; + item.useTime = 40; + item.knockBack = 7.5F; + item.damage = 200; + item.scale = 1.1F; + item.noUseGraphic = true; + item.shoot = mod.ProjectileType("TheBoogerPro"); + item.shootSpeed = 15.9F; + item.UseSound = SoundID.Item1; + item.melee = true; + item.channel = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("The Booger"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("The Booger"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "NightCore", 3); - recipe.AddIngredient(null, "CometiteBar", 15); - recipe.AddIngredient(null, "Squorb", 3); - recipe.AddIngredient(null, "LunarRoot", 18); - recipe.AddIngredient(null, "Catalyst", 3); - recipe.AddIngredient(null, "SoulofFight", 3); - recipe.SetResult(this); - recipe.AddTile(null, "StarvilTile"); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "NightCore", 3); + recipe.AddIngredient(null, "CometiteBar", 15); + recipe.AddIngredient(null, "Squorb", 3); + recipe.AddIngredient(null, "LunarRoot", 18); + recipe.AddIngredient(null, "Catalyst", 3); + recipe.AddIngredient(null, "SoulofFight", 3); + recipe.SetResult(this); + recipe.AddTile(null, "StarvilTile"); + recipe.AddRecipe(); + } + } } diff --git a/Items/TheBrain.cs b/Items/TheBrain.cs index e8bb1a08..c155f8d5 100644 --- a/Items/TheBrain.cs +++ b/Items/TheBrain.cs @@ -4,24 +4,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TheBrain : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class TheBrain : ModItem + { + public override void SetDefaults() + { - item.width = 28; - item.height = 30; + item.width = 28; + item.height = 30; - item.maxStack = 99; - item.value = 100; - item.rare = 3; - } + item.maxStack = 99; + item.value = 100; + item.rare = 3; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("The Brain"); - Tooltip.SetDefault("'Braaainzzzz!'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("The Brain"); + Tooltip.SetDefault("'Braaainzzzz!'"); + } -}} + } +} diff --git a/Items/TheCadence.cs b/Items/TheCadence.cs index 8a2a4b82..a901fed4 100644 --- a/Items/TheCadence.cs +++ b/Items/TheCadence.cs @@ -6,38 +6,38 @@ namespace Tremor.Items { - public class TheCadence : ModItem - { + public class TheCadence : ModItem + { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("The Cadence"); - Tooltip.SetDefault("Flasks attack your enemies with souls"); - } - public override void SetDefaults() - { - item.width = 30; - item.height = 26; - item.value = 1000000; - item.rare = 11; - item.accessory = true; - item.defense = 7; - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("The Cadence"); + Tooltip.SetDefault("Flasks attack your enemies with souls"); + } + public override void SetDefaults() + { + item.width = 30; + item.height = 26; + item.value = 1000000; + item.rare = 11; + item.accessory = true; + item.defense = 7; + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.AddBuff(mod.BuffType("TheCadenceBuff"), 2); - } + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.AddBuff(mod.BuffType("TheCadenceBuff"), 2); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "DragonCapsule", 10); - recipe.AddIngredient(null, "EarthFragment", 8); - recipe.AddIngredient(ItemID.Sapphire, 6); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "DragonCapsule", 10); + recipe.AddIngredient(null, "EarthFragment", 8); + recipe.AddIngredient(ItemID.Sapphire, 6); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } } \ No newline at end of file diff --git a/Items/TheCreator.cs b/Items/TheCreator.cs index 0e20e420..f6ea0013 100644 --- a/Items/TheCreator.cs +++ b/Items/TheCreator.cs @@ -4,60 +4,62 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TheCreator : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.width = 22; - item.height = 44; - - - item.value = 10000; - item.rare = 4; - item.defense = 9; - item.accessory = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("The Creator"); - Tooltip.SetDefault("15% increased all damage and crit\nIncreases maximum mana and health by 100"); - } - - - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.magicDamage += 0.15f; - player.minionDamage += 0.15f; - player.meleeDamage += 0.15f; - player.rangedDamage += 0.15f; - player.thrownDamage += 0.15f; - player.GetModPlayer(mod).alchemistDamage += 0.15f; - player.statManaMax2 += 100; - player.statLifeMax2 += 100; - player.meleeCrit += 15; - player.magicCrit += 15; - player.rangedCrit += 15; - player.thrownCrit += 15; - player.GetModPlayer(mod).alchemistCrit += 15; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "TrueBloodshed", 1); - recipe.AddIngredient(null, "TrueSanctifier", 1); - recipe.SetResult(this); - recipe.AddTile(null, "GreatAnvilTile"); - recipe.AddRecipe(); - - recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "TrueNightsWatch", 1); - recipe.AddIngredient(null, "TrueSanctifier", 1); - recipe.SetResult(this); - recipe.AddTile(null, "GreatAnvilTile"); - recipe.AddRecipe(); - } -}} + public class TheCreator : ModItem + { + public override void SetDefaults() + { + + item.width = 22; + item.height = 44; + + + item.value = 10000; + item.rare = 4; + item.defense = 9; + item.accessory = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("The Creator"); + Tooltip.SetDefault("15% increased all damage and crit\nIncreases maximum mana and health by 100"); + } + + + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.magicDamage += 0.15f; + player.minionDamage += 0.15f; + player.meleeDamage += 0.15f; + player.rangedDamage += 0.15f; + player.thrownDamage += 0.15f; + player.GetModPlayer(mod).alchemistDamage += 0.15f; + player.statManaMax2 += 100; + player.statLifeMax2 += 100; + player.meleeCrit += 15; + player.magicCrit += 15; + player.rangedCrit += 15; + player.thrownCrit += 15; + player.GetModPlayer(mod).alchemistCrit += 15; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "TrueBloodshed", 1); + recipe.AddIngredient(null, "TrueSanctifier", 1); + recipe.SetResult(this); + recipe.AddTile(null, "GreatAnvilTile"); + recipe.AddRecipe(); + + recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "TrueNightsWatch", 1); + recipe.AddIngredient(null, "TrueSanctifier", 1); + recipe.SetResult(this); + recipe.AddTile(null, "GreatAnvilTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/TheCrescent.cs b/Items/TheCrescent.cs index b60fd0f6..ff2fd624 100644 --- a/Items/TheCrescent.cs +++ b/Items/TheCrescent.cs @@ -5,53 +5,55 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TheCrescent : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class TheCrescent : ModItem + { + public override void SetDefaults() + { - item.damage = 275; - item.noMelee = true; - item.ranged = true; - item.width = 16; - item.height = 32; - item.useTime = 5; - item.shoot = 1; - item.shootSpeed = 11f; - item.useAnimation = 25; - item.useStyle = 5; - item.knockBack = 1; - item.value = 10000; - item.useAmmo = AmmoID.Arrow; - item.rare = 1; - item.UseSound = SoundID.Item5; - item.autoReuse = true; - } + item.damage = 275; + item.noMelee = true; + item.ranged = true; + item.width = 16; + item.height = 32; + item.useTime = 5; + item.shoot = 1; + item.shootSpeed = 11f; + item.useAnimation = 25; + item.useStyle = 5; + item.knockBack = 1; + item.value = 10000; + item.useAmmo = AmmoID.Arrow; + item.rare = 1; + item.UseSound = SoundID.Item5; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("The Crescent"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("The Crescent"); + Tooltip.SetDefault(""); + } - public override bool ConsumeAmmo(Player p) + public override bool ConsumeAmmo(Player p) { return Main.rand.Next(2) == 0; } - public override Vector2? HoldoutOffset() - { - return new Vector2(-12, -2); - } + public override Vector2? HoldoutOffset() + { + return new Vector2(-12, -2); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "WhiteGoldBar", 15); - recipe.SetResult(this); - recipe.AddTile(null, "DivineForgeTile"); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "WhiteGoldBar", 15); + recipe.SetResult(this); + recipe.AddTile(null, "DivineForgeTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/TheGhostClaymore.cs b/Items/TheGhostClaymore.cs index 85e70ff7..d307fcc8 100644 --- a/Items/TheGhostClaymore.cs +++ b/Items/TheGhostClaymore.cs @@ -5,32 +5,34 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TheGhostClaymore: ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class TheGhostClaymore : ModItem + { + public override void SetDefaults() + { - item.damage = 325; - item.width = 50; - item.height = 50; - item.useTime = 25; - item.useAnimation = 25; - item.useStyle = 1; - item.knockBack = 3; - item.value = 750000; - item.rare = 11; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - item.shoot = mod.ProjectileType("TheGhostClaymorePro"); - item.shootSpeed = 16f; - item.melee = true; - } + item.damage = 325; + item.width = 50; + item.height = 50; + item.useTime = 25; + item.useAnimation = 25; + item.useStyle = 1; + item.knockBack = 3; + item.value = 750000; + item.rare = 11; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + item.shoot = mod.ProjectileType("TheGhostClaymorePro"); + item.shootSpeed = 16f; + item.melee = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("The Ghost Claymore"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("The Ghost Claymore"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/TheGirlBanner.cs b/Items/TheGirlBanner.cs index 6875f692..5e0892cf 100644 --- a/Items/TheGirlBanner.cs +++ b/Items/TheGirlBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TheGirlBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class TheGirlBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 96; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 96; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("The Girl Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("The Girl Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/TheGlorch.cs b/Items/TheGlorch.cs index cb3cc9f5..c145cdb9 100644 --- a/Items/TheGlorch.cs +++ b/Items/TheGlorch.cs @@ -4,47 +4,49 @@ using Terraria.ModLoader; using Microsoft.Xna.Framework; -namespace Tremor.Items { -public class TheGlorch : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class TheGlorch : ModItem + { + public override void SetDefaults() + { - item.damage = 72; - item.melee = true; - item.width = 40; - item.height = 52; - item.useTime = 21; - item.useAnimation = 21; - item.useStyle = 1; - item.knockBack = 6; - item.value = 660; - item.rare = 5; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 72; + item.melee = true; + item.width = 40; + item.height = 52; + item.useTime = 21; + item.useAnimation = 21; + item.useStyle = 1; + item.knockBack = 6; + item.value = 660; + item.rare = 5; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("The Glorch"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("The Glorch"); + Tooltip.SetDefault(""); + } - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) - { - if(Main.rand.Next(3) == 0) - { - target.AddBuff(70, 1200); - } - } + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + { + if (Main.rand.Next(3) == 0) + { + target.AddBuff(70, 1200); + } + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if(Main.rand.Next(3) == 0) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 74); - } - } -}} + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.Next(3) == 0) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 74); + } + } + } +} diff --git a/Items/TheRib.cs b/Items/TheRib.cs index f45e4814..a930818e 100644 --- a/Items/TheRib.cs +++ b/Items/TheRib.cs @@ -4,23 +4,25 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TheRib : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class TheRib : ModItem + { + public override void SetDefaults() + { - item.width = 28; - item.height = 30; - item.maxStack = 99; - item.value = 100; - item.rare = 4; - } + item.width = 28; + item.height = 30; + item.maxStack = 99; + item.value = 100; + item.rare = 4; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("The Rib"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("The Rib"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/TheSnowBall.cs b/Items/TheSnowBall.cs index 1b360a62..6b3ea092 100644 --- a/Items/TheSnowBall.cs +++ b/Items/TheSnowBall.cs @@ -5,35 +5,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TheSnowBall : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class TheSnowBall : ModItem + { + public override void SetDefaults() + { - item.damage = 27; - item.magic = true; - item.mana = 9; - item.width = 40; - item.height = 40; - item.useTime = 40; - item.useAnimation = 40; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 3; - item.value = 13800; - item.rare = 3; - item.UseSound = SoundID.Item43; - item.autoReuse = true; - item.noUseGraphic = true; - item.shoot = mod.ProjectileType("TheSnowBall"); - item.shootSpeed = 8f; - } + item.damage = 27; + item.magic = true; + item.mana = 9; + item.width = 40; + item.height = 40; + item.useTime = 40; + item.useAnimation = 40; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 3; + item.value = 13800; + item.rare = 3; + item.UseSound = SoundID.Item43; + item.autoReuse = true; + item.noUseGraphic = true; + item.shoot = mod.ProjectileType("TheSnowBall"); + item.shootSpeed = 8f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("The Snow Ball"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("The Snow Ball"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/TheSpike.cs b/Items/TheSpike.cs index d83f971d..53e9eee3 100644 --- a/Items/TheSpike.cs +++ b/Items/TheSpike.cs @@ -5,27 +5,28 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TheSpike : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.CloneDefaults(3279); + public class TheSpike : ModItem + { + public override void SetDefaults() + { + item.CloneDefaults(3279); - item.damage = 23; - item.width = 30; - item.height = 26; - item.shoot = mod.ProjectileType("TheSpikePro"); - item.knockBack = 4; - item.value = 30000; - item.rare = 3; - } + item.damage = 23; + item.width = 30; + item.height = 26; + item.shoot = mod.ProjectileType("TheSpikePro"); + item.knockBack = 4; + item.value = 30000; + item.rare = 3; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("The Spike"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("The Spike"); + Tooltip.SetDefault(""); + } -} + } } diff --git a/Items/TheThingBanner.cs b/Items/TheThingBanner.cs index 432c82ef..08eed4a6 100644 --- a/Items/TheThingBanner.cs +++ b/Items/TheThingBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TheThingBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class TheThingBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 97; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 97; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("The Thing Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("The Thing Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/TheTide.cs b/Items/TheTide.cs index a1c3e2f2..ba8e7556 100644 --- a/Items/TheTide.cs +++ b/Items/TheTide.cs @@ -5,37 +5,38 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TheTide : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.damage = 44; - item.ranged = true; - item.width = 52; - item.height = 22; - item.useTime = 15; - item.useAnimation = 15; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 6; - item.value = 50000; - - - item.rare = 5; - item.UseSound = SoundID.Item11; - item.autoReuse = true; - item.shoot = 27; - item.shootSpeed = 26f; - item.useAmmo = AmmoID.Bullet; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("The Tide"); - Tooltip.SetDefault("Shoots fast moving water bolts\nUses bullets as ammo"); - } + public class TheTide : ModItem + { + public override void SetDefaults() + { + + item.damage = 44; + item.ranged = true; + item.width = 52; + item.height = 22; + item.useTime = 15; + item.useAnimation = 15; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 6; + item.value = 50000; + + + item.rare = 5; + item.UseSound = SoundID.Item11; + item.autoReuse = true; + item.shoot = 27; + item.shootSpeed = 26f; + item.useAmmo = AmmoID.Bullet; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("The Tide"); + Tooltip.SetDefault("Shoots fast moving water bolts\nUses bullets as ammo"); + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) @@ -44,8 +45,9 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX return base.Shoot(player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack); } - public override Vector2? HoldoutOffset() - { - return new Vector2(-16, 0); - } -}} + public override Vector2? HoldoutOffset() + { + return new Vector2(-16, 0); + } + } +} diff --git a/Items/TheUltimateBoomstick.cs b/Items/TheUltimateBoomstick.cs index 007df383..5f7500bd 100644 --- a/Items/TheUltimateBoomstick.cs +++ b/Items/TheUltimateBoomstick.cs @@ -5,77 +5,79 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TheUltimateBoomstick : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class TheUltimateBoomstick : ModItem + { + public override void SetDefaults() + { - item.damage = 312; - item.ranged = true; - item.width = 78; - item.height = 22; - item.useTime = 45; - item.useAnimation = 45; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 3; - item.value = 13800; - item.rare = 10; - item.UseSound = SoundID.Item36; - item.autoReuse = false; - item.shoot = 10; - item.shootSpeed = 5f; - item.useAmmo = AmmoID.Bullet; + item.damage = 312; + item.ranged = true; + item.width = 78; + item.height = 22; + item.useTime = 45; + item.useAnimation = 45; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 3; + item.value = 13800; + item.rare = 10; + item.UseSound = SoundID.Item36; + item.autoReuse = false; + item.shoot = 10; + item.shootSpeed = 5f; + item.useAmmo = AmmoID.Bullet; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("The Ultimate Boomstick"); - Tooltip.SetDefault("Has a chance to shoot moon flames\n'What can be better than a giant shotgun!?'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("The Ultimate Boomstick"); + Tooltip.SetDefault("Has a chance to shoot moon flames\n'What can be better than a giant shotgun!?'"); + } - public override Vector2? HoldoutOffset() - { - return new Vector2(-18, 0); - } + public override Vector2? HoldoutOffset() + { + return new Vector2(-18, 0); + } -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) -{ + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { type = 638; - if(Main.rand.Next(4) == 0) - { - type = 645; - } + if (Main.rand.Next(4) == 0) + { + type = 645; + } - for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. - { - Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 2, speedY - 2, type, damage, knockBack, Main.myPlayer); - } - return false; -} + for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. + { + Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 2, speedY - 2, type, damage, knockBack, Main.myPlayer); + } + return false; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "VoidBar", 5); - recipe.AddIngredient(3467, 5); - recipe.AddIngredient(null, "MultidimensionalFragment", 10); - recipe.AddIngredient(null, "ConcentratedEther", 15); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "VoidBar", 5); + recipe.AddIngredient(3467, 5); + recipe.AddIngredient(null, "MultidimensionalFragment", 10); + recipe.AddIngredient(null, "ConcentratedEther", 15); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } +} diff --git a/Items/ThiefBanner.cs b/Items/ThiefBanner.cs index 0e6d9f62..8ff7cdad 100644 --- a/Items/ThiefBanner.cs +++ b/Items/ThiefBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ThiefBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ThiefBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 98; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 98; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Thief Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Thief Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/ThornBall.cs b/Items/ThornBall.cs index 6ded2e43..c420210c 100644 --- a/Items/ThornBall.cs +++ b/Items/ThornBall.cs @@ -5,34 +5,36 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ThornBall : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ThornBall : ModItem + { + public override void SetDefaults() + { - item.damage = 36; - item.thrown = true; - item.width = 18; - item.height = 18; -item.maxStack = 999; - item.useTime = 14; - item.useAnimation = 14; - item.shoot = mod.ProjectileType("ThornBall"); - item.shootSpeed = 8f; - item.useStyle = 1; - item.knockBack = 3; - item.value = 155; - item.rare = 5; -item.consumable = true; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 36; + item.thrown = true; + item.width = 18; + item.height = 18; + item.maxStack = 999; + item.useTime = 14; + item.useAnimation = 14; + item.shoot = mod.ProjectileType("ThornBall"); + item.shootSpeed = 8f; + item.useStyle = 1; + item.knockBack = 3; + item.value = 155; + item.rare = 5; + item.consumable = true; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Thorn Ball"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Thorn Ball"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/ThrowerEmblem.cs b/Items/ThrowerEmblem.cs index 6430e22d..4ecb65a7 100644 --- a/Items/ThrowerEmblem.cs +++ b/Items/ThrowerEmblem.cs @@ -17,18 +17,18 @@ public override void SetDefaults() item.accessory = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Thrower Emblem"); - Tooltip.SetDefault("15% increased throwing damage"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Thrower Emblem"); + Tooltip.SetDefault("15% increased throwing damage"); + } + - public override void UpdateAccessory(Player player, bool hideVisual) { - player.thrownDamage += 0.15f; - } - + player.thrownDamage += 0.15f; + } + public override void AddRecipes() { var recipe = new ModRecipe(mod); diff --git a/Items/ThrowerFocus.cs b/Items/ThrowerFocus.cs index 41c6c2d7..efff5578 100644 --- a/Items/ThrowerFocus.cs +++ b/Items/ThrowerFocus.cs @@ -6,43 +6,45 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ThrowerFocus : ModItem +namespace Tremor.Items { + public class ThrowerFocus : ModItem + { - public override void SetDefaults() - { - - item.width = 22; - item.height = 22; - - - item.rare = 2; - item.accessory = true; - item.value = 100000; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Thrower Focus"); - Tooltip.SetDefault("6% increased thrown damage\nIncreases thrown critical strike chance by 12"); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 4)); - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.thrownDamage += 0.06f; - player.thrownCrit += 12; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ThrowerSpark"); - recipe.AddIngredient(3380, 15); - recipe.AddIngredient(ItemID.Amber, 16); - recipe.SetResult(this); - recipe.AddTile(null, "AltarofEnchantmentsTile"); - recipe.AddRecipe(); - } -}} + public override void SetDefaults() + { + + item.width = 22; + item.height = 22; + + + item.rare = 2; + item.accessory = true; + item.value = 100000; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Thrower Focus"); + Tooltip.SetDefault("6% increased thrown damage\nIncreases thrown critical strike chance by 12"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 4)); + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.thrownDamage += 0.06f; + player.thrownCrit += 12; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ThrowerSpark"); + recipe.AddIngredient(3380, 15); + recipe.AddIngredient(ItemID.Amber, 16); + recipe.SetResult(this); + recipe.AddTile(null, "AltarofEnchantmentsTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/ThrowerSoul.cs b/Items/ThrowerSoul.cs index 7515377e..55a343b2 100644 --- a/Items/ThrowerSoul.cs +++ b/Items/ThrowerSoul.cs @@ -6,43 +6,45 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ThrowerSoul : ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 22; - item.height = 22; - - - item.rare = 3; - item.accessory = true; - item.value = 50000; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Thrower Soul"); - Tooltip.SetDefault("10% increased thrown damage\nIncreases thrown critical strike chance by 15"); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 6)); - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.thrownDamage += 0.1f; - player.thrownCrit += 15; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ThrowerFocus"); - recipe.AddIngredient(null, "Opal", 3); - recipe.AddIngredient(null, "ThrowerEmblem", 1); - recipe.SetResult(this); - recipe.AddTile(null, "AltarofEnchantmentsTile"); - recipe.AddRecipe(); - } -}} + public class ThrowerSoul : ModItem + { + + public override void SetDefaults() + { + + item.width = 22; + item.height = 22; + + + item.rare = 3; + item.accessory = true; + item.value = 50000; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Thrower Soul"); + Tooltip.SetDefault("10% increased thrown damage\nIncreases thrown critical strike chance by 15"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 6)); + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.thrownDamage += 0.1f; + player.thrownCrit += 15; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ThrowerFocus"); + recipe.AddIngredient(null, "Opal", 3); + recipe.AddIngredient(null, "ThrowerEmblem", 1); + recipe.SetResult(this); + recipe.AddTile(null, "AltarofEnchantmentsTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/ThrowerSpark.cs b/Items/ThrowerSpark.cs index f6fed3ee..92f35c7a 100644 --- a/Items/ThrowerSpark.cs +++ b/Items/ThrowerSpark.cs @@ -6,40 +6,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ThrowerSpark : ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 22; - item.height = 22; - - - item.rare = 1; - item.accessory = true; - item.value = 20000; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Thrower Spark"); - Tooltip.SetDefault("3% increased thrown damage\nIncreases thrown critical strike chance by 8"); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 4)); - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.thrownDamage += 0.03f; - player.thrownCrit += 8; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "AdventurerSpark"); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public class ThrowerSpark : ModItem + { + + public override void SetDefaults() + { + + item.width = 22; + item.height = 22; + + + item.rare = 1; + item.accessory = true; + item.value = 20000; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Thrower Spark"); + Tooltip.SetDefault("3% increased thrown damage\nIncreases thrown critical strike chance by 8"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 4)); + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.thrownDamage += 0.03f; + player.thrownCrit += 8; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "AdventurerSpark"); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/ThrowingAxe.cs b/Items/ThrowingAxe.cs index bc3ba27e..97897e2b 100644 --- a/Items/ThrowingAxe.cs +++ b/Items/ThrowingAxe.cs @@ -5,35 +5,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ThrowingAxe : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ThrowingAxe : ModItem + { + public override void SetDefaults() + { - item.damage = 15; - item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("ThrowingAxe"); - item.shootSpeed = 10f; - item.useStyle = 1; - item.knockBack = 4; - item.value = 14; - item.rare = 0; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 15; + item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("ThrowingAxe"); + item.shootSpeed = 10f; + item.useStyle = 1; + item.knockBack = 4; + item.value = 14; + item.rare = 0; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Throwing Axe"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Throwing Axe"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/ThrowingCog.cs b/Items/ThrowingCog.cs index 2d0d5541..0e32ddfe 100644 --- a/Items/ThrowingCog.cs +++ b/Items/ThrowingCog.cs @@ -5,35 +5,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ThrowingCog : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ThrowingCog : ModItem + { + public override void SetDefaults() + { - item.damage = 49; - item.thrown = true; - item.width = 30; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("ThrowingCog"); - item.shootSpeed = 10f; - item.useStyle = 1; - item.knockBack = 4; - item.value = 7; - item.rare = 5; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 49; + item.thrown = true; + item.width = 30; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("ThrowingCog"); + item.shootSpeed = 10f; + item.useStyle = 1; + item.knockBack = 4; + item.value = 7; + item.rare = 5; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Throwing Cog"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Throwing Cog"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/ThrowingWrench.cs b/Items/ThrowingWrench.cs index d41093fe..e844bbe0 100644 --- a/Items/ThrowingWrench.cs +++ b/Items/ThrowingWrench.cs @@ -5,35 +5,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ThrowingWrench : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ThrowingWrench : ModItem + { + public override void SetDefaults() + { - item.damage = 25; - item.thrown = true; - item.width = 28; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = 582; - item.shootSpeed = 14f; - item.useStyle = 1; - item.knockBack = 4; - item.value = 60; - item.rare = 4; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 25; + item.thrown = true; + item.width = 28; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = 582; + item.shootSpeed = 14f; + item.useStyle = 1; + item.knockBack = 4; + item.value = 60; + item.rare = 4; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Throwing Wrench"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Throwing Wrench"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/ThunderRay.cs b/Items/ThunderRay.cs index 1c8fa32a..5ad8aaf7 100644 --- a/Items/ThunderRay.cs +++ b/Items/ThunderRay.cs @@ -4,33 +4,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ThunderRay : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ThunderRay : ModItem + { + public override void SetDefaults() + { - item.damage = 24; - item.width = 14; - item.height = 84; - item.magic = true; - item.mana = 9; - item.useTime = 26; - item.shoot = 255; - item.shootSpeed = 8f; - item.useAnimation = 26; - item.useStyle = 5; - item.knockBack = 0; - item.value = 2100; - item.rare = 2; - item.UseSound = SoundID.Item114; - item.autoReuse = true; - } + item.damage = 24; + item.width = 14; + item.height = 84; + item.magic = true; + item.mana = 9; + item.useTime = 26; + item.shoot = 255; + item.shootSpeed = 8f; + item.useAnimation = 26; + item.useStyle = 5; + item.knockBack = 0; + item.value = 2100; + item.rare = 2; + item.UseSound = SoundID.Item114; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Thunder Ray"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Thunder Ray"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/TikiArmor.cs b/Items/TikiArmor.cs index eefd2465..6ac8ef4f 100644 --- a/Items/TikiArmor.cs +++ b/Items/TikiArmor.cs @@ -5,43 +5,45 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TikiArmor : ModItem +namespace Tremor.Items { + public class TikiArmor : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 34; - item.height = 34; - item.value = 150000; - item.rare = 3; + item.width = 34; + item.height = 34; + item.value = 150000; + item.rare = 3; - item.defense = 4; - item.accessory = true; - } + item.defense = 4; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Tiki Armor"); - Tooltip.SetDefault("15% increased minion damage"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Tiki Armor"); + Tooltip.SetDefault("15% increased minion damage"); + } - public override void UpdateEquip(Player player) - { - player.minionDamage += 0.15f; - } + public override void UpdateEquip(Player player) + { + player.minionDamage += 0.15f; + } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(null, "JungleAlloy", 1); recipe.AddIngredient(null, "WoodenFrame", 1); - recipe.AddIngredient(ItemID.Vine, 5); - recipe.AddIngredient(ItemID.JungleSpores, 15); + recipe.AddIngredient(ItemID.Vine, 5); + recipe.AddIngredient(ItemID.JungleSpores, 15); recipe.AddTile(114); recipe.SetResult(this); recipe.AddRecipe(); - } + } -}} + } +} diff --git a/Items/TikiSkull.cs b/Items/TikiSkull.cs index fb394a98..3bfff523 100644 --- a/Items/TikiSkull.cs +++ b/Items/TikiSkull.cs @@ -5,29 +5,31 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TikiSkull : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class TikiSkull : ModItem + { + public override void SetDefaults() + { - item.width = 20; - item.height = 24; - item.value = 10000; + item.width = 20; + item.height = 24; + item.value = 10000; - item.rare = 9; - item.expert = true; - item.accessory = true; - } + item.rare = 9; + item.expert = true; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Tiki Skull"); - Tooltip.SetDefault("10% increased minion damage"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Tiki Skull"); + Tooltip.SetDefault("10% increased minion damage"); + } - public override void UpdateEquip(Player player) - { - player.minionDamage += 0.1f; - } -}} + public override void UpdateEquip(Player player) + { + player.minionDamage += 0.1f; + } + } +} diff --git a/Items/TikiTotemBag.cs b/Items/TikiTotemBag.cs index 231fe616..0e4ceaf1 100644 --- a/Items/TikiTotemBag.cs +++ b/Items/TikiTotemBag.cs @@ -4,66 +4,68 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TikiTotemBag : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class TikiTotemBag : ModItem + { + public override void SetDefaults() + { - item.maxStack = 999; - item.consumable = true; - item.width = 24; - item.height = 24; + item.maxStack = 999; + item.consumable = true; + item.width = 24; + item.height = 24; - item.rare = 9; - item.expert = true; - bossBagNPC = mod.NPCType("TikiTotem"); - } + item.rare = 9; + item.expert = true; + bossBagNPC = mod.NPCType("TikiTotem"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Treasure Bag"); - Tooltip.SetDefault("Right click to open"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Treasure Bag"); + Tooltip.SetDefault("Right click to open"); + } - public override bool CanRightClick() - { - return true; - } + public override bool CanRightClick() + { + return true; + } - public override void OpenBossBag(Player player) - { - if(Main.rand.Next(7) == 0) - { - player.QuickSpawnItem(mod.ItemType("AngryTotemMask")); - } - if(Main.rand.Next(1) == 0) - { - player.QuickSpawnItem(mod.ItemType("JungleAlloy")); - } + public override void OpenBossBag(Player player) + { + if (Main.rand.Next(7) == 0) + { + player.QuickSpawnItem(mod.ItemType("AngryTotemMask")); + } + if (Main.rand.Next(1) == 0) + { + player.QuickSpawnItem(mod.ItemType("JungleAlloy")); + } - if(Main.rand.Next(7) == 0) - { - player.QuickSpawnItem(mod.ItemType("HappyTotemMask")); - } + if (Main.rand.Next(7) == 0) + { + player.QuickSpawnItem(mod.ItemType("HappyTotemMask")); + } - if(Main.rand.Next(7) == 0) - { - player.QuickSpawnItem(mod.ItemType("IndifferentTotemMask")); - } - player.QuickSpawnItem(mod.ItemType("ToxicBlade")); + if (Main.rand.Next(7) == 0) + { + player.QuickSpawnItem(mod.ItemType("IndifferentTotemMask")); + } + player.QuickSpawnItem(mod.ItemType("ToxicBlade")); - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("ToxicHilt")); - } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("ToxicHilt")); + } - player.QuickSpawnItem(mod.ItemType("TikiSkull")); + player.QuickSpawnItem(mod.ItemType("TikiSkull")); - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("PickaxeofBloom")); - } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("PickaxeofBloom")); + } + } + } } -}} diff --git a/Items/TikiTotemMusicBox.cs b/Items/TikiTotemMusicBox.cs index 80bcf6ad..0a27f96e 100644 --- a/Items/TikiTotemMusicBox.cs +++ b/Items/TikiTotemMusicBox.cs @@ -25,11 +25,11 @@ public override void SetDefaults() item.accessory = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Music Box (Tiki Totem)"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Music Box (Tiki Totem)"); + Tooltip.SetDefault(""); + } } } diff --git a/Items/TikiTotemTrophy.cs b/Items/TikiTotemTrophy.cs index 11aae385..574d7b6e 100644 --- a/Items/TikiTotemTrophy.cs +++ b/Items/TikiTotemTrophy.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TikiTotemTrophy : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class TikiTotemTrophy : ModItem + { + public override void SetDefaults() + { - item.width = 32; - item.height = 32; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 50000; - item.createTile = mod.TileType("TikiTotemTrophy"); - item.placeStyle = 0; - } + item.width = 32; + item.height = 32; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 50000; + item.createTile = mod.TileType("TikiTotemTrophy"); + item.placeStyle = 0; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Tiki Totem Trophy"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Tiki Totem Trophy"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/TinShield.cs b/Items/TinShield.cs index 09d16262..26a01cbe 100644 --- a/Items/TinShield.cs +++ b/Items/TinShield.cs @@ -5,37 +5,39 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Shield)] -public class TinShield : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + [AutoloadEquip(EquipType.Shield)] + public class TinShield : ModItem + { + public override void SetDefaults() + { - item.width = 24; - item.height = 30; - item.value = 110; - item.rare = 0; - item.accessory = true; - item.defense = 2; - } + item.width = 24; + item.height = 30; + item.value = 110; + item.rare = 0; + item.accessory = true; + item.defense = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Tin Shield"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Tin Shield"); + Tooltip.SetDefault(""); + } - public override void UpdateEquip(Player player) - { - player.moveSpeed -= 0.10f; - } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.TinBar, 15); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void UpdateEquip(Player player) + { + player.moveSpeed -= 0.10f; + } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.TinBar, 15); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/TinSpear.cs b/Items/TinSpear.cs index c04aaf80..5f44c54f 100644 --- a/Items/TinSpear.cs +++ b/Items/TinSpear.cs @@ -4,42 +4,44 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TinSpear : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class TinSpear : ModItem + { + public override void SetDefaults() + { - item.damage = 10; - item.width = 14; - item.height = 84; - item.noUseGraphic = true; - item.melee = true; - item.useTime = 30; - item.shoot = mod.ProjectileType("TinSpearPro"); - item.shootSpeed = 3f; - item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 4; - item.value = 1000; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 10; + item.width = 14; + item.height = 84; + item.noUseGraphic = true; + item.melee = true; + item.useTime = 30; + item.shoot = mod.ProjectileType("TinSpearPro"); + item.shootSpeed = 3f; + item.useAnimation = 30; + item.useStyle = 5; + item.knockBack = 4; + item.value = 1000; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Tin Spear"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Tin Spear"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.TinBar, 9); - recipe.AddTile(16); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.TinBar, 9); + recipe.AddTile(16); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/TinySai.cs b/Items/TinySai.cs index 9fcc129e..8a3e536d 100644 --- a/Items/TinySai.cs +++ b/Items/TinySai.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TinySai : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class TinySai : ModItem + { + public override void SetDefaults() + { - item.damage = 8; - item.melee = true; - item.width = 32; - item.height = 32; - item.useTime = 9; - item.useAnimation = 9; - item.useStyle = 3; - item.knockBack = 2; - item.value = 600; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 8; + item.melee = true; + item.width = 32; + item.height = 32; + item.useTime = 9; + item.useAnimation = 9; + item.useStyle = 3; + item.knockBack = 2; + item.value = 600; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Tiny Sai"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Tiny Sai"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/TitaniumDisc.cs b/Items/TitaniumDisc.cs index 2c0a19a9..3de07d93 100644 --- a/Items/TitaniumDisc.cs +++ b/Items/TitaniumDisc.cs @@ -4,53 +4,55 @@ using Terraria.ModLoader; using Terraria.ID; -namespace Tremor.Items { -public class TitaniumDisc : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class TitaniumDisc : ModItem + { + public override void SetDefaults() + { - item.damage = 44; - item.thrown = true; - item.width = 48; - item.height = 48; - item.useTime = 20; - item.shootSpeed = 12f; - item.useAnimation = 20; - item.useStyle = 1; - item.knockBack = 3f; - item.shoot = mod.ProjectileType("TitaniumDiscPro"); - item.value = 27600; - item.rare = 4; - item.noUseGraphic = true; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 44; + item.thrown = true; + item.width = 48; + item.height = 48; + item.useTime = 20; + item.shootSpeed = 12f; + item.useAnimation = 20; + item.useStyle = 1; + item.knockBack = 3f; + item.shoot = mod.ProjectileType("TitaniumDiscPro"); + item.value = 27600; + item.rare = 4; + item.noUseGraphic = true; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Titanium Disc"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Titanium Disc"); + Tooltip.SetDefault(""); + } -public override bool CanUseItem(Player player) -{ - for (int i = 0; i < 1000; ++i) - { - if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) - { - return false; - } - } - return true; + public override bool CanUseItem(Player player) + { + for (int i = 0; i < 1000; ++i) + { + if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == item.shoot) + { + return false; + } + } + return true; + } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.TitaniumBar, 12); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.TitaniumBar, 12); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} diff --git a/Items/TitaniumHeader.cs b/Items/TitaniumHeader.cs index 78031ba6..18f15695 100644 --- a/Items/TitaniumHeader.cs +++ b/Items/TitaniumHeader.cs @@ -5,58 +5,61 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class TitaniumHeader : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class TitaniumHeader : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 24; - item.height = 24; + item.width = 24; + item.height = 24; - item.value = 400; - item.rare = 4; - item.defense = 8; - } + item.value = 400; + item.rare = 4; + item.defense = 8; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Titanium Header"); - Tooltip.SetDefault("Increases thrown damage by 24%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Titanium Header"); + Tooltip.SetDefault("Increases thrown damage by 24%"); + } - public override void UpdateEquip(Player player) - { - player.thrownDamage += 0.24f; - } + public override void UpdateEquip(Player player) + { + player.thrownDamage += 0.24f; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == 1218 && legs.type == 1219; - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == 1218 && legs.type == 1219; + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increases thrown weapon velocity and briefly become invulnerable after striking an enemy"; - player.thrownVelocity +=0.25f; -player.onHitDodge = true; - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increases thrown weapon velocity and briefly become invulnerable after striking an enemy"; + player.thrownVelocity += 0.25f; + player.onHitDodge = true; + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawOutlines=true; + player.armorEffectDrawOutlines = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.TitaniumBar, 12); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.TitaniumBar, 12); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/TitaniumHood.cs b/Items/TitaniumHood.cs index 44f71c10..157f9132 100644 --- a/Items/TitaniumHood.cs +++ b/Items/TitaniumHood.cs @@ -5,58 +5,61 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class TitaniumHood : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class TitaniumHood : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 24; - item.height = 24; + item.width = 24; + item.height = 24; - item.value = 400; - item.rare = 4; - item.defense = 8; - } + item.value = 400; + item.rare = 4; + item.defense = 8; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Titanium Hood"); - Tooltip.SetDefault("Increases minion damage by 24%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Titanium Hood"); + Tooltip.SetDefault("Increases minion damage by 24%"); + } - public override void UpdateEquip(Player player) - { - player.minionDamage += 0.24f; - } + public override void UpdateEquip(Player player) + { + player.minionDamage += 0.24f; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == 1218 && legs.type == 1219; - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == 1218 && legs.type == 1219; + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increases your max number of minions and briefly become invulnerable after striking an enemy"; - player.maxMinions += 3; -player.onHitDodge = true; - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increases your max number of minions and briefly become invulnerable after striking an enemy"; + player.maxMinions += 3; + player.onHitDodge = true; + } public override void ArmorSetShadows(Player player) { - player.armorEffectDrawOutlines=true; + player.armorEffectDrawOutlines = true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.TitaniumBar, 12); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.TitaniumBar, 12); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/TitaniumRifle.cs b/Items/TitaniumRifle.cs index 2d33586d..8910b9a8 100644 --- a/Items/TitaniumRifle.cs +++ b/Items/TitaniumRifle.cs @@ -5,47 +5,49 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TitaniumRifle : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class TitaniumRifle : ModItem + { + public override void SetDefaults() + { - item.damage = 45; - item.ranged = true; - item.width = 40; - item.height = 20; - item.useTime = 15; - item.useAnimation = 15; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 6; - item.value = 10000; - item.rare = 5; - item.UseSound = SoundID.Item11; - item.autoReuse = true; - item.shoot = 10; - item.shootSpeed = 12f; - item.useAmmo = AmmoID.Bullet; - } + item.damage = 45; + item.ranged = true; + item.width = 40; + item.height = 20; + item.useTime = 15; + item.useAnimation = 15; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 6; + item.value = 10000; + item.rare = 5; + item.UseSound = SoundID.Item11; + item.autoReuse = true; + item.shoot = 10; + item.shootSpeed = 12f; + item.useAmmo = AmmoID.Bullet; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Titanium Rifle"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Titanium Rifle"); + Tooltip.SetDefault(""); + } - public override Vector2? HoldoutOffset() - { - return new Vector2(-15, 0); - } + public override Vector2? HoldoutOffset() + { + return new Vector2(-15, 0); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.TitaniumBar, 15); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.TitaniumBar, 15); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/TitaniumStaff.cs b/Items/TitaniumStaff.cs index 7500a453..808181ef 100644 --- a/Items/TitaniumStaff.cs +++ b/Items/TitaniumStaff.cs @@ -5,36 +5,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TitaniumStaff : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.CloneDefaults(ItemID.Starfury); + public class TitaniumStaff : ModItem + { + public override void SetDefaults() + { + item.CloneDefaults(ItemID.Starfury); - item.damage = 43; - item.magic = true; - item.mana = 9; - item.width = 40; - item.height = 40; - item.useTime = 14; - item.useAnimation = 14; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 3; - item.value = 13800; - item.rare = 4; - item.UseSound = SoundID.Item24; - item.autoReuse = true; - Item.staff[item.type] = true; //this makes the useStyle animate as a staff instead of as a gun - item.shootSpeed = 15f; - } + item.damage = 43; + item.magic = true; + item.mana = 9; + item.width = 40; + item.height = 40; + item.useTime = 14; + item.useAnimation = 14; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 3; + item.value = 13800; + item.rare = 4; + item.UseSound = SoundID.Item24; + item.autoReuse = true; + Item.staff[item.type] = true; //this makes the useStyle animate as a staff instead of as a gun + item.shootSpeed = 15f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Titanium Staff"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Titanium Staff"); + Tooltip.SetDefault(""); + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) @@ -42,12 +43,13 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX type = mod.ProjectileType("TitaniumBolt"); return base.Shoot(player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.TitaniumBar, 12); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.TitaniumBar, 12); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/TitaniumVisage.cs b/Items/TitaniumVisage.cs index 2986aee9..d8103a1e 100644 --- a/Items/TitaniumVisage.cs +++ b/Items/TitaniumVisage.cs @@ -7,52 +7,52 @@ namespace Tremor.Items { -[AutoloadEquip(EquipType.Head)] - public class TitaniumVisage : ModItem - { - - public override void SetDefaults() - { - - item.width = 24; - item.height = 24; - - item.value = 400; - item.rare = 4; - item.defense = 9; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Titanium Visage"); - Tooltip.SetDefault("Increases alchemic damage by 24%"); - } - - - public override void UpdateEquip(Player player) - { - player.GetModPlayer(mod).alchemistDamage += 0.24f; - } - - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == 1218 && legs.type == 1219; - } - - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increases alchemic critical strike chance by 20% and become invulnerable after striking an enemy"; - player.GetModPlayer(mod).alchemistCrit += 20; - player.onHitDodge = true; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.TitaniumBar, 10); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } - } + [AutoloadEquip(EquipType.Head)] + public class TitaniumVisage : ModItem + { + + public override void SetDefaults() + { + + item.width = 24; + item.height = 24; + + item.value = 400; + item.rare = 4; + item.defense = 9; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Titanium Visage"); + Tooltip.SetDefault("Increases alchemic damage by 24%"); + } + + + public override void UpdateEquip(Player player) + { + player.GetModPlayer(mod).alchemistDamage += 0.24f; + } + + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == 1218 && legs.type == 1219; + } + + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increases alchemic critical strike chance by 20% and become invulnerable after striking an enemy"; + player.GetModPlayer(mod).alchemistCrit += 20; + player.onHitDodge = true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.TitaniumBar, 10); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } } diff --git a/Items/TitaniumWarhammer.cs b/Items/TitaniumWarhammer.cs index a4eef5a7..4267683b 100644 --- a/Items/TitaniumWarhammer.cs +++ b/Items/TitaniumWarhammer.cs @@ -4,40 +4,42 @@ using Terraria.ModLoader; using Terraria.ID; -namespace Tremor.Items { -public class TitaniumWarhammer : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class TitaniumWarhammer : ModItem + { + public override void SetDefaults() + { - item.damage = 50; - item.melee = true; - item.width = 44; - item.height = 44; - item.useTime = 35; - item.useAnimation = 35; - item.hammer = 86; - item.useStyle = 1; - item.knockBack = 7; - item.value = 32200; - item.rare = 4; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 50; + item.melee = true; + item.width = 44; + item.height = 44; + item.useTime = 35; + item.useAnimation = 35; + item.hammer = 86; + item.useStyle = 1; + item.knockBack = 7; + item.value = 32200; + item.rare = 4; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Titanium Warhammer"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Titanium Warhammer"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.TitaniumBar, 13); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.TitaniumBar, 13); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/TombRaider.cs b/Items/TombRaider.cs index a5f8adae..ebf848b4 100644 --- a/Items/TombRaider.cs +++ b/Items/TombRaider.cs @@ -4,35 +4,37 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { -public class TombRaider : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class TombRaider : ModItem + { + public override void SetDefaults() + { - item.damage = 20; - item.melee = true; - item.width = 40; - item.height = 40; - item.useTime = 30; - item.useAnimation = 20; - item.useStyle = 1; - item.knockBack = 9; - item.value = 36000; - item.rare = 2; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 20; + item.melee = true; + item.width = 40; + item.height = 40; + item.useTime = 30; + item.useAnimation = 20; + item.useStyle = 1; + item.knockBack = 9; + item.value = 36000; + item.rare = 2; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Tomb Raider"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Tomb Raider"); + Tooltip.SetDefault(""); + } - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(31, 30); - } -}} + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(31, 30); + } + } +} diff --git a/Items/ToothofAbraxas.cs b/Items/ToothofAbraxas.cs index ae8e0e78..19839cd9 100644 --- a/Items/ToothofAbraxas.cs +++ b/Items/ToothofAbraxas.cs @@ -4,24 +4,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ToothofAbraxas : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ToothofAbraxas : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 19000; - item.rare = 11; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 19000; + item.rare = 11; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Tooth of Abraxas"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Tooth of Abraxas"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/Toothpick.cs b/Items/Toothpick.cs index efb75bac..cf0ce357 100644 --- a/Items/Toothpick.cs +++ b/Items/Toothpick.cs @@ -4,54 +4,56 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class Toothpick : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.damage = 8; - item.melee = true; - item.width = 20; - item.height = 12; - item.useTime = 15; - item.useAnimation = 25; - item.channel = true; - item.noUseGraphic = true; - item.noMelee = true; - item.pick = 65; - item.tileBoost++; - item.useStyle = 5; - item.knockBack = 6; - item.value = Item.buyPrice(0, 1, 50, 0); - item.rare = 3; - item.UseSound = SoundID.Item23; - item.autoReuse = true; - item.shoot = mod.ProjectileType("ToothpickPro"); - item.shootSpeed = 26f; - } + public class Toothpick : ModItem + { + public override void SetDefaults() + { + + item.damage = 8; + item.melee = true; + item.width = 20; + item.height = 12; + item.useTime = 15; + item.useAnimation = 25; + item.channel = true; + item.noUseGraphic = true; + item.noMelee = true; + item.pick = 65; + item.tileBoost++; + item.useStyle = 5; + item.knockBack = 6; + item.value = Item.buyPrice(0, 1, 50, 0); + item.rare = 3; + item.UseSound = SoundID.Item23; + item.autoReuse = true; + item.shoot = mod.ProjectileType("ToothpickPro"); + item.shootSpeed = 26f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Toothpick"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Toothpick"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.CrimtaneBar, 10); - recipe.AddIngredient(null, "SharpenedTooth", 5); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.CrimtaneBar, 10); + recipe.AddIngredient(null, "SharpenedTooth", 5); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.DemoniteBar, 10); - recipe.AddIngredient(null, "SharpenedTooth", 5); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.DemoniteBar, 10); + recipe.AddIngredient(null, "SharpenedTooth", 5); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/TopazBlade.cs b/Items/TopazBlade.cs index bd7143d5..64c375eb 100644 --- a/Items/TopazBlade.cs +++ b/Items/TopazBlade.cs @@ -5,46 +5,48 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TopazBlade : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class TopazBlade : ModItem + { + public override void SetDefaults() + { - item.damage = 14; - item.melee = true; - item.width = 46; - item.height = 48; - item.useTime = 25; - item.useAnimation = 25; - item.useStyle = 1; - item.knockBack = 3; - item.value = 6400; - item.rare = 2; - item.UseSound = SoundID.Item15; - item.autoReuse = true; - item.useTurn = true; - } + item.damage = 14; + item.melee = true; + item.width = 46; + item.height = 48; + item.useTime = 25; + item.useAnimation = 25; + item.useStyle = 1; + item.knockBack = 3; + item.value = 6400; + item.rare = 2; + item.UseSound = SoundID.Item15; + item.autoReuse = true; + item.useTurn = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Topaz Blade"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Topaz Blade"); + Tooltip.SetDefault(""); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 64); - } + public override void MeleeEffects(Player player, Rectangle hitbox) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 64); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Topaz, 12); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Topaz, 12); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/TopazDrill.cs b/Items/TopazDrill.cs index d52d02be..5ca9d4e9 100644 --- a/Items/TopazDrill.cs +++ b/Items/TopazDrill.cs @@ -4,47 +4,49 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class TopazDrill : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.damage = 9; - item.melee = true; - item.width = 20; - item.height = 12; - item.useTime = 8; - item.useAnimation = 25; - item.channel = true; - item.noUseGraphic = true; - item.noMelee = true; - item.pick = 85; - item.useStyle = 5; - item.knockBack = 6; - item.value = Item.buyPrice(0, 0, 50, 0); - item.rare = 2; - item.UseSound = SoundID.Item23; - item.autoReuse = true; - item.shoot = mod.ProjectileType("TopazDrillPro"); - item.shootSpeed = 40f; - } + public class TopazDrill : ModItem + { + public override void SetDefaults() + { + + item.damage = 9; + item.melee = true; + item.width = 20; + item.height = 12; + item.useTime = 8; + item.useAnimation = 25; + item.channel = true; + item.noUseGraphic = true; + item.noMelee = true; + item.pick = 85; + item.useStyle = 5; + item.knockBack = 6; + item.value = Item.buyPrice(0, 0, 50, 0); + item.rare = 2; + item.UseSound = SoundID.Item23; + item.autoReuse = true; + item.shoot = mod.ProjectileType("TopazDrillPro"); + item.shootSpeed = 40f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Topaz Drill"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Topaz Drill"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Obsidian, 25); - recipe.AddIngredient(ItemID.MeteoriteBar, 16); - recipe.AddIngredient(ItemID.Topaz, 12); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Obsidian, 25); + recipe.AddIngredient(ItemID.MeteoriteBar, 16); + recipe.AddIngredient(ItemID.Topaz, 12); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/ToxicBlade.cs b/Items/ToxicBlade.cs index b07a443c..ceb3b92a 100644 --- a/Items/ToxicBlade.cs +++ b/Items/ToxicBlade.cs @@ -4,23 +4,25 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ToxicBlade : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ToxicBlade : ModItem + { + public override void SetDefaults() + { - item.width = 28; - item.height = 36; - item.maxStack = 99; - item.value = 100; - item.rare = 1; - } + item.width = 28; + item.height = 36; + item.maxStack = 99; + item.value = 100; + item.rare = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Toxic Blade"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Toxic Blade"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/ToxicClaymore.cs b/Items/ToxicClaymore.cs index 552e670d..7795940f 100644 --- a/Items/ToxicClaymore.cs +++ b/Items/ToxicClaymore.cs @@ -3,49 +3,51 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { -public class ToxicClaymore : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ToxicClaymore : ModItem + { + public override void SetDefaults() + { - item.damage = 26; - item.melee = true; - item.width = 40; - item.height = 52; - item.useTime = 21; - item.useAnimation = 21; - item.useStyle = 1; - item.knockBack = 6; - item.value = 660; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 26; + item.melee = true; + item.width = 40; + item.height = 52; + item.useTime = 21; + item.useAnimation = 21; + item.useStyle = 1; + item.knockBack = 6; + item.value = 660; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Toxic Claymore"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Toxic Claymore"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ToxicHilt", 1); - recipe.AddIngredient(null, "ToxicBlade", 1); - recipe.AddIngredient(null, "BottledGlue", 1); - recipe.SetResult(this); - recipe.AddTile(null, "GreatAnvilTile"); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ToxicHilt", 1); + recipe.AddIngredient(null, "ToxicBlade", 1); + recipe.AddIngredient(null, "BottledGlue", 1); + recipe.SetResult(this); + recipe.AddTile(null, "GreatAnvilTile"); + recipe.AddRecipe(); + } - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) - { - if(Main.rand.Next(3) == 0) - { - target.AddBuff(70, 1200); - } - } -}} + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + { + if (Main.rand.Next(3) == 0) + { + target.AddBuff(70, 1200); + } + } + } +} diff --git a/Items/ToxicFlask.cs b/Items/ToxicFlask.cs index 1b1fedba..880bdd2b 100644 --- a/Items/ToxicFlask.cs +++ b/Items/ToxicFlask.cs @@ -8,66 +8,66 @@ namespace Tremor.Items { - public class ToxicFlask : AlchemistItem - { - public override void SetDefaults() - { - item.damage = 46; - item.width = 28; - item.noUseGraphic = true; - item.maxStack = 1; - item.consumable = false; - item.height = 28; - item.useTime = 28; - item.useAnimation = 28; - item.shoot = mod.ProjectileType("ToxicFlaskPro"); - item.shootSpeed = 9f; - item.useStyle = 1; - item.knockBack = 4; - item.noMelee = true; - item.UseSound = SoundID.Item106; - item.value = Item.sellPrice(0, 2, 0, 0); - item.rare = 8; - item.autoReuse = false; - } + public class ToxicFlask : AlchemistItem + { + public override void SetDefaults() + { + item.damage = 46; + item.width = 28; + item.noUseGraphic = true; + item.maxStack = 1; + item.consumable = false; + item.height = 28; + item.useTime = 28; + item.useAnimation = 28; + item.shoot = mod.ProjectileType("ToxicFlaskPro"); + item.shootSpeed = 9f; + item.useStyle = 1; + item.knockBack = 4; + item.noMelee = true; + item.UseSound = SoundID.Item106; + item.value = Item.sellPrice(0, 2, 0, 0); + item.rare = 8; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Toxic Flask"); - Tooltip.SetDefault("Throws a flask that explodes into toxic clouds"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Toxic Flask"); + Tooltip.SetDefault("Throws a flask that explodes into toxic clouds"); + } - public override void UpdateInventory(Player player) - { - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) - { - item.shootSpeed = 11f; - } - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) - { - item.shootSpeed = 9f; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) - { - item.autoReuse = true; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) - { - item.autoReuse = false; - } - } + public override void UpdateInventory(Player player) + { + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) + { + item.shootSpeed = 11f; + } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) + { + item.shootSpeed = 9f; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) + { + item.autoReuse = true; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) + { + item.autoReuse = false; + } + } - public override void AddRecipes() - { - var recipe = new ModRecipe(mod); - recipe.AddIngredient(this); - recipe.SetResult(3105); - recipe.AddRecipe(); + public override void AddRecipes() + { + var recipe = new ModRecipe(mod); + recipe.AddIngredient(this); + recipe.SetResult(3105); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(3105); - recipe.SetResult(this); - recipe.AddRecipe(); - } - } + recipe = new ModRecipe(mod); + recipe.AddIngredient(3105); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } diff --git a/Items/ToxicHilt.cs b/Items/ToxicHilt.cs index 679f613d..19bcc408 100644 --- a/Items/ToxicHilt.cs +++ b/Items/ToxicHilt.cs @@ -4,23 +4,25 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ToxicHilt : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ToxicHilt : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 22; - item.maxStack = 99; - item.value = 100; - item.rare = 1; - } + item.width = 22; + item.height = 22; + item.maxStack = 99; + item.value = 100; + item.rare = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Toxic Hilt"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Toxic Hilt"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/ToxicRazorknife.cs b/Items/ToxicRazorknife.cs index 734d4e6c..70347b42 100644 --- a/Items/ToxicRazorknife.cs +++ b/Items/ToxicRazorknife.cs @@ -4,32 +4,34 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ToxicRazorknife : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ToxicRazorknife : ModItem + { + public override void SetDefaults() + { - item.damage = 29; - item.width = 16; - item.height = 32; - item.melee = true; - item.useTime = 30; - item.shoot = mod.ProjectileType("ToxicRazorknifePro"); - item.shootSpeed = 12f; - item.useAnimation = 25; - item.useStyle = 5; - item.knockBack = 5; - item.value = 100000; - item.rare = 4; - item.UseSound = SoundID.Item10; - item.autoReuse = true; - } + item.damage = 29; + item.width = 16; + item.height = 32; + item.melee = true; + item.useTime = 30; + item.shoot = mod.ProjectileType("ToxicRazorknifePro"); + item.shootSpeed = 12f; + item.useAnimation = 25; + item.useStyle = 5; + item.knockBack = 5; + item.value = 100000; + item.rare = 4; + item.UseSound = SoundID.Item10; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Toxic Razorknife"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Toxic Razorknife"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/Transistor.cs b/Items/Transistor.cs index c9edd959..016d4f6d 100644 --- a/Items/Transistor.cs +++ b/Items/Transistor.cs @@ -5,42 +5,43 @@ using Terraria.ModLoader; using System.Linq; -namespace Tremor.Items { -public class Transistor : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Transistor : ModItem + { + public override void SetDefaults() + { - item.damage = 133; - item.melee = true; - item.width = 66; - item.height = 66; + item.damage = 133; + item.melee = true; + item.width = 66; + item.height = 66; - item.useTime = 25; - item.useAnimation = 25; - item.useStyle = 1; - item.knockBack = 3; - item.value = 13500; - item.rare = 8; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.shoot = mod.ProjectileType("BrainiacWavePro"); - item.shootSpeed = 9f; - } + item.useTime = 25; + item.useAnimation = 25; + item.useStyle = 1; + item.knockBack = 3; + item.value = 13500; + item.rare = 8; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.shoot = mod.ProjectileType("BrainiacWavePro"); + item.shootSpeed = 9f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Transistor"); - Tooltip.SetDefault("'Crash() everyone!'\nSends energy waves in different directions on swing"); - } - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - Vector2 speed = new Vector2(speedX, speedY); - speed = speed.RotatedByRandom(MathHelper.ToRadians(60)); - damage = (int)(damage); - speedX = speed.X; - speedY = speed.Y; - return true; - } - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Transistor"); + Tooltip.SetDefault("'Crash() everyone!'\nSends energy waves in different directions on swing"); + } + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + Vector2 speed = new Vector2(speedX, speedY); + speed = speed.RotatedByRandom(MathHelper.ToRadians(60)); + damage = (int)(damage); + speedX = speed.X; + speedY = speed.Y; + return true; + } + } } diff --git a/Items/TreasureGlaive.cs b/Items/TreasureGlaive.cs index 24d2de29..d1b0db0d 100644 --- a/Items/TreasureGlaive.cs +++ b/Items/TreasureGlaive.cs @@ -4,33 +4,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TreasureGlaive : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class TreasureGlaive : ModItem + { + public override void SetDefaults() + { - item.damage = 290; - item.width = 18; - item.height = 66; - item.noUseGraphic = true; - item.thrown = true; - item.useTime = 30; - item.shoot = mod.ProjectileType("TreasureGlaive"); - item.shootSpeed = 15f; - item.useAnimation = 30; - item.useStyle = 1; - item.knockBack = 4; - item.value = 1000000; - item.rare = 11; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 290; + item.width = 18; + item.height = 66; + item.noUseGraphic = true; + item.thrown = true; + item.useTime = 30; + item.shoot = mod.ProjectileType("TreasureGlaive"); + item.shootSpeed = 15f; + item.useAnimation = 30; + item.useStyle = 1; + item.knockBack = 4; + item.value = 1000000; + item.rare = 11; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Treasure Glaive"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Treasure Glaive"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/TrebleClef.cs b/Items/TrebleClef.cs index 1885a595..0ffe141b 100644 --- a/Items/TrebleClef.cs +++ b/Items/TrebleClef.cs @@ -14,39 +14,39 @@ public class TrebleClef : ModItem public override void SetDefaults() { - item.mana = 6; - item.noMelee=true; - item.useStyle = 5; - item.damage = 362; - item.autoReuse = true; - item.useAnimation = 12; - item.useTime = 12; - item.width = 40; - item.height = 40; - item.shoot = 76; - item.shootSpeed = 6f; - item.knockBack = 6f; - item.value = Item.sellPrice(0, 40, 0, 0); - item.magic = true; - item.noMelee = true; - item.rare = 0; + item.mana = 6; + item.noMelee = true; + item.useStyle = 5; + item.damage = 362; + item.autoReuse = true; + item.useAnimation = 12; + item.useTime = 12; + item.width = 40; + item.height = 40; + item.shoot = 76; + item.shootSpeed = 6f; + item.knockBack = 6f; + item.value = Item.sellPrice(0, 40, 0, 0); + item.magic = true; + item.noMelee = true; + item.rare = 0; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Treble Clef"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Treble Clef"); + Tooltip.SetDefault(""); + } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) - { - tooltips[0].overrideColor = new Color(238, 194, 73); - } + public override void ModifyTooltips(System.Collections.Generic.List tooltips) + { + tooltips[0].overrideColor = new Color(238, 194, 73); + } - public override Vector2? HoldoutOffset() - { - return new Vector2(-28, -9); - } + public override Vector2? HoldoutOffset() + { + return new Vector2(-28, -9); + } } } diff --git a/Items/Tremor.cs b/Items/Tremor.cs index 7ad374d1..e8c0e770 100644 --- a/Items/Tremor.cs +++ b/Items/Tremor.cs @@ -5,30 +5,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Tremor : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Tremor : ModItem + { + public override void SetDefaults() + { - item.damage = 210; - item.melee = true; - item.width = 70; - item.height = 70; - item.useTime = 18; - item.useAnimation = 16; - item.useStyle = 1; - item.knockBack = 8; - item.value = 67800; - item.rare = 10; - item.UseSound = SoundID.Item71; - item.autoReuse = true; - } + item.damage = 210; + item.melee = true; + item.width = 70; + item.height = 70; + item.useTime = 18; + item.useAnimation = 16; + item.useStyle = 1; + item.knockBack = 8; + item.value = 67800; + item.rare = 10; + item.UseSound = SoundID.Item71; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("The Tremor"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("The Tremor"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/TremorItems.cs b/Items/TremorItems.cs index 607d929a..7375a49c 100644 --- a/Items/TremorItems.cs +++ b/Items/TremorItems.cs @@ -15,135 +15,135 @@ public class TremorItems : GlobalItem public override void UpdateEquip(Item item, Player player) { -//items damage - if(item.type == 1865) - { - player.GetModPlayer(mod).alchemistDamage += 0.1f; - } - if(item.type == 3110) - { - player.GetModPlayer(mod).alchemistDamage += 0.1f; - } - if(item.type == 899) - { - player.GetModPlayer(mod).alchemistDamage += 0.1f; - } - if(item.type == 900) - { - player.GetModPlayer(mod).alchemistDamage += 0.1f; - } - if(item.type == 935) - { - player.GetModPlayer(mod).alchemistDamage += 0.12f; - } - if(item.type == 1301) - { - player.GetModPlayer(mod).alchemistDamage += 0.1f; - } - if(item.type == 552) - { - player.GetModPlayer(mod).alchemistDamage += 0.07f; - } - if(item.type == 1208) - { - player.GetModPlayer(mod).alchemistDamage += 0.03f; - } - if(item.type == 1209) - { - player.GetModPlayer(mod).alchemistDamage += 0.02f; - } - if(item.type == 379) - { - player.GetModPlayer(mod).alchemistDamage += 0.05f; - } - if(item.type == 403) - { - player.GetModPlayer(mod).alchemistDamage += 0.06f; - } - if(item.type == 1218) - { - player.GetModPlayer(mod).alchemistDamage += 0.04f; - } - if(item.type == 1219) - { - player.GetModPlayer(mod).alchemistDamage += 0.03f; - } - if(item.type == 1004) - { - player.GetModPlayer(mod).alchemistDamage += 0.05f; - } -//items crit chance - if(item.type == 374) - { - player.GetModPlayer(mod).alchemistCrit += 3; - } - if(item.type == 1208) - { - player.GetModPlayer(mod).alchemistCrit += 2; - } - if(item.type == 1209) - { - player.GetModPlayer(mod).alchemistCrit += 1; - } - if(item.type == 380) - { - player.GetModPlayer(mod).alchemistCrit += 5; - } - if(item.type == 1213) - { - player.GetModPlayer(mod).alchemistCrit += 6; - } - if(item.type == 404) - { - player.GetModPlayer(mod).alchemistCrit += 4; - } - if(item.type == 1218) - { - player.GetModPlayer(mod).alchemistCrit += 3; - } - if(item.type == 1219) - { - player.GetModPlayer(mod).alchemistCrit += 3; - } - if(item.type == 3808) - { - player.GetModPlayer(mod).alchemistCrit += 10; - } - if(item.type == 551) - { - player.GetModPlayer(mod).alchemistCrit += 7; - } - if(item.type == 1004) - { - player.GetModPlayer(mod).alchemistCrit += 7; - } - if(item.type == 1317) - { - player.GetModPlayer(mod).alchemistCrit += 8; - } - if(item.type == 3873) - { - player.GetModPlayer(mod).alchemistCrit += 30; - } + //items damage + if (item.type == 1865) + { + player.GetModPlayer(mod).alchemistDamage += 0.1f; + } + if (item.type == 3110) + { + player.GetModPlayer(mod).alchemistDamage += 0.1f; + } + if (item.type == 899) + { + player.GetModPlayer(mod).alchemistDamage += 0.1f; + } + if (item.type == 900) + { + player.GetModPlayer(mod).alchemistDamage += 0.1f; + } + if (item.type == 935) + { + player.GetModPlayer(mod).alchemistDamage += 0.12f; + } + if (item.type == 1301) + { + player.GetModPlayer(mod).alchemistDamage += 0.1f; + } + if (item.type == 552) + { + player.GetModPlayer(mod).alchemistDamage += 0.07f; + } + if (item.type == 1208) + { + player.GetModPlayer(mod).alchemistDamage += 0.03f; + } + if (item.type == 1209) + { + player.GetModPlayer(mod).alchemistDamage += 0.02f; + } + if (item.type == 379) + { + player.GetModPlayer(mod).alchemistDamage += 0.05f; + } + if (item.type == 403) + { + player.GetModPlayer(mod).alchemistDamage += 0.06f; + } + if (item.type == 1218) + { + player.GetModPlayer(mod).alchemistDamage += 0.04f; + } + if (item.type == 1219) + { + player.GetModPlayer(mod).alchemistDamage += 0.03f; + } + if (item.type == 1004) + { + player.GetModPlayer(mod).alchemistDamage += 0.05f; + } + //items crit chance + if (item.type == 374) + { + player.GetModPlayer(mod).alchemistCrit += 3; + } + if (item.type == 1208) + { + player.GetModPlayer(mod).alchemistCrit += 2; + } + if (item.type == 1209) + { + player.GetModPlayer(mod).alchemistCrit += 1; + } + if (item.type == 380) + { + player.GetModPlayer(mod).alchemistCrit += 5; + } + if (item.type == 1213) + { + player.GetModPlayer(mod).alchemistCrit += 6; + } + if (item.type == 404) + { + player.GetModPlayer(mod).alchemistCrit += 4; + } + if (item.type == 1218) + { + player.GetModPlayer(mod).alchemistCrit += 3; + } + if (item.type == 1219) + { + player.GetModPlayer(mod).alchemistCrit += 3; + } + if (item.type == 3808) + { + player.GetModPlayer(mod).alchemistCrit += 10; + } + if (item.type == 551) + { + player.GetModPlayer(mod).alchemistCrit += 7; + } + if (item.type == 1004) + { + player.GetModPlayer(mod).alchemistCrit += 7; + } + if (item.type == 1317) + { + player.GetModPlayer(mod).alchemistCrit += 8; + } + if (item.type == 3873) + { + player.GetModPlayer(mod).alchemistCrit += 30; + } } public override void SetDefaults(Item item) { if (item.ranged == true && Main.player[Main.myPlayer].active && Main.player[Main.myPlayer].FindBuffIndex(mod.BuffType("ShotSpeedBuff")) != -1) { - item.shootSpeed*=2f; + item.shootSpeed *= 2f; } if (item.ranged == true && Main.player[Main.myPlayer].active && Main.player[Main.myPlayer].FindBuffIndex(mod.BuffType("ShotSpeedBuff")) != -1) { - item.shootSpeed*=2f; - } + item.shootSpeed *= 2f; + } if (item.type == 2196) { - item.value = 30; + item.value = 30; } if (item.type == ItemID.Minishark) { - item.value = 500000; + item.value = 500000; } if (item.type == 3) { @@ -151,16 +151,16 @@ public override void SetDefaults(Item item) } if (item.type == ItemID.EnchantedSword && Main.player[Main.myPlayer].active && Main.player[Main.myPlayer].FindBuffIndex(mod.BuffType("EnchantedBuff")) != -1) { - item.damage += 5; + item.damage += 5; } if (item.type == ItemID.EnchantedBoomerang && Main.player[Main.myPlayer].active && Main.player[Main.myPlayer].FindBuffIndex(mod.BuffType("EnchantedBuff")) != -1) { - item.damage += 5; + item.damage += 5; } - if (item.type == ItemID.SlimeStaff) - { - item.value = 2000; - } - } + if (item.type == ItemID.SlimeStaff) + { + item.value = 2000; + } + } } } \ No newline at end of file diff --git a/Items/TriangleMask.cs b/Items/TriangleMask.cs index 0d76f8fb..7279a74e 100644 --- a/Items/TriangleMask.cs +++ b/Items/TriangleMask.cs @@ -5,25 +5,28 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class TriangleMask : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class TriangleMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 24; + item.width = 26; + item.height = 24; - item.rare = 1; - } + item.rare = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Triangle Mask"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Triangle Mask"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/TrinityBag1.cs b/Items/TrinityBag1.cs index c4d055df..24495423 100644 --- a/Items/TrinityBag1.cs +++ b/Items/TrinityBag1.cs @@ -4,74 +4,76 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TrinityBag1 : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class TrinityBag1 : ModItem + { + public override void SetDefaults() + { - item.maxStack = 999; - item.consumable = true; - item.width = 24; - item.height = 24; + item.maxStack = 999; + item.consumable = true; + item.width = 24; + item.height = 24; - item.rare = 9; - item.expert = true; - bossBagNPC = mod.NPCType("SoulofTruth"); - } + item.rare = 9; + item.expert = true; + bossBagNPC = mod.NPCType("SoulofTruth"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Treasure Bag"); - Tooltip.SetDefault("Right click to open"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Treasure Bag"); + Tooltip.SetDefault("Right click to open"); + } - public override bool CanRightClick() - { - return true; - } + public override bool CanRightClick() + { + return true; + } - public override void OpenBossBag(Player player) - { - if(Main.rand.Next(7) == 0) - { - player.QuickSpawnItem(mod.ItemType("HopeMask")); - } - if(Main.rand.Next(7) == 0) - { - player.QuickSpawnItem(mod.ItemType("TrustMask")); - } - if(Main.rand.Next(7) == 0) - { - player.QuickSpawnItem(mod.ItemType("TruthMask")); - } - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("Banhammer")); - } - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("BestNightmare")); - } - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("HonestBlade")); - } - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("Volcannon")); - } - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("TrebleClef")); - } - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("Revolwar")); - } - player.QuickSpawnItem(mod.ItemType("Unpredictable�ompass")); - player.QuickSpawnItem(mod.ItemType("OmnikronBar"), Main.rand.Next(20, 36)); - player.QuickSpawnItem(mod.ItemType("TrueEssense"), Main.rand.Next(10, 25)); - } -}} + public override void OpenBossBag(Player player) + { + if (Main.rand.Next(7) == 0) + { + player.QuickSpawnItem(mod.ItemType("HopeMask")); + } + if (Main.rand.Next(7) == 0) + { + player.QuickSpawnItem(mod.ItemType("TrustMask")); + } + if (Main.rand.Next(7) == 0) + { + player.QuickSpawnItem(mod.ItemType("TruthMask")); + } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("Banhammer")); + } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("BestNightmare")); + } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("HonestBlade")); + } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("Volcannon")); + } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("TrebleClef")); + } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("Revolwar")); + } + player.QuickSpawnItem(mod.ItemType("Unpredictable�ompass")); + player.QuickSpawnItem(mod.ItemType("OmnikronBar"), Main.rand.Next(20, 36)); + player.QuickSpawnItem(mod.ItemType("TrueEssense"), Main.rand.Next(10, 25)); + } + } +} diff --git a/Items/TrinityBag2.cs b/Items/TrinityBag2.cs index 3105b30a..f7312d15 100644 --- a/Items/TrinityBag2.cs +++ b/Items/TrinityBag2.cs @@ -4,74 +4,76 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TrinityBag2 : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class TrinityBag2 : ModItem + { + public override void SetDefaults() + { - item.maxStack = 999; - item.consumable = true; - item.width = 24; - item.height = 24; + item.maxStack = 999; + item.consumable = true; + item.width = 24; + item.height = 24; - item.rare = 9; - item.expert = true; - bossBagNPC = mod.NPCType("SoulofTrust"); - } + item.rare = 9; + item.expert = true; + bossBagNPC = mod.NPCType("SoulofTrust"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Treasure Bag"); - Tooltip.SetDefault("Right click to open"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Treasure Bag"); + Tooltip.SetDefault("Right click to open"); + } - public override bool CanRightClick() - { - return true; - } + public override bool CanRightClick() + { + return true; + } - public override void OpenBossBag(Player player) - { - if(Main.rand.Next(7) == 0) - { - player.QuickSpawnItem(mod.ItemType("HopeMask")); - } - if(Main.rand.Next(7) == 0) - { - player.QuickSpawnItem(mod.ItemType("TrustMask")); - } - if(Main.rand.Next(7) == 0) - { - player.QuickSpawnItem(mod.ItemType("TruthMask")); - } - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("Banhammer")); - } - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("BestNightmare")); - } - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("HonestBlade")); - } - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("Volcannon")); - } - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("TrebleClef")); - } - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("Revolwar")); - } - player.QuickSpawnItem(mod.ItemType("Unpredictable�ompass")); - player.QuickSpawnItem(mod.ItemType("OmnikronBar"), Main.rand.Next(20, 36)); - player.QuickSpawnItem(mod.ItemType("TrueEssense"), Main.rand.Next(10, 25)); - } -}} + public override void OpenBossBag(Player player) + { + if (Main.rand.Next(7) == 0) + { + player.QuickSpawnItem(mod.ItemType("HopeMask")); + } + if (Main.rand.Next(7) == 0) + { + player.QuickSpawnItem(mod.ItemType("TrustMask")); + } + if (Main.rand.Next(7) == 0) + { + player.QuickSpawnItem(mod.ItemType("TruthMask")); + } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("Banhammer")); + } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("BestNightmare")); + } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("HonestBlade")); + } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("Volcannon")); + } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("TrebleClef")); + } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("Revolwar")); + } + player.QuickSpawnItem(mod.ItemType("Unpredictable�ompass")); + player.QuickSpawnItem(mod.ItemType("OmnikronBar"), Main.rand.Next(20, 36)); + player.QuickSpawnItem(mod.ItemType("TrueEssense"), Main.rand.Next(10, 25)); + } + } +} diff --git a/Items/TrinityBag3.cs b/Items/TrinityBag3.cs index eb16ddfa..1f7f6cb5 100644 --- a/Items/TrinityBag3.cs +++ b/Items/TrinityBag3.cs @@ -4,74 +4,76 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TrinityBag3 : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class TrinityBag3 : ModItem + { + public override void SetDefaults() + { - item.maxStack = 999; - item.consumable = true; - item.width = 24; - item.height = 24; + item.maxStack = 999; + item.consumable = true; + item.width = 24; + item.height = 24; - item.rare = 9; - item.expert = true; - bossBagNPC = mod.NPCType("SoulofHope"); - } + item.rare = 9; + item.expert = true; + bossBagNPC = mod.NPCType("SoulofHope"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Treasure Bag"); - Tooltip.SetDefault("Right click to open"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Treasure Bag"); + Tooltip.SetDefault("Right click to open"); + } - public override bool CanRightClick() - { - return true; - } + public override bool CanRightClick() + { + return true; + } - public override void OpenBossBag(Player player) - { - if(Main.rand.Next(7) == 0) - { - player.QuickSpawnItem(mod.ItemType("HopeMask")); - } - if(Main.rand.Next(7) == 0) - { - player.QuickSpawnItem(mod.ItemType("TrustMask")); - } - if(Main.rand.Next(7) == 0) - { - player.QuickSpawnItem(mod.ItemType("TruthMask")); - } - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("Banhammer")); - } - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("BestNightmare")); - } - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("HonestBlade")); - } - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("Volcannon")); - } - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("TrebleClef")); - } - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("Revolwar")); - } - player.QuickSpawnItem(mod.ItemType("Unpredictable�ompass")); - player.QuickSpawnItem(mod.ItemType("OmnikronBar"), Main.rand.Next(20, 36)); - player.QuickSpawnItem(mod.ItemType("TrueEssense"), Main.rand.Next(10, 25)); - } -}} + public override void OpenBossBag(Player player) + { + if (Main.rand.Next(7) == 0) + { + player.QuickSpawnItem(mod.ItemType("HopeMask")); + } + if (Main.rand.Next(7) == 0) + { + player.QuickSpawnItem(mod.ItemType("TrustMask")); + } + if (Main.rand.Next(7) == 0) + { + player.QuickSpawnItem(mod.ItemType("TruthMask")); + } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("Banhammer")); + } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("BestNightmare")); + } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("HonestBlade")); + } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("Volcannon")); + } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("TrebleClef")); + } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("Revolwar")); + } + player.QuickSpawnItem(mod.ItemType("Unpredictable�ompass")); + player.QuickSpawnItem(mod.ItemType("OmnikronBar"), Main.rand.Next(20, 36)); + player.QuickSpawnItem(mod.ItemType("TrueEssense"), Main.rand.Next(10, 25)); + } + } +} diff --git a/Items/TrinityMusicBox.cs b/Items/TrinityMusicBox.cs index b2fbd673..ffef9c17 100644 --- a/Items/TrinityMusicBox.cs +++ b/Items/TrinityMusicBox.cs @@ -25,11 +25,11 @@ public override void SetDefaults() item.accessory = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Music Box (The Trinity)"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Music Box (The Trinity)"); + Tooltip.SetDefault(""); + } } } diff --git a/Items/TrinityTrophy.cs b/Items/TrinityTrophy.cs index 2db15dd5..b7fe4242 100644 --- a/Items/TrinityTrophy.cs +++ b/Items/TrinityTrophy.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TrinityTrophy : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class TrinityTrophy : ModItem + { + public override void SetDefaults() + { - item.width = 32; - item.height = 32; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 50000; - item.createTile = mod.TileType("TrinityTrophy"); - item.placeStyle = 0; - } + item.width = 32; + item.height = 32; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 50000; + item.createTile = mod.TileType("TrinityTrophy"); + item.placeStyle = 0; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Trinity Trophy"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Trinity Trophy"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/TrueArachnophobia.cs b/Items/TrueArachnophobia.cs index f28f25d1..fc7157da 100644 --- a/Items/TrueArachnophobia.cs +++ b/Items/TrueArachnophobia.cs @@ -5,53 +5,55 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TrueArachnophobia : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class TrueArachnophobia : ModItem + { + public override void SetDefaults() + { - item.damage = 49; - item.melee = true; - item.width = 66; - item.height = 66; - item.useTime = 35; - item.useAnimation = 35; - item.useStyle = 1; - item.knockBack = 7; - item.shoot = 379; - item.shootSpeed = 17f; - item.value = 12500; - item.rare = 8; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 49; + item.melee = true; + item.width = 66; + item.height = 66; + item.useTime = 35; + item.useAnimation = 35; + item.useStyle = 1; + item.knockBack = 7; + item.shoot = 379; + item.shootSpeed = 17f; + item.value = 12500; + item.rare = 8; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("True Arachnophobia"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("True Arachnophobia"); + Tooltip.SetDefault(""); + } -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) -{ - for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. - { - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); - } - return false; -} + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. + { + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); + } + return false; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Arachnophobia", 1); - recipe.AddIngredient(ItemID.BrokenHeroSword, 1); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Arachnophobia", 1); + recipe.AddIngredient(ItemID.BrokenHeroSword, 1); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/TrueBeamSword.cs b/Items/TrueBeamSword.cs index cd510432..320032e4 100644 --- a/Items/TrueBeamSword.cs +++ b/Items/TrueBeamSword.cs @@ -5,46 +5,47 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TrueBeamSword : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class TrueBeamSword : ModItem + { + public override void SetDefaults() + { - item.damage = 92; - item.melee = true; - item.width = 50; - item.height = 52; - item.useTime = 45; - item.useAnimation = 15; - item.useStyle = 1; - item.shoot = 116; - item.shootSpeed = 15f; - item.knockBack = 8; + item.damage = 92; + item.melee = true; + item.width = 50; + item.height = 52; + item.useTime = 45; + item.useAnimation = 15; + item.useStyle = 1; + item.shoot = 116; + item.shootSpeed = 15f; + item.knockBack = 8; - item.value = 750000; - item.rare = 6; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.value = 750000; + item.rare = 6; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("True Beam Sword"); - Tooltip.SetDefault("Shoots a beam of light"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("True Beam Sword"); + Tooltip.SetDefault("Shoots a beam of light"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.EnchantedSword, 1); - recipe.AddIngredient(ItemID.BeamSword, 1); - recipe.AddIngredient(null, "MagiumShard", 25); - recipe.AddIngredient(ItemID.BrokenHeroSword, 1); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.EnchantedSword, 1); + recipe.AddIngredient(ItemID.BeamSword, 1); + recipe.AddIngredient(null, "MagiumShard", 25); + recipe.AddIngredient(ItemID.BrokenHeroSword, 1); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } } diff --git a/Items/TrueBloodCarnage.cs b/Items/TrueBloodCarnage.cs index 1479eb66..5944ac7e 100644 --- a/Items/TrueBloodCarnage.cs +++ b/Items/TrueBloodCarnage.cs @@ -5,49 +5,50 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TrueBloodCarnage : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class TrueBloodCarnage : ModItem + { + public override void SetDefaults() + { - item.damage = 92; - item.melee = true; - item.width = 50; - item.height = 52; - item.useTime = 25; - item.useAnimation = 25; - item.useStyle = 1; - item.shoot = mod.ProjectileType("TrueBloodCarnage"); - item.shootSpeed = 10f; - item.knockBack = 4; - item.value = 10000; - item.rare = 8; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 92; + item.melee = true; + item.width = 50; + item.height = 52; + item.useTime = 25; + item.useAnimation = 25; + item.useStyle = 1; + item.shoot = mod.ProjectileType("TrueBloodCarnage"); + item.shootSpeed = 10f; + item.knockBack = 4; + item.value = 10000; + item.rare = 8; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("True Blood Carnage"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("True Blood Carnage"); + Tooltip.SetDefault(""); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 60); - } + public override void MeleeEffects(Player player, Rectangle hitbox) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 60); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BloodCarnage", 1); - recipe.AddIngredient(ItemID.BrokenHeroSword, 1); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "BloodCarnage", 1); + recipe.AddIngredient(ItemID.BrokenHeroSword, 1); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } } diff --git a/Items/TrueBloodshed.cs b/Items/TrueBloodshed.cs index 855a4101..fc4cc230 100644 --- a/Items/TrueBloodshed.cs +++ b/Items/TrueBloodshed.cs @@ -4,49 +4,51 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TrueBloodshed : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.width = 22; - item.height = 44; - - - item.value = 10000; - item.rare = 4; - item.defense = 6; - item.accessory = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("True Bloodshed"); - Tooltip.SetDefault("12% increased melee, magic, minion, ranged damage and crit\nIncreases maximum mana and health by 80"); - } - - - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.magicDamage += 0.12f; - player.minionDamage += 0.12f; - player.meleeDamage += 0.12f; - player.rangedDamage += 0.12f; - player.statManaMax2 += 80; - player.statLifeMax2 += 80; - player.meleeCrit += 12; - player.magicCrit += 12; - player.rangedCrit += 12; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Bloodshed", 1); - recipe.AddIngredient(null, "BrokenHeroAmulet", 1); - recipe.SetResult(this); - recipe.AddTile(null, "GreatAnvilTile"); - recipe.AddRecipe(); - } -}} + public class TrueBloodshed : ModItem + { + public override void SetDefaults() + { + + item.width = 22; + item.height = 44; + + + item.value = 10000; + item.rare = 4; + item.defense = 6; + item.accessory = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("True Bloodshed"); + Tooltip.SetDefault("12% increased melee, magic, minion, ranged damage and crit\nIncreases maximum mana and health by 80"); + } + + + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.magicDamage += 0.12f; + player.minionDamage += 0.12f; + player.meleeDamage += 0.12f; + player.rangedDamage += 0.12f; + player.statManaMax2 += 80; + player.statLifeMax2 += 80; + player.meleeCrit += 12; + player.magicCrit += 12; + player.rangedCrit += 12; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Bloodshed", 1); + recipe.AddIngredient(null, "BrokenHeroAmulet", 1); + recipe.SetResult(this); + recipe.AddTile(null, "GreatAnvilTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/TrueDeathSickle.cs b/Items/TrueDeathSickle.cs index 2a32e742..b1d266c7 100644 --- a/Items/TrueDeathSickle.cs +++ b/Items/TrueDeathSickle.cs @@ -20,7 +20,7 @@ public override void SetDefaults() item.channel = true; item.noUseGraphic = true; item.noMelee = true; - item.useTurn = true; + item.useTurn = true; item.useStyle = 100; item.knockBack = 8f; item.value = Item.sellPrice(0, 10, 0, 0); @@ -30,11 +30,11 @@ public override void SetDefaults() item.shootSpeed = 0f; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("True Death Sickle"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("True Death Sickle"); + Tooltip.SetDefault(""); + } public override bool UseItemFrame(Player player) @@ -43,15 +43,15 @@ public override bool UseItemFrame(Player player) return true; } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(1327); - recipe.AddIngredient(1570); - recipe.AddIngredient(548, 10); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this, 1); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(1327); + recipe.AddIngredient(1570); + recipe.AddIngredient(548, 10); + recipe.AddTile(TileID.MythrilAnvil); + recipe.SetResult(this, 1); + recipe.AddRecipe(); + } + } } diff --git a/Items/TrueEssense.cs b/Items/TrueEssense.cs index 1e51ec13..f489573d 100644 --- a/Items/TrueEssense.cs +++ b/Items/TrueEssense.cs @@ -6,33 +6,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TrueEssense : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class TrueEssense : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 22; - item.maxStack = 999; - item.value = 100; - item.rare = 0; - ItemID.Sets.ItemNoGravity[item.type] = true; + item.width = 22; + item.height = 22; + item.maxStack = 999; + item.value = 100; + item.rare = 0; + ItemID.Sets.ItemNoGravity[item.type] = true; //ItemID.Sets.AnimatesAsSoul[item.type] = true; ItemID.Sets.ItemIconPulse[item.type] = true; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("True Essence"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("True Essence"); + Tooltip.SetDefault(""); + } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) - { - tooltips[0].overrideColor = new Color(238, 194, 73); - } + public override void ModifyTooltips(System.Collections.Generic.List tooltips) + { + tooltips[0].overrideColor = new Color(238, 194, 73); + } -}} + } +} diff --git a/Items/TrueHeroHood.cs b/Items/TrueHeroHood.cs index da8904c6..f34ec18b 100644 --- a/Items/TrueHeroHood.cs +++ b/Items/TrueHeroHood.cs @@ -8,59 +8,59 @@ namespace Tremor.Items { -[AutoloadEquip(EquipType.Head)] - public class TrueHeroHood : ModItem - { + [AutoloadEquip(EquipType.Head)] + public class TrueHeroHood : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 32; - item.height = 26; - item.value = 25000; + item.width = 32; + item.height = 26; + item.value = 25000; - item.rare = 0; - item.defense = 15; - } + item.rare = 0; + item.defense = 15; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("True Hero Hood"); - Tooltip.SetDefault("Gives one of three true blades"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("True Hero Hood"); + Tooltip.SetDefault("Gives one of three true blades"); + } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) - { - tooltips[0].overrideColor = new Color(238, 194, 73); - } + public override void ModifyTooltips(System.Collections.Generic.List tooltips) + { + tooltips[0].overrideColor = new Color(238, 194, 73); + } - public override void UpdateEquip(Player player) - { - player.AddBuff(mod.BuffType("FirstTrueBlade"), 2); - } + public override void UpdateEquip(Player player) + { + player.AddBuff(mod.BuffType("FirstTrueBlade"), 2); + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == mod.ItemType("TrueHeroShirt") && legs.type == mod.ItemType("TrueHeroPants"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("TrueHeroShirt") && legs.type == mod.ItemType("TrueHeroPants"); + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increases maximum defense by 20"; - player.statDefense += 20; - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increases maximum defense by 20"; + player.statDefense += 20; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(247, 1); - recipe.AddIngredient(null, "GiantShell", 1); - recipe.AddIngredient(null, "BrokenHeroArmorplate", 1); - recipe.AddIngredient(null, "TrueEssense", 5); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(247, 1); + recipe.AddIngredient(null, "GiantShell", 1); + recipe.AddIngredient(null, "BrokenHeroArmorplate", 1); + recipe.AddIngredient(null, "TrueEssense", 5); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } } diff --git a/Items/TrueHeroPants.cs b/Items/TrueHeroPants.cs index fa8fa7d3..3a11cbf6 100644 --- a/Items/TrueHeroPants.cs +++ b/Items/TrueHeroPants.cs @@ -9,49 +9,49 @@ namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] - public class TrueHeroPants : ModItem - { - - - public override void SetDefaults() - { - - item.width = 22; - item.height = 18; - item.value = 25000; - - item.rare = 0; - item.defense = 20; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("True Hero Pants"); - Tooltip.SetDefault("Gives one of three true blades"); - } - - - public override void ModifyTooltips(System.Collections.Generic.List tooltips) - { - tooltips[0].overrideColor = new Color(238, 194, 73); - } - - public override void UpdateEquip(Player player) - { - player.AddBuff(mod.BuffType("ThirdTrueBlade"), 2); - } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(249, 1); - recipe.AddIngredient(null, "GiantShell", 1); - recipe.AddIngredient(null, "BrokenHeroArmorplate", 1); - recipe.AddIngredient(null, "TrueEssense", 3); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } - } + public class TrueHeroPants : ModItem + { + + + public override void SetDefaults() + { + + item.width = 22; + item.height = 18; + item.value = 25000; + + item.rare = 0; + item.defense = 20; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("True Hero Pants"); + Tooltip.SetDefault("Gives one of three true blades"); + } + + + public override void ModifyTooltips(System.Collections.Generic.List tooltips) + { + tooltips[0].overrideColor = new Color(238, 194, 73); + } + + public override void UpdateEquip(Player player) + { + player.AddBuff(mod.BuffType("ThirdTrueBlade"), 2); + } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(249, 1); + recipe.AddIngredient(null, "GiantShell", 1); + recipe.AddIngredient(null, "BrokenHeroArmorplate", 1); + recipe.AddIngredient(null, "TrueEssense", 3); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } } diff --git a/Items/TrueHeroShirt.cs b/Items/TrueHeroShirt.cs index c862fa1c..a116922f 100644 --- a/Items/TrueHeroShirt.cs +++ b/Items/TrueHeroShirt.cs @@ -8,49 +8,49 @@ using Terraria.DataStructures; namespace Tremor.Items -{ -[AutoloadEquip(EquipType.Body)] - public class TrueHeroShirt : ModItem - { - - public override void SetDefaults() - { - - item.width = 26; - item.height = 18; - - item.value = 25000; - item.rare = 0; - item.defense = 25; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("True Hero Shirt"); - Tooltip.SetDefault("Gives one of three true blades"); - } - - - public override void UpdateEquip(Player player) - { - player.AddBuff(mod.BuffType("SecondTrueBlade"), 2); - } - - public override void ModifyTooltips(System.Collections.Generic.List tooltips) - { - tooltips[0].overrideColor = new Color(238, 194, 73); - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(248, 1); - recipe.AddIngredient(null, "GiantShell", 1); - recipe.AddIngredient(null, "BrokenHeroArmorplate", 1); - recipe.AddIngredient(null, "TrueEssense", 3); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } - } +{ + [AutoloadEquip(EquipType.Body)] + public class TrueHeroShirt : ModItem + { + + public override void SetDefaults() + { + + item.width = 26; + item.height = 18; + + item.value = 25000; + item.rare = 0; + item.defense = 25; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("True Hero Shirt"); + Tooltip.SetDefault("Gives one of three true blades"); + } + + + public override void UpdateEquip(Player player) + { + player.AddBuff(mod.BuffType("SecondTrueBlade"), 2); + } + + public override void ModifyTooltips(System.Collections.Generic.List tooltips) + { + tooltips[0].overrideColor = new Color(238, 194, 73); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(248, 1); + recipe.AddIngredient(null, "GiantShell", 1); + recipe.AddIngredient(null, "BrokenHeroArmorplate", 1); + recipe.AddIngredient(null, "TrueEssense", 3); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } } diff --git a/Items/TrueNightsWatch.cs b/Items/TrueNightsWatch.cs index 71f26690..6aac5fcd 100644 --- a/Items/TrueNightsWatch.cs +++ b/Items/TrueNightsWatch.cs @@ -4,49 +4,51 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TrueNightsWatch : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.width = 22; - item.height = 44; - - - item.value = 10000; - item.rare = 4; - item.defense = 6; - item.accessory = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("True Night's Watch"); - Tooltip.SetDefault("12% increased melee, magic, minion, ranged damage and crit\nIncreases maximum mana and health by 80"); - } - - - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.magicDamage += 0.12f; - player.minionDamage += 0.12f; - player.meleeDamage += 0.12f; - player.rangedDamage += 0.12f; - player.statManaMax2 += 80; - player.statLifeMax2 += 80; - player.meleeCrit += 12; - player.magicCrit += 12; - player.rangedCrit += 12; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "NightsWatch", 1); - recipe.AddIngredient(null, "BrokenHeroAmulet", 1); - recipe.SetResult(this); - recipe.AddTile(null, "GreatAnvilTile"); - recipe.AddRecipe(); - } -}} + public class TrueNightsWatch : ModItem + { + public override void SetDefaults() + { + + item.width = 22; + item.height = 44; + + + item.value = 10000; + item.rare = 4; + item.defense = 6; + item.accessory = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("True Night's Watch"); + Tooltip.SetDefault("12% increased melee, magic, minion, ranged damage and crit\nIncreases maximum mana and health by 80"); + } + + + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.magicDamage += 0.12f; + player.minionDamage += 0.12f; + player.meleeDamage += 0.12f; + player.rangedDamage += 0.12f; + player.statManaMax2 += 80; + player.statLifeMax2 += 80; + player.meleeCrit += 12; + player.magicCrit += 12; + player.rangedCrit += 12; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "NightsWatch", 1); + recipe.AddIngredient(null, "BrokenHeroAmulet", 1); + recipe.SetResult(this); + recipe.AddTile(null, "GreatAnvilTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/TrueSanctifier.cs b/Items/TrueSanctifier.cs index 08c11334..1e97fd85 100644 --- a/Items/TrueSanctifier.cs +++ b/Items/TrueSanctifier.cs @@ -4,43 +4,45 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TrueSanctifier : ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 22; - item.height = 44; - - item.value = 30000; - item.rare = 5; - item.maxStack = 1; - item.defense = 3; - item.accessory = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("True Sanctifier"); - Tooltip.SetDefault("Increases alchemic and throwing damage by 30%"); - } - - - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.GetModPlayer(mod).alchemistDamage += 0.3f; - player.thrownDamage += 0.3f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Sanctifier", 1); - recipe.AddIngredient(null, "BrokenHeroAmulet", 1); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public class TrueSanctifier : ModItem + { + + public override void SetDefaults() + { + + item.width = 22; + item.height = 44; + + item.value = 30000; + item.rare = 5; + item.maxStack = 1; + item.defense = 3; + item.accessory = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("True Sanctifier"); + Tooltip.SetDefault("Increases alchemic and throwing damage by 30%"); + } + + + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.GetModPlayer(mod).alchemistDamage += 0.3f; + player.thrownDamage += 0.3f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Sanctifier", 1); + recipe.AddIngredient(null, "BrokenHeroAmulet", 1); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/TrueTerraBlade.cs b/Items/TrueTerraBlade.cs index f3e98fc4..23f419c9 100644 --- a/Items/TrueTerraBlade.cs +++ b/Items/TrueTerraBlade.cs @@ -5,34 +5,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TrueTerraBlade : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - item.rare = 10; - item.UseSound = SoundID.Item1; + public class TrueTerraBlade : ModItem + { + public override void SetDefaults() + { + item.rare = 10; + item.UseSound = SoundID.Item1; - item.useStyle = 1; - item.damage = 196; - item.useAnimation = 16; - item.useTime = 14; - item.width = 84; - item.height = 84; - item.shoot = 132; - item.scale = 1.1f; - item.shootSpeed = 15f; - item.knockBack = 6.5f; - item.melee = true; - item.value = Item.sellPrice(0, 20, 0, 0); - item.autoReuse = true; - } + item.useStyle = 1; + item.damage = 196; + item.useAnimation = 16; + item.useTime = 14; + item.width = 84; + item.height = 84; + item.shoot = 132; + item.scale = 1.1f; + item.shootSpeed = 15f; + item.knockBack = 6.5f; + item.melee = true; + item.value = Item.sellPrice(0, 20, 0, 0); + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("True Terra Blade"); - Tooltip.SetDefault("'Shining, shimmering, splendid!'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("True Terra Blade"); + Tooltip.SetDefault("'Shining, shimmering, splendid!'"); + } public override void AddRecipes() @@ -48,4 +49,5 @@ public override void AddRecipes() recipe.SetResult(this); recipe.AddRecipe(); } -}} + } +} diff --git a/Items/TrueTrident.cs b/Items/TrueTrident.cs index 32f0d445..53f07d1b 100644 --- a/Items/TrueTrident.cs +++ b/Items/TrueTrident.cs @@ -4,33 +4,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TrueTrident : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class TrueTrident : ModItem + { + public override void SetDefaults() + { - item.damage = 43; - item.width = 50; - item.height = 50; - item.noUseGraphic = true; - item.melee = true; - item.useTime = 30; - item.shoot = mod.ProjectileType("TrueTridentProjectile"); - item.shootSpeed = 3f; - item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 15; - item.value = 40000; - item.rare = 5; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 43; + item.width = 50; + item.height = 50; + item.noUseGraphic = true; + item.melee = true; + item.useTime = 30; + item.shoot = mod.ProjectileType("TrueTridentProjectile"); + item.shootSpeed = 3f; + item.useAnimation = 30; + item.useStyle = 5; + item.knockBack = 15; + item.value = 40000; + item.rare = 5; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("True Trident"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("True Trident"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/TrustMask.cs b/Items/TrustMask.cs index b5703d59..ba4cb8f0 100644 --- a/Items/TrustMask.cs +++ b/Items/TrustMask.cs @@ -4,25 +4,28 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class TrustMask : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class TrustMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 28; - item.height = 32; - item.rare = 1; - item.vanity = true; - } + item.width = 28; + item.height = 32; + item.rare = 1; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Doom Mask"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Doom Mask"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/TruthMask.cs b/Items/TruthMask.cs index d40cbb78..361c9740 100644 --- a/Items/TruthMask.cs +++ b/Items/TruthMask.cs @@ -4,25 +4,28 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class TruthMask : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class TruthMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 28; - item.rare = 1; - item.vanity = true; - } + item.width = 26; + item.height = 28; + item.rare = 1; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Truth Mask"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Truth Mask"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/TungstenBullet.cs b/Items/TungstenBullet.cs index 72e9cc1d..5000493c 100644 --- a/Items/TungstenBullet.cs +++ b/Items/TungstenBullet.cs @@ -5,40 +5,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TungstenBullet : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class TungstenBullet : ModItem + { + public override void SetDefaults() + { - item.damage = 10; - item.ranged = true; - item.width = 12; - item.height = 12; - item.maxStack = 999; - item.consumable = true; - item.knockBack = 3; - item.value = 3; - item.rare = 1; - item.shoot = 14; - item.shootSpeed = 4f; + item.damage = 10; + item.ranged = true; + item.width = 12; + item.height = 12; + item.maxStack = 999; + item.consumable = true; + item.knockBack = 3; + item.value = 3; + item.rare = 1; + item.shoot = 14; + item.shootSpeed = 4f; item.shoot = 14; item.ammo = AmmoID.Bullet; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Tungsten Bullet"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Tungsten Bullet"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.MusketBall, 70); - recipe.AddIngredient(ItemID.TungstenBar, 1); - recipe.SetResult(this, 70); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.MusketBall, 70); + recipe.AddIngredient(ItemID.TungstenBar, 1); + recipe.SetResult(this, 70); + recipe.AddRecipe(); + } + } +} diff --git a/Items/TungstenShield.cs b/Items/TungstenShield.cs index 809d2e48..a0c53cce 100644 --- a/Items/TungstenShield.cs +++ b/Items/TungstenShield.cs @@ -5,37 +5,39 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Shield)] -public class TungstenShield : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + [AutoloadEquip(EquipType.Shield)] + public class TungstenShield : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 30; - item.value = 110; - item.rare = 0; - item.accessory = true; - item.defense = 3; - } + item.width = 30; + item.height = 30; + item.value = 110; + item.rare = 0; + item.accessory = true; + item.defense = 3; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Tungsten Shield"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Tungsten Shield"); + Tooltip.SetDefault(""); + } - public override void UpdateEquip(Player player) - { - player.moveSpeed -= 0.30f; - } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.TungstenBar, 15); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } -}} + public override void UpdateEquip(Player player) + { + player.moveSpeed -= 0.30f; + } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.TungstenBar, 15); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + } +} diff --git a/Items/TungstenSpear.cs b/Items/TungstenSpear.cs index 5794d548..80e770fa 100644 --- a/Items/TungstenSpear.cs +++ b/Items/TungstenSpear.cs @@ -4,42 +4,44 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TungstenSpear : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class TungstenSpear : ModItem + { + public override void SetDefaults() + { - item.damage = 13; - item.width = 14; - item.height = 84; - item.noUseGraphic = true; - item.melee = true; - item.useTime = 30; - item.shoot = mod.ProjectileType("TungstenSpearPro"); - item.shootSpeed = 3f; - item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 4; - item.value = 1000; - item.rare = 0; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 13; + item.width = 14; + item.height = 84; + item.noUseGraphic = true; + item.melee = true; + item.useTime = 30; + item.shoot = mod.ProjectileType("TungstenSpearPro"); + item.shootSpeed = 3f; + item.useAnimation = 30; + item.useStyle = 5; + item.knockBack = 4; + item.value = 1000; + item.rare = 0; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Tungsten Spear"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Tungsten Spear"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.TungstenBar, 9); - recipe.AddTile(16); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.TungstenBar, 9); + recipe.AddTile(16); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/TurtleGreatsword.cs b/Items/TurtleGreatsword.cs index c79a2389..d213cc1a 100644 --- a/Items/TurtleGreatsword.cs +++ b/Items/TurtleGreatsword.cs @@ -5,46 +5,47 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TurtleGreatsword : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class TurtleGreatsword : ModItem + { + public override void SetDefaults() + { - item.damage = 95; - item.melee = true; - item.width = 94; - item.height = 94; - item.useTime = 45; - item.useAnimation = 45; - item.useStyle = 1; - item.knockBack = 8; - item.value = 50000; - item.rare = 8; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 95; + item.melee = true; + item.width = 94; + item.height = 94; + item.useTime = 45; + item.useAnimation = 45; + item.useStyle = 1; + item.knockBack = 8; + item.value = 50000; + item.rare = 8; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Turtle Greatsword"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Turtle Greatsword"); + Tooltip.SetDefault(""); + } - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(36, 300); - } + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(36, 300); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.TurtleShell); - recipe.AddIngredient(ItemID.ChlorophyteBar, 20); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.TurtleShell); + recipe.AddIngredient(ItemID.ChlorophyteBar, 20); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } } diff --git a/Items/TurtlePitchfork.cs b/Items/TurtlePitchfork.cs index 3c2ed05f..11511fd6 100644 --- a/Items/TurtlePitchfork.cs +++ b/Items/TurtlePitchfork.cs @@ -5,44 +5,45 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TurtlePitchfork : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class TurtlePitchfork : ModItem + { + public override void SetDefaults() + { - item.damage = 86; - item.width = 80; - item.height = 80; - item.noUseGraphic = true; - item.melee = true; - item.useTime = 30; - item.shoot = mod.ProjectileType("TurtlePitchfork"); - item.shootSpeed = 3f; - item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 4; - item.value = 30000; - item.rare = 8; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 86; + item.width = 80; + item.height = 80; + item.noUseGraphic = true; + item.melee = true; + item.useTime = 30; + item.shoot = mod.ProjectileType("TurtlePitchfork"); + item.shootSpeed = 3f; + item.useAnimation = 30; + item.useStyle = 5; + item.knockBack = 4; + item.value = 30000; + item.rare = 8; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Turtle Pitchfork"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Turtle Pitchfork"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.TurtleShell); - recipe.AddIngredient(ItemID.ChlorophyteBar, 15); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.TurtleShell); + recipe.AddIngredient(ItemID.ChlorophyteBar, 15); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } } diff --git a/Items/TurtleShield.cs b/Items/TurtleShield.cs index 6e75381f..351c3378 100644 --- a/Items/TurtleShield.cs +++ b/Items/TurtleShield.cs @@ -5,57 +5,59 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Shield)] -public class TurtleShield : ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 36; - item.height = 42; - item.value = 123450; - item.rare = 8; - - item.accessory = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Turtle Shield"); - Tooltip.SetDefault("The less health, the more defense..."); - } - - - public override void UpdateAccessory(Player player, bool hideVisual) - - { - if (player.statLife < 25) - { - player.statDefense += 10; - } - if (player.statLife < 100) - { - player.statDefense += 8; - } - if (player.statLife < 200) - { - player.statDefense += 6; - } - if (player.statLife < 300) - { - player.statDefense += 3; - } - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.ChlorophyteBar, 20); - recipe.AddIngredient(ItemID.TurtleShell, 2); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + [AutoloadEquip(EquipType.Shield)] + public class TurtleShield : ModItem + { + + public override void SetDefaults() + { + + item.width = 36; + item.height = 42; + item.value = 123450; + item.rare = 8; + + item.accessory = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Turtle Shield"); + Tooltip.SetDefault("The less health, the more defense..."); + } + + + public override void UpdateAccessory(Player player, bool hideVisual) + + { + if (player.statLife < 25) + { + player.statDefense += 10; + } + if (player.statLife < 100) + { + player.statDefense += 8; + } + if (player.statLife < 200) + { + player.statDefense += 6; + } + if (player.statLife < 300) + { + player.statDefense += 3; + } + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.ChlorophyteBar, 20); + recipe.AddIngredient(ItemID.TurtleShell, 2); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/TurtleSickle.cs b/Items/TurtleSickle.cs index d4c262a5..773b70b2 100644 --- a/Items/TurtleSickle.cs +++ b/Items/TurtleSickle.cs @@ -7,42 +7,42 @@ namespace Tremor.Items { - public class TurtleSickle : ModItem - { - public override void SetDefaults() - { + public class TurtleSickle : ModItem + { + public override void SetDefaults() + { - item.damage = 85; - item.melee = true; - item.width = 68; - item.height = 68; - item.useTime = 25; - item.useAnimation = 25; - item.useStyle = 1; - item.knockBack = 4; - item.value = 30000; - item.rare = 8; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.useTurn = true; - //item.shoot = mod.ProjectileType("TurtleSicklePro"); - item.shootSpeed = 6f; - } + item.damage = 85; + item.melee = true; + item.width = 68; + item.height = 68; + item.useTime = 25; + item.useAnimation = 25; + item.useStyle = 1; + item.knockBack = 4; + item.value = 30000; + item.rare = 8; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.useTurn = true; + //item.shoot = mod.ProjectileType("TurtleSicklePro"); + item.shootSpeed = 6f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Turtle Sickle"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Turtle Sickle"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.TurtleShell); - recipe.AddIngredient(ItemID.ChlorophyteBar, 17); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.TurtleShell); + recipe.AddIngredient(ItemID.ChlorophyteBar, 17); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } } diff --git a/Items/TwilightBatBanner.cs b/Items/TwilightBatBanner.cs index 9475d758..21ba349b 100644 --- a/Items/TwilightBatBanner.cs +++ b/Items/TwilightBatBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TwilightBatBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class TwilightBatBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 99; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 99; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Twilight Bat Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Twilight Bat Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/TwilightHorns.cs b/Items/TwilightHorns.cs index 6bc35156..8dd25a43 100644 --- a/Items/TwilightHorns.cs +++ b/Items/TwilightHorns.cs @@ -4,38 +4,40 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TwilightHorns : ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 24; - item.height = 28; - item.value = 125000; - - item.rare = 1; - item.accessory = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Twilight Horns"); - Tooltip.SetDefault("You gain more power during night"); - } - - - public override void UpdateAccessory(Player player, bool hideVisual) - - { - if (!Main.dayTime) - { - player.meleeDamage +=0.1f; - player.rangedDamage +=0.1f; - player.thrownDamage +=0.1f; - player.minionDamage +=0.1f; - player.magicDamage +=0.1f; - } - } -}} + public class TwilightHorns : ModItem + { + + public override void SetDefaults() + { + + item.width = 24; + item.height = 28; + item.value = 125000; + + item.rare = 1; + item.accessory = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Twilight Horns"); + Tooltip.SetDefault("You gain more power during night"); + } + + + public override void UpdateAccessory(Player player, bool hideVisual) + + { + if (!Main.dayTime) + { + player.meleeDamage += 0.1f; + player.rangedDamage += 0.1f; + player.thrownDamage += 0.1f; + player.minionDamage += 0.1f; + player.magicDamage += 0.1f; + } + } + } +} diff --git a/Items/TwilightKnife.cs b/Items/TwilightKnife.cs index 792cf31a..a17c372b 100644 --- a/Items/TwilightKnife.cs +++ b/Items/TwilightKnife.cs @@ -5,56 +5,58 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class TwilightKnife : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class TwilightKnife : ModItem + { + public override void SetDefaults() + { - item.damage = 150; - item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.shoot = mod.ProjectileType("TwilightKnifePro"); - item.shootSpeed = 22f; - item.useStyle = 1; - item.knockBack = 4; - item.value = 7; - item.rare = 11; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 150; + item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 20; + item.useAnimation = 20; + item.shoot = mod.ProjectileType("TwilightKnifePro"); + item.shootSpeed = 22f; + item.useStyle = 1; + item.knockBack = 4; + item.value = 7; + item.rare = 11; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Twilight Knife"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Twilight Knife"); + Tooltip.SetDefault(""); + } -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) -{ - for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. - { - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); - } - return false; -} + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. + { + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); + } + return false; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "PurpleQuartz", 1); - recipe.AddIngredient(null, "NightmareBar", 1); - recipe.SetResult(this, 125); - recipe.AddTile(14); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "PurpleQuartz", 1); + recipe.AddIngredient(null, "NightmareBar", 1); + recipe.SetResult(this, 125); + recipe.AddTile(14); + recipe.AddRecipe(); + } + } +} diff --git a/Items/UnchargedBand.cs b/Items/UnchargedBand.cs index 44b913c7..0d76418d 100644 --- a/Items/UnchargedBand.cs +++ b/Items/UnchargedBand.cs @@ -12,17 +12,17 @@ public class UnchargedBand : ModItem public override void SetDefaults() { - item.rare = 11; - item.value = 380000; + item.rare = 11; + item.value = 380000; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Uncharged Band"); - Tooltip.SetDefault("Can be charged with fragments\nCharged band summons a pet"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Uncharged Band"); + Tooltip.SetDefault("Can be charged with fragments\nCharged band summons a pet"); + } } diff --git a/Items/UndeadWarriorBanner.cs b/Items/UndeadWarriorBanner.cs index 2e6696b0..b531a2dc 100644 --- a/Items/UndeadWarriorBanner.cs +++ b/Items/UndeadWarriorBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class UndeadWarriorBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class UndeadWarriorBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 2; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Undead Warrior Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Undead Warrior Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/UnderratedTrinkets.cs b/Items/UnderratedTrinkets.cs index 5467d733..0ab2cc74 100644 --- a/Items/UnderratedTrinkets.cs +++ b/Items/UnderratedTrinkets.cs @@ -5,110 +5,112 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class UnderratedTrinkets: ModItem +namespace Tremor.Items { + public class UnderratedTrinkets : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 20; - item.value = 125000; - item.rare = 10; + item.width = 26; + item.height = 20; + item.value = 125000; + item.rare = 10; - item.accessory = true; - } + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Underrated Trinkets"); - Tooltip.SetDefault("The less health, the more stats bonuses you gain"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Underrated Trinkets"); + Tooltip.SetDefault("The less health, the more stats bonuses you gain"); + } - public override void UpdateAccessory(Player player, bool hideVisual) + public override void UpdateAccessory(Player player, bool hideVisual) - { - if (player.statMana < 25) - { - player.statDefense += 10; - } - if (player.statMana < 100) - { - player.statDefense += 8; - } - if (player.statMana < 200) - { - player.statDefense += 6; - } - if (player.statMana < 300) - { - player.statDefense += 3; - } - if (player.statLife < 50) - { - player.moveSpeed += 1f; - } - if (player.statLife < 100) - { - player.moveSpeed += 0.9f; - } - if (player.statLife < 200) - { - player.moveSpeed += 0.7f; - } - if (player.statLife < 300) - { - player.moveSpeed += 0.5f; - } - if (player.statLife < 50) - { - player.magicCrit += 20; - player.meleeCrit += 20; - player.rangedCrit += 20; - player.magicDamage += 0.20f; - player.meleeDamage += 0.20f; - player.rangedDamage += 0.20f; - } - if (player.statLife < 100) - { - player.magicCrit += 15; - player.meleeCrit += 15; - player.rangedCrit += 15; - player.magicDamage += 0.15f; - player.meleeDamage += 0.15f; - player.rangedDamage += 0.15f; - } - if (player.statLife < 200) - { - player.magicCrit += 10; - player.meleeCrit += 10; - player.rangedCrit += 10; - player.magicDamage += 0.10f; - player.meleeDamage += 0.10f; - player.rangedDamage += 0.10f; - } - if (player.statLife < 300) - { - player.magicCrit += 5; - player.meleeCrit += 5; - player.rangedCrit += 5; - player.magicDamage += 0.05f; - player.meleeDamage += 0.05f; - player.rangedDamage += 0.05f; - } - } + { + if (player.statMana < 25) + { + player.statDefense += 10; + } + if (player.statMana < 100) + { + player.statDefense += 8; + } + if (player.statMana < 200) + { + player.statDefense += 6; + } + if (player.statMana < 300) + { + player.statDefense += 3; + } + if (player.statLife < 50) + { + player.moveSpeed += 1f; + } + if (player.statLife < 100) + { + player.moveSpeed += 0.9f; + } + if (player.statLife < 200) + { + player.moveSpeed += 0.7f; + } + if (player.statLife < 300) + { + player.moveSpeed += 0.5f; + } + if (player.statLife < 50) + { + player.magicCrit += 20; + player.meleeCrit += 20; + player.rangedCrit += 20; + player.magicDamage += 0.20f; + player.meleeDamage += 0.20f; + player.rangedDamage += 0.20f; + } + if (player.statLife < 100) + { + player.magicCrit += 15; + player.meleeCrit += 15; + player.rangedCrit += 15; + player.magicDamage += 0.15f; + player.meleeDamage += 0.15f; + player.rangedDamage += 0.15f; + } + if (player.statLife < 200) + { + player.magicCrit += 10; + player.meleeCrit += 10; + player.rangedCrit += 10; + player.magicDamage += 0.10f; + player.meleeDamage += 0.10f; + player.rangedDamage += 0.10f; + } + if (player.statLife < 300) + { + player.magicCrit += 5; + player.meleeCrit += 5; + player.rangedCrit += 5; + player.magicDamage += 0.05f; + player.meleeDamage += 0.05f; + player.rangedDamage += 0.05f; + } + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "ChaoticCross", 1); - recipe.AddIngredient(null, "ShroomiteMagicalBoots", 1); - recipe.SetResult(this); - recipe.AddTile(114); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "ChaoticCross", 1); + recipe.AddIngredient(null, "ShroomiteMagicalBoots", 1); + recipe.SetResult(this); + recipe.AddTile(114); + recipe.AddRecipe(); + } + } +} diff --git a/Items/UnfathomableFlower.cs b/Items/UnfathomableFlower.cs index 363e6bba..72531d72 100644 --- a/Items/UnfathomableFlower.cs +++ b/Items/UnfathomableFlower.cs @@ -5,34 +5,36 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class UnfathomableFlower : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class UnfathomableFlower : ModItem + { + public override void SetDefaults() + { - item.damage = 42; - item.magic = true; - item.width = 40; - item.mana = 11; - item.height = 20; - item.useTime = 12; - item.useAnimation = 12; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 6; - item.value = 60000; - item.rare = 6; - item.autoReuse = true; - item.shoot = 248; - item.shootSpeed = 12f; - } + item.damage = 42; + item.magic = true; + item.width = 40; + item.mana = 11; + item.height = 20; + item.useTime = 12; + item.useAnimation = 12; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 6; + item.value = 60000; + item.rare = 6; + item.autoReuse = true; + item.shoot = 248; + item.shootSpeed = 12f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Unfathomable Flower"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Unfathomable Flower"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git "a/Items/Unpredictable\320\241ompass.cs" "b/Items/Unpredictable\320\241ompass.cs" index 1e1ef664..77801483 100644 --- "a/Items/Unpredictable\320\241ompass.cs" +++ "b/Items/Unpredictable\320\241ompass.cs" @@ -6,36 +6,36 @@ namespace Tremor.Items { - class UnpredictableСompass : ModItem - { - public override void SetDefaults() - { + class UnpredictableСompass : ModItem + { + public override void SetDefaults() + { - item.width = 44; - item.height = 48; + item.width = 44; + item.height = 48; - item.useTime = 30; - item.useAnimation = 30; - item.useStyle = 4; - item.knockBack = 0; - item.shoot = 1; - item.value = 240000; - item.rare = 9; - item.expert = true; - item.UseSound = SoundID.Item6; - } + item.useTime = 30; + item.useAnimation = 30; + item.useStyle = 4; + item.knockBack = 0; + item.shoot = 1; + item.value = 240000; + item.rare = 9; + item.expert = true; + item.UseSound = SoundID.Item6; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Unpredictable compass"); - Tooltip.SetDefault("Teleports you to a random location"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Unpredictable compass"); + Tooltip.SetDefault("Teleports you to a random location"); + } - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - player.TeleportationPotion(); - return false; - } - } + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + player.TeleportationPotion(); + return false; + } + } } diff --git a/Items/UnstableCrystal.cs b/Items/UnstableCrystal.cs index 8d905ab4..cce8201e 100644 --- a/Items/UnstableCrystal.cs +++ b/Items/UnstableCrystal.cs @@ -6,38 +6,38 @@ namespace Tremor.Items { - class UnstableCrystal : ModItem - { - public override void SetDefaults() - { + class UnstableCrystal : ModItem + { + public override void SetDefaults() + { - item.width = 44; - item.height = 48; + item.width = 44; + item.height = 48; - item.useTime = 30; - item.useAnimation = 30; - item.useStyle = 4; - item.knockBack = 0; - item.shoot = 1; - item.value = 10000; - item.rare = 1; - item.consumable = true; - item.maxStack = 999; - item.UseSound = SoundID.Item6; - } + item.useTime = 30; + item.useAnimation = 30; + item.useStyle = 4; + item.knockBack = 0; + item.shoot = 1; + item.value = 10000; + item.rare = 1; + item.consumable = true; + item.maxStack = 999; + item.UseSound = SoundID.Item6; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Unstable Crystal"); - Tooltip.SetDefault("Teleports you to a random location\n'Be careful! It can take you to a very dangerous place!'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Unstable Crystal"); + Tooltip.SetDefault("Teleports you to a random location\n'Be careful! It can take you to a very dangerous place!'"); + } - public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - player.TeleportationPotion(); - return false; - } - } + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + player.TeleportationPotion(); + return false; + } + } } diff --git a/Items/UntreatedFlesh.cs b/Items/UntreatedFlesh.cs index bc9e9053..e0736bd3 100644 --- a/Items/UntreatedFlesh.cs +++ b/Items/UntreatedFlesh.cs @@ -4,23 +4,25 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class UntreatedFlesh : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class UntreatedFlesh : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 22; - item.maxStack = 99; - item.value = 80; - item.rare = 1; - } + item.width = 22; + item.height = 22; + item.maxStack = 99; + item.value = 80; + item.rare = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Untreated Flesh"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Untreated Flesh"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/VampireDagger.cs b/Items/VampireDagger.cs index 83508cee..40eb1e01 100644 --- a/Items/VampireDagger.cs +++ b/Items/VampireDagger.cs @@ -5,44 +5,46 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class VampireDagger : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class VampireDagger : ModItem + { + public override void SetDefaults() + { - item.damage = 48; - item.thrown = true; - item.width = 26; - item.noUseGraphic = true; - item.maxStack = 999; - item.consumable = true; - item.height = 30; - item.useTime = 15; - item.useAnimation = 20; - item.shoot = 304; - item.shootSpeed = 15f; - item.useStyle = 1; - item.knockBack = 4; - item.value = 7; - item.rare = 5; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 48; + item.thrown = true; + item.width = 26; + item.noUseGraphic = true; + item.maxStack = 999; + item.consumable = true; + item.height = 30; + item.useTime = 15; + item.useAnimation = 20; + item.shoot = 304; + item.shootSpeed = 15f; + item.useStyle = 1; + item.knockBack = 4; + item.value = 7; + item.rare = 5; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Vampire Dagger"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Vampire Dagger"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "SkullTeeth"); - recipe.SetResult(this, 100); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "SkullTeeth"); + recipe.SetResult(this, 100); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Vertebrow.cs b/Items/Vertebrow.cs index 66d7fe26..28e851d7 100644 --- a/Items/Vertebrow.cs +++ b/Items/Vertebrow.cs @@ -4,33 +4,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Vertebrow : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Vertebrow : ModItem + { + public override void SetDefaults() + { - item.damage = 15; - item.width = 16; - item.height = 32; - item.useTime = 30; - item.ranged = true; - item.shoot = 1; - item.shootSpeed = 12f; - item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 8; - item.value = 540; - item.useAmmo = AmmoID.Arrow; - item.rare = 1; - item.UseSound = SoundID.Item5; - item.autoReuse = false; - } + item.damage = 15; + item.width = 16; + item.height = 32; + item.useTime = 30; + item.ranged = true; + item.shoot = 1; + item.shootSpeed = 12f; + item.useAnimation = 30; + item.useStyle = 5; + item.knockBack = 8; + item.value = 540; + item.useAmmo = AmmoID.Arrow; + item.rare = 1; + item.UseSound = SoundID.Item5; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Vertebrow"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Vertebrow"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/ViciousChestplate.cs b/Items/ViciousChestplate.cs index ff0ba353..0ec566ce 100644 --- a/Items/ViciousChestplate.cs +++ b/Items/ViciousChestplate.cs @@ -5,34 +5,36 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class ViciousChestplate : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Body)] + public class ViciousChestplate : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 38; - item.height = 22; + item.width = 38; + item.height = 22; - item.value = 30000; - item.rare = 1; - item.defense = 5; - } + item.value = 30000; + item.rare = 1; + item.defense = 5; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Vicious Chestplate"); - Tooltip.SetDefault("8% increased minion damage\nIncreases your max number of minions"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Vicious Chestplate"); + Tooltip.SetDefault("8% increased minion damage\nIncreases your max number of minions"); + } - public override void UpdateEquip(Player player) - { - player.maxMinions += 1; - player.minionDamage += 0.08f; - } + public override void UpdateEquip(Player player) + { + player.maxMinions += 1; + player.minionDamage += 0.08f; + } -}} + } +} diff --git a/Items/ViciousHelmet.cs b/Items/ViciousHelmet.cs index fece3cd2..424405aa 100644 --- a/Items/ViciousHelmet.cs +++ b/Items/ViciousHelmet.cs @@ -5,45 +5,48 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class ViciousHelmet : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class ViciousHelmet : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 38; - item.height = 22; + item.width = 38; + item.height = 22; - item.value = 30000; - item.rare = 1; - item.defense = 1; - } + item.value = 30000; + item.rare = 1; + item.defense = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Vicious Helmet"); - Tooltip.SetDefault("6% increased minion damage\nIncreases your max number of minions"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Vicious Helmet"); + Tooltip.SetDefault("6% increased minion damage\nIncreases your max number of minions"); + } - public override void UpdateEquip(Player player) - { - player.maxMinions += 1; - player.minionDamage += 0.06f; - } + public override void UpdateEquip(Player player) + { + player.maxMinions += 1; + player.minionDamage += 0.06f; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("ViciousChestplate") && legs.type == mod.ItemType("ViciousLeggings"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("ViciousChestplate") && legs.type == mod.ItemType("ViciousLeggings"); + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increased maximum defense by 2"; - player.statDefense += 3; - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increased maximum defense by 2"; + player.statDefense += 3; + } -}} + } +} diff --git a/Items/ViciousLeggings.cs b/Items/ViciousLeggings.cs index eb51e9f9..fc52b050 100644 --- a/Items/ViciousLeggings.cs +++ b/Items/ViciousLeggings.cs @@ -5,34 +5,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class ViciousLeggings : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Legs)] + public class ViciousLeggings : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 38; - item.height = 22; + item.width = 38; + item.height = 22; - item.value = 30000; - item.rare = 1; - item.defense = 1; - } + item.value = 30000; + item.rare = 1; + item.defense = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Vicious Leggings"); - Tooltip.SetDefault("6% increased minion damage\nIncreases your max number of minions"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Vicious Leggings"); + Tooltip.SetDefault("6% increased minion damage\nIncreases your max number of minions"); + } - public override void UpdateEquip(Player player) - { - player.maxMinions += 1; - player.minionDamage += 0.06f; - } + public override void UpdateEquip(Player player) + { + player.maxMinions += 1; + player.minionDamage += 0.06f; + } -}} + } +} diff --git a/Items/VileChestplate.cs b/Items/VileChestplate.cs index d9774e3f..af379e3b 100644 --- a/Items/VileChestplate.cs +++ b/Items/VileChestplate.cs @@ -5,33 +5,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class VileChestplate : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + [AutoloadEquip(EquipType.Body)] + public class VileChestplate : ModItem + { + public override void SetDefaults() + { - item.width = 38; - item.height = 22; + item.width = 38; + item.height = 22; - item.value = 30000; - item.rare = 1; - item.defense = 4; - } + item.value = 30000; + item.rare = 1; + item.defense = 4; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Vile Chestplate"); - Tooltip.SetDefault("8% increased minion damage\nIncreases your max number of minions"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Vile Chestplate"); + Tooltip.SetDefault("8% increased minion damage\nIncreases your max number of minions"); + } - public override void UpdateEquip(Player player) - { - player.maxMinions += 1; - player.minionDamage += 0.08f; - } + public override void UpdateEquip(Player player) + { + player.maxMinions += 1; + player.minionDamage += 0.08f; + } -}} + } +} diff --git a/Items/VileHelmet.cs b/Items/VileHelmet.cs index 86551ab4..41b5e221 100644 --- a/Items/VileHelmet.cs +++ b/Items/VileHelmet.cs @@ -7,45 +7,46 @@ namespace Tremor.Items { -[AutoloadEquip(EquipType.Head)] -public class VileHelmet : ModItem -{ + [AutoloadEquip(EquipType.Head)] + public class VileHelmet : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 38; - item.height = 22; + item.width = 38; + item.height = 22; - item.value = 30000; - item.rare = 1; - item.defense = 1; - } + item.value = 30000; + item.rare = 1; + item.defense = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Vile Helmet"); - Tooltip.SetDefault("6% increased minion damage\nIncreases your max number of minions"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Vile Helmet"); + Tooltip.SetDefault("6% increased minion damage\nIncreases your max number of minions"); + } - public override void UpdateEquip(Player player) - { - player.maxMinions += 1; - player.minionDamage += 0.06f; - } + public override void UpdateEquip(Player player) + { + player.maxMinions += 1; + player.minionDamage += 0.06f; + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("VileChestplate") && legs.type == mod.ItemType("VileLeggings"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("VileChestplate") && legs.type == mod.ItemType("VileLeggings"); + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increased maximum defense by 2"; - player.statDefense += 2; - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increased maximum defense by 2"; + player.statDefense += 2; + } -}} + } +} diff --git a/Items/VileLeggings.cs b/Items/VileLeggings.cs index 874903a6..e7953333 100644 --- a/Items/VileLeggings.cs +++ b/Items/VileLeggings.cs @@ -5,34 +5,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class VileLeggings : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Legs)] + public class VileLeggings : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 38; - item.height = 22; + item.width = 38; + item.height = 22; - item.value = 30000; - item.rare = 1; - item.defense = 1; - } + item.value = 30000; + item.rare = 1; + item.defense = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Vile Leggings"); - Tooltip.SetDefault("6% increased minion damage\nIncreases your max number of minions"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Vile Leggings"); + Tooltip.SetDefault("6% increased minion damage\nIncreases your max number of minions"); + } - public override void UpdateEquip(Player player) - { - player.maxMinions += 1; - player.minionDamage += 0.06f; - } + public override void UpdateEquip(Player player) + { + player.maxMinions += 1; + player.minionDamage += 0.06f; + } -}} + } +} diff --git a/Items/Vindicator.cs b/Items/Vindicator.cs index 3d492746..7fbacdd9 100644 --- a/Items/Vindicator.cs +++ b/Items/Vindicator.cs @@ -6,60 +6,62 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { - -public class Vindicator : ModItem +namespace Tremor.Items { - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Vindicator"); - Tooltip.SetDefault(""); - } - - public override void SetDefaults() - { - item.damage = 200; - item.ranged = true; - item.width = 76; - item.height = 26; - item.useTime = 9; - item.useAnimation = 9; - item.channel = true; - item.noUseGraphic = true; - item.noMelee = true; - item.useStyle = 5; - item.knockBack = 6; - item.value = Item.buyPrice(15, 00); - item.rare = 11; - //item.UseSound = SoundID.Item23; - item.autoReuse = true; - item.shoot = mod.ProjectileType("VindicatorProj"); - item.shootSpeed = 45f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "CarbonSteel", 15); - recipe.AddIngredient(null, "NightmareBar", 18); - recipe.AddIngredient(ItemID.IllegalGunParts, 3); - recipe.AddIngredient(ItemID.LaserMachinegun, 1); - recipe.AddIngredient(ItemID.SoulofNight, 8); - recipe.AddIngredient(null, "MultidimensionalFragment", 9); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } - - public override Vector2? HoldoutOffset() - { - return new Vector2(-12, -7); - } + + public class Vindicator : ModItem + { + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Vindicator"); + Tooltip.SetDefault(""); + } + + public override void SetDefaults() + { + item.damage = 200; + item.ranged = true; + item.width = 76; + item.height = 26; + item.useTime = 9; + item.useAnimation = 9; + item.channel = true; + item.noUseGraphic = true; + item.noMelee = true; + item.useStyle = 5; + item.knockBack = 6; + item.value = Item.buyPrice(15, 00); + item.rare = 11; + //item.UseSound = SoundID.Item23; + item.autoReuse = true; + item.shoot = mod.ProjectileType("VindicatorProj"); + item.shootSpeed = 45f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "CarbonSteel", 15); + recipe.AddIngredient(null, "NightmareBar", 18); + recipe.AddIngredient(ItemID.IllegalGunParts, 3); + recipe.AddIngredient(ItemID.LaserMachinegun, 1); + recipe.AddIngredient(ItemID.SoulofNight, 8); + recipe.AddIngredient(null, "MultidimensionalFragment", 9); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + + public override Vector2? HoldoutOffset() + { + return new Vector2(-12, -7); + } public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f); return false; } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/Items/VineCape.cs b/Items/VineCape.cs index de4cfa04..5786ae48 100644 --- a/Items/VineCape.cs +++ b/Items/VineCape.cs @@ -5,41 +5,43 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class VineCape : ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 30; - item.height = 22; - - item.value = 100; - item.rare = 1; - item.defense = 3; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Vine Cape"); - Tooltip.SetDefault("5% increased ranged damage"); - } - - - public override void UpdateEquip(Player player) - { - player.rangedDamage += 0.05f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.VineRope, 60); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } - -}} + [AutoloadEquip(EquipType.Body)] + public class VineCape : ModItem + { + + public override void SetDefaults() + { + + item.width = 30; + item.height = 22; + + item.value = 100; + item.rare = 1; + item.defense = 3; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Vine Cape"); + Tooltip.SetDefault("5% increased ranged damage"); + } + + + public override void UpdateEquip(Player player) + { + player.rangedDamage += 0.05f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.VineRope, 60); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + + } +} diff --git a/Items/VineHood.cs b/Items/VineHood.cs index 3de76959..6f29a205 100644 --- a/Items/VineHood.cs +++ b/Items/VineHood.cs @@ -5,51 +5,54 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class VineHood : ModItem +namespace Tremor.Items { - - - public override void SetDefaults() - { - - item.width = 26; - item.height = 26; - - item.value = 100; - item.rare = 1; - item.defense = 1; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Vine Hood"); - Tooltip.SetDefault("5% increased ranged damage"); - } - - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("VineCape") && legs.type == mod.ItemType("VinePants"); - } - - public override void UpdateArmorSet(Player player) - { - player.setBonus = "15% increased movement speed"; - player.moveSpeed += 0.15f; - } - public override void UpdateEquip(Player player) - { - player.rangedDamage += 0.05f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.VineRope, 25); - recipe.AddIngredient(ItemID.Daybloom, 1); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } - -}} + [AutoloadEquip(EquipType.Head)] + public class VineHood : ModItem + { + + + public override void SetDefaults() + { + + item.width = 26; + item.height = 26; + + item.value = 100; + item.rare = 1; + item.defense = 1; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Vine Hood"); + Tooltip.SetDefault("5% increased ranged damage"); + } + + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("VineCape") && legs.type == mod.ItemType("VinePants"); + } + + public override void UpdateArmorSet(Player player) + { + player.setBonus = "15% increased movement speed"; + player.moveSpeed += 0.15f; + } + public override void UpdateEquip(Player player) + { + player.rangedDamage += 0.05f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.VineRope, 25); + recipe.AddIngredient(ItemID.Daybloom, 1); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } + + } +} diff --git a/Items/VinePants.cs b/Items/VinePants.cs index 41186c23..b2bccb04 100644 --- a/Items/VinePants.cs +++ b/Items/VinePants.cs @@ -5,41 +5,44 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class VinePants : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Legs)] + public class VinePants : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 18; - item.value = 100; + item.width = 22; + item.height = 18; + item.value = 100; - item.rare = 1; - item.defense = 2; - } + item.rare = 1; + item.defense = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Vine Pants"); - Tooltip.SetDefault("5% increased ranged damage"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Vine Pants"); + Tooltip.SetDefault("5% increased ranged damage"); + } - public override void UpdateEquip(Player player) - { - player.rangedDamage += 0.05f; - } + public override void UpdateEquip(Player player) + { + player.rangedDamage += 0.05f; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.VineRope, 45); - recipe.SetResult(this); - recipe.AddTile(16); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.VineRope, 45); + recipe.SetResult(this); + recipe.AddTile(16); + recipe.AddRecipe(); + } -}} + } +} diff --git a/Items/VoidBar.cs b/Items/VoidBar.cs index dda1cd14..cda47bed 100644 --- a/Items/VoidBar.cs +++ b/Items/VoidBar.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class VoidBar : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class VoidBar : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 100; - item.rare = 11; - item.createTile = mod.TileType("VoidBarTile"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 100; + item.rare = 11; + item.createTile = mod.TileType("VoidBarTile"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Void Bar"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Void Bar"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/VoidBlade.cs b/Items/VoidBlade.cs index 4a837291..d0688f27 100644 --- a/Items/VoidBlade.cs +++ b/Items/VoidBlade.cs @@ -5,49 +5,51 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class VoidBlade : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class VoidBlade : ModItem + { + public override void SetDefaults() + { - item.damage = 72; - item.melee = true; - item.width = 46; - item.height = 48; - item.useTime = 44; - item.useAnimation = 44; - item.useStyle = 1; - item.knockBack = 3; + item.damage = 72; + item.melee = true; + item.width = 46; + item.height = 48; + item.useTime = 44; + item.useAnimation = 44; + item.useStyle = 1; + item.knockBack = 3; item.shoot = mod.ProjectileType("VoidBladePro"); item.shootSpeed = 12f; - item.value = 12400; - item.rare = 11; - item.UseSound = SoundID.Item15; - item.autoReuse = false; - item.useTurn = false; - } + item.value = 12400; + item.rare = 11; + item.UseSound = SoundID.Item15; + item.autoReuse = false; + item.useTurn = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Void Blade"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Void Blade"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.BrokenHeroSword, 1); - recipe.AddIngredient(ItemID.HallowedBar, 25); - recipe.AddIngredient(ItemID.Ectoplasm, 15); - recipe.AddIngredient(null, "DarkMatter", 45); - recipe.AddIngredient(null, "AirFragment", 10); - recipe.AddIngredient(null, "FireFragment", 10); - recipe.AddIngredient(null, "MultidimensionalFragment", 8); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.BrokenHeroSword, 1); + recipe.AddIngredient(ItemID.HallowedBar, 25); + recipe.AddIngredient(ItemID.Ectoplasm, 15); + recipe.AddIngredient(null, "DarkMatter", 45); + recipe.AddIngredient(null, "AirFragment", 10); + recipe.AddIngredient(null, "FireFragment", 10); + recipe.AddIngredient(null, "MultidimensionalFragment", 8); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/VoidKnife.cs b/Items/VoidKnife.cs index 020a4208..3857202e 100644 --- a/Items/VoidKnife.cs +++ b/Items/VoidKnife.cs @@ -6,53 +6,53 @@ namespace Tremor.Items { - public class VoidKnife : ModItem - { - public override void SetDefaults() - { - item.damage = 666; - item.melee = true; - item.width = 56; - item.height = 56; - item.useTime = 21; - item.useAnimation = 21; - item.useStyle = 1; - item.knockBack = 6; - item.value = 120000; - item.rare = 10; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.useTurn = true; - item.scale = 1.5f; - } + public class VoidKnife : ModItem + { + public override void SetDefaults() + { + item.damage = 666; + item.melee = true; + item.width = 56; + item.height = 56; + item.useTime = 21; + item.useAnimation = 21; + item.useStyle = 1; + item.knockBack = 6; + item.value = 120000; + item.rare = 10; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.useTurn = true; + item.scale = 1.5f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Void Knife"); - Tooltip.SetDefault("Hitting enemies will spawn an explosion\nIf you are below 50% of life your hits have a chance to heal you"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Void Knife"); + Tooltip.SetDefault("Hitting enemies will spawn an explosion\nIf you are below 50% of life your hits have a chance to heal you"); + } - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) - { - Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, mod.ProjectileType("VoidKnifeExplosion"), damage, knockback, Main.myPlayer); - if (player.statLife < (player.statLifeMax2 * 0.5f) && Main.rand.Next(4) == 0) - { - int NewLife = Main.rand.Next(19, 41); - player.statLife += NewLife; - player.HealEffect(NewLife); - } - } + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + { + Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, mod.ProjectileType("VoidKnifeExplosion"), damage, knockback, Main.myPlayer); + if (player.statLife < (player.statLifeMax2 * 0.5f) && Main.rand.Next(4) == 0) + { + int NewLife = Main.rand.Next(19, 41); + player.statLife += NewLife; + player.HealEffect(NewLife); + } + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "VoidBar", 15); - recipe.AddIngredient(null, "DarkMatter", 64); - recipe.AddIngredient(null, "AtisBlood", 8); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "VoidBar", 15); + recipe.AddIngredient(null, "DarkMatter", 64); + recipe.AddIngredient(null, "AtisBlood", 8); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } - } + } } diff --git a/Items/Volcannon.cs b/Items/Volcannon.cs index 52f07329..dfb9b3e2 100644 --- a/Items/Volcannon.cs +++ b/Items/Volcannon.cs @@ -7,55 +7,56 @@ using Microsoft.Xna.Framework; using Terraria.DataStructures; -namespace Tremor.Items { -public class Volcannon : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Volcannon : ModItem + { + public override void SetDefaults() + { - item.damage = 356; - item.melee = false; - item.magic = true; - item.width = 50; - item.height = 55; - item.useTime = 20; - item.useAnimation = 20; - item.mana = 9; - item.useStyle = 5; - item.shoot = 376; - item.shootSpeed = 26f; - item.knockBack = 4; - item.value = 12000; - item.rare = 0; - item.UseSound = SoundID.Item100; - item.autoReuse = true; - } + item.damage = 356; + item.melee = false; + item.magic = true; + item.width = 50; + item.height = 55; + item.useTime = 20; + item.useAnimation = 20; + item.mana = 9; + item.useStyle = 5; + item.shoot = 376; + item.shootSpeed = 26f; + item.knockBack = 4; + item.value = 12000; + item.rare = 0; + item.UseSound = SoundID.Item100; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Volcannon"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Volcannon"); + Tooltip.SetDefault(""); + } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) - { - tooltips[0].overrideColor = new Color(238, 194, 73); - } + public override void ModifyTooltips(System.Collections.Generic.List tooltips) + { + tooltips[0].overrideColor = new Color(238, 194, 73); + } -public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) -{ - for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. - { - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 3, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX + 3, speedY + 2, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 2, speedY - 3, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX - 3, speedY - 2, type, damage, knockBack, Main.myPlayer); - } - return false; -} -} + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + for (int i = 0; i < 1; ++i) // Will shoot 3 bullets. + { + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 3, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX + 3, speedY + 2, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 1, speedY - 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 2, speedY - 3, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX - 3, speedY - 2, type, damage, knockBack, Main.myPlayer); + } + return false; + } + } } diff --git a/Items/Voltager.cs b/Items/Voltager.cs index 2bf16f80..cb5b416c 100644 --- a/Items/Voltager.cs +++ b/Items/Voltager.cs @@ -5,46 +5,48 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Voltager : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Voltager : ModItem + { + public override void SetDefaults() + { - item.damage = 212; - item.magic = true; - item.width = 28; - item.height = 30; - item.useTime = 30; - item.useAnimation = 14; - item.shoot = mod.ProjectileType("LightningBoltPro"); - item.shootSpeed = 7f; - item.mana = 6; - item.useStyle = 5; - item.knockBack = 3; - item.value = 122355; - item.rare = 5; - item.UseSound = SoundID.Item117; - item.autoReuse = false; - } + item.damage = 212; + item.magic = true; + item.width = 28; + item.height = 30; + item.useTime = 30; + item.useAnimation = 14; + item.shoot = mod.ProjectileType("LightningBoltPro"); + item.shootSpeed = 7f; + item.mana = 6; + item.useStyle = 5; + item.knockBack = 3; + item.value = 122355; + item.rare = 5; + item.UseSound = SoundID.Item117; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Voltager"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Voltager"); + Tooltip.SetDefault(""); + } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(null, "NightmareBar", 10); - recipe.AddIngredient(3467, 10); + recipe.AddIngredient(3467, 10); recipe.AddIngredient(null, "Doomstone", 9); recipe.AddIngredient(null, "Phantaplasm", 12); recipe.AddIngredient(null, "ConcentratedEther", 8); recipe.AddTile(412); recipe.SetResult(this); recipe.AddRecipe(); - } -}} + } + } +} diff --git a/Items/VortexBand.cs b/Items/VortexBand.cs index 7eb2d127..4bbcfe30 100644 --- a/Items/VortexBand.cs +++ b/Items/VortexBand.cs @@ -13,20 +13,20 @@ public override void SetDefaults() { item.CloneDefaults(ItemID.Carrot); - item.rare = 11; - item.value = 380000; - item.useTime = 25; - item.useAnimation = 25; + item.rare = 11; + item.value = 380000; + item.useTime = 25; + item.useAnimation = 25; item.shoot = mod.ProjectileType("VortexBee"); item.buffType = mod.BuffType("VortexBeeBuff"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Vortex Band"); - Tooltip.SetDefault("Summons a vortex bee"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Vortex Band"); + Tooltip.SetDefault("Summons a vortex bee"); + } public override void UseStyle(Player player) @@ -37,14 +37,14 @@ public override void UseStyle(Player player) } } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "UnchargedBand"); - recipe.AddIngredient(3456, 10); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "UnchargedBand"); + recipe.AddIngredient(3456, 10); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } } } diff --git a/Items/VortexRing.cs b/Items/VortexRing.cs index d89a6e9c..fd1a9923 100644 --- a/Items/VortexRing.cs +++ b/Items/VortexRing.cs @@ -4,42 +4,44 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class VortexRing : ModItem +namespace Tremor.Items { + public class VortexRing : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 28; - item.height = 20; - item.value = 250000; - item.rare = 8; - item.accessory = true; - } + item.width = 28; + item.height = 20; + item.value = 250000; + item.rare = 8; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Vortex Ring "); - Tooltip.SetDefault("20% increased ranged damage\nIncreases ranged critical strike chance by 15\n25% chance not to consume ammo"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Vortex Ring "); + Tooltip.SetDefault("20% increased ranged damage\nIncreases ranged critical strike chance by 15\n25% chance not to consume ammo"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.rangedDamage += 0.2f; - player.rangedCrit += 15; - player.ammoCost75 = true; - } + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.rangedDamage += 0.2f; + player.rangedCrit += 15; + player.ammoCost75 = true; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(3456, 10); - recipe.AddIngredient(3467, 15); - recipe.AddIngredient(null, "Band"); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(3456, 10); + recipe.AddIngredient(3467, 15); + recipe.AddIngredient(null, "Band"); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } +} diff --git a/Items/VulcanBlade.cs b/Items/VulcanBlade.cs index 9e786aa3..84e63758 100644 --- a/Items/VulcanBlade.cs +++ b/Items/VulcanBlade.cs @@ -5,38 +5,40 @@ using Terraria.ID; using Microsoft.Xna.Framework; -namespace Tremor.Items { -public class VulcanBlade : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class VulcanBlade : ModItem + { + public override void SetDefaults() + { - item.damage = 545; - item.melee = true; - item.width = 46; - item.height = 48; - item.useTime = 45; - item.useAnimation = 45; - item.useStyle = 1; - item.knockBack = 3; - item.shoot = mod.ProjectileType("VulcanBladePro"); - item.shootSpeed = 12f; - item.value = 600000; - item.rare = 0; - item.UseSound = SoundID.Item71; - item.autoReuse = false; - item.useTurn = false; - } + item.damage = 545; + item.melee = true; + item.width = 46; + item.height = 48; + item.useTime = 45; + item.useAnimation = 45; + item.useStyle = 1; + item.knockBack = 3; + item.shoot = mod.ProjectileType("VulcanBladePro"); + item.shootSpeed = 12f; + item.value = 600000; + item.rare = 0; + item.UseSound = SoundID.Item71; + item.autoReuse = false; + item.useTurn = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Vulcan Blade"); - Tooltip.SetDefault("Shoots a molten bolt that leaves molten spheres behind\nSpheres home on enemies, explode on contact and set enemies on fire"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Vulcan Blade"); + Tooltip.SetDefault("Shoots a molten bolt that leaves molten spheres behind\nSpheres home on enemies, explode on contact and set enemies on fire"); + } - public override void ModifyTooltips(System.Collections.Generic.List tooltips) - { - tooltips[0].overrideColor = new Color(238, 194, 73); - } -}} + public override void ModifyTooltips(System.Collections.Generic.List tooltips) + { + tooltips[0].overrideColor = new Color(238, 194, 73); + } + } +} diff --git a/Items/VultureFeather.cs b/Items/VultureFeather.cs index 8bc87079..7c148c64 100644 --- a/Items/VultureFeather.cs +++ b/Items/VultureFeather.cs @@ -4,28 +4,30 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class VultureFeather : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class VultureFeather : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 44; - item.value = 100; - item.rare = 2; - item.accessory = true; - } + item.width = 22; + item.height = 44; + item.value = 100; + item.rare = 2; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Vulture Feather"); - Tooltip.SetDefault("Increases movement speed by 15%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Vulture Feather"); + Tooltip.SetDefault("Increases movement speed by 15%"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.moveSpeed += 0.15f; - } -}} + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.moveSpeed += 0.15f; + } + } +} diff --git a/Items/VultureKingBag.cs b/Items/VultureKingBag.cs index 92404893..dce31066 100644 --- a/Items/VultureKingBag.cs +++ b/Items/VultureKingBag.cs @@ -4,56 +4,58 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class VultureKingBag : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class VultureKingBag : ModItem + { + public override void SetDefaults() + { - item.maxStack = 999; - item.consumable = true; - item.width = 24; - item.height = 24; + item.maxStack = 999; + item.consumable = true; + item.width = 24; + item.height = 24; - item.rare = 9; - item.expert = true; - bossBagNPC = mod.NPCType("npcVultureKing"); - } + item.rare = 9; + item.expert = true; + bossBagNPC = mod.NPCType("npcVultureKing"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Treasure Bag"); - Tooltip.SetDefault("Right click to open"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Treasure Bag"); + Tooltip.SetDefault("Right click to open"); + } - public override bool CanRightClick() - { - return true; - } + public override bool CanRightClick() + { + return true; + } - public override void OpenBossBag(Player player) - { - if(Main.rand.Next(7) == 0) - { - player.QuickSpawnItem(mod.ItemType("VultureKingMask")); - } - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("CactusBow")); - } - if(Main.rand.Next(3) == 0) - { - player.QuickSpawnItem(mod.ItemType("SandKnife")); - } - if(Main.rand.Next(4) == 0) - { - player.QuickSpawnItem(mod.ItemType("VultureFeather")); - } - if(Main.rand.Next(1) == 0) - { - player.QuickSpawnItem(mod.ItemType("SandstoneBar"), Main.rand.Next(10,18)); - } - player.QuickSpawnItem(mod.ItemType("DesertClaymore")); - } -}} + public override void OpenBossBag(Player player) + { + if (Main.rand.Next(7) == 0) + { + player.QuickSpawnItem(mod.ItemType("VultureKingMask")); + } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("CactusBow")); + } + if (Main.rand.Next(3) == 0) + { + player.QuickSpawnItem(mod.ItemType("SandKnife")); + } + if (Main.rand.Next(4) == 0) + { + player.QuickSpawnItem(mod.ItemType("VultureFeather")); + } + if (Main.rand.Next(1) == 0) + { + player.QuickSpawnItem(mod.ItemType("SandstoneBar"), Main.rand.Next(10, 18)); + } + player.QuickSpawnItem(mod.ItemType("DesertClaymore")); + } + } +} diff --git a/Items/VultureKingMask.cs b/Items/VultureKingMask.cs index 6415b0a3..bc216f49 100644 --- a/Items/VultureKingMask.cs +++ b/Items/VultureKingMask.cs @@ -4,26 +4,29 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class VultureKingMask : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class VultureKingMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 30; - item.height = 22; - item.value = 20000; - item.rare = 0; - item.vanity = true; - } + item.width = 30; + item.height = 22; + item.value = 20000; + item.rare = 0; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Rukh Mask"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Rukh Mask"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/VultureKingTrophy.cs b/Items/VultureKingTrophy.cs index faceb733..cdf9cb01 100644 --- a/Items/VultureKingTrophy.cs +++ b/Items/VultureKingTrophy.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class VultureKingTrophy : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class VultureKingTrophy : ModItem + { + public override void SetDefaults() + { - item.width = 32; - item.height = 32; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 50000; - item.createTile = mod.TileType("VultureKingTrophyTile"); - item.placeStyle = 0; - } + item.width = 32; + item.height = 32; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 50000; + item.createTile = mod.TileType("VultureKingTrophyTile"); + item.placeStyle = 0; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Rukh Trophy"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Rukh Trophy"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/VultureStaff.cs b/Items/VultureStaff.cs index 2681bad5..f4bcc6b7 100644 --- a/Items/VultureStaff.cs +++ b/Items/VultureStaff.cs @@ -32,11 +32,11 @@ public override void SetDefaults() item.buffTime = 3600; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Vulture Staff"); - Tooltip.SetDefault("Summons a vulture to fight for you."); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Vulture Staff"); + Tooltip.SetDefault("Summons a vulture to fight for you."); + } } } diff --git a/Items/VultureWings.cs b/Items/VultureWings.cs index 0444e19e..c00d8f5c 100644 --- a/Items/VultureWings.cs +++ b/Items/VultureWings.cs @@ -5,56 +5,58 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Wings)] -public class VultureWings : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Wings)] + public class VultureWings : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 20; - item.value = 10000; - item.rare = 5; - item.accessory = true; - } + item.width = 22; + item.height = 20; + item.value = 10000; + item.rare = 5; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Vulture Wings"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Vulture Wings"); + Tooltip.SetDefault(""); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.wingTimeMax = 100; - } + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.wingTimeMax = 100; + } public override void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend) - { - ascentWhenFalling = 0.75f; - ascentWhenRising = 0.15f; - maxCanAscendMultiplier = 1f; - maxAscentMultiplier = 3f; - constantAscend = 0.125f; - } - - public override void HorizontalWingSpeeds(Player player, ref float speed, ref float acceleration) - { - speed = 8f; - acceleration *= 2.5f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "VultureFeather", 1); - recipe.AddIngredient(ItemID.SoulofFlight, 20); - recipe.AddTile(134); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + { + ascentWhenFalling = 0.75f; + ascentWhenRising = 0.15f; + maxCanAscendMultiplier = 1f; + maxAscentMultiplier = 3f; + constantAscend = 0.125f; + } + + public override void HorizontalWingSpeeds(Player player, ref float speed, ref float acceleration) + { + speed = 8f; + acceleration *= 2.5f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "VultureFeather", 1); + recipe.AddIngredient(ItemID.SoulofFlight, 20); + recipe.AddTile(134); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/WallOfShadowsFlask.cs b/Items/WallOfShadowsFlask.cs index f38b71c0..3c5a1d8e 100644 --- a/Items/WallOfShadowsFlask.cs +++ b/Items/WallOfShadowsFlask.cs @@ -9,93 +9,93 @@ namespace Tremor.Items { - public class WallOfShadowsFlask : ModItem - { - const float ShootRange = 600.0f; - const float ShootKN = 1.0f; - const int ShootRate = 180; - int ShootCount = 3; - const float ShootSpeed = 8f; - const int spread = 45; - const float spreadMult = 0.045f; - int TimeToShoot = ShootRate; + public class WallOfShadowsFlask : ModItem + { + const float ShootRange = 600.0f; + const float ShootKN = 1.0f; + const int ShootRate = 180; + int ShootCount = 3; + const float ShootSpeed = 8f; + const int spread = 45; + const float spreadMult = 0.045f; + int TimeToShoot = ShootRate; - public override void SetDefaults() - { + public override void SetDefaults() + { - item.damage = 70; - item.knockBack = 3; - item.width = 26; - item.height = 30; + item.damage = 70; + item.knockBack = 3; + item.width = 26; + item.height = 30; - item.value = 00250000; - item.rare = 9; - item.expert = true; - item.accessory = true; - } + item.value = 00250000; + item.rare = 9; + item.expert = true; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Flask of Shadows"); - Tooltip.SetDefault("Casts shadow flask at nearby enemies \nThe less health, the more count of flasks"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Flask of Shadows"); + Tooltip.SetDefault("Casts shadow flask at nearby enemies \nThe less health, the more count of flasks"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - if (--TimeToShoot <= 0) - { - TimeToShoot = ShootRate; - int Target = GetTarget(); - if (Target != -1) Shoot(Target, GetDamage()); - } - } + public override void UpdateAccessory(Player player, bool hideVisual) + { + if (--TimeToShoot <= 0) + { + TimeToShoot = ShootRate; + int Target = GetTarget(); + if (Target != -1) Shoot(Target, GetDamage()); + } + } - int GetTarget() - { - int Target = -1; - for (int k = 0; k < Main.npc.Length; k++) - { - if (Main.npc[k].active && Main.npc[k].lifeMax > 5 && !Main.npc[k].dontTakeDamage && !Main.npc[k].friendly && Main.npc[k].Distance(Main.player[item.owner].Center) <= ShootRange && Collision.CanHitLine(Main.player[item.owner].Center, 4, 4, Main.npc[k].Center, 4, 4)) - { - Target = k; - break; - } - } - return Target; - } + int GetTarget() + { + int Target = -1; + for (int k = 0; k < Main.npc.Length; k++) + { + if (Main.npc[k].active && Main.npc[k].lifeMax > 5 && !Main.npc[k].dontTakeDamage && !Main.npc[k].friendly && Main.npc[k].Distance(Main.player[item.owner].Center) <= ShootRange && Collision.CanHitLine(Main.player[item.owner].Center, 4, 4, Main.npc[k].Center, 4, 4)) + { + Target = k; + break; + } + } + return Target; + } - int GetDamage() - { - return (10 * (int)Main.player[item.owner].GetModPlayer(mod).alchemistDamage) + 50; - } + int GetDamage() + { + return (10 * (int)Main.player[item.owner].GetModPlayer(mod).alchemistDamage) + 50; + } - void Shoot(int Target, int Damage) - { - if (Main.player[item.owner].statLife < 50) - { - ShootCount = 7; - } - if (Main.player[item.owner].statLife < 100) - { - ShootCount = 6; - } - if (Main.player[item.owner].statLife < 200) - { - ShootCount = 5; - } - if (Main.player[item.owner].statLife < 300) - { - ShootCount = 4; - } + void Shoot(int Target, int Damage) + { + if (Main.player[item.owner].statLife < 50) + { + ShootCount = 7; + } + if (Main.player[item.owner].statLife < 100) + { + ShootCount = 6; + } + if (Main.player[item.owner].statLife < 200) + { + ShootCount = 5; + } + if (Main.player[item.owner].statLife < 300) + { + ShootCount = 4; + } - Vector2 velocity = Helper.VelocityToPoint(Main.player[item.owner].Center, Main.npc[Target].Center, ShootSpeed); - for (int l = 0; l < ShootCount; l++) - { - velocity.X = velocity.X + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - velocity.Y = velocity.Y + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - int i = Projectile.NewProjectile(Main.player[item.owner].Center.X, Main.player[item.owner].Center.Y, velocity.X, velocity.Y, mod.ProjectileType("WallOfShadowsFlask_Proj"), Damage, ShootKN, item.owner); - } - } - } + Vector2 velocity = Helper.VelocityToPoint(Main.player[item.owner].Center, Main.npc[Target].Center, ShootSpeed); + for (int l = 0; l < ShootCount; l++) + { + velocity.X = velocity.X + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.Y = velocity.Y + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + int i = Projectile.NewProjectile(Main.player[item.owner].Center.X, Main.player[item.owner].Center.Y, velocity.X, velocity.Y, mod.ProjectileType("WallOfShadowsFlask_Proj"), Damage, ShootKN, item.owner); + } + } + } } diff --git a/Items/WallofShadowBag.cs b/Items/WallofShadowBag.cs index 1fc7310d..e7c8998d 100644 --- a/Items/WallofShadowBag.cs +++ b/Items/WallofShadowBag.cs @@ -4,58 +4,60 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class WallofShadowBag : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { - - item.maxStack = 999; - item.consumable = true; - item.width = 24; - item.height = 24; - - item.rare = 9; - item.expert = true; - bossBagNPC = mod.NPCType("WallOfShadow"); - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Treasure Bag"); - Tooltip.SetDefault("Right click to open"); - } - - - public override bool CanRightClick() - { - return true; - } - - public override void OpenBossBag(Player player) - { - switch (Main.rand.Next(4)) - { - case 0: - player.QuickSpawnItem(mod.ItemType("HeavyBeamCannon")); - break; - case 1: - player.QuickSpawnItem(mod.ItemType("Bolter")); - break; - case 2: - player.QuickSpawnItem(mod.ItemType("StrikerBlade")); - break; - } - - if(Main.rand.Next(7) == 0) - { - player.QuickSpawnItem(mod.ItemType("WallofShadowMask")); - } - - player.TryGettingDevArmor(); - player.QuickSpawnItem(mod.ItemType("WallOfShadowsFlask")); - player.QuickSpawnItem(mod.ItemType("DarknessCloth"), Main.rand.Next(8,15)); - player.QuickSpawnItem(499, Main.rand.Next(5,15)); - } - -}} + public class WallofShadowBag : ModItem + { + public override void SetDefaults() + { + + item.maxStack = 999; + item.consumable = true; + item.width = 24; + item.height = 24; + + item.rare = 9; + item.expert = true; + bossBagNPC = mod.NPCType("WallOfShadow"); + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Treasure Bag"); + Tooltip.SetDefault("Right click to open"); + } + + + public override bool CanRightClick() + { + return true; + } + + public override void OpenBossBag(Player player) + { + switch (Main.rand.Next(4)) + { + case 0: + player.QuickSpawnItem(mod.ItemType("HeavyBeamCannon")); + break; + case 1: + player.QuickSpawnItem(mod.ItemType("Bolter")); + break; + case 2: + player.QuickSpawnItem(mod.ItemType("StrikerBlade")); + break; + } + + if (Main.rand.Next(7) == 0) + { + player.QuickSpawnItem(mod.ItemType("WallofShadowMask")); + } + + player.TryGettingDevArmor(); + player.QuickSpawnItem(mod.ItemType("WallOfShadowsFlask")); + player.QuickSpawnItem(mod.ItemType("DarknessCloth"), Main.rand.Next(8, 15)); + player.QuickSpawnItem(499, Main.rand.Next(5, 15)); + } + + } +} diff --git a/Items/WallofShadowMask.cs b/Items/WallofShadowMask.cs index 347fa094..2be415aa 100644 --- a/Items/WallofShadowMask.cs +++ b/Items/WallofShadowMask.cs @@ -4,25 +4,28 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class WallofShadowMask : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class WallofShadowMask : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 20; - item.height = 24; - item.rare = 1; - item.vanity = true; - } + item.width = 20; + item.height = 24; + item.rare = 1; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Wall of Shadows Mask"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Wall of Shadows Mask"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/WallofShadowTrophy.cs b/Items/WallofShadowTrophy.cs index dacb7910..7f1c3bf0 100644 --- a/Items/WallofShadowTrophy.cs +++ b/Items/WallofShadowTrophy.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class WallofShadowTrophy : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class WallofShadowTrophy : ModItem + { + public override void SetDefaults() + { - item.width = 32; - item.height = 32; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 50000; - item.createTile = mod.TileType("WallofShadowTrophy"); - item.placeStyle = 0; - } + item.width = 32; + item.height = 32; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 50000; + item.createTile = mod.TileType("WallofShadowTrophy"); + item.placeStyle = 0; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Wall of Shadows Trophy"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Wall of Shadows Trophy"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/WarpPad.cs b/Items/WarpPad.cs index dfb68b77..d3316f0f 100644 --- a/Items/WarpPad.cs +++ b/Items/WarpPad.cs @@ -7,51 +7,51 @@ namespace Tremor.Items { - public class WarpPad : ModItem - { - - public override void SetDefaults() - { - - item.UseSound = SoundID.Item6; - item.useStyle = 4; - item.useAnimation = 30; - item.useTime = 30; - item.width = 32; - item.height = 32; - - item.value = 60000; - item.rare = 8; - item.mana = 10; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Warp Pad"); - Tooltip.SetDefault("Teleports you to your last death point upon use"); - } - - - public override bool UseItem(Player player) - { - if (player.lastDeathPostion != player.position && player.showLastDeath) - { - player.Teleport(player.lastDeathPostion, 1, 0); - //NetMessage.SendData(65, -1, -1, "", 0, player.whoAmI, player.lastDeathPostion.X, player.lastDeathPostion.Y, 1, 0, 0); - player.showLastDeath = false; - return true; - } - else - return false; - } - - public override bool CanUseItem(Player player) - { - if (!player.showLastDeath) - { - return false; - } - return true; - } - } + public class WarpPad : ModItem + { + + public override void SetDefaults() + { + + item.UseSound = SoundID.Item6; + item.useStyle = 4; + item.useAnimation = 30; + item.useTime = 30; + item.width = 32; + item.height = 32; + + item.value = 60000; + item.rare = 8; + item.mana = 10; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Warp Pad"); + Tooltip.SetDefault("Teleports you to your last death point upon use"); + } + + + public override bool UseItem(Player player) + { + if (player.lastDeathPostion != player.position && player.showLastDeath) + { + player.Teleport(player.lastDeathPostion, 1, 0); + //NetMessage.SendData(65, -1, -1, "", 0, player.whoAmI, player.lastDeathPostion.X, player.lastDeathPostion.Y, 1, 0, 0); + player.showLastDeath = false; + return true; + } + else + return false; + } + + public override bool CanUseItem(Player player) + { + if (!player.showLastDeath) + { + return false; + } + return true; + } + } } diff --git a/Items/WarriorChainmail.cs b/Items/WarriorChainmail.cs index d37fde04..d7259d2a 100644 --- a/Items/WarriorChainmail.cs +++ b/Items/WarriorChainmail.cs @@ -5,25 +5,27 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class WarriorChainmail : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Body)] + public class WarriorChainmail : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 18; - item.value = 1000; - item.rare = 2; - item.vanity = true; - } + item.width = 26; + item.height = 18; + item.value = 1000; + item.rare = 2; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Warrior Chainmail"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Warrior Chainmail"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/WarriorFocus.cs b/Items/WarriorFocus.cs index d95ad2dd..38116283 100644 --- a/Items/WarriorFocus.cs +++ b/Items/WarriorFocus.cs @@ -6,44 +6,46 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class WarriorFocus : ModItem +namespace Tremor.Items { + public class WarriorFocus : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 22; + item.width = 22; + item.height = 22; - item.accessory = true; -item.defense = 3; - item.rare = 2; - item.value = 50000; - } + item.accessory = true; + item.defense = 3; + item.rare = 2; + item.value = 50000; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Warrior Focus"); - Tooltip.SetDefault("6% increased melee damage\nIncreases melee critical strike chance by 11"); - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 4)); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Warrior Focus"); + Tooltip.SetDefault("6% increased melee damage\nIncreases melee critical strike chance by 11"); + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 4)); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { + public override void UpdateAccessory(Player player, bool hideVisual) + { player.meleeDamage += 0.06f; - player.meleeCrit += 11; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "WarriorSpark"); - recipe.AddIngredient(null, "AirFragment", 1); - recipe.AddIngredient(ItemID.Ruby, 16); - recipe.SetResult(this); - recipe.AddTile(null, "AltarofEnchantmentsTile"); - recipe.AddRecipe(); - } -}} + player.meleeCrit += 11; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "WarriorSpark"); + recipe.AddIngredient(null, "AirFragment", 1); + recipe.AddIngredient(ItemID.Ruby, 16); + recipe.SetResult(this); + recipe.AddTile(null, "AltarofEnchantmentsTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/WarriorGreaves.cs b/Items/WarriorGreaves.cs index 51a4c3ea..20ea59d0 100644 --- a/Items/WarriorGreaves.cs +++ b/Items/WarriorGreaves.cs @@ -5,25 +5,28 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class WarriorGreaves : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Legs)] + public class WarriorGreaves : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 18; - item.value = 1000; - item.rare = 2; - item.vanity = true; - } + item.width = 22; + item.height = 18; + item.value = 1000; + item.rare = 2; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Warrior Greaves"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Warrior Greaves"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/WarriorHelmet.cs b/Items/WarriorHelmet.cs index 3d2d63f9..a1fb1378 100644 --- a/Items/WarriorHelmet.cs +++ b/Items/WarriorHelmet.cs @@ -5,25 +5,28 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class WarriorHelmet : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Head)] + public class WarriorHelmet : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 26; - item.height = 22; - item.value = 1000; - item.rare = 2; - item.vanity = true; - } + item.width = 26; + item.height = 22; + item.value = 1000; + item.rare = 2; + item.vanity = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Warrior Helmet"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Warrior Helmet"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/WarriorSoul.cs b/Items/WarriorSoul.cs index 2debc563..ad417753 100644 --- a/Items/WarriorSoul.cs +++ b/Items/WarriorSoul.cs @@ -6,45 +6,47 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class WarriorSoul : ModItem +namespace Tremor.Items { + public class WarriorSoul : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 22; + item.width = 22; + item.height = 22; - item.accessory = true; -item.defense = 4; - item.rare = 3; - item.value = 100000; - } + item.accessory = true; + item.defense = 4; + item.rare = 3; + item.value = 100000; + } - public override void SetStaticDefaults() - { - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 6)); - DisplayName.SetDefault("Warrior Soul"); - Tooltip.SetDefault("10% increased melee damage\nIncreases melee critical strike chance by 15"); - } + public override void SetStaticDefaults() + { + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 6)); + DisplayName.SetDefault("Warrior Soul"); + Tooltip.SetDefault("10% increased melee damage\nIncreases melee critical strike chance by 15"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { + public override void UpdateAccessory(Player player, bool hideVisual) + { player.meleeDamage += 0.1f; - player.meleeCrit += 15; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "WarriorFocus"); - recipe.AddIngredient(null, "Opal", 3); - recipe.AddIngredient(ItemID.WarriorEmblem, 1); - recipe.SetResult(this); - recipe.AddTile(null, "AltarofEnchantmentsTile"); - recipe.AddRecipe(); - } -}} + player.meleeCrit += 15; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "WarriorFocus"); + recipe.AddIngredient(null, "Opal", 3); + recipe.AddIngredient(ItemID.WarriorEmblem, 1); + recipe.SetResult(this); + recipe.AddTile(null, "AltarofEnchantmentsTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/WarriorSpark.cs b/Items/WarriorSpark.cs index f7c692b6..c0e36e01 100644 --- a/Items/WarriorSpark.cs +++ b/Items/WarriorSpark.cs @@ -6,41 +6,43 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class WarriorSpark : ModItem +namespace Tremor.Items { + public class WarriorSpark : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 22; + item.width = 22; + item.height = 22; - item.accessory = true; -item.defense = 2; - item.rare = 1; - item.value = 20000; - } + item.accessory = true; + item.defense = 2; + item.rare = 1; + item.value = 20000; + } - public override void SetStaticDefaults() - { - Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 4)); - DisplayName.SetDefault("Warrior Spark"); - Tooltip.SetDefault("3% increased melee damage\nIncreases melee critical strike chance by 8"); - } + public override void SetStaticDefaults() + { + Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(6, 4)); + DisplayName.SetDefault("Warrior Spark"); + Tooltip.SetDefault("3% increased melee damage\nIncreases melee critical strike chance by 8"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { + public override void UpdateAccessory(Player player, bool hideVisual) + { player.meleeDamage += 0.03f; - player.meleeCrit += 8; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "AdventurerSpark"); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + player.meleeCrit += 8; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "AdventurerSpark"); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/WartimeRocketLauncher.cs b/Items/WartimeRocketLauncher.cs index 4d0a90cc..41c2eb53 100644 --- a/Items/WartimeRocketLauncher.cs +++ b/Items/WartimeRocketLauncher.cs @@ -5,38 +5,40 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class WartimeRocketLauncher : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class WartimeRocketLauncher : ModItem + { + public override void SetDefaults() + { - item.damage = 220; - item.ranged = true; - item.width = 58; - item.height = 34; - item.useTime = 25; - item.useAnimation = 25; - item.shoot = 134; - item.shootSpeed = 10f; - item.useAmmo = AmmoID.Rocket; - item.useStyle = 5; - item.knockBack = 4; - item.value = 750000; - item.rare = 11; - item.UseSound = SoundID.Item11; - item.autoReuse = true; - } + item.damage = 220; + item.ranged = true; + item.width = 58; + item.height = 34; + item.useTime = 25; + item.useAnimation = 25; + item.shoot = 134; + item.shootSpeed = 10f; + item.useAmmo = AmmoID.Rocket; + item.useStyle = 5; + item.knockBack = 4; + item.value = 750000; + item.rare = 11; + item.UseSound = SoundID.Item11; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Wartime Rocket Launcher"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Wartime Rocket Launcher"); + Tooltip.SetDefault(""); + } - public override Vector2? HoldoutOffset() - { - return new Vector2(-14, -2); - } -}} + public override Vector2? HoldoutOffset() + { + return new Vector2(-14, -2); + } + } +} diff --git a/Items/WaterDeadShot.cs b/Items/WaterDeadShot.cs index 1e21f72c..a2a3845a 100644 --- a/Items/WaterDeadShot.cs +++ b/Items/WaterDeadShot.cs @@ -5,36 +5,37 @@ using Terraria.ModLoader; using Microsoft.Xna.Framework; -namespace Tremor.Items { -public class WaterDeadShot : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class WaterDeadShot : ModItem + { + public override void SetDefaults() + { - item.damage = 14; - item.width = 18; - item.height = 48; - item.useTime = 30; - item.ranged = true; - item.shoot = 27; + item.damage = 14; + item.width = 18; + item.height = 48; + item.useTime = 30; + item.ranged = true; + item.shoot = 27; - item.shootSpeed = 23f; - item.useAnimation = 30; - item.useStyle = 5; - item.knockBack = 5; - item.value = 250; - item.useAmmo = AmmoID.Arrow; - item.rare = 2; - item.UseSound = SoundID.Item5; - item.autoReuse = true; - } + item.shootSpeed = 23f; + item.useAnimation = 30; + item.useStyle = 5; + item.knockBack = 5; + item.value = 250; + item.useAmmo = AmmoID.Arrow; + item.rare = 2; + item.UseSound = SoundID.Item5; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Water Dead Shot"); - Tooltip.SetDefault("Shoots water streams\nUses arrows as ammo"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Water Dead Shot"); + Tooltip.SetDefault("Shoots water streams\nUses arrows as ammo"); + } public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) @@ -43,22 +44,23 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX return base.Shoot(player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "SeaFragment", 8); - recipe.AddIngredient(ItemID.Sapphire, 10); - recipe.AddIngredient(ItemID.GoldBar, 6); - recipe.AddTile(16); - recipe.SetResult(this); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "SeaFragment", 8); + recipe.AddIngredient(ItemID.Sapphire, 10); + recipe.AddIngredient(ItemID.GoldBar, 6); + recipe.AddTile(16); + recipe.SetResult(this); + recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "SeaFragment", 8); - recipe.AddIngredient(ItemID.Sapphire, 10); - recipe.AddIngredient(ItemID.PlatinumBar, 6); - recipe.AddTile(16); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "SeaFragment", 8); + recipe.AddIngredient(ItemID.Sapphire, 10); + recipe.AddIngredient(ItemID.PlatinumBar, 6); + recipe.AddTile(16); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/WaterSpear.cs b/Items/WaterSpear.cs index e5e770ae..f8b08769 100644 --- a/Items/WaterSpear.cs +++ b/Items/WaterSpear.cs @@ -5,44 +5,46 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class WaterSpear : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class WaterSpear : ModItem + { + public override void SetDefaults() + { - item.damage = 34; - item.magic = true; - item.width = 28; - item.height = 30; - item.useTime = 14; - item.useAnimation = 14; - item.shoot = 27; - item.shootSpeed = 26f; - item.mana = 6; - item.useStyle = 5; - item.knockBack = 3; - item.value = 99999; - item.rare = 5; - item.UseSound = SoundID.Item21; - item.autoReuse = true; - } + item.damage = 34; + item.magic = true; + item.width = 28; + item.height = 30; + item.useTime = 14; + item.useAnimation = 14; + item.shoot = 27; + item.shootSpeed = 26f; + item.mana = 6; + item.useStyle = 5; + item.knockBack = 3; + item.value = 99999; + item.rare = 5; + item.UseSound = SoundID.Item21; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Water Spear"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Water Spear"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.WaterBolt, 1); - recipe.AddIngredient(ItemID.SpellTome, 1); - recipe.AddIngredient(ItemID.SoulofLight, 15); - recipe.SetResult(this); - recipe.AddTile(101); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.WaterBolt, 1); + recipe.AddIngredient(ItemID.SpellTome, 1); + recipe.AddIngredient(ItemID.SoulofLight, 15); + recipe.SetResult(this); + recipe.AddTile(101); + recipe.AddRecipe(); + } + } +} diff --git a/Items/WaterStorm.cs b/Items/WaterStorm.cs index 422a4dcd..989ad847 100644 --- a/Items/WaterStorm.cs +++ b/Items/WaterStorm.cs @@ -4,33 +4,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class WaterStorm : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class WaterStorm : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 44; + item.width = 22; + item.height = 44; - item.value = 15000; - item.rare = 3; - item.defense = 3; - item.accessory = true; - } + item.value = 15000; + item.rare = 3; + item.defense = 3; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Water Storm"); - Tooltip.SetDefault("Increases magic critical strike chance by 10%\nIncreases maximum mana by 40"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Water Storm"); + Tooltip.SetDefault("Increases magic critical strike chance by 10%\nIncreases maximum mana by 40"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.statManaMax2 += 40; - player.magicCrit += 10; - } + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.statManaMax2 += 40; + player.magicCrit += 10; + } -}} + } +} diff --git a/Items/WhaleFlippers.cs b/Items/WhaleFlippers.cs index 6c8bf2d3..b47faded 100644 --- a/Items/WhaleFlippers.cs +++ b/Items/WhaleFlippers.cs @@ -5,49 +5,51 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Wings)] -public class WhaleFlippers : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Wings)] + public class WhaleFlippers : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 22; - item.height = 20; + item.width = 22; + item.height = 20; - item.value = 80000; - item.rare = 8; - item.accessory = true; - } + item.value = 80000; + item.rare = 8; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Whale Flippers"); - Tooltip.SetDefault("Allows flight and slow fall"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Whale Flippers"); + Tooltip.SetDefault("Allows flight and slow fall"); + } - //these wings use the same values as the solar wings + //these wings use the same values as the solar wings - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.wingTimeMax = 183; - } + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.wingTimeMax = 183; + } public override void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend) - { - ascentWhenFalling = 0.85f; - ascentWhenRising = 0.15f; - maxCanAscendMultiplier = 1f; - maxAscentMultiplier = 3f; - constantAscend = 0.135f; - } - - public override void HorizontalWingSpeeds(Player player, ref float speed, ref float acceleration) - { - speed = 9f; - acceleration *= 2.5f; - } -}} + { + ascentWhenFalling = 0.85f; + ascentWhenRising = 0.15f; + maxCanAscendMultiplier = 1f; + maxAscentMultiplier = 3f; + constantAscend = 0.135f; + } + + public override void HorizontalWingSpeeds(Player player, ref float speed, ref float acceleration) + { + speed = 9f; + acceleration *= 2.5f; + } + } +} diff --git a/Items/WhiteCrossguardPhasesaber.cs b/Items/WhiteCrossguardPhasesaber.cs index 975fdb57..3f97813c 100644 --- a/Items/WhiteCrossguardPhasesaber.cs +++ b/Items/WhiteCrossguardPhasesaber.cs @@ -5,48 +5,50 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class WhiteCrossguardPhasesaber : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class WhiteCrossguardPhasesaber : ModItem + { + public override void SetDefaults() + { - item.damage = 71; - item.melee = true; - item.width = 46; - item.height = 48; - item.useTime = 25; - item.useAnimation = 25; - item.useStyle = 1; - item.knockBack = 3; - item.value = 54000; - item.rare = 5; - item.UseSound = SoundID.Item15; - item.autoReuse = true; - item.useTurn = true; - } + item.damage = 71; + item.melee = true; + item.width = 46; + item.height = 48; + item.useTime = 25; + item.useAnimation = 25; + item.useStyle = 1; + item.knockBack = 3; + item.value = 54000; + item.rare = 5; + item.UseSound = SoundID.Item15; + item.autoReuse = true; + item.useTurn = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("White Crossguard Phasesaber"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("White Crossguard Phasesaber"); + Tooltip.SetDefault(""); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 63); - } + public override void MeleeEffects(Player player, Rectangle hitbox) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 63); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(3768); - recipe.AddIngredient(ItemID.SoulofMight, 8); - recipe.AddIngredient(null, "SoulofMind", 8); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(3768); + recipe.AddIngredient(ItemID.SoulofMight, 8); + recipe.AddIngredient(null, "SoulofMind", 8); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/WhiteGoldBar.cs b/Items/WhiteGoldBar.cs index cf8399d4..cd064d9c 100644 --- a/Items/WhiteGoldBar.cs +++ b/Items/WhiteGoldBar.cs @@ -4,40 +4,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class WhiteGoldBar : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class WhiteGoldBar : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 17500; - item.rare = 11; - item.createTile = mod.TileType("WhiteGoldBarTile"); - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 17500; + item.rare = 11; + item.createTile = mod.TileType("WhiteGoldBarTile"); + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("White Gold Bar"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("White Gold Bar"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "Catalyst", 1); - recipe.AddIngredient(ItemID.PlatinumOre, 3); - recipe.AddIngredient(ItemID.GoldOre, 3); - recipe.SetResult(this, 2); - recipe.AddTile(null, "DivineForgeTile"); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "Catalyst", 1); + recipe.AddIngredient(ItemID.PlatinumOre, 3); + recipe.AddIngredient(ItemID.GoldOre, 3); + recipe.SetResult(this, 2); + recipe.AddTile(null, "DivineForgeTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/WhiteGoldBreastplate.cs b/Items/WhiteGoldBreastplate.cs index b8f87895..cde223d1 100644 --- a/Items/WhiteGoldBreastplate.cs +++ b/Items/WhiteGoldBreastplate.cs @@ -5,42 +5,44 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class WhiteGoldBreastplate : ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 38; - item.height = 22; - - item.value = 10000; - item.rare = 11; - item.defense = 35; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("White Gold Breastplate"); - Tooltip.SetDefault("Increases melee and ranged critical strike chances by 25%"); - } - - - public override void UpdateEquip(Player player) - { - player.rangedCrit += 25; - player.meleeCrit += 25; - } - - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "WhiteGoldBar", 18); - recipe.SetResult(this); - recipe.AddTile(null, "DivineForgeTile"); - recipe.AddRecipe(); - } -}} + [AutoloadEquip(EquipType.Body)] + public class WhiteGoldBreastplate : ModItem + { + + public override void SetDefaults() + { + + item.width = 38; + item.height = 22; + + item.value = 10000; + item.rare = 11; + item.defense = 35; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("White Gold Breastplate"); + Tooltip.SetDefault("Increases melee and ranged critical strike chances by 25%"); + } + + + public override void UpdateEquip(Player player) + { + player.rangedCrit += 25; + player.meleeCrit += 25; + } + + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "WhiteGoldBar", 18); + recipe.SetResult(this); + recipe.AddTile(null, "DivineForgeTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/WhiteGoldGreaves.cs b/Items/WhiteGoldGreaves.cs index 8924ec14..9321c5f3 100644 --- a/Items/WhiteGoldGreaves.cs +++ b/Items/WhiteGoldGreaves.cs @@ -5,41 +5,44 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class WhiteGoldGreaves : ModItem +namespace Tremor.Items { + [AutoloadEquip(EquipType.Legs)] + public class WhiteGoldGreaves : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 38; - item.height = 22; + item.width = 38; + item.height = 22; - item.value = 10000; - item.rare = 11; - item.defense = 32; - } + item.value = 10000; + item.rare = 11; + item.defense = 32; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("White Gold Greaves"); - Tooltip.SetDefault("50% increased movement speed"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("White Gold Greaves"); + Tooltip.SetDefault("50% increased movement speed"); + } - public override void UpdateEquip(Player player) - { + public override void UpdateEquip(Player player) + { player.moveSpeed += 0.5f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "WhiteGoldBar", 15); - recipe.SetResult(this); - recipe.AddTile(null, "DivineForgeTile"); - recipe.AddRecipe(); - } - -}} + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "WhiteGoldBar", 15); + recipe.SetResult(this); + recipe.AddTile(null, "DivineForgeTile"); + recipe.AddRecipe(); + } + + } +} diff --git a/Items/WhiteGoldHelmet.cs b/Items/WhiteGoldHelmet.cs index c6eb156b..14190146 100644 --- a/Items/WhiteGoldHelmet.cs +++ b/Items/WhiteGoldHelmet.cs @@ -6,100 +6,103 @@ using Terraria.ModLoader; using Microsoft.Xna.Framework; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class WhiteGoldHelmet : ModItem +namespace Tremor.Items { - const int ShootType = ProjectileID.HeatRay; // ��� �������� - const float ShootRange = 600.0f; // ��������� �������� - const float ShootKN = 1.0f; // ������������ - const int ShootRate = 120; // ������� �������� (60 - 1 �������) - const int ShootCount = 2; // ������� �� ������� - const float ShootSpeed = 20f; // �������� �������� (��� ������ - ���������) - const int spread = 45; // ������� - const float spreadMult = 0.045f; // ����������� �������� - - int TimeToShoot = ShootRate; - - - - public override void SetDefaults() - { - - item.width = 38; - item.height = 22; - - - item.value = 10000; - item.rare = 11; - item.defense = 30; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("White Gold Helmet"); - Tooltip.SetDefault("Increases ranged damage by 20%\nIncreases melee damage by 20%"); - } - - - public override void UpdateEquip(Player player) - { - player.rangedDamage += 0.2f; - player.meleeDamage += 0.2f; - } - - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("WhiteGoldBreastplate") && legs.type == mod.ItemType("WhiteGoldGreaves"); - } - - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Shoots dangerous gold daggers"; - - if (--TimeToShoot <= 0) - { - TimeToShoot = ShootRate; - int Target = GetTarget(); - if (Target != -1) Shoot(Target, GetDamage()); - } - } - -int GetTarget() - { - int Target = -1; - for(int k = 0; k < Main.npc.Length; k++) - { - if (Main.npc[k].active && Main.npc[k].lifeMax > 5 && !Main.npc[k].dontTakeDamage && !Main.npc[k].friendly && Main.npc[k].Distance(Main.player[item.owner].Center) <= ShootRange && Collision.CanHitLine(Main.player[item.owner].Center, 4, 4, Main.npc[k].Center, 4, 4)) - { - Target = k; - break; - } - } - return Target; - } - - int GetDamage() - { - return (10 * ((int)Main.player[item.owner].magicDamage + (int)Main.player[item.owner].meleeDamage + (int)Main.player[item.owner].minionDamage + (int)Main.player[item.owner].rangedDamage + (int)Main.player[item.owner].thrownDamage)) + 15; - } - - void Shoot(int Target, int Damage) - { - Vector2 velocity = Helper.VelocityToPoint(Main.player[item.owner].Center, Main.npc[Target].Center, ShootSpeed); - for (int l = 0; l < ShootCount; l++) - { - velocity.X = velocity.X + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - velocity.Y = velocity.Y + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - int i = Projectile.NewProjectile(Main.player[item.owner].Center.X, Main.player[item.owner].Center.Y, velocity.X, velocity.Y, mod.ProjectileType("WhiteGoldKnife"), 100, ShootKN, item.owner); - } - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "WhiteGoldBar", 12); - recipe.SetResult(this); - recipe.AddTile(null, "DivineForgeTile"); - recipe.AddRecipe(); - } -}} + [AutoloadEquip(EquipType.Head)] + public class WhiteGoldHelmet : ModItem + { + const int ShootType = ProjectileID.HeatRay; // ��� �������� + const float ShootRange = 600.0f; // ��������� �������� + const float ShootKN = 1.0f; // ������������ + const int ShootRate = 120; // ������� �������� (60 - 1 �������) + const int ShootCount = 2; // ������� �� ������� + const float ShootSpeed = 20f; // �������� �������� (��� ������ - ���������) + const int spread = 45; // ������� + const float spreadMult = 0.045f; // ����������� �������� + + int TimeToShoot = ShootRate; + + + + public override void SetDefaults() + { + + item.width = 38; + item.height = 22; + + + item.value = 10000; + item.rare = 11; + item.defense = 30; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("White Gold Helmet"); + Tooltip.SetDefault("Increases ranged damage by 20%\nIncreases melee damage by 20%"); + } + + + public override void UpdateEquip(Player player) + { + player.rangedDamage += 0.2f; + player.meleeDamage += 0.2f; + } + + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("WhiteGoldBreastplate") && legs.type == mod.ItemType("WhiteGoldGreaves"); + } + + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Shoots dangerous gold daggers"; + + if (--TimeToShoot <= 0) + { + TimeToShoot = ShootRate; + int Target = GetTarget(); + if (Target != -1) Shoot(Target, GetDamage()); + } + } + + int GetTarget() + { + int Target = -1; + for (int k = 0; k < Main.npc.Length; k++) + { + if (Main.npc[k].active && Main.npc[k].lifeMax > 5 && !Main.npc[k].dontTakeDamage && !Main.npc[k].friendly && Main.npc[k].Distance(Main.player[item.owner].Center) <= ShootRange && Collision.CanHitLine(Main.player[item.owner].Center, 4, 4, Main.npc[k].Center, 4, 4)) + { + Target = k; + break; + } + } + return Target; + } + + int GetDamage() + { + return (10 * ((int)Main.player[item.owner].magicDamage + (int)Main.player[item.owner].meleeDamage + (int)Main.player[item.owner].minionDamage + (int)Main.player[item.owner].rangedDamage + (int)Main.player[item.owner].thrownDamage)) + 15; + } + + void Shoot(int Target, int Damage) + { + Vector2 velocity = Helper.VelocityToPoint(Main.player[item.owner].Center, Main.npc[Target].Center, ShootSpeed); + for (int l = 0; l < ShootCount; l++) + { + velocity.X = velocity.X + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.Y = velocity.Y + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + int i = Projectile.NewProjectile(Main.player[item.owner].Center.X, Main.player[item.owner].Center.Y, velocity.X, velocity.Y, mod.ProjectileType("WhiteGoldKnife"), 100, ShootKN, item.owner); + } + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "WhiteGoldBar", 12); + recipe.SetResult(this); + recipe.AddTile(null, "DivineForgeTile"); + recipe.AddRecipe(); + } + } +} diff --git a/Items/WhiteMasterChestplate.cs b/Items/WhiteMasterChestplate.cs index 8be7a49d..5742fb09 100644 --- a/Items/WhiteMasterChestplate.cs +++ b/Items/WhiteMasterChestplate.cs @@ -6,61 +6,61 @@ namespace Tremor.Items { - [AutoloadEquip(EquipType.Body)] - public class WhiteMasterChestplate : ModItem - { - public override void SetDefaults() - { - item.width = 34; - item.height = 20; - item.value = 50000; - item.rare = 11; - item.defense = 33; - } + [AutoloadEquip(EquipType.Body)] + public class WhiteMasterChestplate : ModItem + { + public override void SetDefaults() + { + item.width = 34; + item.height = 20; + item.value = 50000; + item.rare = 11; + item.defense = 33; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("White Master Chestplate"); - Tooltip.SetDefault("Massively increases alchemic damage as health lowers\nIncreases alchemic damage by 30%\nEnemy attacks have 10% chance to do no damage to you\nImmune to cursed inferno, lava, and can move through liquids"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("White Master Chestplate"); + Tooltip.SetDefault("Massively increases alchemic damage as health lowers\nIncreases alchemic damage by 30%\nEnemy attacks have 10% chance to do no damage to you\nImmune to cursed inferno, lava, and can move through liquids"); + } - public override void UpdateEquip(Player player) - { - TremorPlayer modPlayer = player.GetModPlayer(mod); - modPlayer.zellariumBody = true; - player.lavaImmune = true; - player.ignoreWater = true; - player.GetModPlayer(mod).alchemistDamage += 0.3f; - player.buffImmune[BuffID.CursedInferno] = true; - if (player.statLife <= player.statLifeMax2) - { - player.GetModPlayer(mod).alchemistDamage += 0.3f; - } - if (player.statLife <= 400) - { - player.GetModPlayer(mod).alchemistDamage += 0.4f; - } - if (player.statLife <= 300) - { - player.GetModPlayer(mod).alchemistDamage += 0.5f; - } - if (player.statLife <= 200) - { - player.GetModPlayer(mod).alchemistDamage += 0.6f; - } - } + public override void UpdateEquip(Player player) + { + TremorPlayer modPlayer = player.GetModPlayer(mod); + modPlayer.zellariumBody = true; + player.lavaImmune = true; + player.ignoreWater = true; + player.GetModPlayer(mod).alchemistDamage += 0.3f; + player.buffImmune[BuffID.CursedInferno] = true; + if (player.statLife <= player.statLifeMax2) + { + player.GetModPlayer(mod).alchemistDamage += 0.3f; + } + if (player.statLife <= 400) + { + player.GetModPlayer(mod).alchemistDamage += 0.4f; + } + if (player.statLife <= 300) + { + player.GetModPlayer(mod).alchemistDamage += 0.5f; + } + if (player.statLife <= 200) + { + player.GetModPlayer(mod).alchemistDamage += 0.6f; + } + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BrokenHeroArmorplate", 1); - recipe.AddIngredient(null, "NovaBreastplate", 1); - recipe.AddIngredient(null, "Aquamarine", 8); - recipe.AddIngredient(null, "SoulofFight", 14); - recipe.AddIngredient(null, "Phantaplasm", 8); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "BrokenHeroArmorplate", 1); + recipe.AddIngredient(null, "NovaBreastplate", 1); + recipe.AddIngredient(null, "Aquamarine", 8); + recipe.AddIngredient(null, "SoulofFight", 14); + recipe.AddIngredient(null, "Phantaplasm", 8); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } } diff --git a/Items/WhiteMasterGreaves.cs b/Items/WhiteMasterGreaves.cs index e4c95093..cab46813 100644 --- a/Items/WhiteMasterGreaves.cs +++ b/Items/WhiteMasterGreaves.cs @@ -6,65 +6,65 @@ namespace Tremor.Items { - [AutoloadEquip(EquipType.Legs)] - public class WhiteMasterGreaves : ModItem - { - public override void SetDefaults() - { - item.width = 22; - item.height = 18; - item.value = 50000; - item.rare = 11; - item.defense = 24; - } + [AutoloadEquip(EquipType.Legs)] + public class WhiteMasterGreaves : ModItem + { + public override void SetDefaults() + { + item.width = 22; + item.height = 18; + item.value = 50000; + item.rare = 11; + item.defense = 24; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("White Master Greaves"); - Tooltip.SetDefault("Massively increases alchemic critical chance as health lowers\nIncreases alchemic critical chance by 10\nIncreases life regeneration while moving\nIncreases movement speed by 35%"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("White Master Greaves"); + Tooltip.SetDefault("Massively increases alchemic critical chance as health lowers\nIncreases alchemic critical chance by 10\nIncreases life regeneration while moving\nIncreases movement speed by 35%"); + } - public override void UpdateEquip(Player player) - { - player.moveSpeed += 0.35f; - if (player.velocity.X != 0) - { - player.lifeRegen += 6; - } - else if (player.velocity.Y != 0) - { - player.lifeRegen += 6; - } - player.GetModPlayer(mod).alchemistCrit += 10; - if (player.statLife <= player.statLifeMax2) - { - player.GetModPlayer(mod).alchemistCrit += 10; - } - if (player.statLife <= 400) - { - player.GetModPlayer(mod).alchemistCrit += 15; - } - if (player.statLife <= 300) - { - player.GetModPlayer(mod).alchemistCrit += 20; - } - if (player.statLife <= 200) - { - player.GetModPlayer(mod).alchemistCrit += 25; - } - } + public override void UpdateEquip(Player player) + { + player.moveSpeed += 0.35f; + if (player.velocity.X != 0) + { + player.lifeRegen += 6; + } + else if (player.velocity.Y != 0) + { + player.lifeRegen += 6; + } + player.GetModPlayer(mod).alchemistCrit += 10; + if (player.statLife <= player.statLifeMax2) + { + player.GetModPlayer(mod).alchemistCrit += 10; + } + if (player.statLife <= 400) + { + player.GetModPlayer(mod).alchemistCrit += 15; + } + if (player.statLife <= 300) + { + player.GetModPlayer(mod).alchemistCrit += 20; + } + if (player.statLife <= 200) + { + player.GetModPlayer(mod).alchemistCrit += 25; + } + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BrokenHeroArmorplate", 1); - recipe.AddIngredient(null, "NovaLeggings", 1); - recipe.AddIngredient(null, "Aquamarine", 6); - recipe.AddIngredient(null, "SoulofFight", 8); - recipe.AddIngredient(null, "Phantaplasm", 4); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "BrokenHeroArmorplate", 1); + recipe.AddIngredient(null, "NovaLeggings", 1); + recipe.AddIngredient(null, "Aquamarine", 6); + recipe.AddIngredient(null, "SoulofFight", 8); + recipe.AddIngredient(null, "Phantaplasm", 4); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } } diff --git a/Items/WhiteMasterHood.cs b/Items/WhiteMasterHood.cs index 23ce7998..16156017 100644 --- a/Items/WhiteMasterHood.cs +++ b/Items/WhiteMasterHood.cs @@ -8,103 +8,103 @@ namespace Tremor.Items { - [AutoloadEquip(EquipType.Head)] - public class WhiteMasterHood : ModItem - { - const float ShootRange = 600.0f; - const float ShootKN = 1.0f; - const int ShootRate = 120; - const int ShootCount = 3; - const float ShootSpeed = 20f; - const int spread = 45; - const float spreadMult = 0.045f; - int TimeToShoot = ShootRate; + [AutoloadEquip(EquipType.Head)] + public class WhiteMasterHood : ModItem + { + const float ShootRange = 600.0f; + const float ShootKN = 1.0f; + const int ShootRate = 120; + const int ShootCount = 3; + const float ShootSpeed = 20f; + const int spread = 45; + const float spreadMult = 0.045f; + int TimeToShoot = ShootRate; - public override void SetDefaults() - { - item.width = 30; - item.height = 24; - item.value = 50000; - item.rare = 11; - item.defense = 22; - } + public override void SetDefaults() + { + item.width = 30; + item.height = 24; + item.value = 50000; + item.rare = 11; + item.defense = 22; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("White Master Hood"); - Tooltip.SetDefault("Double tap to dash repeatedly"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("White Master Hood"); + Tooltip.SetDefault("Double tap to dash repeatedly"); + } - public override void UpdateEquip(Player player) - { - //player.GetModPlayer(mod).zellariumHead = true; + public override void UpdateEquip(Player player) + { + //player.GetModPlayer(mod).zellariumHead = true; player.dash = 1; - } + } - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Creates alchemical bubbles to attack enemies\nBubbles heal you"; - if (--this.TimeToShoot <= 0) - { - this.TimeToShoot = ShootRate; - int Target = this.GetTarget(); - if (Target != -1) - Shoot(Target, this.GetDamage()); - } - } + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Creates alchemical bubbles to attack enemies\nBubbles heal you"; + if (--this.TimeToShoot <= 0) + { + this.TimeToShoot = ShootRate; + int Target = this.GetTarget(); + if (Target != -1) + Shoot(Target, this.GetDamage()); + } + } - int GetTarget() - { - int Target = -1; - for (int k = 0; k < Main.npc.Length; k++) - { - if (Main.npc[k].active && Main.npc[k].lifeMax > 5 && !Main.npc[k].dontTakeDamage && !Main.npc[k].friendly && Main.npc[k].Distance(Main.player[item.owner].Center) <= ShootRange && Collision.CanHitLine(Main.player[item.owner].Center, 4, 4, Main.npc[k].Center, 4, 4)) - { - Target = k; - break; - } - } - return Target; - } + int GetTarget() + { + int Target = -1; + for (int k = 0; k < Main.npc.Length; k++) + { + if (Main.npc[k].active && Main.npc[k].lifeMax > 5 && !Main.npc[k].dontTakeDamage && !Main.npc[k].friendly && Main.npc[k].Distance(Main.player[item.owner].Center) <= ShootRange && Collision.CanHitLine(Main.player[item.owner].Center, 4, 4, Main.npc[k].Center, 4, 4)) + { + Target = k; + break; + } + } + return Target; + } - int GetDamage() - { - return (10 * ((int)Main.player[item.owner].magicDamage + (int)Main.player[item.owner].meleeDamage + (int)Main.player[item.owner].minionDamage + (int)Main.player[item.owner].rangedDamage + (int)Main.player[item.owner].thrownDamage)) + 15; - } + int GetDamage() + { + return (10 * ((int)Main.player[item.owner].magicDamage + (int)Main.player[item.owner].meleeDamage + (int)Main.player[item.owner].minionDamage + (int)Main.player[item.owner].rangedDamage + (int)Main.player[item.owner].thrownDamage)) + 15; + } - void Shoot(int Target, int Damage) - { - Vector2 velocity = Helper.VelocityToPoint(Main.player[item.owner].Center, Main.npc[Target].Center, ShootSpeed); - for (int l = 0; l < ShootCount; l++) - { - velocity.X = velocity.X + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - velocity.Y = velocity.Y + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - int i = Projectile.NewProjectile(Main.player[item.owner].Center.X, Main.player[item.owner].Center.Y, velocity.X, velocity.Y, mod.ProjectileType("AlchemicBubbleZellarium"), 115, ShootKN, item.owner); - } - } + void Shoot(int Target, int Damage) + { + Vector2 velocity = Helper.VelocityToPoint(Main.player[item.owner].Center, Main.npc[Target].Center, ShootSpeed); + for (int l = 0; l < ShootCount; l++) + { + velocity.X = velocity.X + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.Y = velocity.Y + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + int i = Projectile.NewProjectile(Main.player[item.owner].Center.X, Main.player[item.owner].Center.Y, velocity.X, velocity.Y, mod.ProjectileType("AlchemicBubbleZellarium"), 115, ShootKN, item.owner); + } + } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == mod.ItemType("WhiteMasterChestplate") && legs.type == mod.ItemType("WhiteMasterGreaves"); - } + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("WhiteMasterChestplate") && legs.type == mod.ItemType("WhiteMasterGreaves"); + } - public override void ArmorSetShadows(Player player) - { - player.armorEffectDrawOutlines = true; - player.armorEffectDrawShadowLokis = true; - } + public override void ArmorSetShadows(Player player) + { + player.armorEffectDrawOutlines = true; + player.armorEffectDrawShadowLokis = true; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BrokenHeroArmorplate", 1); - recipe.AddIngredient(null, "NovaHelmet", 1); - recipe.AddIngredient(null, "Aquamarine", 4); - recipe.AddIngredient(null, "SoulofFight", 11); - recipe.AddIngredient(null, "Phantaplasm", 5); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "BrokenHeroArmorplate", 1); + recipe.AddIngredient(null, "NovaHelmet", 1); + recipe.AddIngredient(null, "Aquamarine", 4); + recipe.AddIngredient(null, "SoulofFight", 11); + recipe.AddIngredient(null, "Phantaplasm", 5); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } } \ No newline at end of file diff --git a/Items/WhiteSakura.cs b/Items/WhiteSakura.cs index 7940a7ba..3bf571e6 100644 --- a/Items/WhiteSakura.cs +++ b/Items/WhiteSakura.cs @@ -32,40 +32,40 @@ public override void SetDefaults() item.buffTime = 3600; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("White Sakura"); - Tooltip.SetDefault("Summons a white wind to fight for you."); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("White Sakura"); + Tooltip.SetDefault("Summons a white wind to fight for you."); + } public override bool AltFunctionUse(Player player) { return true; } - + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { return player.altFunctionUse != 2; } - + public override bool UseItem(Player player) { - if(player.altFunctionUse == 2) + if (player.altFunctionUse == 2) { player.MinionNPCTargetAim(); } return base.UseItem(player); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "BlueSakura", 1); - recipe.AddIngredient(null, "WhiteGoldBar", 15); - recipe.SetResult(this); - recipe.AddTile(null, "DivineForgeTile"); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "BlueSakura", 1); + recipe.AddIngredient(null, "WhiteGoldBar", 15); + recipe.SetResult(this); + recipe.AddTile(null, "DivineForgeTile"); + recipe.AddRecipe(); + } } } diff --git a/Items/WhiteTurban.cs b/Items/WhiteTurban.cs index 595f636a..75294578 100644 --- a/Items/WhiteTurban.cs +++ b/Items/WhiteTurban.cs @@ -7,7 +7,7 @@ namespace Tremor.Items { -[AutoloadEquip(EquipType.Head)] + [AutoloadEquip(EquipType.Head)] public class WhiteTurban : ModItem { @@ -22,11 +22,11 @@ public override void SetDefaults() item.vanity = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("White Turban"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("White Turban"); + Tooltip.SetDefault(""); + } } } diff --git a/Items/WolfClaws.cs b/Items/WolfClaws.cs index 60f12d33..6ceccb4b 100644 --- a/Items/WolfClaws.cs +++ b/Items/WolfClaws.cs @@ -3,39 +3,41 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { -public class WolfClaws : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class WolfClaws : ModItem + { + public override void SetDefaults() + { - item.damage = 9; - item.melee = true; - item.width = 28; - item.height = 30; - item.useTime = 10; - item.useAnimation = 10; - item.useStyle = 1; - item.knockBack = 6; - item.value = 660; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 9; + item.melee = true; + item.width = 28; + item.height = 30; + item.useTime = 10; + item.useAnimation = 10; + item.useStyle = 1; + item.knockBack = 6; + item.value = 660; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Wolf Claws"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Wolf Claws"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "WolfPelt", 13); - recipe.AddIngredient(null, "AlphaClaw", 3); - recipe.SetResult(this); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "WolfPelt", 13); + recipe.AddIngredient(null, "AlphaClaw", 3); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/WolfHood.cs b/Items/WolfHood.cs index de8af922..917f9944 100644 --- a/Items/WolfHood.cs +++ b/Items/WolfHood.cs @@ -5,52 +5,55 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Head)] -public class WolfHood : ModItem +namespace Tremor.Items { - - - public override void SetDefaults() - { - - item.width = 28; - item.height = 22; - item.rare = 1; - - item.value = 100; - item.defense = 2; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Wolf Hood"); - Tooltip.SetDefault("6% increased minion damage"); - } - - - public override void UpdateEquip(Player player) - { - player.minionDamage += 0.06f; - } - - public override bool IsArmorSet(Item head, Item body, Item legs) - { -return body.type == mod.ItemType("WolfJerkin") && legs.type == mod.ItemType("WolfLeggings"); - } - - public override void UpdateArmorSet(Player player) - { - player.setBonus = "Increases your max number of minions"; - player.maxMinions += 1; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "WolfPelt", 8); - recipe.AddIngredient(null, "AlphaClaw", 1); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } -}} + [AutoloadEquip(EquipType.Head)] + public class WolfHood : ModItem + { + + + public override void SetDefaults() + { + + item.width = 28; + item.height = 22; + item.rare = 1; + + item.value = 100; + item.defense = 2; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Wolf Hood"); + Tooltip.SetDefault("6% increased minion damage"); + } + + + public override void UpdateEquip(Player player) + { + player.minionDamage += 0.06f; + } + + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == mod.ItemType("WolfJerkin") && legs.type == mod.ItemType("WolfLeggings"); + } + + public override void UpdateArmorSet(Player player) + { + player.setBonus = "Increases your max number of minions"; + player.maxMinions += 1; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "WolfPelt", 8); + recipe.AddIngredient(null, "AlphaClaw", 1); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } + } +} diff --git a/Items/WolfJerkin.cs b/Items/WolfJerkin.cs index bf0e7c08..482a6225 100644 --- a/Items/WolfJerkin.cs +++ b/Items/WolfJerkin.cs @@ -5,43 +5,45 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Body)] -public class WolfJerkin : ModItem +namespace Tremor.Items { - - public override void SetDefaults() - { - - item.width = 22; - item.height = 26; - item.rare = 1; - - - item.value = 100; - item.defense = 4; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Wolf Jerkin"); - Tooltip.SetDefault("6% increased minion damage\nIncreases your max number of minions"); - } - - - public override void UpdateEquip(Player player) - { - player.maxMinions += 1; - player.minionDamage += 0.06f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "WolfPelt", 16); - recipe.AddIngredient(null, "AlphaClaw", 2); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } -}} + [AutoloadEquip(EquipType.Body)] + public class WolfJerkin : ModItem + { + + public override void SetDefaults() + { + + item.width = 22; + item.height = 26; + item.rare = 1; + + + item.value = 100; + item.defense = 4; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Wolf Jerkin"); + Tooltip.SetDefault("6% increased minion damage\nIncreases your max number of minions"); + } + + + public override void UpdateEquip(Player player) + { + player.maxMinions += 1; + player.minionDamage += 0.06f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "WolfPelt", 16); + recipe.AddIngredient(null, "AlphaClaw", 2); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } + } +} diff --git a/Items/WolfLeggings.cs b/Items/WolfLeggings.cs index 707bc921..5db2ade0 100644 --- a/Items/WolfLeggings.cs +++ b/Items/WolfLeggings.cs @@ -5,43 +5,46 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] -public class WolfLeggings : ModItem +namespace Tremor.Items { - - - public override void SetDefaults() - { - - item.width = 22; - item.height = 18; - item.rare = 1; - - - item.value = 100; - item.defense = 3; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Wolf Leggings"); - Tooltip.SetDefault("6% increased minion damage\nIncreases movement speed"); - } - - - public override void UpdateEquip(Player player) - { - player.minionDamage += 0.06f; - player.moveSpeed += 0.10f; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "WolfPelt", 10); - recipe.AddIngredient(null, "AlphaClaw", 1); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } -}} + [AutoloadEquip(EquipType.Legs)] + public class WolfLeggings : ModItem + { + + + public override void SetDefaults() + { + + item.width = 22; + item.height = 18; + item.rare = 1; + + + item.value = 100; + item.defense = 3; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Wolf Leggings"); + Tooltip.SetDefault("6% increased minion damage\nIncreases movement speed"); + } + + + public override void UpdateEquip(Player player) + { + player.minionDamage += 0.06f; + player.moveSpeed += 0.10f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "WolfPelt", 10); + recipe.AddIngredient(null, "AlphaClaw", 1); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } + } +} diff --git a/Items/WolfPelt.cs b/Items/WolfPelt.cs index f539cfe0..e8d4d6db 100644 --- a/Items/WolfPelt.cs +++ b/Items/WolfPelt.cs @@ -4,30 +4,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class WolfPelt : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class WolfPelt : ModItem + { + public override void SetDefaults() + { - item.width = 20; - item.height = 40; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.value = 150; - item.rare = 1; - item.createTile = mod.TileType("WolfPelt"); - } + item.width = 20; + item.height = 40; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.value = 150; + item.rare = 1; + item.createTile = mod.TileType("WolfPelt"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Wolf Pelt"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Wolf Pelt"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/WolfToothNecklace.cs b/Items/WolfToothNecklace.cs index 7cd74af0..47ab8122 100644 --- a/Items/WolfToothNecklace.cs +++ b/Items/WolfToothNecklace.cs @@ -4,31 +4,33 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { -public class WolfToothNecklace : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class WolfToothNecklace : ModItem + { + public override void SetDefaults() + { - item.width = 20; - item.height = 30; + item.width = 20; + item.height = 30; - item.useTime = 20; - item.useAnimation = 20; - item.pick = 220; - item.useStyle = 1; - item.knockBack = 6; - item.value = 30000; - item.rare = 2; - item.UseSound = SoundID.Item79; - item.noMelee = true; - item.mountType = mod.MountType("Wolf"); - } + item.useTime = 20; + item.useAnimation = 20; + item.pick = 220; + item.useStyle = 1; + item.knockBack = 6; + item.value = 30000; + item.rare = 2; + item.UseSound = SoundID.Item79; + item.noMelee = true; + item.mountType = mod.MountType("Wolf"); + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Wolf Tooth Necklace"); - Tooltip.SetDefault("This is a modded mount."); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Wolf Tooth Necklace"); + Tooltip.SetDefault("This is a modded mount."); + } -}} + } +} diff --git a/Items/WoodenCross.cs b/Items/WoodenCross.cs index 636f3eb6..af5ea68c 100644 --- a/Items/WoodenCross.cs +++ b/Items/WoodenCross.cs @@ -4,39 +4,41 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class WoodenCross : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class WoodenCross : ModItem + { + public override void SetDefaults() + { - item.damage = 8; - item.melee = true; - item.width = 48; - item.height = 48; - item.useTime = 30; - item.useAnimation = 20; - item.useStyle = 1; - item.knockBack = 2; - item.value = 2200; - item.rare = 1; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - } + item.damage = 8; + item.melee = true; + item.width = 48; + item.height = 48; + item.useTime = 30; + item.useAnimation = 20; + item.useStyle = 1; + item.knockBack = 2; + item.value = 2200; + item.rare = 1; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Wooden Cross"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Wooden Cross"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Wood, 15); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Wood, 15); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } + } +} diff --git a/Items/WoodenFrame.cs b/Items/WoodenFrame.cs index e82b5300..6547fbd1 100644 --- a/Items/WoodenFrame.cs +++ b/Items/WoodenFrame.cs @@ -5,26 +5,28 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class WoodenFrame : ModItem +namespace Tremor.Items { + public class WoodenFrame : ModItem + { - public override void SetDefaults() - { + public override void SetDefaults() + { - item.width = 34; - item.height = 34; - item.value = 120000; - item.rare = 2; - item.defense = 3; - item.accessory = true; - } + item.width = 34; + item.height = 34; + item.value = 120000; + item.rare = 2; + item.defense = 3; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Wooden Frame"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Wooden Frame"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/WoodenPiranha.cs b/Items/WoodenPiranha.cs index 7cc29f53..633e50d9 100644 --- a/Items/WoodenPiranha.cs +++ b/Items/WoodenPiranha.cs @@ -21,11 +21,11 @@ public override void SetDefaults() item.rare = -11; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Wooden Piranha"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Wooden Piranha"); + Tooltip.SetDefault(""); + } public override bool IsQuestFish() diff --git a/Items/WoodenShield.cs b/Items/WoodenShield.cs index 1f402526..b4c0952e 100644 --- a/Items/WoodenShield.cs +++ b/Items/WoodenShield.cs @@ -5,33 +5,35 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -[AutoloadEquip(EquipType.Shield)] -public class WoodenShield : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + [AutoloadEquip(EquipType.Shield)] + public class WoodenShield : ModItem + { + public override void SetDefaults() + { - item.width = 24; - item.height = 24; - item.value = 110; - item.rare = 0; - item.accessory = true; - item.defense = 1; - } + item.width = 24; + item.height = 24; + item.value = 110; + item.rare = 0; + item.accessory = true; + item.defense = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Wooden Shield"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Wooden Shield"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Wood, 15); - recipe.SetResult(this); - recipe.AddTile(18); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Wood, 15); + recipe.SetResult(this); + recipe.AddTile(18); + recipe.AddRecipe(); + } + } +} diff --git a/Items/WoodyBanner.cs b/Items/WoodyBanner.cs index 6508c555..ee93f649 100644 --- a/Items/WoodyBanner.cs +++ b/Items/WoodyBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class WoodyBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class WoodyBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 42; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 42; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Woody Wolf Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Woody Wolf Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/WrathofWraith.cs b/Items/WrathofWraith.cs index 3221d51f..06cafd34 100644 --- a/Items/WrathofWraith.cs +++ b/Items/WrathofWraith.cs @@ -5,36 +5,38 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class WrathofWraith : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class WrathofWraith : ModItem + { + public override void SetDefaults() + { - item.damage = 40; - item.magic = true; - item.mana = 8; - item.width = 40; - item.height = 40; - item.useTime = 28; - item.useAnimation = 28; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 3; - item.value = 13800; - item.rare = 4; - item.UseSound = SoundID.Item43; - item.autoReuse = false; - Item.staff[item.type] = true; //this makes the useStyle animate as a staff instead of as a gun - item.shoot = mod.ProjectileType("WraithWrathPro"); - item.shootSpeed = 15f; - } + item.damage = 40; + item.magic = true; + item.mana = 8; + item.width = 40; + item.height = 40; + item.useTime = 28; + item.useAnimation = 28; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 3; + item.value = 13800; + item.rare = 4; + item.UseSound = SoundID.Item43; + item.autoReuse = false; + Item.staff[item.type] = true; //this makes the useStyle animate as a staff instead of as a gun + item.shoot = mod.ProjectileType("WraithWrathPro"); + item.shootSpeed = 15f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Wrath of Wraith"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Wrath of Wraith"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/YellowCrossguardPhasesaber.cs b/Items/YellowCrossguardPhasesaber.cs index 2545d971..c69b061e 100644 --- a/Items/YellowCrossguardPhasesaber.cs +++ b/Items/YellowCrossguardPhasesaber.cs @@ -5,48 +5,50 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class YellowCrossguardPhasesaber : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class YellowCrossguardPhasesaber : ModItem + { + public override void SetDefaults() + { - item.damage = 71; - item.melee = true; - item.width = 46; - item.height = 48; - item.useTime = 25; - item.useAnimation = 25; - item.useStyle = 1; - item.knockBack = 3; - item.value = 54000; - item.rare = 5; - item.UseSound = SoundID.Item15; - item.autoReuse = true; - item.useTurn = true; - } + item.damage = 71; + item.melee = true; + item.width = 46; + item.height = 48; + item.useTime = 25; + item.useAnimation = 25; + item.useStyle = 1; + item.knockBack = 3; + item.value = 54000; + item.rare = 5; + item.UseSound = SoundID.Item15; + item.autoReuse = true; + item.useTurn = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Yellow Crossguard Phasesaber"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Yellow Crossguard Phasesaber"); + Tooltip.SetDefault(""); + } - public override void MeleeEffects(Player player, Rectangle hitbox) - { - int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 64); - } + public override void MeleeEffects(Player player, Rectangle hitbox) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 64); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(3769); - recipe.AddIngredient(ItemID.SoulofMight, 8); - recipe.AddIngredient(null, "SoulofMind", 8); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(3769); + recipe.AddIngredient(ItemID.SoulofMight, 8); + recipe.AddIngredient(null, "SoulofMind", 8); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/YellowPuzzleFragment.cs b/Items/YellowPuzzleFragment.cs index 4142d40c..2246a221 100644 --- a/Items/YellowPuzzleFragment.cs +++ b/Items/YellowPuzzleFragment.cs @@ -4,24 +4,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class YellowPuzzleFragment : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class YellowPuzzleFragment : ModItem + { + public override void SetDefaults() + { - item.width = 30; - item.height = 24; - item.maxStack = 99; - item.value = 10000; - item.rare = 3; - } + item.width = 30; + item.height = 24; + item.maxStack = 99; + item.value = 10000; + item.rare = 3; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Yellow Puzzle Fragment"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Yellow Puzzle Fragment"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/YinYangLance.cs b/Items/YinYangLance.cs index 069c8450..7c1afed8 100644 --- a/Items/YinYangLance.cs +++ b/Items/YinYangLance.cs @@ -4,46 +4,48 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class YinYangLance : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class YinYangLance : ModItem + { + public override void SetDefaults() + { - item.damage = 30; - item.melee = true; - item.width = 32; - item.height = 32; - item.useTime = 11; - item.useAnimation = 9; - item.useStyle = 3; - item.knockBack = 0; - item.value = 2800; - item.rare = 4; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - } + item.damage = 30; + item.melee = true; + item.width = 32; + item.height = 32; + item.useTime = 11; + item.useAnimation = 9; + item.useStyle = 3; + item.knockBack = 0; + item.value = 2800; + item.rare = 4; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Yin Yang Lance"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Yin Yang Lance"); + Tooltip.SetDefault(""); + } - public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(31, 60); - } + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(31, 60); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "RipperKnife"); - recipe.AddIngredient(ItemID.DarkShard, 1); - recipe.AddIngredient(ItemID.LightShard, 1); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } -}} + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "RipperKnife"); + recipe.AddIngredient(ItemID.DarkShard, 1); + recipe.AddIngredient(ItemID.LightShard, 1); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } +} diff --git a/Items/ZarpriteBanner.cs b/Items/ZarpriteBanner.cs index 1c285bd0..ebe76611 100644 --- a/Items/ZarpriteBanner.cs +++ b/Items/ZarpriteBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ZarpriteBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ZarpriteBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 1; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Zarprite Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Zarprite Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/ZarpruteBanner.cs b/Items/ZarpruteBanner.cs index bf4c401f..0a111e63 100644 --- a/Items/ZarpruteBanner.cs +++ b/Items/ZarpruteBanner.cs @@ -4,31 +4,33 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class ZarpruteBanner : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class ZarpruteBanner : ModItem + { + public override void SetDefaults() + { - item.width = 10; - item.height = 24; - item.maxStack = 99; - item.useTurn = true; - item.autoReuse = true; - item.useAnimation = 15; - item.useTime = 10; - item.useStyle = 1; - item.consumable = true; - item.rare = 1; - item.value = Item.buyPrice(0, 0, 10, 0); - item.createTile = mod.TileType("MonsterBanner"); - item.placeStyle = 0; - } + item.width = 10; + item.height = 24; + item.maxStack = 99; + item.useTurn = true; + item.autoReuse = true; + item.useAnimation = 15; + item.useTime = 10; + item.useStyle = 1; + item.consumable = true; + item.rare = 1; + item.value = Item.buyPrice(0, 0, 10, 0); + item.createTile = mod.TileType("MonsterBanner"); + item.placeStyle = 0; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Zarprute Banner"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Zarprute Banner"); + Tooltip.SetDefault(""); + } -}} + } +} diff --git a/Items/Zephyrhorn.cs b/Items/Zephyrhorn.cs index b3bcc4ea..caef7804 100644 --- a/Items/Zephyrhorn.cs +++ b/Items/Zephyrhorn.cs @@ -4,28 +4,30 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Items { -public class Zephyrhorn : ModItem +namespace Tremor.Items { - public override void SetDefaults() - { + public class Zephyrhorn : ModItem + { + public override void SetDefaults() + { - item.width = 22; - item.height = 44; - item.value = 100000; - item.rare = 7; - item.accessory = true; - } + item.width = 22; + item.height = 44; + item.value = 100000; + item.rare = 7; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Zephyrhorn"); - Tooltip.SetDefault("Increases minion damage and size"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Zephyrhorn"); + Tooltip.SetDefault("Increases minion damage and size"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.AddBuff(mod.BuffType("ZephyrhornBuff"), 2); - } -}} + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.AddBuff(mod.BuffType("ZephyrhornBuff"), 2); + } + } +} diff --git a/Items/ZerokkBody.cs b/Items/ZerokkBody.cs index 76877f07..9c4d6598 100644 --- a/Items/ZerokkBody.cs +++ b/Items/ZerokkBody.cs @@ -5,8 +5,8 @@ using Terraria.ModLoader; namespace Tremor.Items -{ -[AutoloadEquip(EquipType.Body)] +{ + [AutoloadEquip(EquipType.Body)] public class ZerokkBody : ModItem { @@ -20,19 +20,19 @@ public override void SetDefaults() item.rare = 9; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Zerokk's Bodyplate"); - Tooltip.SetDefault("'Great for impersonating devs!'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Zerokk's Bodyplate"); + Tooltip.SetDefault("'Great for impersonating devs!'"); + } - public override void UpdateEquip(Player player) - { - if(player.name == "Error 404") - { - player.lifeRegen = +999; - } - } + public override void UpdateEquip(Player player) + { + if (player.name == "Error 404") + { + player.lifeRegen = +999; + } + } } } diff --git a/Items/ZerokkHead.cs b/Items/ZerokkHead.cs index b0866508..b0c5e134 100644 --- a/Items/ZerokkHead.cs +++ b/Items/ZerokkHead.cs @@ -8,7 +8,7 @@ namespace Tremor.Items { -[AutoloadEquip(EquipType.Head)] + [AutoloadEquip(EquipType.Head)] public class ZerokkHead : ModItem { public override void SetDefaults() @@ -21,18 +21,18 @@ public override void SetDefaults() item.rare = 9; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Zerokk's Headgear"); - Tooltip.SetDefault("'Great for impersonating devs!'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Zerokk's Headgear"); + Tooltip.SetDefault("'Great for impersonating devs!'"); + } + - public override bool IsArmorSet(Item head, Item body, Item legs) { return body.type == mod.ItemType("ZerokkBody") && legs.type == mod.ItemType("ZerokkLegs"); } - + public override void ArmorSetShadows(Player player) { player.armorEffectDrawOutlines = true; //Ñреднее пульÑирование diff --git a/Items/ZerokkLegs.cs b/Items/ZerokkLegs.cs index 71bc3ec9..a1649eee 100644 --- a/Items/ZerokkLegs.cs +++ b/Items/ZerokkLegs.cs @@ -3,7 +3,9 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Items { [AutoloadEquip(EquipType.Legs)] +namespace Tremor.Items +{ + [AutoloadEquip(EquipType.Legs)] public class ZerokkLegs : ModItem { @@ -17,11 +19,11 @@ public override void SetDefaults() item.rare = 9; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Zerokk's Leggings"); - Tooltip.SetDefault("'Great for impersonating devs!'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Zerokk's Leggings"); + Tooltip.SetDefault("'Great for impersonating devs!'"); + } } } diff --git a/Items/ZombatStaff.cs b/Items/ZombatStaff.cs index 9bddeb36..136a74b4 100644 --- a/Items/ZombatStaff.cs +++ b/Items/ZombatStaff.cs @@ -28,43 +28,43 @@ public override void SetDefaults() item.shootSpeed = 1f; item.buffType = mod.BuffType("ZombatBuff"); item.buffTime = 3600; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Zombat Staff"); - Tooltip.SetDefault("Summons a zombat to fight for you."); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Zombat Staff"); + Tooltip.SetDefault("Summons a zombat to fight for you."); + } public override bool AltFunctionUse(Player player) { return true; } - + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { return player.altFunctionUse != 2; } - + public override bool UseItem(Player player) { - if(player.altFunctionUse == 2) + if (player.altFunctionUse == 2) { player.MinionNPCTargetAim(); } return base.UseItem(player); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.Diamond, 1); - recipe.AddIngredient(null, "RupicideBar", 6); - recipe.AddIngredient(null, "TearsofDeath",6); - recipe.SetResult(this); - recipe.AddTile(null, "NecromaniacWorkbenchTile"); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.Diamond, 1); + recipe.AddIngredient(null, "RupicideBar", 6); + recipe.AddIngredient(null, "TearsofDeath", 6); + recipe.SetResult(this); + recipe.AddTile(null, "NecromaniacWorkbenchTile"); + recipe.AddRecipe(); + } } } diff --git a/Items/ZootalooEgg.cs b/Items/ZootalooEgg.cs index 5504a54f..1f640701 100644 --- a/Items/ZootalooEgg.cs +++ b/Items/ZootalooEgg.cs @@ -13,18 +13,18 @@ public override void SetDefaults() { item.CloneDefaults(ItemID.Carrot); - item.useTime = 25; - item.useAnimation = 25; + item.useTime = 25; + item.useAnimation = 25; item.shoot = mod.ProjectileType("ZootalooPet"); item.buffType = mod.BuffType("ZootalooBuff"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Zootaloo Egg"); - Tooltip.SetDefault("Summons an zootaloo junior"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Zootaloo Egg"); + Tooltip.SetDefault("Summons an zootaloo junior"); + } public override void UseStyle(Player player) diff --git a/Items/itemBoneHook.cs b/Items/itemBoneHook.cs index 19e51398..9d9783f1 100644 --- a/Items/itemBoneHook.cs +++ b/Items/itemBoneHook.cs @@ -4,48 +4,48 @@ namespace Tremor.Items { - public class itemBoneHook : ModItem - { - public override void SetDefaults() - { + public class itemBoneHook : ModItem + { + public override void SetDefaults() + { - item.damage = 32; - item.melee = true; - item.width = 42; - item.height = 38; + item.damage = 32; + item.melee = true; + item.width = 42; + item.height = 38; - item.useTime = 20; - item.useAnimation = 20; - item.useStyle = 2; - item.knockBack = 0; - item.value = 20000; - item.rare = 6; - item.UseSound = SoundID.Item1; - item.autoReuse = false; - item.shoot = mod.ProjectileType("projBoneHook"); - item.shootSpeed = 20; - item.noMelee = true; - item.noUseGraphic = true; - } + item.useTime = 20; + item.useAnimation = 20; + item.useStyle = 2; + item.knockBack = 0; + item.value = 20000; + item.rare = 6; + item.UseSound = SoundID.Item1; + item.autoReuse = false; + item.shoot = mod.ProjectileType("projBoneHook"); + item.shootSpeed = 20; + item.noMelee = true; + item.noUseGraphic = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bone Hook"); - Tooltip.SetDefault("'Fresh meat!'"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bone Hook"); + Tooltip.SetDefault("'Fresh meat!'"); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "PetrifiedSpike", 25); - recipe.AddIngredient(null, "SharpenedTooth", 6); - recipe.AddIngredient(ItemID.SoulofNight, 9); - recipe.AddIngredient(ItemID.SoulofLight, 9); - recipe.AddIngredient(ItemID.Chain, 10); - recipe.SetResult(this); - recipe.AddTile(134); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "PetrifiedSpike", 25); + recipe.AddIngredient(null, "SharpenedTooth", 6); + recipe.AddIngredient(ItemID.SoulofNight, 9); + recipe.AddIngredient(ItemID.SoulofLight, 9); + recipe.AddIngredient(ItemID.Chain, 10); + recipe.SetResult(this); + recipe.AddTile(134); + recipe.AddRecipe(); + } + } } diff --git a/Mounts/BrutalliskCrystal.cs b/Mounts/BrutalliskCrystal.cs index ce92fa75..bbddd3c3 100644 --- a/Mounts/BrutalliskCrystal.cs +++ b/Mounts/BrutalliskCrystal.cs @@ -10,54 +10,54 @@ public class BrutalliskCrystal : ModMountData public override void SetDefaults() { mountData.spawnDust = 226; - mountData.spawnDustNoGravity = true; - mountData.buff = mod.BuffType("BrutalliskCrystal"); - mountData.heightBoost = 24; - mountData.flightTimeMax = 999999999; - mountData.fatigueMax = 999999999; - mountData.fallDamage = 0f; - mountData.usesHover = true; - mountData.runSpeed = 14f; - mountData.dashSpeed = 14f; - mountData.acceleration = 1f; - mountData.jumpHeight = 10; - mountData.jumpSpeed = 8f; - mountData.blockExtraJumps = true; - mountData.totalFrames = 2; - int[] array = new int[mountData.totalFrames]; - for (int num2 = 0; num2 < array.Length; num2++) - { - array[num2] = 16; - } - mountData.playerYOffsets = array; - mountData.xOffset = 10; - mountData.bodyFrame = 3; - mountData.yOffset = 25; - mountData.playerHeadOffset = 22; - mountData.standingFrameCount = 2; - mountData.standingFrameDelay = 8; - mountData.standingFrameStart = 0; - mountData.runningFrameCount = 2; - mountData.runningFrameDelay = 8; - mountData.runningFrameStart = 0; - mountData.flyingFrameCount = 2; - mountData.flyingFrameDelay = 10; - mountData.flyingFrameStart = 0; - mountData.inAirFrameCount = 2; - mountData.inAirFrameDelay = 10; - mountData.inAirFrameStart = 0; - mountData.idleFrameCount = 2; - mountData.idleFrameDelay = 12; - mountData.idleFrameStart = 0; - mountData.idleFrameLoop = true; - mountData.swimFrameCount = mountData.inAirFrameCount; - mountData.swimFrameDelay = mountData.inAirFrameDelay; - mountData.swimFrameStart = mountData.inAirFrameStart; - if (Main.netMode != 2) - { - mountData.textureWidth = mountData.backTexture.Width + 20; - mountData.textureHeight = mountData.backTexture.Height; - } - } + mountData.spawnDustNoGravity = true; + mountData.buff = mod.BuffType("BrutalliskCrystal"); + mountData.heightBoost = 24; + mountData.flightTimeMax = 999999999; + mountData.fatigueMax = 999999999; + mountData.fallDamage = 0f; + mountData.usesHover = true; + mountData.runSpeed = 14f; + mountData.dashSpeed = 14f; + mountData.acceleration = 1f; + mountData.jumpHeight = 10; + mountData.jumpSpeed = 8f; + mountData.blockExtraJumps = true; + mountData.totalFrames = 2; + int[] array = new int[mountData.totalFrames]; + for (int num2 = 0; num2 < array.Length; num2++) + { + array[num2] = 16; + } + mountData.playerYOffsets = array; + mountData.xOffset = 10; + mountData.bodyFrame = 3; + mountData.yOffset = 25; + mountData.playerHeadOffset = 22; + mountData.standingFrameCount = 2; + mountData.standingFrameDelay = 8; + mountData.standingFrameStart = 0; + mountData.runningFrameCount = 2; + mountData.runningFrameDelay = 8; + mountData.runningFrameStart = 0; + mountData.flyingFrameCount = 2; + mountData.flyingFrameDelay = 10; + mountData.flyingFrameStart = 0; + mountData.inAirFrameCount = 2; + mountData.inAirFrameDelay = 10; + mountData.inAirFrameStart = 0; + mountData.idleFrameCount = 2; + mountData.idleFrameDelay = 12; + mountData.idleFrameStart = 0; + mountData.idleFrameLoop = true; + mountData.swimFrameCount = mountData.inAirFrameCount; + mountData.swimFrameDelay = mountData.inAirFrameDelay; + mountData.swimFrameStart = mountData.inAirFrameStart; + if (Main.netMode != 2) + { + mountData.textureWidth = mountData.backTexture.Width + 20; + mountData.textureHeight = mountData.backTexture.Height; + } + } } } \ No newline at end of file diff --git a/Mounts/Wolf.cs b/Mounts/Wolf.cs index ad5c826a..a06cd211 100644 --- a/Mounts/Wolf.cs +++ b/Mounts/Wolf.cs @@ -3,58 +3,60 @@ using Terraria; using Terraria.ModLoader; -namespace Tremor.Mounts { -public class Wolf: ModMountData +namespace Tremor.Mounts { - public override void SetDefaults() - { - mountData.spawnDust = 57; - mountData.buff = 118; - mountData.heightBoost = 20; - mountData.fallDamage = 0.5f; - mountData.runSpeed = 11f; - mountData.dashSpeed = 8f; - mountData.flightTimeMax = 0; - mountData.fatigueMax = 0; - mountData.jumpHeight = 25; - mountData.acceleration = 0.5f; - mountData.jumpSpeed = 5f; - mountData.blockExtraJumps = false; - mountData.totalFrames = 7; - mountData.constantJump = true; - int[] array = new int[mountData.totalFrames]; - for (int l = 0; l < array.Length; l++) - { - array[l] = 20; - } - mountData.playerYOffsets = array; - mountData.xOffset = 13; - mountData.bodyFrame = 3; - mountData.yOffset = 15; - mountData.playerHeadOffset = 22; - mountData.standingFrameCount = 1; - mountData.standingFrameDelay = 50; - mountData.standingFrameStart = 0; - mountData.runningFrameCount = 7; - mountData.runningFrameDelay = 50; - mountData.runningFrameStart = 0; - mountData.flyingFrameCount = 0; - mountData.flyingFrameDelay = 0; - mountData.flyingFrameStart = 0; - mountData.inAirFrameCount = 1; - mountData.inAirFrameDelay = 12; - mountData.inAirFrameStart = 0; - mountData.idleFrameCount = 7; - mountData.idleFrameDelay = 50; - mountData.idleFrameStart = 0; - mountData.idleFrameLoop = true; - mountData.swimFrameCount = mountData.inAirFrameCount; - mountData.swimFrameDelay = mountData.inAirFrameDelay; - mountData.swimFrameStart = mountData.inAirFrameStart; - if (Main.netMode != 2) - { - mountData.textureWidth = mountData.backTexture.Width + 20; - mountData.textureHeight = mountData.backTexture.Height; - } - } -}} \ No newline at end of file + public class Wolf : ModMountData + { + public override void SetDefaults() + { + mountData.spawnDust = 57; + mountData.buff = 118; + mountData.heightBoost = 20; + mountData.fallDamage = 0.5f; + mountData.runSpeed = 11f; + mountData.dashSpeed = 8f; + mountData.flightTimeMax = 0; + mountData.fatigueMax = 0; + mountData.jumpHeight = 25; + mountData.acceleration = 0.5f; + mountData.jumpSpeed = 5f; + mountData.blockExtraJumps = false; + mountData.totalFrames = 7; + mountData.constantJump = true; + int[] array = new int[mountData.totalFrames]; + for (int l = 0; l < array.Length; l++) + { + array[l] = 20; + } + mountData.playerYOffsets = array; + mountData.xOffset = 13; + mountData.bodyFrame = 3; + mountData.yOffset = 15; + mountData.playerHeadOffset = 22; + mountData.standingFrameCount = 1; + mountData.standingFrameDelay = 50; + mountData.standingFrameStart = 0; + mountData.runningFrameCount = 7; + mountData.runningFrameDelay = 50; + mountData.runningFrameStart = 0; + mountData.flyingFrameCount = 0; + mountData.flyingFrameDelay = 0; + mountData.flyingFrameStart = 0; + mountData.inAirFrameCount = 1; + mountData.inAirFrameDelay = 12; + mountData.inAirFrameStart = 0; + mountData.idleFrameCount = 7; + mountData.idleFrameDelay = 50; + mountData.idleFrameStart = 0; + mountData.idleFrameLoop = true; + mountData.swimFrameCount = mountData.inAirFrameCount; + mountData.swimFrameDelay = mountData.inAirFrameDelay; + mountData.swimFrameStart = mountData.inAirFrameStart; + if (Main.netMode != 2) + { + mountData.textureWidth = mountData.backTexture.Width + 20; + mountData.textureHeight = mountData.backTexture.Height; + } + } + } +} \ No newline at end of file diff --git a/NPCs/Abomination.cs b/NPCs/Abomination.cs index b7abefa4..b68e700a 100644 --- a/NPCs/Abomination.cs +++ b/NPCs/Abomination.cs @@ -5,72 +5,74 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Abomination : ModNPC +namespace Tremor.NPCs { + + public class Abomination : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Abomination"); Main.npcFrameCount[npc.type] = 9; } - - public override void SetDefaults() - { - npc.lifeMax = 125; - npc.damage = 25; - npc.defense = 15; - npc.knockBackResist = 0.6f; - npc.width = 38; - npc.height = 44; - animationType = 489; - npc.aiStyle = 3; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit31; - aiType = 77; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 4, 0); - banner = npc.type; - bannerItem = mod.ItemType("AbominationBanner"); - } -public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { -NPC.NewNPC((int)npc.position.X - 22, (int)npc.position.Y + 55, 21); - } - } + public override void SetDefaults() + { + npc.lifeMax = 125; + npc.damage = 25; + npc.defense = 15; + npc.knockBackResist = 0.6f; + npc.width = 38; + npc.height = 44; + animationType = 489; + npc.aiStyle = 3; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit31; + aiType = 77; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 0, 4, 0); + banner = npc.type; + bannerItem = mod.ItemType("AbominationBanner"); + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + NPC.NewNPC((int)npc.position.X - 22, (int)npc.position.Y + 55, 21); + } + } - public override void AI() - { + public override void AI() + { -if (Main.rand.Next(1000) == 0) - { - Main.PlaySound(22, (int)npc.position.X, (int)npc.position.Y, 1); - } - } + if (Main.rand.Next(1000) == 0) + { + Main.PlaySound(22, (int)npc.position.X, (int)npc.position.Y, 1); + } + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 331, Main.rand.Next(1,3)); - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 331, Main.rand.Next(1, 3)); + } - } - } + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneJungle && y > Main.rockLayer ? 0.01f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneJungle && y > Main.rockLayer ? 0.01f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/Agloomination.cs b/NPCs/Agloomination.cs index df5c1c7f..57f70eff 100644 --- a/NPCs/Agloomination.cs +++ b/NPCs/Agloomination.cs @@ -6,69 +6,71 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Agloomination : ModNPC +namespace Tremor.NPCs { + + public class Agloomination : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Agloomination"); Main.npcFrameCount[npc.type] = 3; } - - public override void SetDefaults() - { - npc.lifeMax = 600; - npc.damage = 90; - npc.defense = 24; - npc.knockBackResist = 0.6f; - npc.width = 38; - npc.height = 44; - animationType = 141; - npc.aiStyle = 1; - npc.npcSlots = 1f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.value = Item.buyPrice(0, 0, 12, 24); - banner = npc.type; - bannerItem = mod.ItemType("AgloominationBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 600; + npc.damage = 90; + npc.defense = 24; + npc.knockBackResist = 0.6f; + npc.width = 38; + npc.height = 44; + animationType = 141; + npc.aiStyle = 1; + npc.npcSlots = 1f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.value = Item.buyPrice(0, 0, 12, 24); + banner = npc.type; + bannerItem = mod.ItemType("AgloominationBanner"); + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedPlantBoss && y > Main.rockLayer ? 0.01f : 0f; - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 60; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - } - else - { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 54, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 54, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 54, (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } -} -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedPlantBoss && y > Main.rockLayer ? 0.01f : 0f; + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 60; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + } + else + { + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 54, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, (float)hitDirection, -1f, 0, default(Color), 0.7f); + } + } + } + } +} \ No newline at end of file diff --git a/NPCs/Alchemaster.cs b/NPCs/Alchemaster.cs index 9037d773..3a68c026 100644 --- a/NPCs/Alchemaster.cs +++ b/NPCs/Alchemaster.cs @@ -7,77 +7,77 @@ namespace Tremor.NPCs { [AutoloadBossHead] - public class Alchemaster : ModNPC - { + public class Alchemaster : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Alchemaster"); } - - #region "КонÑтанты" - const int FlameShootRate = 250; // ЧаÑтота выÑтрела - const int FlameShootDamage = 60; // Урон от лазера. - const float FlameShootKN = 1.0f; // ОтбраÑывание - const int FlameShootType = 100; // Тип проджектайла которым будет произведён выÑтрел. - const float FlameShootSpeed = 4; // Это, Ñ Ñ‚Ð°Ðº понимаю, влиÑет на дальноÑÑ‚ÑŒ выÑтрела - int TimeToFlameShoot = FlameShootRate; // Ð’Ñ€ÐµÐ¼Ñ Ð´Ð¾ выÑтрела. - const int AnimationRate = 8; // ЧаÑтота Ñмены кадров (То, Ñколько кадров не будет ÑменÑÑ‚ÑÑ ÐºÐ°Ð´Ñ€) - const int FrameCount = 4; // Кол-во кадров + #region "КонÑтанты" + const int FlameShootRate = 250; // ЧаÑтота выÑтрела + const int FlameShootDamage = 60; // Урон от лазера. + const float FlameShootKN = 1.0f; // ОтбраÑывание + const int FlameShootType = 100; // Тип проджектайла которым будет произведён выÑтрел. + const float FlameShootSpeed = 4; // Это, Ñ Ñ‚Ð°Ðº понимаю, влиÑет на дальноÑÑ‚ÑŒ выÑтрела - const int ShootRate = 50; // ЧаÑтота выÑтрела. Будет производить 60/ShootRate выÑтрелов в Ñекунду - const int ShootDamage = 75; // Урон от выÑтрела - int ShootType; // Тип выÑтрела (задаётÑÑ Ð² SetDefaults()) - const float ShootKnockback = 1; // ОтбраÑование от выÑтрела - const float ShootSpeed = 10; // СкороÑÑ‚ÑŒ выÑтрела + int TimeToFlameShoot = FlameShootRate; // Ð’Ñ€ÐµÐ¼Ñ Ð´Ð¾ выÑтрела. + const int AnimationRate = 8; // ЧаÑтота Ñмены кадров (То, Ñколько кадров не будет ÑменÑÑ‚ÑÑ ÐºÐ°Ð´Ñ€) + const int FrameCount = 4; // Кол-во кадров - const float DistortPercent = 0.15f; // Процент деформации Ñтатов (неточноÑти) (1.0 == 100%) + const int ShootRate = 50; // ЧаÑтота выÑтрела. Будет производить 60/ShootRate выÑтрелов в Ñекунду + const int ShootDamage = 75; // Урон от выÑтрела + int ShootType; // Тип выÑтрела (задаётÑÑ Ð² SetDefaults()) + const float ShootKnockback = 1; // ОтбраÑование от выÑтрела + const float ShootSpeed = 10; // СкороÑÑ‚ÑŒ выÑтрела - const int MinionsID = 61; // ID вуртулек - const int MinionsCount = 6; // Кол-во вуртулек которых заÑпавнит + const float DistortPercent = 0.15f; // Процент деформации Ñтатов (неточноÑти) (1.0 == 100%) - const int StateTime_Flying = 600; // Сколько будет летать в воздухе до призыва миньонов - const int StateTime_Minions = 120; // Сколько времени будет Ñпавнить вуртулек + const int MinionsID = 61; // ID вуртулек + const int MinionsCount = 6; // Кол-во вуртулек которых заÑпавнит - const int FlyingAI = 2; - const int MinionsAI = 0; + const int StateTime_Flying = 600; // Сколько будет летать в воздухе до призыва миньонов + const int StateTime_Minions = 120; // Сколько времени будет Ñпавнить вуртулек - const float MinionsState_XDeaccelerationPower = 0.05f; // СкороÑÑ‚ÑŒ Ð·Ð°Ð¼ÐµÐ´Ð»ÐµÐ½Ð¸Ñ Ð¿Ð¾ X - const float MinionsState_YMaxSpeed = 2.80f; // МакÑ. ÑкороÑÑ‚ÑŒ взлёта во Ð²Ñ€ÐµÐ¼Ñ Ñпавна миньонов - const float MinionsStete_YSpeedStep = 0.02f; // СкороÑÑ‚ÑŒ ÑƒÐ²ÐµÐ»Ð¸Ñ‡ÐµÐ½Ð¸Ñ ÑкороÑти по Y во Ð²Ñ€ÐµÐ¼Ñ Ñпавна миньонов + const int FlyingAI = 2; + const int MinionsAI = 0; - const int States = 2; - #endregion + const float MinionsState_XDeaccelerationPower = 0.05f; // СкороÑÑ‚ÑŒ Ð·Ð°Ð¼ÐµÐ´Ð»ÐµÐ½Ð¸Ñ Ð¿Ð¾ X + const float MinionsState_YMaxSpeed = 2.80f; // МакÑ. ÑкороÑÑ‚ÑŒ взлёта во Ð²Ñ€ÐµÐ¼Ñ Ñпавна миньонов + const float MinionsStete_YSpeedStep = 0.02f; // СкороÑÑ‚ÑŒ ÑƒÐ²ÐµÐ»Ð¸Ñ‡ÐµÐ½Ð¸Ñ ÑкороÑти по Y во Ð²Ñ€ÐµÐ¼Ñ Ñпавна миньонов - #region "Переменные" - int TimeToAnimation = AnimationRate; - int Frame = 0; - bool Shoots = true; - int TimeToShoot = ShootRate; - int State = 0; - int TimeToState = StateTime_Flying; - bool runAway = false; - #endregion + const int States = 2; + #endregion - public override void SetDefaults() - { - npc.lifeMax = 30000; - npc.damage = 82; - npc.defense = 40; - npc.knockBackResist = 0f; - npc.width = 190; - npc.height = 210; - npc.aiStyle = 2; - npc.noGravity = true; - music = 17; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath42; - npc.value = Item.buyPrice(0, 9, 75, 0); - npc.boss = true; - ShootType = mod.ProjectileType("PlagueFlaskEvil"); - bossBag = mod.ItemType("AlchemasterTreasureBag"); - npc.noTileCollide = true; - } + #region "Переменные" + int TimeToAnimation = AnimationRate; + int Frame = 0; + bool Shoots = true; + int TimeToShoot = ShootRate; + int State = 0; + int TimeToState = StateTime_Flying; + bool runAway = false; + #endregion + + public override void SetDefaults() + { + npc.lifeMax = 30000; + npc.damage = 82; + npc.defense = 40; + npc.knockBackResist = 0f; + npc.width = 190; + npc.height = 210; + npc.aiStyle = 2; + npc.noGravity = true; + music = 17; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath42; + npc.value = Item.buyPrice(0, 9, 75, 0); + npc.boss = true; + ShootType = mod.ProjectileType("PlagueFlaskEvil"); + bossBag = mod.ItemType("AlchemasterTreasureBag"); + npc.noTileCollide = true; + } public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { @@ -85,194 +85,194 @@ public override void ScaleExpertStats(int numPlayers, float bossLifeScale) npc.damage = (int)(npc.damage * 0.6f); } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AlchemasterGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AlchemasterGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AlchemasterGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AlchemasterGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AlchemasterGore4"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AlchemasterGore4"), 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AlchemasterGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AlchemasterGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AlchemasterGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AlchemasterGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AlchemasterGore4"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AlchemasterGore4"), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + } + } - public override void AI() - { - if (--TimeToFlameShoot <= 0 && npc.target != -1) FlameShoot(); // Ð’ Ñтой Ñтроке из переменной TimeToShot отнимаетÑÑ 1, и еÑли TimeToShot < или = 0, то вызываетÑÑ Ð¼ÐµÑ‚Ð¾Ð´ FlameShoot() - PlayAnimation(); // Проигрывание анимации - if (CheckRunConditions()) - return; - ChangeState(); // Смена Ñтадии - Shoot(); // Ð’Ñ‹Ñтрел - DoAI(); // Сам иÑкуÑтвенный интеллект - } - - void PlayAnimation() - { - if (--TimeToAnimation <= 0) - { - TimeToAnimation = (int)Helper.DistortFloat(AnimationRate, DistortPercent); - if (++Frame >= FrameCount) - Frame = 0; - } - } + public override void AI() + { + if (--TimeToFlameShoot <= 0 && npc.target != -1) FlameShoot(); // Ð’ Ñтой Ñтроке из переменной TimeToShot отнимаетÑÑ 1, и еÑли TimeToShot < или = 0, то вызываетÑÑ Ð¼ÐµÑ‚Ð¾Ð´ FlameShoot() + PlayAnimation(); // Проигрывание анимации + if (CheckRunConditions()) + return; + ChangeState(); // Смена Ñтадии + Shoot(); // Ð’Ñ‹Ñтрел + DoAI(); // Сам иÑкуÑтвенный интеллект + } - Vector2 VelocityFPTP(Vector2 pos1, Vector2 pos2, float speed) - { - Vector2 move = pos2 - pos1; - return move * (speed / (float)System.Math.Sqrt(move.X * move.X + move.Y * move.Y)); - } + void PlayAnimation() + { + if (--TimeToAnimation <= 0) + { + TimeToAnimation = (int)Helper.DistortFloat(AnimationRate, DistortPercent); + if (++Frame >= FrameCount) + Frame = 0; + } + } + + Vector2 VelocityFPTP(Vector2 pos1, Vector2 pos2, float speed) + { + Vector2 move = pos2 - pos1; + return move * (speed / (float)System.Math.Sqrt(move.X * move.X + move.Y * move.Y)); + } - void FlameShoot() - { - TimeToFlameShoot = FlameShootRate; // УÑтанавливаем кулдаун выÑтрелу - Vector2 velocity = VelocityFPTP(npc.Center, Main.player[npc.target].Center, FlameShootSpeed); // Тут мы получим нужную velocity (поÑÑнение аргументов ниже) - // 1 аргумент - Ð¿Ð¾Ð·Ð¸Ñ†Ð¸Ñ Ð¸Ð· которой будет вылетать выÑтрел - // 2 аргумент - Ð¿Ð¾Ð·Ð¸Ñ†Ð¸Ñ Ð² которую он должен полететь - // 3 аргумент - ÑкороÑÑ‚ÑŒ выÑтрела - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, velocity.X, velocity.Y, mod.ProjectileType("SparkingFlaskEvil"), FlameShootDamage, FlameShootKN); - } + void FlameShoot() + { + TimeToFlameShoot = FlameShootRate; // УÑтанавливаем кулдаун выÑтрелу + Vector2 velocity = VelocityFPTP(npc.Center, Main.player[npc.target].Center, FlameShootSpeed); // Тут мы получим нужную velocity (поÑÑнение аргументов ниже) + // 1 аргумент - Ð¿Ð¾Ð·Ð¸Ñ†Ð¸Ñ Ð¸Ð· которой будет вылетать выÑтрел + // 2 аргумент - Ð¿Ð¾Ð·Ð¸Ñ†Ð¸Ñ Ð² которую он должен полететь + // 3 аргумент - ÑкороÑÑ‚ÑŒ выÑтрела + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, velocity.X, velocity.Y, mod.ProjectileType("SparkingFlaskEvil"), FlameShootDamage, FlameShootKN); + } - bool CheckRunConditions() - { - if (runAway) - { - npc.aiStyle = 0; - if (npc.velocity.Y >= 0) - npc.velocity.Y = -1f; - npc.velocity.Y *= 1.01f; - return true; - } - int Target = Helper.GetNearestPlayer(npc.Center, true); - if (Target == -1) - { runAway = true; return true; } - return false; - } + bool CheckRunConditions() + { + if (runAway) + { + npc.aiStyle = 0; + if (npc.velocity.Y >= 0) + npc.velocity.Y = -1f; + npc.velocity.Y *= 1.01f; + return true; + } + int Target = Helper.GetNearestPlayer(npc.Center, true); + if (Target == -1) + { runAway = true; return true; } + return false; + } - void ChangeState() - { - if (--TimeToState < 0) - { - State++; - if (State >= States) - State = 0; - switch(State) - { - case 0: - Shoots = true; - npc.aiStyle = FlyingAI; - TimeToState = StateTime_Flying; - break; - case 1: - Shoots = false; - npc.aiStyle = MinionsAI; - TimeToState = StateTime_Minions; - break; - } - } - } + void ChangeState() + { + if (--TimeToState < 0) + { + State++; + if (State >= States) + State = 0; + switch (State) + { + case 0: + Shoots = true; + npc.aiStyle = FlyingAI; + TimeToState = StateTime_Flying; + break; + case 1: + Shoots = false; + npc.aiStyle = MinionsAI; + TimeToState = StateTime_Minions; + break; + } + } + } - void Shoot() - { - if (!Shoots && npc.target < 0) - return; - if (--TimeToShoot > 0) - return; - TimeToShoot = (int)Helper.DistortFloat(ShootRate, DistortPercent); - for (int i = 0; i < ((Main.expertMode) ? 3 : 1); i++) - { - Vector2 Velocity = Helper.VelocityToPoint(npc.Center, Helper.RandomPointInArea(new Vector2(Main.player[npc.target].Center.X - 10, Main.player[npc.target].Center.Y - 10), new Vector2(Main.player[npc.target].Center.X + 20, Main.player[npc.target].Center.Y + 20)), ShootSpeed); - int Proj = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, Velocity.X, Velocity.Y, ShootType, (int)Helper.DistortFloat(ShootDamage, DistortPercent), Helper.DistortFloat(ShootKnockback, DistortPercent)); - Main.projectile[Proj].Center = npc.Center; - } - } + void Shoot() + { + if (!Shoots && npc.target < 0) + return; + if (--TimeToShoot > 0) + return; + TimeToShoot = (int)Helper.DistortFloat(ShootRate, DistortPercent); + for (int i = 0; i < ((Main.expertMode) ? 3 : 1); i++) + { + Vector2 Velocity = Helper.VelocityToPoint(npc.Center, Helper.RandomPointInArea(new Vector2(Main.player[npc.target].Center.X - 10, Main.player[npc.target].Center.Y - 10), new Vector2(Main.player[npc.target].Center.X + 20, Main.player[npc.target].Center.Y + 20)), ShootSpeed); + int Proj = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, Velocity.X, Velocity.Y, ShootType, (int)Helper.DistortFloat(ShootDamage, DistortPercent), Helper.DistortFloat(ShootKnockback, DistortPercent)); + Main.projectile[Proj].Center = npc.Center; + } + } - void DoAI() - { - switch (State) - { - case 1: - npc.velocity.Y -= MinionsStete_YSpeedStep; - if (npc.velocity.Y < -MinionsState_YMaxSpeed) - npc.velocity.Y = MinionsState_YMaxSpeed; - if (TimeToState % StateTime_Minions / MinionsCount == 0) - { - Vector2 Position = Helper.RandomPointInArea(npc.Hitbox); - int index = NPC.NewNPC((int)Position.X, (int)Position.Y, mod.NPCType("PlagueSoul")); - Main.npc[index].Center = Position; - } - break; - } - } + void DoAI() + { + switch (State) + { + case 1: + npc.velocity.Y -= MinionsStete_YSpeedStep; + if (npc.velocity.Y < -MinionsState_YMaxSpeed) + npc.velocity.Y = MinionsState_YMaxSpeed; + if (TimeToState % StateTime_Minions / MinionsCount == 0) + { + Vector2 Position = Helper.RandomPointInArea(npc.Hitbox); + int index = NPC.NewNPC((int)Position.X, (int)Position.Y, mod.NPCType("PlagueSoul")); + Main.npc[index].Center = Position; + } + break; + } + } - public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) - { - SpriteEffects Direction = (npc.target == -1) ? SpriteEffects.None : ((Main.player[npc.target].position.X < npc.position.X) ? SpriteEffects.None : SpriteEffects.FlipHorizontally); - spriteBatch.Draw(Main.npcTexture[npc.type], new Rectangle((int)(npc.position.X - Main.screenPosition.X), (int)(npc.position.Y - Main.screenPosition.Y), 248, 240), new Rectangle(0, Frame * 240, 248, 240), drawColor, 0, new Vector2(0, 0), Direction, 0); - return false; - } + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) + { + SpriteEffects Direction = (npc.target == -1) ? SpriteEffects.None : ((Main.player[npc.target].position.X < npc.position.X) ? SpriteEffects.None : SpriteEffects.FlipHorizontally); + spriteBatch.Draw(Main.npcTexture[npc.type], new Rectangle((int)(npc.position.X - Main.screenPosition.X), (int)(npc.position.Y - Main.screenPosition.Y), 248, 240), new Rectangle(0, Frame * 240, 248, 240), drawColor, 0, new Vector2(0, 0), Direction, 0); + return false; + } - public override void NPCLoot() - { + public override void NPCLoot() + { - if(Main.expertMode) - { - npc.DropBossBags(); - } + if (Main.expertMode) + { + npc.DropBossBags(); + } - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; - if(!Main.expertMode && Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AlchemasterMask")); - } - if(Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AlchemasterTrophy")); - } - if(!Main.expertMode && Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PlagueFlask"), Main.rand.Next(30, 78)); - } - if(!Main.expertMode && Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PlagueFlask"), Main.rand.Next(30, 78)); - } - if(!Main.expertMode && Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LongFuse")); - } - if(!Main.expertMode && Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TheGlorch")); - } - if(!Main.expertMode && Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BadApple")); - } - TremorWorld.downedAlchemaster = true; + if (!Main.expertMode && Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AlchemasterMask")); + } + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AlchemasterTrophy")); + } + if (!Main.expertMode && Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PlagueFlask"), Main.rand.Next(30, 78)); + } + if (!Main.expertMode && Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PlagueFlask"), Main.rand.Next(30, 78)); + } + if (!Main.expertMode && Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LongFuse")); + } + if (!Main.expertMode && Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TheGlorch")); + } + if (!Main.expertMode && Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BadApple")); + } + TremorWorld.downedAlchemaster = true; - } - } - } + } + } + } } \ No newline at end of file diff --git a/NPCs/Alchemist.cs b/NPCs/Alchemist.cs index 93a88bef..dfc25a1c 100644 --- a/NPCs/Alchemist.cs +++ b/NPCs/Alchemist.cs @@ -6,10 +6,11 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { -[AutoloadHead] -public class Alchemist : ModNPC +namespace Tremor.NPCs { + [AutoloadHead] + public class Alchemist : ModNPC + { public override string Texture { get @@ -22,7 +23,7 @@ public override string[] AltTextures { get { - return new string[] { "Tremor/NPCs/Alchemist"}; + return new string[] { "Tremor/NPCs/Alchemist" }; } } @@ -45,218 +46,219 @@ public override void SetStaticDefaults() NPCID.Sets.AttackAverageChance[npc.type] = 30; } - public override void SetDefaults() - { - npc.townNPC = true; - npc.friendly = true; - npc.width = 30; - npc.height = 44; - npc.aiStyle = 7; - npc.damage = 10; - npc.defense = 15; - npc.lifeMax = 250; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.knockBackResist = 0.5f; - animationType = NPCID.GoblinTinkerer; - } + public override void SetDefaults() + { + npc.townNPC = true; + npc.friendly = true; + npc.width = 30; + npc.height = 44; + npc.aiStyle = 7; + npc.damage = 10; + npc.defense = 15; + npc.lifeMax = 250; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.knockBackResist = 0.5f; + animationType = NPCID.GoblinTinkerer; + } - public override bool CanTownNPCSpawn(int numTownNPCs, int money) - { - if(NPC.downedBoss1) - { - return true; - } + public override bool CanTownNPCSpawn(int numTownNPCs, int money) + { + if (NPC.downedBoss1) + { + return true; + } return false; - } + } - public override string TownNPCName() - { - switch(WorldGen.genRand.Next(5)) - { - case 0: - return "Rizo"; - case 1: - return "Albert"; - case 2: - return "Bernando"; - case 3: - return "Seefeld"; - case 4: - return "Raymond"; - case 5: - return "Paracelsus"; - default: - return "Nerxius"; - } - } + public override string TownNPCName() + { + switch (WorldGen.genRand.Next(5)) + { + case 0: + return "Rizo"; + case 1: + return "Albert"; + case 2: + return "Bernando"; + case 3: + return "Seefeld"; + case 4: + return "Raymond"; + case 5: + return "Paracelsus"; + default: + return "Nerxius"; + } + } - public override string GetChat() - { - switch(Main.rand.Next(6)) - { - case 0: - return "Love is just a chain of chemical reactions. So that you know."; - case 1: - return "If you wanna know, it was hard to press these gel cubes."; - case 2: - return "Wanna try something new? I think you may be interested in... BOOM FLASKS! "; - case 3: - return "The man who passes the sentence should throw the flask..."; - case 4: - return "I'm gonna have to throw EVERY SINGLE FLASK in this house!"; - case 5: - return "What? You don't like my hairstyle? Your isn't better."; - default: - return "If you think that I'm a terrorist just because I sell exploding flasks? You're wrong. There are even worse people who sell worse things."; - } - } + public override string GetChat() + { + switch (Main.rand.Next(6)) + { + case 0: + return "Love is just a chain of chemical reactions. So that you know."; + case 1: + return "If you wanna know, it was hard to press these gel cubes."; + case 2: + return "Wanna try something new? I think you may be interested in... BOOM FLASKS! "; + case 3: + return "The man who passes the sentence should throw the flask..."; + case 4: + return "I'm gonna have to throw EVERY SINGLE FLASK in this house!"; + case 5: + return "What? You don't like my hairstyle? Your isn't better."; + default: + return "If you think that I'm a terrorist just because I sell exploding flasks? You're wrong. There are even worse people who sell worse things."; + } + } - public override void SetChatButtons(ref string button, ref string button2) - { - button = Lang.inter[28].Value; - } + public override void SetChatButtons(ref string button, ref string button2) + { + button = Lang.inter[28].Value; + } - public override void OnChatButtonClicked(bool firstButton, ref bool shop) - { - if(firstButton) - { - shop = true; - } - } + public override void OnChatButtonClicked(bool firstButton, ref bool shop) + { + if (firstButton) + { + shop = true; + } + } - public override void SetupShop(Chest shop, ref int nextSlot) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("BasicFlask")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("HazardousChemicals")); - nextSlot++; - shop.item[nextSlot].SetDefaults(ItemID.StinkPotion); - nextSlot++; - shop.item[nextSlot].SetDefaults(ItemID.LovePotion); - nextSlot++; - if(NPC.downedBoss2) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("Nitro")); - nextSlot++; - } - if(TremorWorld.downedAlchemaster) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("Pyro")); - nextSlot++; - } - if(!Main.hardMode && Main.dayTime) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("LesserHealingFlack")); - nextSlot++; - } - if(Main.hardMode) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("ConcentratedTincture")); - nextSlot++; - } - if(Main.hardMode && Main.dayTime) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("BigHealingFlack")); - nextSlot++; - } - if(!Main.hardMode && !Main.dayTime) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("LesserManaFlask")); - nextSlot++; - } - if(Main.hardMode && !Main.dayTime) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("BigManaFlask")); - nextSlot++; - } - if(Main.netMode == 1) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("HealthSupportFlask")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("ManaSupportFlask")); - nextSlot++; - } - if(Main.player[Main.myPlayer].ZoneSnow) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("FreezeFlask")); - nextSlot++; - } - if(Main.player[Main.myPlayer].ZoneJungle) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("LesserPoisonFlask")); - nextSlot++; - } - if(NPC.downedBoss1) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("BoomFlask")); - nextSlot++; - } - if(NPC.downedBoss2) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("BurningFlask")); - nextSlot++; - } - if(NPC.downedBoss3) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("GoldFlask")); - nextSlot++; - } - if(Main.hardMode) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("LesserVenomFlask")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("BlackCauldron")); - nextSlot++; - } - if(NPC.downedGolemBoss) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("CthulhuBlood")); - nextSlot++; - } - if(NPC.downedPlantBoss && Main.bloodMoon) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("AlchemistGlove")); - nextSlot++; - } - } + public override void SetupShop(Chest shop, ref int nextSlot) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("BasicFlask")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("HazardousChemicals")); + nextSlot++; + shop.item[nextSlot].SetDefaults(ItemID.StinkPotion); + nextSlot++; + shop.item[nextSlot].SetDefaults(ItemID.LovePotion); + nextSlot++; + if (NPC.downedBoss2) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("Nitro")); + nextSlot++; + } + if (TremorWorld.downedAlchemaster) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("Pyro")); + nextSlot++; + } + if (!Main.hardMode && Main.dayTime) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("LesserHealingFlack")); + nextSlot++; + } + if (Main.hardMode) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("ConcentratedTincture")); + nextSlot++; + } + if (Main.hardMode && Main.dayTime) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("BigHealingFlack")); + nextSlot++; + } + if (!Main.hardMode && !Main.dayTime) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("LesserManaFlask")); + nextSlot++; + } + if (Main.hardMode && !Main.dayTime) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("BigManaFlask")); + nextSlot++; + } + if (Main.netMode == 1) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("HealthSupportFlask")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("ManaSupportFlask")); + nextSlot++; + } + if (Main.player[Main.myPlayer].ZoneSnow) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("FreezeFlask")); + nextSlot++; + } + if (Main.player[Main.myPlayer].ZoneJungle) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("LesserPoisonFlask")); + nextSlot++; + } + if (NPC.downedBoss1) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("BoomFlask")); + nextSlot++; + } + if (NPC.downedBoss2) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("BurningFlask")); + nextSlot++; + } + if (NPC.downedBoss3) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("GoldFlask")); + nextSlot++; + } + if (Main.hardMode) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("LesserVenomFlask")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("BlackCauldron")); + nextSlot++; + } + if (NPC.downedGolemBoss) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("CthulhuBlood")); + nextSlot++; + } + if (NPC.downedPlantBoss && Main.bloodMoon) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("AlchemistGlove")); + nextSlot++; + } + } - public override void TownNPCAttackStrength(ref int damage, ref float knockback) - { - damage = 20; - knockback = 4f; - } + public override void TownNPCAttackStrength(ref int damage, ref float knockback) + { + damage = 20; + knockback = 4f; + } - public override void TownNPCAttackCooldown(ref int cooldown, ref int randExtraCooldown) - { - cooldown = 10; - randExtraCooldown = 10; - } + public override void TownNPCAttackCooldown(ref int cooldown, ref int randExtraCooldown) + { + cooldown = 10; + randExtraCooldown = 10; + } - public override void TownNPCAttackProj(ref int projType, ref int attackDelay) - { - projType = mod.ProjectileType("BasicFlaskPro"); - attackDelay = 5; - } + public override void TownNPCAttackProj(ref int projType, ref int attackDelay) + { + projType = mod.ProjectileType("BasicFlaskPro"); + attackDelay = 5; + } - public override void TownNPCAttackProjSpeed(ref float multiplier, ref float gravityCorrection, ref float randomOffset) - { - multiplier = 12f; - randomOffset = 2f; - } + public override void TownNPCAttackProjSpeed(ref float multiplier, ref float gravityCorrection, ref float randomOffset) + { + multiplier = 12f; + randomOffset = 2f; + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AlchemistGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AlchemistGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AlchemistGore3"), 1f); - } -} -}} \ No newline at end of file + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AlchemistGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AlchemistGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AlchemistGore3"), 1f); + } + } + } +} \ No newline at end of file diff --git a/NPCs/AlphaWolf.cs b/NPCs/AlphaWolf.cs index f02dad16..afa9fc13 100644 --- a/NPCs/AlphaWolf.cs +++ b/NPCs/AlphaWolf.cs @@ -6,84 +6,86 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class AlphaWolf : ModNPC +namespace Tremor.NPCs { + + public class AlphaWolf : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Alpha Wolf"); Main.npcFrameCount[npc.type] = 9; } - - public override void SetDefaults() - { - npc.lifeMax = 88; - npc.damage = 23; - npc.defense = 10; - npc.knockBackResist = 0.6f; - npc.width = 76; - npc.height = 38; - animationType = 155; - npc.aiStyle = 26; - npc.npcSlots = 1f; - npc.HitSound = SoundID.NPCHit6; - npc.DeathSound = SoundID.NPCDeath5; - npc.value = Item.buyPrice(0, 0, 4, 0); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 88; + npc.damage = 23; + npc.defense = 10; + npc.knockBackResist = 0.6f; + npc.width = 76; + npc.height = 38; + animationType = 155; + npc.aiStyle = 26; + npc.npcSlots = 1f; + npc.HitSound = SoundID.NPCHit6; + npc.DeathSound = SoundID.NPCDeath5; + npc.value = Item.buyPrice(0, 0, 4, 0); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("WolfPelt"), Main.rand.Next(2,3)); - } - if(Main.rand.Next(25) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FurHat")); - } - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AlphaClaw")); - } - if(Main.rand.Next(25) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FurCoat")); - }; - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("WolfPelt"), Main.rand.Next(2, 3)); + } + if (Main.rand.Next(25) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FurHat")); + } + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AlphaClaw")); + } + if (Main.rand.Next(25) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FurCoat")); + }; + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AlphaWolfGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AlphaWolfGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WolfGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WolfGore1"), 1f); - } -} - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneSnow && !Main.dayTime && y < Main.worldSurface ? 0.08f : 0f; - } -}} \ No newline at end of file + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AlphaWolfGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AlphaWolfGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WolfGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WolfGore1"), 1f); + } + } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneSnow && !Main.dayTime && y < Main.worldSurface ? 0.08f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/AncientCursedSkull.cs b/NPCs/AncientCursedSkull.cs index 265e3be1..a5368d6a 100644 --- a/NPCs/AncientCursedSkull.cs +++ b/NPCs/AncientCursedSkull.cs @@ -6,75 +6,77 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class AncientCursedSkull : ModNPC +namespace Tremor.NPCs { + + public class AncientCursedSkull : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Ancient Cursed Skull"); Main.npcFrameCount[npc.type] = 6; } - - public override void SetDefaults() - { - npc.lifeMax = 4000; - npc.damage = 122; - npc.defense = 80; - npc.knockBackResist = 0.2f; - npc.width = 80; - npc.height = 65; - animationType = 289; - npc.noGravity = true; - npc.noTileCollide = true; - npc.aiStyle = 10; - aiType = 289; - npc.npcSlots = 5f; - npc.HitSound = SoundID.NPCHit2; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 8, 0); - banner = npc.type; - bannerItem = mod.ItemType("AncientCursedSkullBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 4000; + npc.damage = 122; + npc.defense = 80; + npc.knockBackResist = 0.2f; + npc.width = 80; + npc.height = 65; + animationType = 289; + npc.noGravity = true; + npc.noTileCollide = true; + npc.aiStyle = 10; + aiType = 289; + npc.npcSlots = 5f; + npc.HitSound = SoundID.NPCHit2; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 0, 8, 0); + banner = npc.type; + bannerItem = mod.ItemType("AncientCursedSkullBanner"); + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDungeon && NPC.downedMoonlord && Main.hardMode && y > Main.rockLayer ? 0.008f : 0f; - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 60; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 15, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 15, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 15, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 15, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Dust.NewDust(npc.position, npc.width, npc.height, 15, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 15, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 15, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - else - { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 15, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - } -} -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDungeon && NPC.downedMoonlord && Main.hardMode && y > Main.rockLayer ? 0.008f : 0f; + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 60; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 15, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 15, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 15, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 15, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Dust.NewDust(npc.position, npc.width, npc.height, 15, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 15, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 15, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + else + { + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 15, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + } + } + } +} \ No newline at end of file diff --git a/NPCs/AndasBoss/Andas.cs b/NPCs/AndasBoss/Andas.cs index a2827415..da86d313 100644 --- a/NPCs/AndasBoss/Andas.cs +++ b/NPCs/AndasBoss/Andas.cs @@ -9,8 +9,8 @@ namespace Tremor.NPCs.AndasBoss { [AutoloadBossHead] - public class Andas : ModNPC - { + public class Andas : ModNPC + { public override void SetStaticDefaults() { @@ -18,236 +18,236 @@ public override void SetStaticDefaults() Main.npcFrameCount[npc.type] = 3; } - public override void SetDefaults() - { - npc.aiStyle = -1; - npc.width = 66; - npc.height = 88; - npc.damage = 52; - npc.defense = 170; - npc.lifeMax = 90000; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath5; - npc.knockBackResist = 0f; - npc.noTileCollide = true; - npc.noGravity = true; - npc.boss = true; - music = MusicID.Boss3; - npc.buffImmune[24] = true; - npc.buffImmune[67] = true; - npc.lavaImmune = true; - } - - #region Settings AI - const int ShootType = 467; - const int ShootDamage = 40; - const float ShootKnockback = 0.8554f; - const int ShootCount = 5; - const int ShootSpeed = 3; - const int ShootDirection = 7; - const float Speed = 14f; - const float Acceleration = 0.1f; - int Timer = 0; - #endregion - public override void AI() - { - npc.TargetClosest(true); - npc.spriteDirection = npc.direction; - Player player = Main.player[npc.target]; - if (player.dead || !player.active) - { - npc.TargetClosest(false); - npc.active = false; - } - Timer++; - if (Timer >= 0) - { - if ((int)(Main.time % 90) == 0) - { - Vector2 Velocity = Helper2.VelocityFPTP(npc.Center, new Vector2(Main.player[npc.target].Center.X, Main.player[npc.target].Center.Y + 20), 10); - int Spread = 65; - float SpreadMult = 0.05f; - Velocity.X = Velocity.X + (float)Main.rand.Next(-Spread, Spread + 1) * SpreadMult; - Velocity.Y = Velocity.Y + (float)Main.rand.Next(-Spread, Spread + 1) * SpreadMult; - int i = Projectile.NewProjectile(npc.Center.X, npc.Center.Y + 20, Velocity.X, Velocity.Y, 258, ShootDamage, ShootKnockback); - Main.projectile[i].hostile = true; - Main.projectile[i].friendly = true; - Main.projectile[i].tileCollide = false; - } - } - if (Timer >= 0 && Timer <= 1000) //flight - { - Vector2 StartPosition = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float DirectionX = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - StartPosition.X; - float DirectionY = (float)(Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - 120) - StartPosition.Y; - float Length = (float)Math.Sqrt(DirectionX * DirectionX + DirectionY * DirectionY); - float Num = Speed / Length; - DirectionX = DirectionX * Num; - DirectionY = DirectionY * Num; - if (npc.velocity.X < DirectionX) - { - npc.velocity.X = npc.velocity.X + Acceleration; - if (npc.velocity.X < 0 && DirectionX > 0) - npc.velocity.X = npc.velocity.X + Acceleration; - } - else if (npc.velocity.X > DirectionX) - { - npc.velocity.X = npc.velocity.X - Acceleration; - if (npc.velocity.X > 0 && DirectionX < 0) - npc.velocity.X = npc.velocity.X - Acceleration; - } - if (npc.velocity.Y < DirectionY) - { - npc.velocity.Y = npc.velocity.Y + Acceleration; - if (npc.velocity.Y < 0 && DirectionY > 0) - npc.velocity.Y = npc.velocity.Y + Acceleration; - } - else if (npc.velocity.Y > DirectionY) - { - npc.velocity.Y = npc.velocity.Y - Acceleration; - if (npc.velocity.Y > 0 && DirectionY < 0) - npc.velocity.Y = npc.velocity.Y - Acceleration; - } - if (Main.rand.Next(36) == 1) - { - Vector2 StartPosition2 = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height / 2)); - float AndasRotation = (float)Math.Atan2(StartPosition2.Y - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), StartPosition2.X - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); - npc.velocity.X = (float)(Math.Cos(AndasRotation) * 18) * -1; - npc.velocity.Y = (float)(Math.Sin(AndasRotation) * 18) * -1; - npc.netUpdate = true; - } - } - - if (Timer == 700) - { - for (int i = 0; i < 50; i++) - { - int dust = Dust.NewDust(npc.position, npc.width, npc.height, 6); - Main.dust[dust].scale = 1.5f; - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 0f; - Main.dust[dust].velocity *= 0f; - } - DoAndasShoot(); - npc.position.X = (Main.player[npc.target].position.X - 500) + Main.rand.Next(1000); - npc.position.Y = (Main.player[npc.target].position.Y - 500) + Main.rand.Next(1000); - } - - - if (Timer == 850) - { - for (int i = 0; i < 50; i++) - { - int dust = Dust.NewDust(npc.position, npc.width, npc.height, 6); - Main.dust[dust].scale = 1.5f; - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 0f; - Main.dust[dust].velocity *= 0f; - } - DoAndasShoot(); - npc.position.X = (Main.player[npc.target].position.X - 500) + Main.rand.Next(1000); - npc.position.Y = (Main.player[npc.target].position.Y - 500) + Main.rand.Next(1000); - } - - - if (Timer == 1000) - { - for (int i = 0; i < 50; i++) - { - int dust = Dust.NewDust(npc.position, npc.width, npc.height, 6); - Main.dust[dust].scale = 1.5f; - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 0f; - Main.dust[dust].velocity *= 0f; - } - DoAndasShoot(); - npc.position.X = (Main.player[npc.target].position.X - 500) + Main.rand.Next(1000); - npc.position.Y = (Main.player[npc.target].position.Y - 500) + Main.rand.Next(1000); - } - - if (Timer == 1150) - { - for (int i = 0; i < 50; i++) - { - int dust = Dust.NewDust(npc.position, npc.width, npc.height, 6); - Main.dust[dust].scale = 1.5f; - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 0f; - Main.dust[dust].velocity *= 0f; - } - DoAndasShoot(); - npc.position.X = (Main.player[npc.target].position.X - 500) + Main.rand.Next(1000); - npc.position.Y = (Main.player[npc.target].position.Y - 500) + Main.rand.Next(1000); - } - - if (Timer == 1300) - { - for (int i = 0; i < 50; i++) - { - int dust = Dust.NewDust(npc.position, npc.width, npc.height, 6); - Main.dust[dust].scale = 1.5f; - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 0f; - Main.dust[dust].velocity *= 0f; - } - DoAndasShoot(); - npc.position.X = (Main.player[npc.target].position.X - 500) + Main.rand.Next(1000); - npc.position.Y = (Main.player[npc.target].position.Y - 500) + Main.rand.Next(1000); - } - - if (Timer > 1300) - { - Timer = 0; - } - } - - void DoAndasShoot() - { - Projectile.NewProjectile(npc.position.X + 40, npc.position.Y + 40, -ShootDirection, 0, ShootType, ShootDamage, ShootKnockback, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(npc.position.X + 40, npc.position.Y + 40, ShootDirection, 0, ShootType, ShootDamage, ShootKnockback, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(npc.position.X + 40, npc.position.Y + 40, 0, ShootDirection, ShootType, ShootDamage, ShootKnockback, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(npc.position.X + 40, npc.position.Y + 40, 0, -ShootDirection, ShootType, ShootDamage, ShootKnockback, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(npc.position.X + 40, npc.position.Y + 40, -ShootDirection, -ShootDirection, ShootType, ShootDamage, ShootKnockback, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(npc.position.X + 40, npc.position.Y + 40, ShootDirection, -ShootDirection, ShootType, ShootDamage, ShootKnockback, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(npc.position.X + 40, npc.position.Y + 40, -ShootDirection, ShootDirection, ShootType, ShootDamage, ShootKnockback, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(npc.position.X + 40, npc.position.Y + 40, ShootDirection, ShootDirection, ShootType, ShootDamage, ShootKnockback, Main.myPlayer, 0f, 0f); - } - - public override bool PreNPCLoot() - { - return false; - } - - public override void HitEffect(int hitDirection, double damage) - { - if (npc.life <= 0) - { - NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("TrueAndas")); - Main.PlaySound(15, 0); - } - } - - public override void FindFrame(int frameHeight) - { - npc.frameCounter += 0.15f; - npc.frameCounter %= Main.npcFrameCount[npc.type]; - int Frame = (int)npc.frameCounter; - npc.frame.Y = Frame * frameHeight; - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Texture2D drawTexture = Main.npcTexture[npc.type]; - Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); - - Vector2 drawPos = new Vector2( - npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, - npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); - - SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); - - return false; - } - } + public override void SetDefaults() + { + npc.aiStyle = -1; + npc.width = 66; + npc.height = 88; + npc.damage = 52; + npc.defense = 170; + npc.lifeMax = 90000; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath5; + npc.knockBackResist = 0f; + npc.noTileCollide = true; + npc.noGravity = true; + npc.boss = true; + music = MusicID.Boss3; + npc.buffImmune[24] = true; + npc.buffImmune[67] = true; + npc.lavaImmune = true; + } + + #region Settings AI + const int ShootType = 467; + const int ShootDamage = 40; + const float ShootKnockback = 0.8554f; + const int ShootCount = 5; + const int ShootSpeed = 3; + const int ShootDirection = 7; + const float Speed = 14f; + const float Acceleration = 0.1f; + int Timer = 0; + #endregion + public override void AI() + { + npc.TargetClosest(true); + npc.spriteDirection = npc.direction; + Player player = Main.player[npc.target]; + if (player.dead || !player.active) + { + npc.TargetClosest(false); + npc.active = false; + } + Timer++; + if (Timer >= 0) + { + if ((int)(Main.time % 90) == 0) + { + Vector2 Velocity = Helper2.VelocityFPTP(npc.Center, new Vector2(Main.player[npc.target].Center.X, Main.player[npc.target].Center.Y + 20), 10); + int Spread = 65; + float SpreadMult = 0.05f; + Velocity.X = Velocity.X + (float)Main.rand.Next(-Spread, Spread + 1) * SpreadMult; + Velocity.Y = Velocity.Y + (float)Main.rand.Next(-Spread, Spread + 1) * SpreadMult; + int i = Projectile.NewProjectile(npc.Center.X, npc.Center.Y + 20, Velocity.X, Velocity.Y, 258, ShootDamage, ShootKnockback); + Main.projectile[i].hostile = true; + Main.projectile[i].friendly = true; + Main.projectile[i].tileCollide = false; + } + } + if (Timer >= 0 && Timer <= 1000) //flight + { + Vector2 StartPosition = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float DirectionX = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - StartPosition.X; + float DirectionY = (float)(Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - 120) - StartPosition.Y; + float Length = (float)Math.Sqrt(DirectionX * DirectionX + DirectionY * DirectionY); + float Num = Speed / Length; + DirectionX = DirectionX * Num; + DirectionY = DirectionY * Num; + if (npc.velocity.X < DirectionX) + { + npc.velocity.X = npc.velocity.X + Acceleration; + if (npc.velocity.X < 0 && DirectionX > 0) + npc.velocity.X = npc.velocity.X + Acceleration; + } + else if (npc.velocity.X > DirectionX) + { + npc.velocity.X = npc.velocity.X - Acceleration; + if (npc.velocity.X > 0 && DirectionX < 0) + npc.velocity.X = npc.velocity.X - Acceleration; + } + if (npc.velocity.Y < DirectionY) + { + npc.velocity.Y = npc.velocity.Y + Acceleration; + if (npc.velocity.Y < 0 && DirectionY > 0) + npc.velocity.Y = npc.velocity.Y + Acceleration; + } + else if (npc.velocity.Y > DirectionY) + { + npc.velocity.Y = npc.velocity.Y - Acceleration; + if (npc.velocity.Y > 0 && DirectionY < 0) + npc.velocity.Y = npc.velocity.Y - Acceleration; + } + if (Main.rand.Next(36) == 1) + { + Vector2 StartPosition2 = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height / 2)); + float AndasRotation = (float)Math.Atan2(StartPosition2.Y - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), StartPosition2.X - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); + npc.velocity.X = (float)(Math.Cos(AndasRotation) * 18) * -1; + npc.velocity.Y = (float)(Math.Sin(AndasRotation) * 18) * -1; + npc.netUpdate = true; + } + } + + if (Timer == 700) + { + for (int i = 0; i < 50; i++) + { + int dust = Dust.NewDust(npc.position, npc.width, npc.height, 6); + Main.dust[dust].scale = 1.5f; + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity *= 0f; + Main.dust[dust].velocity *= 0f; + } + DoAndasShoot(); + npc.position.X = (Main.player[npc.target].position.X - 500) + Main.rand.Next(1000); + npc.position.Y = (Main.player[npc.target].position.Y - 500) + Main.rand.Next(1000); + } + + + if (Timer == 850) + { + for (int i = 0; i < 50; i++) + { + int dust = Dust.NewDust(npc.position, npc.width, npc.height, 6); + Main.dust[dust].scale = 1.5f; + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity *= 0f; + Main.dust[dust].velocity *= 0f; + } + DoAndasShoot(); + npc.position.X = (Main.player[npc.target].position.X - 500) + Main.rand.Next(1000); + npc.position.Y = (Main.player[npc.target].position.Y - 500) + Main.rand.Next(1000); + } + + + if (Timer == 1000) + { + for (int i = 0; i < 50; i++) + { + int dust = Dust.NewDust(npc.position, npc.width, npc.height, 6); + Main.dust[dust].scale = 1.5f; + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity *= 0f; + Main.dust[dust].velocity *= 0f; + } + DoAndasShoot(); + npc.position.X = (Main.player[npc.target].position.X - 500) + Main.rand.Next(1000); + npc.position.Y = (Main.player[npc.target].position.Y - 500) + Main.rand.Next(1000); + } + + if (Timer == 1150) + { + for (int i = 0; i < 50; i++) + { + int dust = Dust.NewDust(npc.position, npc.width, npc.height, 6); + Main.dust[dust].scale = 1.5f; + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity *= 0f; + Main.dust[dust].velocity *= 0f; + } + DoAndasShoot(); + npc.position.X = (Main.player[npc.target].position.X - 500) + Main.rand.Next(1000); + npc.position.Y = (Main.player[npc.target].position.Y - 500) + Main.rand.Next(1000); + } + + if (Timer == 1300) + { + for (int i = 0; i < 50; i++) + { + int dust = Dust.NewDust(npc.position, npc.width, npc.height, 6); + Main.dust[dust].scale = 1.5f; + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity *= 0f; + Main.dust[dust].velocity *= 0f; + } + DoAndasShoot(); + npc.position.X = (Main.player[npc.target].position.X - 500) + Main.rand.Next(1000); + npc.position.Y = (Main.player[npc.target].position.Y - 500) + Main.rand.Next(1000); + } + + if (Timer > 1300) + { + Timer = 0; + } + } + + void DoAndasShoot() + { + Projectile.NewProjectile(npc.position.X + 40, npc.position.Y + 40, -ShootDirection, 0, ShootType, ShootDamage, ShootKnockback, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.position.X + 40, npc.position.Y + 40, ShootDirection, 0, ShootType, ShootDamage, ShootKnockback, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.position.X + 40, npc.position.Y + 40, 0, ShootDirection, ShootType, ShootDamage, ShootKnockback, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.position.X + 40, npc.position.Y + 40, 0, -ShootDirection, ShootType, ShootDamage, ShootKnockback, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.position.X + 40, npc.position.Y + 40, -ShootDirection, -ShootDirection, ShootType, ShootDamage, ShootKnockback, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.position.X + 40, npc.position.Y + 40, ShootDirection, -ShootDirection, ShootType, ShootDamage, ShootKnockback, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.position.X + 40, npc.position.Y + 40, -ShootDirection, ShootDirection, ShootType, ShootDamage, ShootKnockback, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.position.X + 40, npc.position.Y + 40, ShootDirection, ShootDirection, ShootType, ShootDamage, ShootKnockback, Main.myPlayer, 0f, 0f); + } + + public override bool PreNPCLoot() + { + return false; + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("TrueAndas")); + Main.PlaySound(15, 0); + } + } + + public override void FindFrame(int frameHeight) + { + npc.frameCounter += 0.15f; + npc.frameCounter %= Main.npcFrameCount[npc.type]; + int Frame = (int)npc.frameCounter; + npc.frame.Y = Frame * frameHeight; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D drawTexture = Main.npcTexture[npc.type]; + Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); + + Vector2 drawPos = new Vector2( + npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, + npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); + + SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); + + return false; + } + } } \ No newline at end of file diff --git a/NPCs/AndasBoss/InfernoSkull.cs b/NPCs/AndasBoss/InfernoSkull.cs index 3f358d56..8631c353 100644 --- a/NPCs/AndasBoss/InfernoSkull.cs +++ b/NPCs/AndasBoss/InfernoSkull.cs @@ -7,113 +7,113 @@ namespace Tremor.NPCs.AndasBoss { - public class InfernoSkull : ModProjectile - { + public class InfernoSkull : ModProjectile + { public override void SetStaticDefaults() { DisplayName.SetDefault("Inferno Skull"); } - int target; - const int ShootType = 258; - const int ShootDamage = 55; - const float ShootKnockback = 2f; - const int ShootDirection = 7; - public override void SetDefaults() - { - projectile.width = 26; - projectile.height = 52; - projectile.hostile = true; - projectile.ignoreWater = true; - projectile.tileCollide = true; - projectile.penetrate = 1; - projectile.timeLeft = 175; - Main.projFrames[projectile.type] = 2; - } + int target; + const int ShootType = 258; + const int ShootDamage = 55; + const float ShootKnockback = 2f; + const int ShootDirection = 7; + public override void SetDefaults() + { + projectile.width = 26; + projectile.height = 52; + projectile.hostile = true; + projectile.ignoreWater = true; + projectile.tileCollide = true; + projectile.penetrate = 1; + projectile.timeLeft = 175; + Main.projFrames[projectile.type] = 2; + } - public override void Kill(int timeLeft) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); - Projectile.NewProjectile(projectile.position.X + 40, projectile.position.Y + 40, -ShootDirection, 0, ShootType, ShootDamage, ShootKnockback, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(projectile.position.X + 40, projectile.position.Y + 40, ShootDirection, 0, ShootType, ShootDamage, ShootKnockback, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(projectile.position.X + 40, projectile.position.Y + 40, 0, ShootDirection, ShootType, ShootDamage, ShootKnockback, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(projectile.position.X + 40, projectile.position.Y + 40, 0, -ShootDirection, ShootType, ShootDamage, ShootKnockback, Main.myPlayer, 0f, 0f); - } + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Projectile.NewProjectile(projectile.position.X + 40, projectile.position.Y + 40, -ShootDirection, 0, ShootType, ShootDamage, ShootKnockback, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(projectile.position.X + 40, projectile.position.Y + 40, ShootDirection, 0, ShootType, ShootDamage, ShootKnockback, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(projectile.position.X + 40, projectile.position.Y + 40, 0, ShootDirection, ShootType, ShootDamage, ShootKnockback, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(projectile.position.X + 40, projectile.position.Y + 40, 0, -ShootDirection, ShootType, ShootDamage, ShootKnockback, Main.myPlayer, 0f, 0f); + } - public override void OnHitPlayer(Player target, int damage, bool crit) - { - projectile.Kill(); - } + public override void OnHitPlayer(Player target, int damage, bool crit) + { + projectile.Kill(); + } - public override bool PreAI() - { - projectile.spriteDirection = projectile.direction; - projectile.frameCounter++; - if (projectile.frameCounter >= 3) - { - projectile.frame++; - projectile.frameCounter = 0; - if (projectile.frame >= 2) - { - projectile.frame = 0; - } - } + public override bool PreAI() + { + projectile.spriteDirection = projectile.direction; + projectile.frameCounter++; + if (projectile.frameCounter >= 3) + { + projectile.frame++; + projectile.frameCounter = 0; + if (projectile.frame >= 2) + { + projectile.frame = 0; + } + } - projectile.rotation = projectile.velocity.ToRotation() + 1.57F; + projectile.rotation = projectile.velocity.ToRotation() + 1.57F; - if (projectile.ai[0] == 0 && Main.netMode != 1) - { - target = -1; - float distance = 2000f; - for (int k = 0; k < 255; k++) - { - if (Main.player[k].active && !Main.player[k].dead) - { - Vector2 center = Main.player[k].Center; - float currentDistance = Vector2.Distance(center, projectile.Center); - if (currentDistance < distance || target == -1) - { - distance = currentDistance; - target = k; - } - } - } - if (target != -1) - { - projectile.ai[0] = 1; - projectile.netUpdate = true; - } - } - Player targetPlayer = Main.player[this.target]; - Vector2 direction = targetPlayer.Center - projectile.Center; - direction.Normalize(); - projectile.velocity *= 0.98f; - int dust2 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6); - Main.dust[dust2].noGravity = true; - Main.dust[dust2].velocity *= 0f; - Main.dust[dust2].velocity *= 0f; - Main.dust[dust2].scale = 0.9f; - if (Math.Sqrt((projectile.velocity.X * projectile.velocity.X) + (projectile.velocity.Y * projectile.velocity.Y)) < 14f) - { - if (Main.rand.Next(24) == 1) - { - direction.X = direction.X * Main.rand.Next(20, 24); - direction.Y = direction.Y * Main.rand.Next(20, 24); - projectile.velocity.X = direction.X; - projectile.velocity.Y = direction.Y; - } - } - return false; - } + if (projectile.ai[0] == 0 && Main.netMode != 1) + { + target = -1; + float distance = 2000f; + for (int k = 0; k < 255; k++) + { + if (Main.player[k].active && !Main.player[k].dead) + { + Vector2 center = Main.player[k].Center; + float currentDistance = Vector2.Distance(center, projectile.Center); + if (currentDistance < distance || target == -1) + { + distance = currentDistance; + target = k; + } + } + } + if (target != -1) + { + projectile.ai[0] = 1; + projectile.netUpdate = true; + } + } + Player targetPlayer = Main.player[this.target]; + Vector2 direction = targetPlayer.Center - projectile.Center; + direction.Normalize(); + projectile.velocity *= 0.98f; + int dust2 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6); + Main.dust[dust2].noGravity = true; + Main.dust[dust2].velocity *= 0f; + Main.dust[dust2].velocity *= 0f; + Main.dust[dust2].scale = 0.9f; + if (Math.Sqrt((projectile.velocity.X * projectile.velocity.X) + (projectile.velocity.Y * projectile.velocity.Y)) < 14f) + { + if (Main.rand.Next(24) == 1) + { + direction.X = direction.X * Main.rand.Next(20, 24); + direction.Y = direction.Y * Main.rand.Next(20, 24); + projectile.velocity.X = direction.X; + projectile.velocity.Y = direction.Y; + } + } + return false; + } - public override void SendExtraAI(System.IO.BinaryWriter writer) - { - writer.Write(this.target); - } + public override void SendExtraAI(System.IO.BinaryWriter writer) + { + writer.Write(this.target); + } - public override void ReceiveExtraAI(System.IO.BinaryReader reader) - { - this.target = reader.Read(); - } - } + public override void ReceiveExtraAI(System.IO.BinaryReader reader) + { + this.target = reader.Read(); + } + } } diff --git a/NPCs/AndasBoss/MoltenSpirit.cs b/NPCs/AndasBoss/MoltenSpirit.cs index 79cb4a0c..ef5b85a3 100644 --- a/NPCs/AndasBoss/MoltenSpirit.cs +++ b/NPCs/AndasBoss/MoltenSpirit.cs @@ -8,8 +8,8 @@ namespace Tremor.NPCs.AndasBoss { - public class MoltenSpirit : ModNPC - { + public class MoltenSpirit : ModNPC + { public override void SetStaticDefaults() { @@ -17,170 +17,170 @@ public override void SetStaticDefaults() Main.npcFrameCount[npc.type] = 4; } - public override void SetDefaults() - { - npc.width = 102; - npc.height = 88; - npc.damage = 80; - npc.defense = 95; - npc.knockBackResist = 0f; - npc.lifeMax = 4500; - npc.HitSound = SoundID.NPCHit54; - npc.DeathSound = SoundID.NPCDeath52; - npc.noGravity = true; - npc.noTileCollide = true; - npc.npcSlots = 0.75f; - npc.buffImmune[24] = true; - npc.buffImmune[67] = true; - npc.lavaImmune = true; - } + public override void SetDefaults() + { + npc.width = 102; + npc.height = 88; + npc.damage = 80; + npc.defense = 95; + npc.knockBackResist = 0f; + npc.lifeMax = 4500; + npc.HitSound = SoundID.NPCHit54; + npc.DeathSound = SoundID.NPCDeath52; + npc.noGravity = true; + npc.noTileCollide = true; + npc.npcSlots = 0.75f; + npc.buffImmune[24] = true; + npc.buffImmune[67] = true; + npc.lavaImmune = true; + } - int AnimationRate = 6; - int CurrentFrame = 0; - int TimeToAnimation = 6; + int AnimationRate = 6; + int CurrentFrame = 0; + int TimeToAnimation = 6; - Rectangle GetFrame(int Number) - { - return new Rectangle(0, npc.frame.Height * (Number - 1), npc.frame.Width, npc.frame.Height); - } + Rectangle GetFrame(int Number) + { + return new Rectangle(0, npc.frame.Height * (Number - 1), npc.frame.Width, npc.frame.Height); + } - public override bool PreAI() - { - npc.spriteDirection = npc.direction; - if (--TimeToAnimation <= 0) - { - if (++CurrentFrame > 4) - CurrentFrame = 1; - TimeToAnimation = AnimationRate; - npc.frame = GetFrame(CurrentFrame); - } - float velMax = 1f; - float acceleration = 0.011f; - npc.TargetClosest(true); - Vector2 center = npc.Center; - float deltaX = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - center.X; - float deltaY = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - center.Y; - float distance = (float)Math.Sqrt((double)deltaX * (double)deltaX + (double)deltaY * (double)deltaY); - npc.ai[1] += 1f; - if ((double)npc.ai[1] > 600.0) - { - acceleration *= 8f; - velMax = 4f; - if ((double)npc.ai[1] > 650.0) - { - npc.ai[1] = 0f; - } - } - else if ((double)distance < 250.0) - { - npc.ai[0] += 0.9f; - if (npc.ai[0] > 0f) - { - npc.velocity.Y = npc.velocity.Y + 0.019f; - } - else - { - npc.velocity.Y = npc.velocity.Y - 0.019f; - } - if (npc.ai[0] < -100f || npc.ai[0] > 100f) - { - npc.velocity.X = npc.velocity.X + 0.019f; - } - else - { - npc.velocity.X = npc.velocity.X - 0.019f; - } - if (npc.ai[0] > 200f) - { - npc.ai[0] = -200f; - } - } - if ((double)distance > 350.0) - { - velMax = 5f; - acceleration = 0.3f; - } - else if ((double)distance > 300.0) - { - velMax = 3f; - acceleration = 0.2f; - } - else if ((double)distance > 250.0) - { - velMax = 1.5f; - acceleration = 0.1f; - } - float stepRatio = velMax / distance; - float velLimitX = deltaX * stepRatio; - float velLimitY = deltaY * stepRatio; - if (Main.player[npc.target].dead) - { - velLimitX = (float)((double)((float)npc.direction * velMax) / 2.0); - velLimitY = (float)((double)(-(double)velMax) / 2.0); - } - if (npc.velocity.X < velLimitX) - { - npc.velocity.X = npc.velocity.X + acceleration; - } - else if (npc.velocity.X > velLimitX) - { - npc.velocity.X = npc.velocity.X - acceleration; - } - if (npc.velocity.Y < velLimitY) - { - npc.velocity.Y = npc.velocity.Y + acceleration; - } - else if (npc.velocity.Y > velLimitY) - { - npc.velocity.Y = npc.velocity.Y - acceleration; - } - if ((double)velLimitX > 0.0) - { - npc.spriteDirection = -1; - npc.rotation = (float)Math.Atan2((double)velLimitY, (double)velLimitX); - } - if ((double)velLimitX < 0.0) - { - npc.spriteDirection = 1; - npc.rotation = (float)Math.Atan2((double)velLimitY, (double)velLimitX) + 3.14f; - } - Player target = Main.player[npc.target]; - int distance2 = (int)Math.Sqrt((npc.Center.X - target.Center.X) * (npc.Center.X - target.Center.X) + (npc.Center.Y - target.Center.Y) * (npc.Center.Y - target.Center.Y)); - if (distance2 < 320) - { - float num867 = 6f; - int num869 = mod.ProjectileType("SpiritFire"); - Vector2 vector86 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num864 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector86.X; - float num865 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector86.Y; - float num866 = (float)Math.Sqrt((double)(num864 * num864 + num865 * num865)); - num866 = num867 / num866; - num864 *= num866; - num865 *= num866; - num865 += (float)Main.rand.Next(-40, 41) * 0.01f; - num864 += (float)Main.rand.Next(-40, 41) * 0.01f; - num865 += npc.velocity.Y * 0.5f; - num864 += npc.velocity.X * 0.5f; - vector86.X -= num864 * 1f; - vector86.Y -= num865 * 1f; - Projectile.NewProjectile(vector86.X, vector86.Y, num864, num865, num869, npc.damage, 0f, Main.myPlayer, 0f, 0f); - } - return false; - } + public override bool PreAI() + { + npc.spriteDirection = npc.direction; + if (--TimeToAnimation <= 0) + { + if (++CurrentFrame > 4) + CurrentFrame = 1; + TimeToAnimation = AnimationRate; + npc.frame = GetFrame(CurrentFrame); + } + float velMax = 1f; + float acceleration = 0.011f; + npc.TargetClosest(true); + Vector2 center = npc.Center; + float deltaX = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - center.X; + float deltaY = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - center.Y; + float distance = (float)Math.Sqrt((double)deltaX * (double)deltaX + (double)deltaY * (double)deltaY); + npc.ai[1] += 1f; + if ((double)npc.ai[1] > 600.0) + { + acceleration *= 8f; + velMax = 4f; + if ((double)npc.ai[1] > 650.0) + { + npc.ai[1] = 0f; + } + } + else if ((double)distance < 250.0) + { + npc.ai[0] += 0.9f; + if (npc.ai[0] > 0f) + { + npc.velocity.Y = npc.velocity.Y + 0.019f; + } + else + { + npc.velocity.Y = npc.velocity.Y - 0.019f; + } + if (npc.ai[0] < -100f || npc.ai[0] > 100f) + { + npc.velocity.X = npc.velocity.X + 0.019f; + } + else + { + npc.velocity.X = npc.velocity.X - 0.019f; + } + if (npc.ai[0] > 200f) + { + npc.ai[0] = -200f; + } + } + if ((double)distance > 350.0) + { + velMax = 5f; + acceleration = 0.3f; + } + else if ((double)distance > 300.0) + { + velMax = 3f; + acceleration = 0.2f; + } + else if ((double)distance > 250.0) + { + velMax = 1.5f; + acceleration = 0.1f; + } + float stepRatio = velMax / distance; + float velLimitX = deltaX * stepRatio; + float velLimitY = deltaY * stepRatio; + if (Main.player[npc.target].dead) + { + velLimitX = (float)((double)((float)npc.direction * velMax) / 2.0); + velLimitY = (float)((double)(-(double)velMax) / 2.0); + } + if (npc.velocity.X < velLimitX) + { + npc.velocity.X = npc.velocity.X + acceleration; + } + else if (npc.velocity.X > velLimitX) + { + npc.velocity.X = npc.velocity.X - acceleration; + } + if (npc.velocity.Y < velLimitY) + { + npc.velocity.Y = npc.velocity.Y + acceleration; + } + else if (npc.velocity.Y > velLimitY) + { + npc.velocity.Y = npc.velocity.Y - acceleration; + } + if ((double)velLimitX > 0.0) + { + npc.spriteDirection = -1; + npc.rotation = (float)Math.Atan2((double)velLimitY, (double)velLimitX); + } + if ((double)velLimitX < 0.0) + { + npc.spriteDirection = 1; + npc.rotation = (float)Math.Atan2((double)velLimitY, (double)velLimitX) + 3.14f; + } + Player target = Main.player[npc.target]; + int distance2 = (int)Math.Sqrt((npc.Center.X - target.Center.X) * (npc.Center.X - target.Center.X) + (npc.Center.Y - target.Center.Y) * (npc.Center.Y - target.Center.Y)); + if (distance2 < 320) + { + float num867 = 6f; + int num869 = mod.ProjectileType("SpiritFire"); + Vector2 vector86 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num864 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector86.X; + float num865 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector86.Y; + float num866 = (float)Math.Sqrt((double)(num864 * num864 + num865 * num865)); + num866 = num867 / num866; + num864 *= num866; + num865 *= num866; + num865 += (float)Main.rand.Next(-40, 41) * 0.01f; + num864 += (float)Main.rand.Next(-40, 41) * 0.01f; + num865 += npc.velocity.Y * 0.5f; + num864 += npc.velocity.X * 0.5f; + vector86.X -= num864 * 1f; + vector86.Y -= num865 * 1f; + Projectile.NewProjectile(vector86.X, vector86.Y, num864, num865, num869, npc.damage, 0f, Main.myPlayer, 0f, 0f); + } + return false; + } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Texture2D drawTexture = Main.npcTexture[npc.type]; - Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D drawTexture = Main.npcTexture[npc.type]; + Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); - Vector2 drawPos = new Vector2( - npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, - npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); + Vector2 drawPos = new Vector2( + npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, + npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); - SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); + SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); - return false; - } - } + return false; + } + } } diff --git a/NPCs/AndasBoss/SpiritFire.cs b/NPCs/AndasBoss/SpiritFire.cs index 912d7ffd..27336419 100644 --- a/NPCs/AndasBoss/SpiritFire.cs +++ b/NPCs/AndasBoss/SpiritFire.cs @@ -7,26 +7,26 @@ namespace Tremor.NPCs.AndasBoss { - public class SpiritFire : ModProjectile - { - public override void SetStaticDefaults() + public class SpiritFire : ModProjectile + { + public override void SetStaticDefaults() { DisplayName.SetDefault("Spirit Fire"); } - public override void SetDefaults() - { - projectile.width = 6; - projectile.height = 6; - projectile.hostile = true; - projectile.ignoreWater = true; - projectile.penetrate = -1; - projectile.extraUpdates = 3; - projectile.timeLeft = 60; - } + public override void SetDefaults() + { + projectile.width = 6; + projectile.height = 6; + projectile.hostile = true; + projectile.ignoreWater = true; + projectile.penetrate = -1; + projectile.extraUpdates = 3; + projectile.timeLeft = 60; + } - public override void AI() - { + public override void AI() + { if (projectile.timeLeft > 60) { projectile.timeLeft = 60; @@ -87,13 +87,13 @@ public override void AI() projectile.ai[0] += 1f; } projectile.rotation += 0.3f * (float)projectile.direction; - return; - } - - public override bool OnTileCollide(Vector2 oldVelocity) - { - projectile.Kill(); - return false; - } - } + return; + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + projectile.Kill(); + return false; + } + } } \ No newline at end of file diff --git a/NPCs/AndasBoss/TrueAndas.cs b/NPCs/AndasBoss/TrueAndas.cs index 900f9fff..538afccb 100644 --- a/NPCs/AndasBoss/TrueAndas.cs +++ b/NPCs/AndasBoss/TrueAndas.cs @@ -9,250 +9,250 @@ namespace Tremor.NPCs.AndasBoss { [AutoloadBossHead] - public class TrueAndas : ModNPC - { + public class TrueAndas : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("True Andas"); } - public override void SetDefaults() - { - npc.aiStyle = -1; - npc.width = 142; - npc.height = 164; - npc.damage = 67; - npc.defense = 200; - npc.lifeMax = 145000; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath10; - npc.value = 60000f; - npc.knockBackResist = 0f; - npc.noTileCollide = true; - npc.noGravity = true; - npc.boss = true; - music = MusicID.Boss5; - bossBag = mod.ItemType("AndasBag"); - npc.buffImmune[24] = true; - npc.buffImmune[67] = true; - npc.lavaImmune = true; - } + public override void SetDefaults() + { + npc.aiStyle = -1; + npc.width = 142; + npc.height = 164; + npc.damage = 67; + npc.defense = 200; + npc.lifeMax = 145000; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath10; + npc.value = 60000f; + npc.knockBackResist = 0f; + npc.noTileCollide = true; + npc.noGravity = true; + npc.boss = true; + music = MusicID.Boss5; + bossBag = mod.ItemType("AndasBag"); + npc.buffImmune[24] = true; + npc.buffImmune[67] = true; + npc.lavaImmune = true; + } - #region Settings AI - const int ShootType = 467; - const int ShootDamage = 50; - const float ShootKnockback = 2f; - const int ShootCount = 5; - const int ShootSpeed = 5; - const int ShootDirection = 7; - const float Speed = 18f; - const float Acceleration = 0.15f; - int Timer = 0; - #endregion - public override void AI() - { - npc.TargetClosest(true); - npc.spriteDirection = npc.direction; - Player player = Main.player[npc.target]; - if (player.dead || !player.active || !Main.dayTime) - { - npc.TargetClosest(false); - npc.active = false; - } - Timer++; - if (Timer >= 0 && Timer <= 1000) //flight - { - Vector2 StartPosition = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float DirectionX = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - StartPosition.X; - float DirectionY = (float)(Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - 120) - StartPosition.Y; - float Length = (float)Math.Sqrt(DirectionX * DirectionX + DirectionY * DirectionY); - float Num = Speed / Length; - DirectionX = DirectionX * Num; - DirectionY = DirectionY * Num; - if (npc.velocity.X < DirectionX) - { - npc.velocity.X = npc.velocity.X + Acceleration; - if (npc.velocity.X < 0 && DirectionX > 0) - npc.velocity.X = npc.velocity.X + Acceleration; - } - else if (npc.velocity.X > DirectionX) - { - npc.velocity.X = npc.velocity.X - Acceleration; - if (npc.velocity.X > 0 && DirectionX < 0) - npc.velocity.X = npc.velocity.X - Acceleration; - } - if (npc.velocity.Y < DirectionY) - { - npc.velocity.Y = npc.velocity.Y + Acceleration; - if (npc.velocity.Y < 0 && DirectionY > 0) - npc.velocity.Y = npc.velocity.Y + Acceleration; - } - else if (npc.velocity.Y > DirectionY) - { - npc.velocity.Y = npc.velocity.Y - Acceleration; - if (npc.velocity.Y > 0 && DirectionY < 0) - npc.velocity.Y = npc.velocity.Y - Acceleration; - } - if (Main.rand.Next(36) == 1) - { - Vector2 StartPosition2 = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height / 2)); - float AndasRotation = (float)Math.Atan2(StartPosition2.Y - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), StartPosition2.X - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); - npc.velocity.X = (float)(Math.Cos(AndasRotation) * 18) * -1; - npc.velocity.Y = (float)(Math.Sin(AndasRotation) * 18) * -1; - npc.netUpdate = true; - } - } + #region Settings AI + const int ShootType = 467; + const int ShootDamage = 50; + const float ShootKnockback = 2f; + const int ShootCount = 5; + const int ShootSpeed = 5; + const int ShootDirection = 7; + const float Speed = 18f; + const float Acceleration = 0.15f; + int Timer = 0; + #endregion + public override void AI() + { + npc.TargetClosest(true); + npc.spriteDirection = npc.direction; + Player player = Main.player[npc.target]; + if (player.dead || !player.active || !Main.dayTime) + { + npc.TargetClosest(false); + npc.active = false; + } + Timer++; + if (Timer >= 0 && Timer <= 1000) //flight + { + Vector2 StartPosition = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float DirectionX = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - StartPosition.X; + float DirectionY = (float)(Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - 120) - StartPosition.Y; + float Length = (float)Math.Sqrt(DirectionX * DirectionX + DirectionY * DirectionY); + float Num = Speed / Length; + DirectionX = DirectionX * Num; + DirectionY = DirectionY * Num; + if (npc.velocity.X < DirectionX) + { + npc.velocity.X = npc.velocity.X + Acceleration; + if (npc.velocity.X < 0 && DirectionX > 0) + npc.velocity.X = npc.velocity.X + Acceleration; + } + else if (npc.velocity.X > DirectionX) + { + npc.velocity.X = npc.velocity.X - Acceleration; + if (npc.velocity.X > 0 && DirectionX < 0) + npc.velocity.X = npc.velocity.X - Acceleration; + } + if (npc.velocity.Y < DirectionY) + { + npc.velocity.Y = npc.velocity.Y + Acceleration; + if (npc.velocity.Y < 0 && DirectionY > 0) + npc.velocity.Y = npc.velocity.Y + Acceleration; + } + else if (npc.velocity.Y > DirectionY) + { + npc.velocity.Y = npc.velocity.Y - Acceleration; + if (npc.velocity.Y > 0 && DirectionY < 0) + npc.velocity.Y = npc.velocity.Y - Acceleration; + } + if (Main.rand.Next(36) == 1) + { + Vector2 StartPosition2 = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height / 2)); + float AndasRotation = (float)Math.Atan2(StartPosition2.Y - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), StartPosition2.X - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); + npc.velocity.X = (float)(Math.Cos(AndasRotation) * 18) * -1; + npc.velocity.Y = (float)(Math.Sin(AndasRotation) * 18) * -1; + npc.netUpdate = true; + } + } - if (Timer == 700) - { - for (int i = 0; i < 50; i++) - { - int dust = Dust.NewDust(npc.position, npc.width, npc.height, 57); - Main.dust[dust].scale = 1.5f; - } - DoAndasShoot(); - npc.position.X = (Main.player[npc.target].position.X - 500) + Main.rand.Next(1000); - npc.position.Y = (Main.player[npc.target].position.Y - 500) + Main.rand.Next(1000); - } + if (Timer == 700) + { + for (int i = 0; i < 50; i++) + { + int dust = Dust.NewDust(npc.position, npc.width, npc.height, 57); + Main.dust[dust].scale = 1.5f; + } + DoAndasShoot(); + npc.position.X = (Main.player[npc.target].position.X - 500) + Main.rand.Next(1000); + npc.position.Y = (Main.player[npc.target].position.Y - 500) + Main.rand.Next(1000); + } - if (Timer == 850) - { - for (int i = 0; i < 50; i++) - { - int dust = Dust.NewDust(npc.position, npc.width, npc.height, 57); - Main.dust[dust].scale = 1.5f; - } - DoAndasShoot(); - npc.position.X = (Main.player[npc.target].position.X - 500) + Main.rand.Next(1000); - npc.position.Y = (Main.player[npc.target].position.Y - 500) + Main.rand.Next(1000); - } + if (Timer == 850) + { + for (int i = 0; i < 50; i++) + { + int dust = Dust.NewDust(npc.position, npc.width, npc.height, 57); + Main.dust[dust].scale = 1.5f; + } + DoAndasShoot(); + npc.position.X = (Main.player[npc.target].position.X - 500) + Main.rand.Next(1000); + npc.position.Y = (Main.player[npc.target].position.Y - 500) + Main.rand.Next(1000); + } - if (Timer == 1000) - { - for (int i = 0; i < 50; i++) - { - int dust = Dust.NewDust(npc.position, npc.width, npc.height, 57); - Main.dust[dust].scale = 1.5f; - } - NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("MoltenSpirit")); - DoAndasShoot(); - npc.position.X = (Main.player[npc.target].position.X - 500) + Main.rand.Next(1000); - npc.position.Y = (Main.player[npc.target].position.Y - 500) + Main.rand.Next(1000); - } + if (Timer == 1000) + { + for (int i = 0; i < 50; i++) + { + int dust = Dust.NewDust(npc.position, npc.width, npc.height, 57); + Main.dust[dust].scale = 1.5f; + } + NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("MoltenSpirit")); + DoAndasShoot(); + npc.position.X = (Main.player[npc.target].position.X - 500) + Main.rand.Next(1000); + npc.position.Y = (Main.player[npc.target].position.Y - 500) + Main.rand.Next(1000); + } - if (Timer == 1150) - { - for (int i = 0; i < 50; i++) - { - int dust = Dust.NewDust(npc.position, npc.width, npc.height, 57); - Main.dust[dust].scale = 1.5f; - } - DoAndasShoot(); - npc.position.X = (Main.player[npc.target].position.X - 500) + Main.rand.Next(1000); - npc.position.Y = (Main.player[npc.target].position.Y - 500) + Main.rand.Next(1000); - } + if (Timer == 1150) + { + for (int i = 0; i < 50; i++) + { + int dust = Dust.NewDust(npc.position, npc.width, npc.height, 57); + Main.dust[dust].scale = 1.5f; + } + DoAndasShoot(); + npc.position.X = (Main.player[npc.target].position.X - 500) + Main.rand.Next(1000); + npc.position.Y = (Main.player[npc.target].position.Y - 500) + Main.rand.Next(1000); + } - if (Timer == 1300) - { - for (int i = 0; i < 50; i++) - { - int dust = Dust.NewDust(npc.position, npc.width, npc.height, 57); - Main.dust[dust].scale = 1.5f; - } - NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("UndeadWyrmHead")); - npc.position.X = (Main.player[npc.target].position.X - 500) + Main.rand.Next(1000); - npc.position.Y = (Main.player[npc.target].position.Y - 500) + Main.rand.Next(1000); - } + if (Timer == 1300) + { + for (int i = 0; i < 50; i++) + { + int dust = Dust.NewDust(npc.position, npc.width, npc.height, 57); + Main.dust[dust].scale = 1.5f; + } + NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("UndeadWyrmHead")); + npc.position.X = (Main.player[npc.target].position.X - 500) + Main.rand.Next(1000); + npc.position.Y = (Main.player[npc.target].position.Y - 500) + Main.rand.Next(1000); + } - if (Timer > 1300) - { - Timer = 0; - } - } + if (Timer > 1300) + { + Timer = 0; + } + } - void DoAndasShoot() - { - Projectile.NewProjectile(npc.position.X + 40, npc.position.Y + 40, -ShootDirection, 0, mod.ProjectileType("InfernoSkull"), ShootDamage, ShootKnockback, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(npc.position.X + 40, npc.position.Y + 40, ShootDirection, 0, mod.ProjectileType("InfernoSkull"), ShootDamage, ShootKnockback, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(npc.position.X + 40, npc.position.Y + 40, 0, ShootDirection, mod.ProjectileType("InfernoSkull"), ShootDamage, ShootKnockback, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(npc.position.X + 40, npc.position.Y + 40, 0, -ShootDirection, mod.ProjectileType("InfernoSkull"), ShootDamage, ShootKnockback, Main.myPlayer, 0f, 0f); - } + void DoAndasShoot() + { + Projectile.NewProjectile(npc.position.X + 40, npc.position.Y + 40, -ShootDirection, 0, mod.ProjectileType("InfernoSkull"), ShootDamage, ShootKnockback, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.position.X + 40, npc.position.Y + 40, ShootDirection, 0, mod.ProjectileType("InfernoSkull"), ShootDamage, ShootKnockback, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.position.X + 40, npc.position.Y + 40, 0, ShootDirection, mod.ProjectileType("InfernoSkull"), ShootDamage, ShootKnockback, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.position.X + 40, npc.position.Y + 40, 0, -ShootDirection, mod.ProjectileType("InfernoSkull"), ShootDamage, ShootKnockback, Main.myPlayer, 0f, 0f); + } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Texture2D drawTexture = Main.npcTexture[npc.type]; - Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D drawTexture = Main.npcTexture[npc.type]; + Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); - Vector2 drawPos = new Vector2( - npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, - npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); + Vector2 drawPos = new Vector2( + npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, + npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); - SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); + SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); - return false; - } + return false; + } -public override void NPCLoot() -{ - if(Main.expertMode) - { - npc.DropBossBags(); - } + public override void NPCLoot() + { + if (Main.expertMode) + { + npc.DropBossBags(); + } -if (Main.netMode != 1) -{ - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; - if(!Main.expertMode) - { - Helper.DropItem(new Rectangle((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height), new Drop(mod.ItemType("Inferno"), 1, 1), new Drop(mod.ItemType("GehennaStaff"), 1, 1), new Drop(mod.ItemType("Pandemonium"), 1, 1), new Drop(mod.ItemType("VulcanBlade"), 1, 1), new Drop(mod.ItemType("HellStorm"), 1, 1)); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 3544, Main.rand.Next(10, 25)); + if (!Main.expertMode) + { + Helper.DropItem(new Rectangle((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height), new Drop(mod.ItemType("Inferno"), 1, 1), new Drop(mod.ItemType("GehennaStaff"), 1, 1), new Drop(mod.ItemType("Pandemonium"), 1, 1), new Drop(mod.ItemType("VulcanBlade"), 1, 1), new Drop(mod.ItemType("HellStorm"), 1, 1)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 3544, Main.rand.Next(10, 25)); - if(Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AndasMask")); - } - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("InfernoSoul"), Main.rand.Next(8,15)); - } + if (Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AndasMask")); + } + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("InfernoSoul"), Main.rand.Next(8, 15)); + } - if(Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AndasTrophy")); - } -} + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AndasTrophy")); + } + } - if (Main.netMode != 1) - { - int num1 = (int)(npc.position.X + (npc.width / 2)) / 16; - int num2 = (int)(npc.position.Y + (npc.height / 2)) / 16; - int num5 = npc.width / 2 / 16 + 1; - for (int index2 = num1 - num5; index2 <= num1 + num5; ++index2) - { - for (int index3 = num2 - num5; index3 <= num2 + num5; ++index3) - { - if ((index2 == num1 - num5 || index2 == num1 + num5 || (index3 == num2 - num5 || index3 == num2 + num5)) && !Main.tile[index2, index3].active()) - { - Main.tile[index2, index3].type = 76; - Main.tile[index2, index3].active(true); - } - Main.tile[index2, index3].lava(false); - Main.tile[index2, index3].liquid = 0; - if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, index2, index3, 1); - else - WorldGen.SquareTileFrame(index2, index3, true); - } - } + if (Main.netMode != 1) + { + int num1 = (int)(npc.position.X + (npc.width / 2)) / 16; + int num2 = (int)(npc.position.Y + (npc.height / 2)) / 16; + int num5 = npc.width / 2 / 16 + 1; + for (int index2 = num1 - num5; index2 <= num1 + num5; ++index2) + { + for (int index3 = num2 - num5; index3 <= num2 + num5; ++index3) + { + if ((index2 == num1 - num5 || index2 == num1 + num5 || (index3 == num2 - num5 || index3 == num2 + num5)) && !Main.tile[index2, index3].active()) + { + Main.tile[index2, index3].type = 76; + Main.tile[index2, index3].active(true); + } + Main.tile[index2, index3].lava(false); + Main.tile[index2, index3].liquid = 0; + if (Main.netMode == 2) + NetMessage.SendTileSquare(-1, index2, index3, 1); + else + WorldGen.SquareTileFrame(index2, index3, true); + } + } - //if (Main.netMode == 2) - //NetMessage.SendData(7, -1, -1, "", 0, 0.0f, 0.0f, 0.0f, 0, 0, 0); - } + //if (Main.netMode == 2) + //NetMessage.SendData(7, -1, -1, "", 0, 0.0f, 0.0f, 0.0f, 0, 0, 0); + } -} - } + } + } } \ No newline at end of file diff --git a/NPCs/AndasBoss/UndeadWyrmBody.cs b/NPCs/AndasBoss/UndeadWyrmBody.cs index 55bfb025..78b6cd82 100644 --- a/NPCs/AndasBoss/UndeadWyrmBody.cs +++ b/NPCs/AndasBoss/UndeadWyrmBody.cs @@ -7,62 +7,62 @@ namespace Tremor.NPCs.AndasBoss { - public class UndeadWyrmBody : ModNPC - { + public class UndeadWyrmBody : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Undead Wyrm"); } - public override void SetDefaults() - { - npc.lifeMax = 1; - npc.damage = 65; - npc.defense = 30; - npc.width = 26; - npc.height = 48; - npc.noTileCollide = true; - npc.behindTiles = true; - npc.friendly = false; - npc.noGravity = true; - npc.aiStyle = 6; - npc.dontTakeDamage = false; - npc.HitSound = SoundID.NPCHit2; - npc.buffImmune[24] = true; - npc.buffImmune[67] = true; - npc.lavaImmune = true; - } - public override void AI() - { - if (!Main.npc[(int)npc.ai[1]].active) - { - npc.life = 0; - npc.HitEffect(0, 10.0); - NPCLoot(); - npc.active = false; - } - } - public override bool CheckActive() - { - return false; - } - public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) - { - return false; - } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Texture2D drawTexture = Main.npcTexture[npc.type]; - Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); + public override void SetDefaults() + { + npc.lifeMax = 1; + npc.damage = 65; + npc.defense = 30; + npc.width = 26; + npc.height = 48; + npc.noTileCollide = true; + npc.behindTiles = true; + npc.friendly = false; + npc.noGravity = true; + npc.aiStyle = 6; + npc.dontTakeDamage = false; + npc.HitSound = SoundID.NPCHit2; + npc.buffImmune[24] = true; + npc.buffImmune[67] = true; + npc.lavaImmune = true; + } + public override void AI() + { + if (!Main.npc[(int)npc.ai[1]].active) + { + npc.life = 0; + npc.HitEffect(0, 10.0); + NPCLoot(); + npc.active = false; + } + } + public override bool CheckActive() + { + return false; + } + public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) + { + return false; + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D drawTexture = Main.npcTexture[npc.type]; + Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); - Vector2 drawPos = new Vector2( - npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, - npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); + Vector2 drawPos = new Vector2( + npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, + npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); - SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); + SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); - return false; - } - } + return false; + } + } } \ No newline at end of file diff --git a/NPCs/AndasBoss/UndeadWyrmHead.cs b/NPCs/AndasBoss/UndeadWyrmHead.cs index 31295ad6..74f799d1 100644 --- a/NPCs/AndasBoss/UndeadWyrmHead.cs +++ b/NPCs/AndasBoss/UndeadWyrmHead.cs @@ -7,102 +7,102 @@ namespace Tremor.NPCs.AndasBoss { - public class UndeadWyrmHead : ModNPC - { + public class UndeadWyrmHead : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Undead Wyrm"); } - bool TailSpawned = false; + bool TailSpawned = false; - public static int ShootRate = 20; - const int ShootDamage = 58; - const float ShootKN = 1.0f; - const int ShootType = 100; - const float ShootSpeed = 10; - const int ShootCount = 5; - const int spread = 2; - const float spreadMult = 0.045f; + public static int ShootRate = 20; + const int ShootDamage = 58; + const float ShootKN = 1.0f; + const int ShootType = 100; + const float ShootSpeed = 10; + const int ShootCount = 5; + const int spread = 2; + const float spreadMult = 0.045f; - const int ShootSound = 62; - const int ShootSoundStyle = 1; + const int ShootSound = 62; + const int ShootSoundStyle = 1; - int TimeToShoot = ShootRate; - public override void SetDefaults() - { - npc.lifeMax = 8000; - npc.damage = 75; - npc.defense = 50; - npc.knockBackResist = 0f; - npc.width = 74; - npc.height = 82; - npc.aiStyle = 6; - npc.npcSlots = 1f; - npc.noTileCollide = true; - npc.behindTiles = true; - npc.friendly = false; - npc.dontTakeDamage = false; - npc.noGravity = true; - npc.HitSound = SoundID.NPCHit2; - npc.DeathSound = SoundID.NPCDeath6; - npc.buffImmune[24] = true; - npc.buffImmune[67] = true; - npc.lavaImmune = true; - } + int TimeToShoot = ShootRate; + public override void SetDefaults() + { + npc.lifeMax = 8000; + npc.damage = 75; + npc.defense = 50; + npc.knockBackResist = 0f; + npc.width = 74; + npc.height = 82; + npc.aiStyle = 6; + npc.npcSlots = 1f; + npc.noTileCollide = true; + npc.behindTiles = true; + npc.friendly = false; + npc.dontTakeDamage = false; + npc.noGravity = true; + npc.HitSound = SoundID.NPCHit2; + npc.DeathSound = SoundID.NPCDeath6; + npc.buffImmune[24] = true; + npc.buffImmune[67] = true; + npc.lavaImmune = true; + } - public override void AI() - { - npc.position += npc.velocity * (2 - 1); + public override void AI() + { + npc.position += npc.velocity * (2 - 1); - if (!TailSpawned) - { - int Previous = npc.whoAmI; - for (int num36 = 0; num36 < 10; num36++) - { - int lol = 0; - if (num36 >= 0 && num36 < 9) - { - lol = NPC.NewNPC((int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.width / 2), mod.NPCType("UndeadWyrmBody"), npc.whoAmI); - } - else - { - lol = NPC.NewNPC((int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.width / 2), mod.NPCType("UndeadWyrmTail"), npc.whoAmI); - } - Main.npc[lol].realLife = npc.whoAmI; - Main.npc[lol].ai[2] = (float)npc.whoAmI; - Main.npc[lol].ai[1] = (float)Previous; - Main.npc[Previous].ai[0] = (float)lol; - //NetMessage.SendData(23, -1, -1, "", lol, 0f, 0f, 0f, 0); - Previous = lol; - } - TailSpawned = true; - } + if (!TailSpawned) + { + int Previous = npc.whoAmI; + for (int num36 = 0; num36 < 10; num36++) + { + int lol = 0; + if (num36 >= 0 && num36 < 9) + { + lol = NPC.NewNPC((int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.width / 2), mod.NPCType("UndeadWyrmBody"), npc.whoAmI); + } + else + { + lol = NPC.NewNPC((int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.width / 2), mod.NPCType("UndeadWyrmTail"), npc.whoAmI); + } + Main.npc[lol].realLife = npc.whoAmI; + Main.npc[lol].ai[2] = (float)npc.whoAmI; + Main.npc[lol].ai[1] = (float)Previous; + Main.npc[Previous].ai[0] = (float)lol; + //NetMessage.SendData(23, -1, -1, "", lol, 0f, 0f, 0f, 0); + Previous = lol; + } + TailSpawned = true; + } - if ((int)(Main.time % 180) == 0) - { - Vector2 vector = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height / 2)); - float birdRotation = (float)Math.Atan2(vector.Y - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), vector.X - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); - npc.velocity.X = (float)(Math.Cos(birdRotation) * 7) * -1; - npc.velocity.Y = (float)(Math.Sin(birdRotation) * 7) * -1; - npc.netUpdate = true; - } - } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Texture2D drawTexture = Main.npcTexture[npc.type]; - Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); + if ((int)(Main.time % 180) == 0) + { + Vector2 vector = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height / 2)); + float birdRotation = (float)Math.Atan2(vector.Y - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), vector.X - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); + npc.velocity.X = (float)(Math.Cos(birdRotation) * 7) * -1; + npc.velocity.Y = (float)(Math.Sin(birdRotation) * 7) * -1; + npc.netUpdate = true; + } + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D drawTexture = Main.npcTexture[npc.type]; + Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); - Vector2 drawPos = new Vector2( - npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, - npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); + Vector2 drawPos = new Vector2( + npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, + npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); - SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); + SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); - return false; - } - } + return false; + } + } } \ No newline at end of file diff --git a/NPCs/AndasBoss/UndeadWyrmTail.cs b/NPCs/AndasBoss/UndeadWyrmTail.cs index a5b412fc..c17172bf 100644 --- a/NPCs/AndasBoss/UndeadWyrmTail.cs +++ b/NPCs/AndasBoss/UndeadWyrmTail.cs @@ -7,58 +7,58 @@ namespace Tremor.NPCs.AndasBoss { - public class UndeadWyrmTail : ModNPC - { + public class UndeadWyrmTail : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Undead Wyrm"); } - - public override void SetDefaults() - { - npc.lifeMax = 1; - npc.damage = 65; - npc.defense = 30; - npc.width = 30; - npc.height = 62; - npc.noTileCollide = true; - npc.behindTiles = true; - npc.friendly = false; - npc.noGravity = true; - npc.aiStyle = 6; - npc.dontTakeDamage = false; - npc.HitSound = SoundID.NPCHit2; - npc.buffImmune[24] = true; - npc.buffImmune[67] = true; - npc.lavaImmune = true; - } - public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) - { - return false; - } - public override void AI() - { - if (!Main.npc[(int)npc.ai[1]].active) - { - npc.life = 0; - npc.HitEffect(0, 10.0); - npc.active = false; - } - } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Texture2D drawTexture = Main.npcTexture[npc.type]; - Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); - Vector2 drawPos = new Vector2( - npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, - npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); + public override void SetDefaults() + { + npc.lifeMax = 1; + npc.damage = 65; + npc.defense = 30; + npc.width = 30; + npc.height = 62; + npc.noTileCollide = true; + npc.behindTiles = true; + npc.friendly = false; + npc.noGravity = true; + npc.aiStyle = 6; + npc.dontTakeDamage = false; + npc.HitSound = SoundID.NPCHit2; + npc.buffImmune[24] = true; + npc.buffImmune[67] = true; + npc.lavaImmune = true; + } + public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) + { + return false; + } + public override void AI() + { + if (!Main.npc[(int)npc.ai[1]].active) + { + npc.life = 0; + npc.HitEffect(0, 10.0); + npc.active = false; + } + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D drawTexture = Main.npcTexture[npc.type]; + Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); - SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); + Vector2 drawPos = new Vector2( + npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, + npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); - return false; - } - } + SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); + + return false; + } + } } \ No newline at end of file diff --git a/NPCs/AngerSoul.cs b/NPCs/AngerSoul.cs index 5c70cf57..2f05fde3 100644 --- a/NPCs/AngerSoul.cs +++ b/NPCs/AngerSoul.cs @@ -7,66 +7,68 @@ using Terraria.ModLoader; -namespace Tremor.NPCs { - [AutoloadBossHead] - -public class AngerSoul : ModNPC +namespace Tremor.NPCs { + [AutoloadBossHead] + + public class AngerSoul : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Soul of Anger"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 750; - npc.damage = 26; - npc.defense = 5; - npc.knockBackResist = 1f; - npc.width = 60; - npc.height = 85; - animationType = 288; - npc.aiStyle = 17; - npc.npcSlots = 15f; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit31; - npc.noGravity = true; - npc.DeathSound = SoundID.NPCDeath6; - npc.value = Item.buyPrice(0, 2, 0, 9); - } - public override void AI() - { + + public override void SetDefaults() + { + npc.lifeMax = 750; + npc.damage = 26; + npc.defense = 5; + npc.knockBackResist = 1f; + npc.width = 60; + npc.height = 85; + animationType = 288; + npc.aiStyle = 17; + npc.npcSlots = 15f; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit31; + npc.noGravity = true; + npc.DeathSound = SoundID.NPCDeath6; + npc.value = Item.buyPrice(0, 2, 0, 9); + } + public override void AI() + { npc.position += npc.velocity * 2f; -if (Main.rand.Next(6) == 0) - { - int num706 = Dust.NewDust(npc.position, npc.width , npc.height, 64, 0f, 0f, 200, npc.color, 1f); - Main.dust[num706].velocity *= 0.3f; - } - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + if (Main.rand.Next(6) == 0) + { + int num706 = Dust.NewDust(npc.position, npc.width, npc.height, 64, 0f, 0f, 200, npc.color, 1f); + Main.dust[num706].velocity *= 0.3f; + } + } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Dust.NewDust(npc.position, npc.width, npc.height, 64, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 64, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 64, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 64, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 64, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 64, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 64, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); - Dust.NewDust(npc.position, npc.width, npc.height, 64, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 64, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); - } - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Dust.NewDust(npc.position, npc.width, npc.height, 64, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 64, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 64, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 64, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 64, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 64, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 64, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); + Dust.NewDust(npc.position, npc.width, npc.height, 64, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 64, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); + } + } + } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/ArabianMerchant.cs b/NPCs/ArabianMerchant.cs index b2090215..1e914570 100644 --- a/NPCs/ArabianMerchant.cs +++ b/NPCs/ArabianMerchant.cs @@ -7,10 +7,11 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { -[AutoloadHead] -public class ArabianMerchant : ModNPC +namespace Tremor.NPCs { + [AutoloadHead] + public class ArabianMerchant : ModNPC + { public override string Texture { get @@ -18,12 +19,12 @@ public override string Texture return "Tremor/NPCs/ArabianMerchant"; } } - + public override string[] AltTextures { get { - return new string[] { "Tremor/NPCs/ArabianMerchant"}; + return new string[] { "Tremor/NPCs/ArabianMerchant" }; } } @@ -44,169 +45,170 @@ public override void SetStaticDefaults() NPCID.Sets.AttackTime[npc.type] = 30; NPCID.Sets.AttackAverageChance[npc.type] = 30; } - public override void SetDefaults() - { - npc.townNPC = true; - npc.friendly = true; - npc.width = 28; - npc.height = 48; - npc.aiStyle = 7; - npc.damage = 10; - npc.defense = 15; - npc.lifeMax = 250; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.knockBackResist = 0.5f; - //npc.homeless = true; - //npc.active = false; - animationType = NPCID.Guide; - } - - public override bool CanTownNPCSpawn(int numTownNPCs, int money) - { - if(TremorWorld.downedRukh) - { - return true; - } + public override void SetDefaults() + { + npc.townNPC = true; + npc.friendly = true; + npc.width = 28; + npc.height = 48; + npc.aiStyle = 7; + npc.damage = 10; + npc.defense = 15; + npc.lifeMax = 250; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.knockBackResist = 0.5f; + //npc.homeless = true; + //npc.active = false; + animationType = NPCID.Guide; + } + + public override bool CanTownNPCSpawn(int numTownNPCs, int money) + { + if (TremorWorld.downedRukh) + { + return true; + } return false; - } - - public override string TownNPCName() - { - switch(WorldGen.genRand.Next(5)) - { - case 0: - return "Badruddin"; - case 1: - return "Galib"; - case 2: - return "Salavat"; - case 3: - return "Zafar"; - case 4: - return "Valid"; - case 5: - return "Tunak"; - default: - return "Nadim"; - } - } - - public override string GetChat() - { - switch(Main.rand.Next(6)) - { - case 0: - return "Salam aleykum! Do you need anything?"; - case 1: - return "I got some sand in my pockets. I think throwing it will hurt your eyes."; - case 2: - return "My wear was absolutely white long time ago. Maybe I should wash it with this perfect yellow water?"; - case 3: - return "There are stories about what happened in the sands of this desert. But I won't tell you anything."; - case 4: - return "In case something will happen with me... I bequeath you all my sand."; - case 5: - return "The sands are telling me that... That... Ugh... That you will buy everything!"; - default: - return "The sands are moving... Be careful or you will be sucked into unknown depths!"; - } - } - - public override void SetChatButtons(ref string button, ref string button2) - { - button = Lang.inter[28].Value; - } - - public override void OnChatButtonClicked(bool firstButton, ref bool shop) - { - if(firstButton) - { - shop = true; - } - } - - public override void SetupShop(Chest shop, ref int nextSlot) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("GenieLamp")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("JavaHood")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("JavaRobe")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("SandstoneRing")); - nextSlot++; - if(NPC.downedBoss1) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("FossilSugar")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("DesertCrown")); - nextSlot++; - } - if(NPC.downedBoss2) - { - shop.item[nextSlot].SetDefaults(3378); - nextSlot++; - shop.item[nextSlot].SetDefaults(3379); - nextSlot++; - } - if(Main.hardMode) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("DesertEagle")); - nextSlot++; - } - } - - public override void TownNPCAttackStrength(ref int damage, ref float knockback) - { - damage = 30; - knockback = 3f; - } - - public override void TownNPCAttackCooldown(ref int cooldown, ref int randExtraCooldown) - { - cooldown = 10; - randExtraCooldown = 10; - } - - public override void TownNPCAttackProj(ref int projType, ref int attackDelay) - { - projType = mod.ProjectileType("Sand"); - attackDelay = 4; - } - - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("WhiteTurban")); - }; - } - } - - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ArabianMerchantGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ArabianMerchantGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ArabianMerchantGore3"), 1f); - } -} - - - public override void TownNPCAttackProjSpeed(ref float multiplier, ref float gravityCorrection, ref float randomOffset) - { - multiplier = 12f; - randomOffset = 2f; - } -}} \ No newline at end of file + } + + public override string TownNPCName() + { + switch (WorldGen.genRand.Next(5)) + { + case 0: + return "Badruddin"; + case 1: + return "Galib"; + case 2: + return "Salavat"; + case 3: + return "Zafar"; + case 4: + return "Valid"; + case 5: + return "Tunak"; + default: + return "Nadim"; + } + } + + public override string GetChat() + { + switch (Main.rand.Next(6)) + { + case 0: + return "Salam aleykum! Do you need anything?"; + case 1: + return "I got some sand in my pockets. I think throwing it will hurt your eyes."; + case 2: + return "My wear was absolutely white long time ago. Maybe I should wash it with this perfect yellow water?"; + case 3: + return "There are stories about what happened in the sands of this desert. But I won't tell you anything."; + case 4: + return "In case something will happen with me... I bequeath you all my sand."; + case 5: + return "The sands are telling me that... That... Ugh... That you will buy everything!"; + default: + return "The sands are moving... Be careful or you will be sucked into unknown depths!"; + } + } + + public override void SetChatButtons(ref string button, ref string button2) + { + button = Lang.inter[28].Value; + } + + public override void OnChatButtonClicked(bool firstButton, ref bool shop) + { + if (firstButton) + { + shop = true; + } + } + + public override void SetupShop(Chest shop, ref int nextSlot) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("GenieLamp")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("JavaHood")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("JavaRobe")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("SandstoneRing")); + nextSlot++; + if (NPC.downedBoss1) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("FossilSugar")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("DesertCrown")); + nextSlot++; + } + if (NPC.downedBoss2) + { + shop.item[nextSlot].SetDefaults(3378); + nextSlot++; + shop.item[nextSlot].SetDefaults(3379); + nextSlot++; + } + if (Main.hardMode) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("DesertEagle")); + nextSlot++; + } + } + + public override void TownNPCAttackStrength(ref int damage, ref float knockback) + { + damage = 30; + knockback = 3f; + } + + public override void TownNPCAttackCooldown(ref int cooldown, ref int randExtraCooldown) + { + cooldown = 10; + randExtraCooldown = 10; + } + + public override void TownNPCAttackProj(ref int projType, ref int attackDelay) + { + projType = mod.ProjectileType("Sand"); + attackDelay = 4; + } + + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("WhiteTurban")); + }; + } + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ArabianMerchantGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ArabianMerchantGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ArabianMerchantGore3"), 1f); + } + } + + + public override void TownNPCAttackProjSpeed(ref float multiplier, ref float gravityCorrection, ref float randomOffset) + { + multiplier = 12f; + randomOffset = 2f; + } + } +} \ No newline at end of file diff --git a/NPCs/ArchDemon.cs b/NPCs/ArchDemon.cs index 1920557c..1c00e284 100644 --- a/NPCs/ArchDemon.cs +++ b/NPCs/ArchDemon.cs @@ -6,63 +6,65 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class ArchDemon : ModNPC +namespace Tremor.NPCs { + + public class ArchDemon : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Arch Demon"); Main.npcFrameCount[npc.type] = 2; } - - public override void SetDefaults() - { - npc.lifeMax = 300; - npc.damage = 62; - npc.defense = 2; - npc.knockBackResist = 0.3f; - npc.width = 66; - npc.height = 58; -animationType = 62; - npc.aiStyle = 14; - npc.npcSlots = 15f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 2, 50); - banner = npc.type; - bannerItem = mod.ItemType("ArchDemonBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 300; + npc.damage = 62; + npc.defense = 2; + npc.knockBackResist = 0.3f; + npc.width = 66; + npc.height = 58; + animationType = 62; + npc.aiStyle = 14; + npc.npcSlots = 15f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 0, 2, 50); + banner = npc.type; + bannerItem = mod.ItemType("ArchDemonBanner"); + } - public override void AI() - { - if(Main.rand.Next(125) == 0) - { - NPC.NewNPC((int)npc.position.X - 50, (int)npc.position.Y, mod.NPCType("FlamingReaper")); - } - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } + + public override void AI() + { + if (Main.rand.Next(125) == 0) + { + NPC.NewNPC((int)npc.position.X - 50, (int)npc.position.Y, mod.NPCType("FlamingReaper")); + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ArchdemonGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ArchdemonGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ArchdemonGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ArchdemonGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ArchdemonGore3"), 1f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ArchdemonGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ArchdemonGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ArchdemonGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ArchdemonGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ArchdemonGore3"), 1f); + } + } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/Archer.cs b/NPCs/Archer.cs index 8be991e2..5ec912d6 100644 --- a/NPCs/Archer.cs +++ b/NPCs/Archer.cs @@ -6,10 +6,11 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { -[AutoloadHead] -public class Archer : ModNPC +namespace Tremor.NPCs { + [AutoloadHead] + public class Archer : ModNPC + { public override string Texture { get @@ -17,12 +18,12 @@ public override string Texture return "Tremor/NPCs/Archer"; } } - + public override string[] AltTextures { get { - return new string[] { "Tremor/NPCs/Archer"}; + return new string[] { "Tremor/NPCs/Archer" }; } } @@ -44,177 +45,178 @@ public override void SetStaticDefaults() NPCID.Sets.AttackAverageChance[npc.type] = 30; } - public override void SetDefaults() - { - npc.townNPC = true; - npc.friendly = true; - npc.width = 30; - npc.height = 48; - npc.aiStyle = 7; - npc.damage = 10; - npc.defense = 15; - npc.lifeMax = 250; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.knockBackResist = 0.5f; - animationType = NPCID.Guide; - } - - public override bool CanTownNPCSpawn(int numTownNPCs, int money) - { - return true; - } - - - public override string TownNPCName() - { - switch(WorldGen.genRand.Next(4)) - { - case 0: - return "Richard"; - case 1: - return "Arthur"; - case 2: - return "Jack"; - case 3: - return "William"; - case 4: - return "Robin"; - default: - return "Wales"; - } - } - - public override string GetChat() - { - switch(Main.rand.Next(6)) - { - case 0: - return "You'd have to be a very good archer in order to shoot an arrow into a knee."; - case 1: - return "I'd like to get my hands on a goblintech bow. Those things can shoot multiple arrows."; - case 2: - return "I deal in long distance death! Have a look at my wares."; - case 3: - return "I will shoot you with my best arrow if you will not buy anything!"; - case 4: - return "Guns? Guns are for cowards!"; - default: - return "You don't need to make arrows. You need to buy them!"; - } - } - - public override void SetChatButtons(ref string button, ref string button2) - { - button = Lang.inter[28].Value; - } - - public override void OnChatButtonClicked(bool firstButton, ref bool shop) - { - if(firstButton) - { - shop = true; - } - } - - public override void SetupShop(Chest shop, ref int nextSlot) - { - shop.item[nextSlot].SetDefaults(40); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("ArcherGlove")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("Crossbow")); - nextSlot++; - if(NPC.downedBoss1) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("Quiver")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("MiniGun")); - nextSlot++; - shop.item[nextSlot].SetDefaults(51); - nextSlot++; - } - if(NPC.downedBoss2) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("DragonGem")); - nextSlot++; - shop.item[nextSlot].SetDefaults(47); - nextSlot++; - } - - if(Main.hardMode) - { - shop.item[nextSlot].SetDefaults(516); - nextSlot++; - shop.item[nextSlot].SetDefaults(265); - nextSlot++; - } - - if(Main.bloodMoon) - { - shop.item[nextSlot].SetDefaults(3003); - nextSlot++; - } - } - - public override void TownNPCAttackStrength(ref int damage, ref float knockback) - { - damage = 20; - knockback = 4f; - } - - public override void TownNPCAttackCooldown(ref int cooldown, ref int randExtraCooldown) - { - cooldown = 10; - randExtraCooldown = 10; - } - - public override void DrawTownAttackGun(ref float scale, ref int item, ref int closeness) //Allows you to customize how this town NPC's weapon is drawn when this NPC is shooting (this NPC must have an attack type of 1). Scale is a multiplier for the item's drawing size, item is the ID of the item to be drawn, and closeness is how close the item should be drawn to the NPC. - { - scale = 1f; - if(!Main.hardMode) - { - item = 44; - } - if(Main.hardMode) - { - item = 3052; - } - closeness = 20; - } - public override void TownNPCAttackProj(ref int projType, ref int attackDelay)//Allows you to determine the projectile type of this town NPC's attack, and how long it takes for the projectile to actually appear - { - if(!Main.hardMode) - { - projType = ProjectileID.FlamingArrow; - } - if(Main.hardMode) - { - projType = 495; - } - attackDelay = 1; - } - - public override void TownNPCAttackProjSpeed(ref float multiplier, ref float gravityCorrection, ref float randomOffset)//Allows you to determine the speed at which this town NPC throws a projectile when it attacks. Multiplier is the speed of the projectile, gravityCorrection is how much extra the projectile gets thrown upwards, and randomOffset allows you to randomize the projectile's velocity in a square centered around the original velocity - { - multiplier = 7f; - // randomOffset = 4f; - - } - - - - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ArcherGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ArcherGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ArcherGore3"), 1f); - } -} -}} \ No newline at end of file + public override void SetDefaults() + { + npc.townNPC = true; + npc.friendly = true; + npc.width = 30; + npc.height = 48; + npc.aiStyle = 7; + npc.damage = 10; + npc.defense = 15; + npc.lifeMax = 250; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.knockBackResist = 0.5f; + animationType = NPCID.Guide; + } + + public override bool CanTownNPCSpawn(int numTownNPCs, int money) + { + return true; + } + + + public override string TownNPCName() + { + switch (WorldGen.genRand.Next(4)) + { + case 0: + return "Richard"; + case 1: + return "Arthur"; + case 2: + return "Jack"; + case 3: + return "William"; + case 4: + return "Robin"; + default: + return "Wales"; + } + } + + public override string GetChat() + { + switch (Main.rand.Next(6)) + { + case 0: + return "You'd have to be a very good archer in order to shoot an arrow into a knee."; + case 1: + return "I'd like to get my hands on a goblintech bow. Those things can shoot multiple arrows."; + case 2: + return "I deal in long distance death! Have a look at my wares."; + case 3: + return "I will shoot you with my best arrow if you will not buy anything!"; + case 4: + return "Guns? Guns are for cowards!"; + default: + return "You don't need to make arrows. You need to buy them!"; + } + } + + public override void SetChatButtons(ref string button, ref string button2) + { + button = Lang.inter[28].Value; + } + + public override void OnChatButtonClicked(bool firstButton, ref bool shop) + { + if (firstButton) + { + shop = true; + } + } + + public override void SetupShop(Chest shop, ref int nextSlot) + { + shop.item[nextSlot].SetDefaults(40); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("ArcherGlove")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("Crossbow")); + nextSlot++; + if (NPC.downedBoss1) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("Quiver")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("MiniGun")); + nextSlot++; + shop.item[nextSlot].SetDefaults(51); + nextSlot++; + } + if (NPC.downedBoss2) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("DragonGem")); + nextSlot++; + shop.item[nextSlot].SetDefaults(47); + nextSlot++; + } + + if (Main.hardMode) + { + shop.item[nextSlot].SetDefaults(516); + nextSlot++; + shop.item[nextSlot].SetDefaults(265); + nextSlot++; + } + + if (Main.bloodMoon) + { + shop.item[nextSlot].SetDefaults(3003); + nextSlot++; + } + } + + public override void TownNPCAttackStrength(ref int damage, ref float knockback) + { + damage = 20; + knockback = 4f; + } + + public override void TownNPCAttackCooldown(ref int cooldown, ref int randExtraCooldown) + { + cooldown = 10; + randExtraCooldown = 10; + } + + public override void DrawTownAttackGun(ref float scale, ref int item, ref int closeness) //Allows you to customize how this town NPC's weapon is drawn when this NPC is shooting (this NPC must have an attack type of 1). Scale is a multiplier for the item's drawing size, item is the ID of the item to be drawn, and closeness is how close the item should be drawn to the NPC. + { + scale = 1f; + if (!Main.hardMode) + { + item = 44; + } + if (Main.hardMode) + { + item = 3052; + } + closeness = 20; + } + public override void TownNPCAttackProj(ref int projType, ref int attackDelay)//Allows you to determine the projectile type of this town NPC's attack, and how long it takes for the projectile to actually appear + { + if (!Main.hardMode) + { + projType = ProjectileID.FlamingArrow; + } + if (Main.hardMode) + { + projType = 495; + } + attackDelay = 1; + } + + public override void TownNPCAttackProjSpeed(ref float multiplier, ref float gravityCorrection, ref float randomOffset)//Allows you to determine the speed at which this town NPC throws a projectile when it attacks. Multiplier is the speed of the projectile, gravityCorrection is how much extra the projectile gets thrown upwards, and randomOffset allows you to randomize the projectile's velocity in a square centered around the original velocity + { + multiplier = 7f; + // randomOffset = 4f; + + } + + + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ArcherGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ArcherGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ArcherGore3"), 1f); + } + } + } +} \ No newline at end of file diff --git a/NPCs/ArmoredJellyfish.cs b/NPCs/ArmoredJellyfish.cs index 96f8efce..a14be40f 100644 --- a/NPCs/ArmoredJellyfish.cs +++ b/NPCs/ArmoredJellyfish.cs @@ -7,72 +7,74 @@ using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class ArmoredJellyfish : ModNPC +namespace Tremor.NPCs { + + public class ArmoredJellyfish : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Armored Jellyfish"); Main.npcFrameCount[npc.type] = 7; } - - public override void SetDefaults() - { - npc.lifeMax = 40; - npc.damage = 12; - npc.defense = 20; - npc.knockBackResist = 0.3f; - npc.width = 62; - npc.height = 46; - animationType = 242; - npc.aiStyle = 18; - npc.npcSlots = 0.7f; - npc.HitSound = SoundID.NPCHit47; - npc.DeathSound = SoundID.NPCDeath23; - npc.value = Item.buyPrice(0, 0, 6, 3); - banner = npc.type; - bannerItem = mod.ItemType("ArmoredJellyfishBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 40; + npc.damage = 12; + npc.defense = 20; + npc.knockBackResist = 0.3f; + npc.width = 62; + npc.height = 46; + animationType = 242; + npc.aiStyle = 18; + npc.npcSlots = 0.7f; + npc.HitSound = SoundID.NPCHit47; + npc.DeathSound = SoundID.NPCDeath23; + npc.value = Item.buyPrice(0, 0, 6, 3); + banner = npc.type; + bannerItem = mod.ItemType("ArmoredJellyfishBanner"); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ArmoredGore"), 1f); - } -} + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 68); - }; - } - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ArmoredGore"), 1f); + } + } + + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 68); + }; + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return spawnInfo.player.ZoneCorrupt && y > Main.rockLayer ? 0.05f : 0f; - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return spawnInfo.player.ZoneCorrupt && y > Main.rockLayer ? 0.05f : 0f; + } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/Astrofly.cs b/NPCs/Astrofly.cs index ab333ddf..eb5ed151 100644 --- a/NPCs/Astrofly.cs +++ b/NPCs/Astrofly.cs @@ -7,99 +7,101 @@ using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Astrofly : ModNPC +namespace Tremor.NPCs { + + public class Astrofly : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Astrofly"); Main.npcFrameCount[npc.type] = 7; } - - public override void SetDefaults() - { - npc.lifeMax = 5000; - npc.damage = 160; - npc.defense = 115; - npc.knockBackResist = 0.2f; - npc.width = 56; - npc.height = 12; - animationType = 156; - npc.aiStyle = 22; - npc.npcSlots = 15f; - npc.noTileCollide = true; - npc.noGravity = true; - npc.HitSound = SoundID.NPCHit3; - npc.noGravity = true; - npc.DeathSound = SoundID.NPCDeath5; - npc.value = Item.buyPrice(0, 2, 4, 9); - banner = npc.type; - bannerItem = mod.ItemType("AstroflyBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 5000; + npc.damage = 160; + npc.defense = 115; + npc.knockBackResist = 0.2f; + npc.width = 56; + npc.height = 12; + animationType = 156; + npc.aiStyle = 22; + npc.npcSlots = 15f; + npc.noTileCollide = true; + npc.noGravity = true; + npc.HitSound = SoundID.NPCHit3; + npc.noGravity = true; + npc.DeathSound = SoundID.NPCDeath5; + npc.value = Item.buyPrice(0, 2, 4, 9); + banner = npc.type; + bannerItem = mod.ItemType("AstroflyBanner"); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CometiteOre"), Main.rand.Next(2,5)); - } - if(Main.rand.Next(6) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HardCometiteOre"), Main.rand.Next(1,3)); - } - } - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return spawnInfo.spawnTileY < Main.rockLayer && NPC.downedMoonlord && tile == mod.TileType("CometiteOreTile") || tile == mod.TileType("HardCometiteOreTile") ? 0.005f : 0f; - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CometiteOre"), Main.rand.Next(2, 5)); + } + if (Main.rand.Next(6) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HardCometiteOre"), Main.rand.Next(1, 3)); + } + } + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return spawnInfo.spawnTileY < Main.rockLayer && NPC.downedMoonlord && tile == mod.TileType("CometiteOreTile") || tile == mod.TileType("HardCometiteOreTile") ? 0.005f : 0f; + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AstroflyGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AstroflyGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AstroflyGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AstroflyGore3"), 1f); - } - else - { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 59, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AstroflyGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AstroflyGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AstroflyGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AstroflyGore3"), 1f); + } + else + { + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 59, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, (float)hitDirection, -1f, 0, default(Color), 0.7f); + } + } + } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/Atis.cs b/NPCs/Atis.cs index 310db33b..b21ff450 100644 --- a/NPCs/Atis.cs +++ b/NPCs/Atis.cs @@ -7,94 +7,96 @@ using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Atis : ModNPC +namespace Tremor.NPCs { + + public class Atis : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Atis"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 140; - npc.damage = 15; - npc.defense = 10; - npc.knockBackResist = 0.6f; - npc.width = 34; - npc.height = 48; - animationType = 82; - npc.aiStyle = 22; - npc.npcSlots = 0.4f; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit31; - npc.noGravity = true; - npc.DeathSound = SoundID.NPCDeath6; - npc.value = Item.buyPrice(0, 0, 4, 15); - banner = npc.type; - bannerItem = mod.ItemType("AtisBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 140; + npc.damage = 15; + npc.defense = 10; + npc.knockBackResist = 0.6f; + npc.width = 34; + npc.height = 48; + animationType = 82; + npc.aiStyle = 22; + npc.npcSlots = 0.4f; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit31; + npc.noGravity = true; + npc.DeathSound = SoundID.NPCDeath6; + npc.value = Item.buyPrice(0, 0, 4, 15); + banner = npc.type; + bannerItem = mod.ItemType("AtisBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AtisGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AtisGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AtisGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AtisGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AtisGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AtisGore2"), 1f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AtisGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AtisGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AtisGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AtisGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AtisGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AtisGore2"), 1f); + } + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(25) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HeartofAtis")); - }; - if(Main.rand.Next(25) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BoneMask")); - }; - if(Main.hardMode && Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("RawMeat")); - }; - if (Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AtisBlood"), Main.rand.Next(1,2)); - }; - if (Main.rand.Next(30) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 1325); - }; - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(25) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HeartofAtis")); + }; + if (Main.rand.Next(25) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BoneMask")); + }; + if (Main.hardMode && Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("RawMeat")); + }; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AtisBlood"), Main.rand.Next(1, 2)); + }; + if (Main.rand.Next(30) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 1325); + }; + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && y > Main.rockLayer ? 0.01f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && y > Main.rockLayer ? 0.01f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/Avenger.cs b/NPCs/Avenger.cs index 1b91123d..1a2dd392 100644 --- a/NPCs/Avenger.cs +++ b/NPCs/Avenger.cs @@ -8,92 +8,92 @@ namespace Tremor.NPCs { - public class Avenger : ModNPC - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Avenger"); - Main.npcFrameCount[npc.type] = 4; - } + public class Avenger : ModNPC + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Avenger"); + Main.npcFrameCount[npc.type] = 4; + } - public override void SetDefaults() - { - npc.lifeMax = 1750; - npc.damage = 165; - npc.defense = 80; - npc.knockBackResist = 0.0f; - npc.width = 80; - npc.height = 80; - animationType = 82; - npc.aiStyle = 97; - aiType = 420; - npc.npcSlots = 0.4f; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit4; - npc.noGravity = true; - npc.DeathSound = SoundID.NPCDeath6; - npc.value = Item.buyPrice(0, 0, 4, 15); - banner = npc.type; - bannerItem = mod.ItemType("AvengerBanner"); - } + public override void SetDefaults() + { + npc.lifeMax = 1750; + npc.damage = 165; + npc.defense = 80; + npc.knockBackResist = 0.0f; + npc.width = 80; + npc.height = 80; + animationType = 82; + npc.aiStyle = 97; + aiType = 420; + npc.npcSlots = 0.4f; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit4; + npc.noGravity = true; + npc.DeathSound = SoundID.NPCDeath6; + npc.value = Item.buyPrice(0, 0, 4, 15); + banner = npc.type; + bannerItem = mod.ItemType("AvengerBanner"); + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if (npc.life > 0) - { - int num85 = Dust.NewDust(npc.position, npc.width, npc.height, 71, 0f, 0f, 200, default(Color), 1f); - Main.dust[num85].velocity *= 1.5f; - } - else - { - for (int num86 = 0; num86 < 50; num86++) - { - int num87 = Dust.NewDust(npc.position, npc.width, npc.height, 71, (float)hitDirection, 0f, 200, default(Color), 1f); - Main.dust[num87].velocity *= 1.5f; - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AvengerGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AvengerGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AvengerGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AvengerGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AvengerGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AvengerGore4"), 1f); - } - } - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life > 0) + { + int num85 = Dust.NewDust(npc.position, npc.width, npc.height, 71, 0f, 0f, 200, default(Color), 1f); + Main.dust[num85].velocity *= 1.5f; + } + else + { + for (int num86 = 0; num86 < 50; num86++) + { + int num87 = Dust.NewDust(npc.position, npc.width, npc.height, 71, (float)hitDirection, 0f, 200, default(Color), 1f); + Main.dust[num87].velocity *= 1.5f; + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AvengerGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AvengerGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AvengerGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AvengerGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AvengerGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/AvengerGore4"), 1f); + } + } + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if (Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CarbonSteel"), Main.rand.Next(1, 3)); - } - if (Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GoldenClaw"), Main.rand.Next(1, 5)); - } - if (Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AngryShard"), Main.rand.Next(1, 2)); - } - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CarbonSteel"), Main.rand.Next(1, 3)); + } + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GoldenClaw"), Main.rand.Next(1, 5)); + } + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AngryShard"), Main.rand.Next(1, 2)); + } + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.03f : 0f; - } - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.03f : 0f; + } + } } \ No newline at end of file diff --git a/NPCs/BGiantSlime.cs b/NPCs/BGiantSlime.cs index f9860347..9396981b 100644 --- a/NPCs/BGiantSlime.cs +++ b/NPCs/BGiantSlime.cs @@ -7,75 +7,77 @@ using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class BGiantSlime : ModNPC +namespace Tremor.NPCs { - + + public class BGiantSlime : ModNPC + { + public override void SetStaticDefaults() { DisplayName.SetDefault("Blue Slime"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 1200; - npc.damage = 100; - npc.defense = 30; - npc.knockBackResist = 0.3f; - npc.width = 70; - npc.alpha = 175; - npc.color = new Color(0, 80, 255, 100); - npc.height = 46; - animationType = 244; - npc.aiStyle = 1; - aiType = 138; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath23; - npc.value = Item.buyPrice(0, 0, 12, 15); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 1200; + npc.damage = 100; + npc.defense = 30; + npc.knockBackResist = 0.3f; + npc.width = 70; + npc.alpha = 175; + npc.color = new Color(0, 80, 255, 100); + npc.height = 46; + animationType = 244; + npc.aiStyle = 1; + aiType = 138; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath23; + npc.value = Item.buyPrice(0, 0, 12, 15); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Blue, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Blue, 0.7f); - } - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Blue, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Blue, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Blue, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 1, 2.5f * (float)hitDirection, -2.5f, 0, Color.Blue, 0.7f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Blue, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Blue, 0.7f); + } + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Blue, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Blue, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Blue, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 1, 2.5f * (float)hitDirection, -2.5f, 0, Color.Blue, 0.7f); + } + } public override float SpawnChance(NPCSpawnInfo spawnInfo) { return spawnInfo.spawnTileY < Main.rockLayer && Main.hardMode && Tremor.NoInvasion(spawnInfo) && NPC.downedMoonlord && Main.dayTime ? 0.02f : 0f; } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 23); - }; - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 23); + }; + } + } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/Banshee.cs b/NPCs/Banshee.cs index 676aa8db..5f69550a 100644 --- a/NPCs/Banshee.cs +++ b/NPCs/Banshee.cs @@ -14,7 +14,7 @@ public override void SetStaticDefaults() DisplayName.SetDefault("Banshee"); Main.npcFrameCount[npc.type] = 9; } - + public override void SetDefaults() { npc.width = 50; @@ -24,38 +24,38 @@ public override void SetDefaults() npc.lifeMax = 250; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath6; - npc.value = Item.buyPrice(0, 0, 5, 7); + npc.value = Item.buyPrice(0, 0, 5, 7); npc.knockBackResist = 0.3f; npc.aiStyle = 3; aiType = 529; animationType = 529; - npc.buffImmune[20] = true; - npc.buffImmune[31] = false; - npc.buffImmune[24] = true; - banner = npc.type; - bannerItem = mod.ItemType("BansheeBanner"); + npc.buffImmune[20] = true; + npc.buffImmune[31] = false; + npc.buffImmune[24] = true; + banner = npc.type; + bannerItem = mod.ItemType("BansheeBanner"); NPCID.Sets.TrailCacheLength[npc.type] = 5; } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Vector2 drawOrigin = new Vector2(Main.npcTexture[npc.type].Width, Main.npcTexture[npc.type].Height * 0.8f); for (int k = 0; k < npc.oldPos.Length; k++) { - SpriteEffects effect = SpriteEffects.None; - if (npc.direction ==1) {effect = SpriteEffects.FlipHorizontally;} - if (npc.direction ==-1) {effect = SpriteEffects.None;} + SpriteEffects effect = SpriteEffects.None; + if (npc.direction == 1) { effect = SpriteEffects.FlipHorizontally; } + if (npc.direction == -1) { effect = SpriteEffects.None; } Vector2 drawPos = npc.oldPos[k] - Main.screenPosition; Color color = npc.GetAlpha(lightColor) * ((float)(npc.oldPos.Length - k) / (float)npc.oldPos.Length); - Rectangle frame = new Rectangle(0, 0, 50, 62); -frame.Y += 164 * (k / 60); + Rectangle frame = new Rectangle(0, 0, 50, 62); + frame.Y += 164 * (k / 60); spriteBatch.Draw(Main.npcTexture[npc.type], drawPos, frame, color, 0, Vector2.Zero, npc.scale, effect, 1f); @@ -63,80 +63,81 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) return true; } - public override void AI() - { + public override void AI() + { -if (Main.rand.Next(500) == 0) - { - Main.PlaySound(101, (int)npc.position.X, (int)npc.position.Y, 1); - } -if (Main.rand.Next(500) == 0) - { - Main.PlaySound(100, (int)npc.position.X, (int)npc.position.Y, 1); - }if (Main.rand.Next(500) == 0) - { - Main.PlaySound(102, (int)npc.position.X, (int)npc.position.Y, 1); - } -for (int num74 = npc.oldPos.Length - 1; num74 > 0; num74--) -{ -npc.oldPos[num74] = npc.oldPos[num74 - 1]; -} -npc.oldPos[0] = npc.position; - } + if (Main.rand.Next(500) == 0) + { + Main.PlaySound(101, (int)npc.position.X, (int)npc.position.Y, 1); + } + if (Main.rand.Next(500) == 0) + { + Main.PlaySound(100, (int)npc.position.X, (int)npc.position.Y, 1); + } + if (Main.rand.Next(500) == 0) + { + Main.PlaySound(102, (int)npc.position.X, (int)npc.position.Y, 1); + } + for (int num74 = npc.oldPos.Length - 1; num74 > 0; num74--) + { + npc.oldPos[num74] = npc.oldPos[num74 - 1]; + } + npc.oldPos[0] = npc.position; + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 177, 2); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 178, 2); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 179, 2); - }; - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 180, 2); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 181, 2); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 182, 2); - }; - if(Main.rand.Next(32) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ThunderRay")); - }; - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 177, 2); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 178, 2); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 179, 2); + }; + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 180, 2); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 181, 2); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 182, 2); + }; + if (Main.rand.Next(32) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ThunderRay")); + }; + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BansheeGore1"), 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BansheeGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BansheeGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BansheeGore3"), 1f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BansheeGore1"), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BansheeGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BansheeGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BansheeGore3"), 1f); + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && y > Main.rockLayer ? 0.004f : 0f; - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && y > Main.rockLayer ? 0.004f : 0f; + } } } diff --git a/NPCs/Barmadillo.cs b/NPCs/Barmadillo.cs index 9f3a8615..753ce645 100644 --- a/NPCs/Barmadillo.cs +++ b/NPCs/Barmadillo.cs @@ -7,99 +7,101 @@ using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Barmadillo : ModNPC +namespace Tremor.NPCs { + + public class Barmadillo : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Barmadillo"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 12500; - npc.damage = 120; - npc.defense = 100; - npc.knockBackResist = 0.3f; - npc.width = 100; - npc.height = 100; - npc.aiStyle = 2; - aiType = 180; - animationType = 48; - npc.aiStyle = 2; - npc.npcSlots = 0.5f; - npc.noTileCollide = true; - npc.buffImmune[20] = true; - npc.buffImmune[24] = true; - npc.buffImmune[39] = true; - npc.buffImmune[31] = false; - npc.HitSound = SoundID.NPCHit1; - npc.noGravity = true; - npc.DeathSound = SoundID.NPCDeath57; - banner = npc.type; - bannerItem = mod.ItemType("BarmadilloBanner"); - } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 44, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BarmadilloGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BarmadilloGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BarmadilloGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BarmadilloGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BarmadilloGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BarmadilloGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BarmadilloGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BarmadilloGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BarmadilloGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BarmadilloGore4"), 1f); - } - else - { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 44, (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } - } + public override void SetDefaults() + { + npc.lifeMax = 12500; + npc.damage = 120; + npc.defense = 100; + npc.knockBackResist = 0.3f; + npc.width = 100; + npc.height = 100; + npc.aiStyle = 2; + aiType = 180; + animationType = 48; + npc.aiStyle = 2; + npc.npcSlots = 0.5f; + npc.noTileCollide = true; + npc.buffImmune[20] = true; + npc.buffImmune[24] = true; + npc.buffImmune[39] = true; + npc.buffImmune[31] = false; + npc.HitSound = SoundID.NPCHit1; + npc.noGravity = true; + npc.DeathSound = SoundID.NPCDeath57; + banner = npc.type; + bannerItem = mod.ItemType("BarmadilloBanner"); + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 44, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BarmadilloGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BarmadilloGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BarmadilloGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BarmadilloGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BarmadilloGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BarmadilloGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BarmadilloGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BarmadilloGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BarmadilloGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BarmadilloGore4"), 1f); + } + else + { + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 44, (float)hitDirection, -1f, 0, default(Color), 0.7f); + } + } + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Blasticyde"), Main.rand.Next(1,3)); - } - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LapisLazuli"), Main.rand.Next(2,4)); - } - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Blasticyde"), Main.rand.Next(1, 3)); + } + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LapisLazuli"), Main.rand.Next(2, 4)); + } + } + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return Main.hardMode && TremorWorld.downedTrinity && !spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.002f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return Main.hardMode && TremorWorld.downedTrinity && !spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.002f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/BetaWolf.cs b/NPCs/BetaWolf.cs index 2f94890f..54320faf 100644 --- a/NPCs/BetaWolf.cs +++ b/NPCs/BetaWolf.cs @@ -6,76 +6,78 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class BetaWolf : ModNPC +namespace Tremor.NPCs { + + public class BetaWolf : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Beta Wolf"); Main.npcFrameCount[npc.type] = 9; } - - public override void SetDefaults() - { - npc.lifeMax = 62; - npc.damage = 25; - npc.defense = 6; - npc.knockBackResist = 0.6f; - npc.width = 68; - npc.height = 33; - animationType = 155; - npc.aiStyle = 26; - npc.npcSlots = 0.4f; - npc.HitSound = SoundID.NPCHit6; - npc.DeathSound = SoundID.NPCDeath5; - npc.value = Item.buyPrice(0, 0, 4, 0); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 62; + npc.damage = 25; + npc.defense = 6; + npc.knockBackResist = 0.6f; + npc.width = 68; + npc.height = 33; + animationType = 155; + npc.aiStyle = 26; + npc.npcSlots = 0.4f; + npc.HitSound = SoundID.NPCHit6; + npc.DeathSound = SoundID.NPCDeath5; + npc.value = Item.buyPrice(0, 0, 4, 0); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("WolfPelt"), Main.rand.Next(1,2)); - } - if(Main.rand.Next(25) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FurCoat")); - }; - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("WolfPelt"), Main.rand.Next(1, 2)); + } + if (Main.rand.Next(25) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FurCoat")); + }; + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BetaWolfGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BetaWolfGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WolfGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WolfGore1"), 1f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BetaWolfGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BetaWolfGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WolfGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WolfGore1"), 1f); + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneSnow && y < Main.worldSurface ? 0.01f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneSnow && y < Main.worldSurface ? 0.01f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/Bicholmere.cs b/NPCs/Bicholmere.cs index e2d8273a..7cd2f15d 100644 --- a/NPCs/Bicholmere.cs +++ b/NPCs/Bicholmere.cs @@ -7,77 +7,79 @@ using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Bicholmere : ModNPC +namespace Tremor.NPCs { - + + public class Bicholmere : ModNPC + { + public override void SetStaticDefaults() { DisplayName.SetDefault("Bicholmere"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 250; - npc.damage = 20; - npc.defense = 9; - npc.knockBackResist = 0.3f; - npc.width = 62; - npc.height = 46; - animationType = 244; - npc.aiStyle = 1; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit47; - npc.DeathSound = SoundID.NPCDeath23; - npc.value = Item.buyPrice(0, 0, 5, 15); - banner = npc.type; - bannerItem = mod.ItemType("BicholmereBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 250; + npc.damage = 20; + npc.defense = 9; + npc.knockBackResist = 0.3f; + npc.width = 62; + npc.height = 46; + animationType = 244; + npc.aiStyle = 1; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit47; + npc.DeathSound = SoundID.NPCDeath23; + npc.value = Item.buyPrice(0, 0, 5, 15); + banner = npc.type; + bannerItem = mod.ItemType("BicholmereBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BicholmereGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BicholmereGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BicholmereGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BicholmereGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BicholmereGore3"), 1f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BicholmereGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BicholmereGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BicholmereGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BicholmereGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BicholmereGore3"), 1f); + } + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 23); - }; - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 23); + }; + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && y > Main.rockLayer ? 0.01f : 0f; - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && y > Main.rockLayer ? 0.01f : 0f; + } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/Blazer.cs b/NPCs/Blazer.cs index 421c4e50..0ab6ae36 100644 --- a/NPCs/Blazer.cs +++ b/NPCs/Blazer.cs @@ -6,61 +6,63 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Blazer : ModNPC +namespace Tremor.NPCs { - + + public class Blazer : ModNPC + { + public override void SetStaticDefaults() { DisplayName.SetDefault("Blazer"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 350; - npc.damage = 100; - npc.defense = 12; - npc.knockBackResist = 0.5f; - npc.width = 40; - npc.height = 40; - animationType = 121; - npc.aiStyle = 14; - npc.noGravity = true; - npc.npcSlots = 1f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.value = Item.buyPrice(0, 0, 10, 0); - banner = npc.type; - bannerItem = mod.ItemType("BlazerBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 350; + npc.damage = 100; + npc.defense = 12; + npc.knockBackResist = 0.5f; + npc.width = 40; + npc.height = 40; + animationType = 121; + npc.aiStyle = 14; + npc.noGravity = true; + npc.npcSlots = 1f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.value = Item.buyPrice(0, 0, 10, 0); + banner = npc.type; + bannerItem = mod.ItemType("BlazerBanner"); + } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } -NPC.NewNPC((int)npc.position.X, (int)npc.position.Y - 48, 59); - } -} - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && spawnInfo.spawnTileY > Main.maxTilesY - 200 ? 0.02f : 0; - } -}} \ No newline at end of file + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + NPC.NewNPC((int)npc.position.X, (int)npc.position.Y - 48, 59); + } + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && spawnInfo.spawnTileY > Main.maxTilesY - 200 ? 0.02f : 0; + } + } +} \ No newline at end of file diff --git a/NPCs/BloodmoonWarrior1.cs b/NPCs/BloodmoonWarrior1.cs index 8e9fcdb4..a6674d18 100644 --- a/NPCs/BloodmoonWarrior1.cs +++ b/NPCs/BloodmoonWarrior1.cs @@ -6,80 +6,82 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class BloodmoonWarrior1 : ModNPC +namespace Tremor.NPCs { - + + public class BloodmoonWarrior1 : ModNPC + { + public override void SetStaticDefaults() { DisplayName.SetDefault("Bloodmoon Warrior"); Main.npcFrameCount[npc.type] = 15; } - - public override void SetDefaults() - { - npc.lifeMax = 150; - npc.damage = 20; - npc.defense = 10; - npc.knockBackResist = 0.3f; - npc.width = 36; - npc.height = 44; - aiType = 77; -animationType = 21; - npc.aiStyle = 3; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit2; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 6, 9); - banner = npc.type; - bannerItem = mod.ItemType("BloodmoonWarriorBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 150; + npc.damage = 20; + npc.defense = 10; + npc.knockBackResist = 0.3f; + npc.width = 36; + npc.height = 44; + aiType = 77; + animationType = 21; + npc.aiStyle = 3; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit2; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 0, 6, 9); + banner = npc.type; + bannerItem = mod.ItemType("BloodmoonWarriorBanner"); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BloodmoonWarrior1Gore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); - } -} + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(25) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EvilCup")); - }; - if(Main.rand.Next(25) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TornPapyrus")); - }; - } - } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.bloodMoon && y < Main.worldSurface ? 0.02f : 0f; - } -}} \ No newline at end of file + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BloodmoonWarrior1Gore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); + } + } + + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(25) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EvilCup")); + }; + if (Main.rand.Next(25) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TornPapyrus")); + }; + } + } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.bloodMoon && y < Main.worldSurface ? 0.02f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/BloodmoonWarrior2.cs b/NPCs/BloodmoonWarrior2.cs index 977f0f6a..c35504ae 100644 --- a/NPCs/BloodmoonWarrior2.cs +++ b/NPCs/BloodmoonWarrior2.cs @@ -6,80 +6,82 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class BloodmoonWarrior2 : ModNPC +namespace Tremor.NPCs { - + + public class BloodmoonWarrior2 : ModNPC + { + public override void SetStaticDefaults() { DisplayName.SetDefault("Bloodmoon Warrior"); Main.npcFrameCount[npc.type] = 15; } - - public override void SetDefaults() - { - npc.lifeMax = 150; - npc.damage = 20; - npc.defense = 10; - npc.knockBackResist = 0.4f; - npc.width = 36; - npc.height = 44; -animationType = 21; - npc.aiStyle = 3; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit2; - aiType = 77; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 6, 9); - banner = npc.type; - bannerItem = mod.ItemType("BloodmoonWarriorBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 150; + npc.damage = 20; + npc.defense = 10; + npc.knockBackResist = 0.4f; + npc.width = 36; + npc.height = 44; + animationType = 21; + npc.aiStyle = 3; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit2; + aiType = 77; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 0, 6, 9); + banner = npc.type; + bannerItem = mod.ItemType("BloodmoonWarriorBanner"); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BloodmoonWarrior2Gore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); - } -} + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(25) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EvilCup")); - }; - if(Main.rand.Next(25) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TornPapyrus")); - }; - } - } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.bloodMoon && y < Main.worldSurface ? 0.01f : 0f; - } -}} \ No newline at end of file + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BloodmoonWarrior2Gore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); + } + } + + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(25) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EvilCup")); + }; + if (Main.rand.Next(25) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TornPapyrus")); + }; + } + } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.bloodMoon && y < Main.worldSurface ? 0.01f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/BloodmoonWarrior3.cs b/NPCs/BloodmoonWarrior3.cs index 295d1ff3..d35cfd10 100644 --- a/NPCs/BloodmoonWarrior3.cs +++ b/NPCs/BloodmoonWarrior3.cs @@ -6,81 +6,83 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class BloodmoonWarrior3 : ModNPC +namespace Tremor.NPCs { - + + public class BloodmoonWarrior3 : ModNPC + { + public override void SetStaticDefaults() { DisplayName.SetDefault("Bloodmoon Warrior"); Main.npcFrameCount[npc.type] = 15; } - - public override void SetDefaults() - { - npc.lifeMax = 150; - npc.damage = 20; - npc.defense = 10; - npc.knockBackResist = 0.4f; - npc.width = 36; - npc.height = 44; -animationType = 21; - npc.aiStyle = 3; - npc.npcSlots = 0.5f; - aiType = 77; - npc.HitSound = SoundID.NPCHit2; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 6, 9); - banner = npc.type; - bannerItem = mod.ItemType("BloodmoonWarriorBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 150; + npc.damage = 20; + npc.defense = 10; + npc.knockBackResist = 0.4f; + npc.width = 36; + npc.height = 44; + animationType = 21; + npc.aiStyle = 3; + npc.npcSlots = 0.5f; + aiType = 77; + npc.HitSound = SoundID.NPCHit2; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 0, 6, 9); + banner = npc.type; + bannerItem = mod.ItemType("BloodmoonWarriorBanner"); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BloodmoonWarrior3Gore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BloodmoonWarrior3Gore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); - } -} + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(25) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EvilCup")); - }; - if(Main.rand.Next(25) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TornPapyrus")); - }; - } - } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.bloodMoon && y < Main.worldSurface ? 0.01f : 0f; - } -}} \ No newline at end of file + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BloodmoonWarrior3Gore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BloodmoonWarrior3Gore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); + } + } + + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(25) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EvilCup")); + }; + if (Main.rand.Next(25) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TornPapyrus")); + }; + } + } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.bloodMoon && y < Main.worldSurface ? 0.01f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/BoneArcher.cs b/NPCs/BoneArcher.cs index 31705cc3..0d0cd690 100644 --- a/NPCs/BoneArcher.cs +++ b/NPCs/BoneArcher.cs @@ -7,92 +7,94 @@ using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class BoneArcher : ModNPC +namespace Tremor.NPCs { - + + public class BoneArcher : ModNPC + { + public override void SetStaticDefaults() { DisplayName.SetDefault("Bone Archer"); Main.npcFrameCount[npc.type] = 21; } - - public override void SetDefaults() - { - npc.lifeMax = 200; - npc.damage = 36; - npc.defense = 13; - npc.knockBackResist = 0.3f; - npc.width = 36; - npc.height = 44; - npc.npcSlots = 0.2f; - npc.HitSound = SoundID.NPCHit2; - npc.DeathSound = SoundID.NPCDeath6; - npc.aiStyle = 3; - aiType = 111; - animationType = 111; - npc.value = Item.buyPrice(0, 0, 6, 9); - banner = npc.type; - bannerItem = mod.ItemType("BoneArcherBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 200; + npc.damage = 36; + npc.defense = 13; + npc.knockBackResist = 0.3f; + npc.width = 36; + npc.height = 44; + npc.npcSlots = 0.2f; + npc.HitSound = SoundID.NPCHit2; + npc.DeathSound = SoundID.NPCDeath6; + npc.aiStyle = 3; + aiType = 111; + animationType = 111; + npc.value = Item.buyPrice(0, 0, 6, 9); + banner = npc.type; + bannerItem = mod.ItemType("BoneArcherBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(45) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 118, Main.rand.Next(1)); - } - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 40, Main.rand.Next(1,3)); - } - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 41, Main.rand.Next(1,2)); - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(45) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 118, Main.rand.Next(1)); + } + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 40, Main.rand.Next(1, 3)); + } + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 41, Main.rand.Next(1, 2)); + } - if(Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TornPapyrus")); - }; + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TornPapyrus")); + }; - } - } + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BoneArcherGore"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BoneArcherGore"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedBoss3 && y > Main.rockLayer ? 0.02f : 0f; - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedBoss3 && y > Main.rockLayer ? 0.02f : 0f; + } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/BoneFish.cs b/NPCs/BoneFish.cs index 0e32c55b..ba8e2a54 100644 --- a/NPCs/BoneFish.cs +++ b/NPCs/BoneFish.cs @@ -7,67 +7,68 @@ using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class BoneFish : ModNPC +namespace Tremor.NPCs { + + public class BoneFish : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Bone Fish"); Main.npcFrameCount[npc.type] = 6; } - - public override void SetDefaults() - { - npc.lifeMax = 40; - npc.damage = 28; - npc.defense = 6; - npc.knockBackResist = 0.3f; - npc.width = 38; - npc.height = 26; - animationType = 241; - npc.aiStyle = 16; - npc.npcSlots = 1f; - npc.HitSound = SoundID.NPCHit2; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 0, 3); - banner = npc.type; - bannerItem = mod.ItemType("BoneFishBanner"); + + public override void SetDefaults() + { + npc.lifeMax = 40; + npc.damage = 28; + npc.defense = 6; + npc.knockBackResist = 0.3f; + npc.width = 38; + npc.height = 26; + animationType = 241; + npc.aiStyle = 16; + npc.npcSlots = 1f; + npc.HitSound = SoundID.NPCHit2; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 0, 0, 3); + banner = npc.type; + bannerItem = mod.ItemType("BoneFishBanner"); NPCID.Sets.TrailCacheLength[npc.type] = 5; - } + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 154); - }; - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 154); + }; + } + } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Vector2 drawOrigin = new Vector2(Main.npcTexture[npc.type].Width, Main.npcTexture[npc.type].Height * 0.8f); for (int k = 0; k < npc.oldPos.Length; k++) { - SpriteEffects effect = SpriteEffects.None; - if (npc.direction ==1) {effect = SpriteEffects.FlipHorizontally;} - if (npc.direction ==-1) {effect = SpriteEffects.None;} + SpriteEffects effect = SpriteEffects.None; + if (npc.direction == 1) { effect = SpriteEffects.FlipHorizontally; } + if (npc.direction == -1) { effect = SpriteEffects.None; } Vector2 drawPos = npc.oldPos[k] - Main.screenPosition; Color color = npc.GetAlpha(lightColor) * ((float)(npc.oldPos.Length - k) / (float)npc.oldPos.Length); - Rectangle frame = new Rectangle(0, 0, 38, 26); -frame.Y += 164 * (k / 60); + Rectangle frame = new Rectangle(0, 0, 38, 26); + frame.Y += 164 * (k / 60); spriteBatch.Draw(Main.npcTexture[npc.type], drawPos, frame, color, 0, Vector2.Zero, npc.scale, effect, 1f); @@ -75,21 +76,22 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) return true; } - public override void AI() - { -for (int num74 = npc.oldPos.Length - 1; num74 > 0; num74--) -{ -npc.oldPos[num74] = npc.oldPos[num74 - 1]; -} -npc.oldPos[0] = npc.position; - } + public override void AI() + { + for (int num74 = npc.oldPos.Length - 1; num74 > 0; num74--) + { + npc.oldPos[num74] = npc.oldPos[num74 - 1]; + } + npc.oldPos[0] = npc.position; + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BoneFishGore"), 1f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BoneFishGore"), 1f); + } + } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/BoneFlyer.cs b/NPCs/BoneFlyer.cs index b33301a2..e15cd9aa 100644 --- a/NPCs/BoneFlyer.cs +++ b/NPCs/BoneFlyer.cs @@ -6,84 +6,86 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class BoneFlyer : ModNPC +namespace Tremor.NPCs { + + public class BoneFlyer : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Flying Bones"); Main.npcFrameCount[npc.type] = 2; } - - public override void SetDefaults() - { - npc.lifeMax = 140; - npc.damage = 26; - npc.defense = 9; - npc.knockBackResist = 0.3f; - npc.width = 82; - npc.height = 56; - animationType = 62; - npc.aiStyle = 14; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 7, 0); - banner = npc.type; - bannerItem = mod.ItemType("BoneFlyerBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 140; + npc.damage = 26; + npc.defense = 9; + npc.knockBackResist = 0.3f; + npc.width = 82; + npc.height = 56; + animationType = 62; + npc.aiStyle = 14; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 0, 7, 0); + banner = npc.type; + bannerItem = mod.ItemType("BoneFlyerBanner"); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 154, Main.rand.Next(1,2)); - } - if(Main.rand.Next(6) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 189, Main.rand.Next(1,2)); - } - if(Main.rand.Next(6) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 188, Main.rand.Next(1,2)); - } - } - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FlyerGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FlyerGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FlyerGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FlyerGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FlyerGore3"), 1f); - } -} + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 154, Main.rand.Next(1, 2)); + } + if (Main.rand.Next(6) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 189, Main.rand.Next(1, 2)); + } + if (Main.rand.Next(6) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 188, Main.rand.Next(1, 2)); + } + } + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FlyerGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FlyerGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FlyerGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FlyerGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FlyerGore3"), 1f); + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.01f : 0f; - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.01f : 0f; + } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/Brutallisk.cs b/NPCs/Brutallisk.cs index a6151646..f7a01ef7 100644 --- a/NPCs/Brutallisk.cs +++ b/NPCs/Brutallisk.cs @@ -5,63 +5,64 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - [AutoloadBossHead] -public class Brutallisk : ModNPC +namespace Tremor.NPCs { + [AutoloadBossHead] + public class Brutallisk : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Brutallisk"); Main.npcFrameCount[npc.type] = 4; } - + int timer = 0; - int timer2 = 0; - int timer3 = 0; - int timer4 = 0; - bool SpawnMinion = false; - public static bool phase2 = false; - public static bool phase3 = false; - static bool expertMode = Main.expertMode; - const int ShootRate = 170; - const int ShootDamage = 20; - const float ShootKN = 1.0f; - const int ShootType = 55; - const float ShootSpeed = 10; - const int SpeedMulti = 2; - - int TimeToShoot = ShootRate; - static int num1461 = 360; - float num1453 = expertMode ? 15f : 14f; //Ñила рывка - float num1463 = 6.28318548f / (float)(num1461 / 2); - int num1450 = expertMode ? 160 : 240; //чаÑтота рывка - int num1472 = 0; - bool flag128; - static float scaleFactor10 = expertMode ? 8.5f : 7.5f; - //Vector2 value17 = Main.player[npc.target].Center + new Vector2(npc.ai[1], -200f) - npc.Center; - //Vector2 vector170 = Vector2.Normalize(Main.player[npc.target].Center + new Vector2(npc.ai[1], -200f) - npc.Center - npc.velocity) * scaleFactor10; - float num1451 = expertMode ? 0.55f : 0.45f; - //int num1471 = Math.Sign(Main.player[npc.target].Center.X - npc.Center.X); - public override void SetDefaults() - { - npc.lifeMax = 115000; - npc.damage = 245; - npc.defense = 105; - npc.knockBackResist = 0f; - npc.width = 276; - npc.height = 366; - animationType = 82; - npc.aiStyle = 2; - npc.npcSlots = 1f; - //npc.soundHit = 7; - //npc.soundKilled = 10; - npc.boss = true; - npc.noGravity = true; - npc.noTileCollide = true; - music = 17; - npc.value = Item.buyPrice(3, 50, 0, 0); - bossBag = mod.ItemType("BrutalliskBag"); - } + int timer2 = 0; + int timer3 = 0; + int timer4 = 0; + bool SpawnMinion = false; + public static bool phase2 = false; + public static bool phase3 = false; + static bool expertMode = Main.expertMode; + const int ShootRate = 170; + const int ShootDamage = 20; + const float ShootKN = 1.0f; + const int ShootType = 55; + const float ShootSpeed = 10; + const int SpeedMulti = 2; + + int TimeToShoot = ShootRate; + static int num1461 = 360; + float num1453 = expertMode ? 15f : 14f; //Ñила рывка + float num1463 = 6.28318548f / (float)(num1461 / 2); + int num1450 = expertMode ? 160 : 240; //чаÑтота рывка + int num1472 = 0; + bool flag128; + static float scaleFactor10 = expertMode ? 8.5f : 7.5f; + //Vector2 value17 = Main.player[npc.target].Center + new Vector2(npc.ai[1], -200f) - npc.Center; + //Vector2 vector170 = Vector2.Normalize(Main.player[npc.target].Center + new Vector2(npc.ai[1], -200f) - npc.Center - npc.velocity) * scaleFactor10; + float num1451 = expertMode ? 0.55f : 0.45f; + //int num1471 = Math.Sign(Main.player[npc.target].Center.X - npc.Center.X); + public override void SetDefaults() + { + npc.lifeMax = 115000; + npc.damage = 245; + npc.defense = 105; + npc.knockBackResist = 0f; + npc.width = 276; + npc.height = 366; + animationType = 82; + npc.aiStyle = 2; + npc.npcSlots = 1f; + //npc.soundHit = 7; + //npc.soundKilled = 10; + npc.boss = true; + npc.noGravity = true; + npc.noTileCollide = true; + music = 17; + npc.value = Item.buyPrice(3, 50, 0, 0); + bossBag = mod.ItemType("BrutalliskBag"); + } public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { @@ -70,483 +71,497 @@ public override void ScaleExpertStats(int numPlayers, float bossLifeScale) } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BrutalliskGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BrutalliskGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BrutalliskGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BrutalliskGore4"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BrutalliskGore4"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BrutalliskCrystal"), 1f); - } - else - { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 59, (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } - } - - public override void AI() - { - - npc.TargetClosest(true); - npc.spriteDirection = npc.direction; - Player player = Main.player[npc.target]; - if (!player.active || player.dead) - { - npc.TargetClosest(false); - npc.velocity.Y = 50; - timer = 0; - timer2 = 0; - timer3 = 0; - timer4 = 0; - } - timer++; - if (timer <= 1000) - { - timer2++; - } - if (timer <= 1000) - { - timer3++; - } - if (timer >= 1000) - { - timer4++; - } - if (timer == 1750) - { - timer = 0; - } - - if (timer >= 200 && timer <= 650) + public override void HitEffect(int hitDirection, double damage) { - if (npc.ai[1] == 0f) - { - npc.ai[1] = (float)(300 * Math.Sign((npc.Center - Main.player[npc.target].Center).X)); - } - //value17 = Main.player[npc.target].Center + new Vector2(npc.ai[1], -200f) - npc.Center; - //vector170 = Vector2.Normalize(Main.player[npc.target].Center + new Vector2(npc.ai[1], -200f) - npc.Center - npc.velocity) * scaleFactor10; - //num1471 = Math.Sign(Main.player[npc.target].Center.X - npc.Center.X); - if (Math.Sign(Main.player[npc.target].Center.X - npc.Center.X) != 0) - { - if (npc.ai[2] == 0f && Math.Sign(Main.player[npc.target].Center.X - npc.Center.X) != npc.direction) - { - npc.rotation += 3.14159274f; - } - npc.direction = Math.Sign(Main.player[npc.target].Center.X - npc.Center.X); - if (npc.spriteDirection != -npc.direction) - { - npc.rotation += 3.14159274f; - } - npc.spriteDirection = -npc.direction; - } - npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num1450) - { - num1472 = 0; - switch ((int)npc.ai[3]) - { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - num1472 = 1; - break; - case 10: - npc.ai[3] = 1f; - num1472 = 2; - break; - case 11: - npc.ai[3] = 0f; - num1472 = 3; - break; - } - if (flag128) - { - num1472 = 4; - } - if (num1472 == 1) - { - npc.ai[0] = 1f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.velocity = Vector2.Normalize(Main.player[npc.target].Center - npc.Center) * num1453; - npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X); - if (Math.Sign(Main.player[npc.target].Center.X - npc.Center.X) != 0) - { - npc.direction = Math.Sign(Main.player[npc.target].Center.X - npc.Center.X); - if (npc.spriteDirection == 1) - { - npc.rotation += 3.14159274f; - } - npc.spriteDirection = -npc.direction; - } - } - else if (num1472 == 2) - { - npc.ai[0] = 2f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - else if (num1472 == 3) - { - npc.ai[0] = 3f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - else if (num1472 == 4) - { - npc.ai[0] = 4f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - npc.netUpdate = true; - return; - } - } - - if (timer >= 650 && timer <= 1000) - { - npc.velocity.X *= 0.98f; - npc.velocity.Y *= 0.98f; - Vector2 vector8 = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height * 0.5f)); - { - float rotation = (float)Math.Atan2((vector8.Y) - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), (vector8.X) - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); - npc.velocity.X = (float)(Math.Cos(rotation) * 8) * -1; - npc.velocity.Y = (float)(Math.Sin(rotation) * 8) * -1; - } - return; + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BrutalliskGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BrutalliskGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BrutalliskGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BrutalliskGore4"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BrutalliskGore4"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BrutalliskCrystal"), 1f); + } + else + { + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 59, (float)hitDirection, -1f, 0, default(Color), 0.7f); + } + } } - - if (timer >= 1000 && timer <= 1250) + + public override void AI() { - if ((Main.player[npc.target].position.X+400 < npc.position.X || Main.player[npc.target].position.X-400 > npc.position.X || Main.player[npc.target].position.Y+400 < npc.position.Y || Main.player[npc.target].position.Y-400 > npc.position.Y)) + + npc.TargetClosest(true); + npc.spriteDirection = npc.direction; + Player player = Main.player[npc.target]; + if (!player.active || player.dead) + { + npc.TargetClosest(false); + npc.velocity.Y = 50; + timer = 0; + timer2 = 0; + timer3 = 0; + timer4 = 0; + } + timer++; + if (timer <= 1000) + { + timer2++; + } + if (timer <= 1000) + { + timer3++; + } + if (timer >= 1000) + { + timer4++; + } + if (timer == 1750) + { + timer = 0; + } + + if (timer >= 200 && timer <= 650) { - if (Main.player[npc.target].position.X+400 < npc.position.X) + if (npc.ai[1] == 0f) { - if (npc.velocity.X > -6) {npc.velocity.X -= 0.2f;} + npc.ai[1] = (float)(300 * Math.Sign((npc.Center - Main.player[npc.target].Center).X)); } - else if (Main.player[npc.target].position.X-400 > npc.position.X) + //value17 = Main.player[npc.target].Center + new Vector2(npc.ai[1], -200f) - npc.Center; + //vector170 = Vector2.Normalize(Main.player[npc.target].Center + new Vector2(npc.ai[1], -200f) - npc.Center - npc.velocity) * scaleFactor10; + //num1471 = Math.Sign(Main.player[npc.target].Center.X - npc.Center.X); + if (Math.Sign(Main.player[npc.target].Center.X - npc.Center.X) != 0) { - if (npc.velocity.X < 6) {npc.velocity.X += 0.2f;} + if (npc.ai[2] == 0f && Math.Sign(Main.player[npc.target].Center.X - npc.Center.X) != npc.direction) + { + npc.rotation += 3.14159274f; + } + npc.direction = Math.Sign(Main.player[npc.target].Center.X - npc.Center.X); + if (npc.spriteDirection != -npc.direction) + { + npc.rotation += 3.14159274f; + } + npc.spriteDirection = -npc.direction; } - if (Main.player[npc.target].position.Y+400 < npc.position.Y) + npc.ai[2] += 1f; + if (npc.ai[2] >= (float)num1450) { - if (npc.velocity.Y > -6) npc.velocity.Y -= 0.2f; + num1472 = 0; + switch ((int)npc.ai[3]) + { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + num1472 = 1; + break; + case 10: + npc.ai[3] = 1f; + num1472 = 2; + break; + case 11: + npc.ai[3] = 0f; + num1472 = 3; + break; + } + if (flag128) + { + num1472 = 4; + } + if (num1472 == 1) + { + npc.ai[0] = 1f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.velocity = Vector2.Normalize(Main.player[npc.target].Center - npc.Center) * num1453; + npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X); + if (Math.Sign(Main.player[npc.target].Center.X - npc.Center.X) != 0) + { + npc.direction = Math.Sign(Main.player[npc.target].Center.X - npc.Center.X); + if (npc.spriteDirection == 1) + { + npc.rotation += 3.14159274f; + } + npc.spriteDirection = -npc.direction; + } + } + else if (num1472 == 2) + { + npc.ai[0] = 2f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + } + else if (num1472 == 3) + { + npc.ai[0] = 3f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + } + else if (num1472 == 4) + { + npc.ai[0] = 4f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + } + npc.netUpdate = true; + return; } - else if (Main.player[npc.target].position.Y-400 > npc.position.Y) + } + + if (timer >= 650 && timer <= 1000) + { + npc.velocity.X *= 0.98f; + npc.velocity.Y *= 0.98f; + Vector2 vector8 = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height * 0.5f)); { - if (npc.velocity.Y < 6) npc.velocity.Y += 0.2f; + float rotation = (float)Math.Atan2((vector8.Y) - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), (vector8.X) - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); + npc.velocity.X = (float)(Math.Cos(rotation) * 8) * -1; + npc.velocity.Y = (float)(Math.Sin(rotation) * 8) * -1; } + return; } - else + + if (timer >= 1000 && timer <= 1250) { - npc.velocity.X *= 0.95f; npc.velocity.Y *= 0.95f; + if ((Main.player[npc.target].position.X + 400 < npc.position.X || Main.player[npc.target].position.X - 400 > npc.position.X || Main.player[npc.target].position.Y + 400 < npc.position.Y || Main.player[npc.target].position.Y - 400 > npc.position.Y)) + { + if (Main.player[npc.target].position.X + 400 < npc.position.X) + { + if (npc.velocity.X > -6) { npc.velocity.X -= 0.2f; } + } + else if (Main.player[npc.target].position.X - 400 > npc.position.X) + { + if (npc.velocity.X < 6) { npc.velocity.X += 0.2f; } + } + if (Main.player[npc.target].position.Y + 400 < npc.position.Y) + { + if (npc.velocity.Y > -6) npc.velocity.Y -= 0.2f; + } + else if (Main.player[npc.target].position.Y - 400 > npc.position.Y) + { + if (npc.velocity.Y < 6) npc.velocity.Y += 0.2f; + } + } + else + { + npc.velocity.X *= 0.95f; npc.velocity.Y *= 0.95f; + npc.ai[1]++; + if (npc.ai[1] >= 30) + { + npc.velocity.X += Main.rand.Next(-4, 4); + npc.velocity.Y += Main.rand.Next(-4, 4); + npc.ai[1] = 0; + } + } + + Vector2 vector = npc.velocity; + npc.velocity = Collision.TileCollision(npc.position, npc.velocity, npc.width, npc.height, false, false); + if (npc.velocity.X != vector.X) + { + npc.velocity.X = -vector.X; + } + if (npc.velocity.Y != vector.Y) + { + npc.velocity.Y = -vector.Y; + } + + if (npc.ai[0] >= 0) + { + if ((Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height))) + { + float num48 = 12f; + int damage = 30; + npc.ai[0] = -100 - Main.rand.Next(100); + } + } + + if (Main.time % 2 == 0 && Main.netMode == 2 && npc.whoAmI < 200) + { + //NetMessage.SendData(23, -1, -1, "", npc.whoAmI, 0f, 0f, 0f, 0); + } + } + + if (timer >= 1250 && timer <= 1500) + { + if (Main.player[npc.target].position.X < npc.position.X) + { + if (npc.velocity.X > -8) npc.velocity.X -= 0.22f; + } + + if (Main.player[npc.target].position.X > npc.position.X) + { + if (npc.velocity.X < 8) npc.velocity.X += 0.22f; + } + + if (Main.player[npc.target].position.Y < npc.position.Y + 300) + { + if (npc.velocity.Y < 0) + { + if (npc.velocity.Y > -4) npc.velocity.Y -= 0.8f; + } + else npc.velocity.Y -= 0.6f; + } + + if (Main.player[npc.target].position.Y > npc.position.Y + 300) + { + if (npc.velocity.Y > 0) + { + if (npc.velocity.Y < 4) npc.velocity.Y += 0.8f; + } + else npc.velocity.Y += 0.6f; + } + npc.ai[0]++; + if (npc.ai[0] >= 70) + { + float Speed = 12f; + Vector2 vector8 = new Vector2(npc.position.X + (npc.width / 2), npc.position.Y + (npc.height / 2)); + int damage = 45; + //Main.PlaySound(2, (int) npc.position.X, (int) npc.position.Y, 33); + float rotation = (float)Math.Atan2(vector8.Y - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), vector8.X - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); + //int num54 = npc.NewProjectile(vector8.X, vector8.Y,(float)((Math.Cos(rotation) * Speed)*-1),(float)((Math.Sin(rotation) * Speed)*-1), 100, damage, 0f, 0); + npc.ai[0] = 0; + } npc.ai[1]++; - if (npc.ai[1] >= 30) + if (npc.ai[1] >= 300) { - npc.velocity.X += Main.rand.Next(-4,4); - npc.velocity.Y += Main.rand.Next(-4,4); - npc.ai[1] = 0; + npc.velocity.X *= 0.98f; + npc.velocity.Y *= 0.98f; + Vector2 vector8 = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height / 2)); + if ((npc.velocity.X < 2f) && (npc.velocity.X > -2f) && (npc.velocity.Y < 2f) && (npc.velocity.Y > -2f)) + { + float rotation = (float)Math.Atan2((vector8.Y) - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), (vector8.X) - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); + npc.velocity.X = (float)(Math.Cos(rotation) * 25) * -1; + npc.velocity.Y = (float)(Math.Sin(rotation) * 25) * -1; + } } } - Vector2 vector = npc.velocity; - npc.velocity = Collision.TileCollision(npc.position, npc.velocity, npc.width, npc.height, false, false); - if (npc.velocity.X != vector.X) + if (timer >= 1500) { - npc.velocity.X = -vector.X; + npc.netUpdate = true; + npc.ai[1]++; + npc.TargetClosest(); + Player tarP = Main.player[npc.target]; float num74 = 0.022f; + float num75 = tarP.position.X + (float)(tarP.width / 2); + float num76 = tarP.position.Y + (float)(tarP.height / 2); + Vector2 vector11 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + num75 = (float)((int)(num75 / 8f) * 8); + num76 = (float)((int)(num76 / 8f) * 8); + vector11.X = (float)((int)(vector11.X / 8f) * 8); + vector11.Y = (float)((int)(vector11.Y / 8f) * 8); + num75 -= vector11.X; + num76 -= vector11.Y; + if ((tarP.position.X + 300 < npc.position.X || tarP.position.X - 300 > npc.position.X || tarP.position.Y + 300 < npc.position.Y || tarP.position.Y - 300 > npc.position.Y)) + { + if (tarP.position.X + 300 < npc.position.X) + { + if (npc.velocity.X > -6) + { + npc.velocity.X -= 0.2f; + } + } + else if (tarP.position.X - 300 > npc.position.X) + { + if (npc.velocity.X < 6) + { + npc.velocity.X += 0.2f; + } + } + if (tarP.position.Y + 300 < npc.position.Y) + { + if (npc.velocity.Y > -6) + { + npc.velocity.Y -= 0.2f; + } + } + else if (tarP.position.Y - 300 > npc.position.Y) + { + if (npc.velocity.Y < 6) + { + npc.velocity.Y += 0.2f; + } + } + } + else + { + npc.velocity.X *= 0.95f; npc.velocity.Y *= 0.95f; + npc.ai[2]++; + if (npc.ai[2] == 60) + { + npc.ai[0] = Main.rand.Next(-7, 7); + npc.velocity.X += npc.ai[0]; + npc.velocity.Y += npc.ai[0]; + npc.ai[2] = 0; + } + } + Vector2 vector = npc.velocity; + npc.velocity = Collision.TileCollision(npc.position, npc.velocity, npc.width, npc.height, false, false); + if (npc.velocity.X != vector.X) + { + npc.velocity.X = -vector.X; + } + if (npc.velocity.Y != vector.Y) + { + npc.velocity.Y = -vector.Y; + } + npc.rotation = (float)Math.Atan2((double)num76, (double)num75) - 1.57f; + float num83 = 0.7f; + if (npc.collideX) + { + npc.netUpdate = true; + npc.velocity.X = npc.oldVelocity.X * -num83; + if (npc.direction == -1 && npc.velocity.X > 0f && npc.velocity.X < 2f) + { + npc.velocity.X = 2f; + } + if (npc.direction == 1 && npc.velocity.X < 0f && npc.velocity.X > -2f) + { + npc.velocity.X = -2f; + } + } + if (npc.collideY) + { + npc.netUpdate = true; + npc.velocity.Y = npc.oldVelocity.Y * -num83; + if (npc.velocity.Y > 0f && (double)npc.velocity.Y < 1.5) + { + npc.velocity.Y = 2f; + } + if (npc.velocity.Y < 0f && (double)npc.velocity.Y > -1.5) + { + npc.velocity.Y = -2f; + } + } + + if ((int)(Main.time % 120) == 0) + { + Projectile.NewProjectile(npc.position.X + 40, npc.position.Y + 40, -7, 0, 686, npc.damage, 0, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.position.X + 40, npc.position.Y + 40, 7, 0, 467, npc.damage, 0, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.position.X + 40, npc.position.Y + 40, 0, 7, 467, npc.damage, 0, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.position.X + 40, npc.position.Y + 40, 0, -7, 467, npc.damage, 0, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.position.X + 40, npc.position.Y + 40, -7, -7, 686, npc.damage, 0, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.position.X + 40, npc.position.Y + 40, 7, -7, 467, npc.damage, 0, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.position.X + 40, npc.position.Y + 40, -7, 7, 467, npc.damage, 0, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.position.X + 40, npc.position.Y + 40, 7, 7, 686, npc.damage, 0, Main.myPlayer, 0f, 0f); + } + } - if (npc.velocity.Y != vector.Y) + + if (!Main.expertMode && Main.rand.Next(320) == 0) { - npc.velocity.Y = -vector.Y; + Main.PlaySound(29, (int)npc.position.X, (int)npc.position.Y, 97); + + for (int i = 0; i < 255; ++i) + { + if (Main.player[i].active && !Main.player[i].dead) + { + //Main.player[i].Hurt(45, 1, false, false, "was roared to death.", false, -1); + } + } } - - if (npc.ai[0] >= 0) + + if (Main.expertMode && Main.rand.Next(310) == 0) { - if ((Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height))) + Main.PlaySound(29, (int)npc.position.X, (int)npc.position.Y, 97); + + for (int i = 0; i < 255; ++i) { - float num48 = 12f; - int damage = 30; - npc.ai[0] = -100-Main.rand.Next(100); + if (Main.player[i].active && !Main.player[i].dead) + { + //Main.player[i].Hurt(60, 1, false, false, "was roared to death.", false, -1); + } } } - - if (Main.time % 2 == 0 && Main.netMode == 2 && npc.whoAmI < 200) + + if (Main.rand.Next(380) == 0) { - //NetMessage.SendData(23, -1, -1, "", npc.whoAmI, 0f, 0f, 0f, 0); + NPC.NewNPC((int)npc.position.X - 50, (int)npc.position.Y, mod.NPCType("Naga")); + } + + if (Main.rand.Next(380) == 0) + { + NPC.NewNPC((int)npc.position.Y + 100, (int)npc.position.Y, mod.NPCType("Quetzalcoatl")); } - } - - if (timer >= 1250 && timer <= 1500) - { - if (Main.player[npc.target].position.X < npc.position.X) - { - if (npc.velocity.X > -8) npc.velocity.X -= 0.22f; - } - if (Main.player[npc.target].position.X > npc.position.X) - { - if (npc.velocity.X < 8) npc.velocity.X += 0.22f; - } - if (Main.player[npc.target].position.Y < npc.position.Y+300) - { - if (npc.velocity.Y < 0) - { - if (npc.velocity.Y > -4) npc.velocity.Y -= 0.8f; } - else npc.velocity.Y -= 0.6f; - } - if (Main.player[npc.target].position.Y > npc.position.Y+300) - { - if (npc.velocity.Y > 0) + Vector2 VelocityFPTP(Vector2 pos1, Vector2 pos2, float speed) { - if (npc.velocity.Y < 4) npc.velocity.Y += 0.8f; + Vector2 move = pos2 - pos1; + return move * (speed / (float)System.Math.Sqrt(move.X * move.X + move.Y * move.Y)); } - else npc.velocity.Y += 0.6f; - } - npc.ai[0]++; - if (npc.ai[0] >= 70) - { - float Speed = 12f; - Vector2 vector8 = new Vector2(npc.position.X + (npc.width / 2), npc.position.Y + (npc.height / 2)); - int damage = 45; - //Main.PlaySound(2, (int) npc.position.X, (int) npc.position.Y, 33); - float rotation = (float) Math.Atan2(vector8.Y-(Main.player[npc.target].position.Y+(Main.player[npc.target].height * 0.5f)), vector8.X-(Main.player[npc.target].position.X+(Main.player[npc.target].width * 0.5f))); - //int num54 = npc.NewProjectile(vector8.X, vector8.Y,(float)((Math.Cos(rotation) * Speed)*-1),(float)((Math.Sin(rotation) * Speed)*-1), 100, damage, 0f, 0); - npc.ai[0] = 0; - } - npc.ai[1]++; - if (npc.ai[1] >= 300) - { - npc.velocity.X *= 0.98f; - npc.velocity.Y *= 0.98f; - Vector2 vector8 = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height / 2)); - if ((npc.velocity.X < 2f) && (npc.velocity.X > -2f) && (npc.velocity.Y < 2f) && (npc.velocity.Y > -2f)) + + public override void NPCLoot() { - float rotation = (float) Math.Atan2((vector8.Y)-(Main.player[npc.target].position.Y+(Main.player[npc.target].height * 0.5f)), (vector8.X)-(Main.player[npc.target].position.X+(Main.player[npc.target].width * 0.5f))); - npc.velocity.X = (float) (Math.Cos(rotation) * 25)*-1; - npc.velocity.Y = (float) (Math.Sin(rotation) * 25)*-1; - } - } + + if (Main.expertMode) + { + npc.DropBossBags(); + } + + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + + if (!Main.expertMode && Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SnakeDevourer")); + } + if (!Main.expertMode && Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Awakening")); + } + if (!Main.expertMode && Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LightningStaff")); + } + if (!Main.expertMode && Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("QuetzalcoatlStave")); + } + if (!Main.expertMode && Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TreasureGlaive")); + } + if (!Main.expertMode && Main.rand.Next(25) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FallenSnake")); + } + if (!Main.expertMode && Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Aquamarine"), Main.rand.Next(10, 18)); + } + if (!Main.expertMode && Main.rand.Next(100) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StrangeEgg")); + } + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrutalliskTrophy")); + } + if (!Main.expertMode && Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrutalliskMask")); + } + TremorWorld.downedBrutallisk = true; + } } - - if (timer >= 1500) - { - npc.netUpdate = true; - npc.ai[1]++; - npc.TargetClosest(); - Player tarP = Main.player[npc.target]; float num74 = 0.022f; - float num75 = tarP.position.X + (float)(tarP.width / 2); - float num76 = tarP.position.Y + (float)(tarP.height / 2); - Vector2 vector11 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - num75 = (float)((int)(num75 / 8f) * 8); - num76 = (float)((int)(num76 / 8f) * 8); - vector11.X = (float)((int)(vector11.X / 8f) * 8); - vector11.Y = (float)((int)(vector11.Y / 8f) * 8); - num75 -= vector11.X; - num76 -= vector11.Y; - if ((tarP.position.X + 300 < npc.position.X || tarP.position.X - 300 > npc.position.X || tarP.position.Y + 300 < npc.position.Y || tarP.position.Y - 300 > npc.position.Y)) { - if (tarP.position.X + 300 < npc.position.X) { - if (npc.velocity.X > -6) { - npc.velocity.X -= 0.2f; - } - } - else if (tarP.position.X - 300 > npc.position.X) { - if (npc.velocity.X < 6) { - npc.velocity.X += 0.2f; - } - } - if (tarP.position.Y + 300 < npc.position.Y) { - if (npc.velocity.Y > -6) { - npc.velocity.Y -= 0.2f; - } - } - else if (tarP.position.Y - 300 > npc.position.Y) { - if (npc.velocity.Y < 6) { - npc.velocity.Y += 0.2f; - } - } - } - else { - npc.velocity.X *= 0.95f; npc.velocity.Y *= 0.95f; - npc.ai[2]++; - if (npc.ai[2] == 60) { - npc.ai[0] = Main.rand.Next(-7, 7); - npc.velocity.X += npc.ai[0]; - npc.velocity.Y += npc.ai[0]; - npc.ai[2] = 0; - } - } - Vector2 vector = npc.velocity; - npc.velocity = Collision.TileCollision(npc.position, npc.velocity, npc.width, npc.height, false, false); - if (npc.velocity.X != vector.X) { - npc.velocity.X = -vector.X; - } - if (npc.velocity.Y != vector.Y) { - npc.velocity.Y = -vector.Y; - } - npc.rotation = (float)Math.Atan2((double)num76, (double)num75) - 1.57f; - float num83 = 0.7f; - if (npc.collideX) - { - npc.netUpdate = true; - npc.velocity.X = npc.oldVelocity.X * -num83; - if (npc.direction == -1 && npc.velocity.X > 0f && npc.velocity.X < 2f) - { - npc.velocity.X = 2f; - } - if (npc.direction == 1 && npc.velocity.X < 0f && npc.velocity.X > -2f) - { - npc.velocity.X = -2f; - } - } - if (npc.collideY) - { - npc.netUpdate = true; - npc.velocity.Y = npc.oldVelocity.Y * -num83; - if (npc.velocity.Y > 0f && (double)npc.velocity.Y < 1.5) - { - npc.velocity.Y = 2f; - } - if (npc.velocity.Y < 0f && (double)npc.velocity.Y > -1.5) - { - npc.velocity.Y = -2f; - } - } - - if ((int)(Main.time % 120) == 0) - { - Projectile.NewProjectile(npc.position.X+40, npc.position.Y+40, -7,0, 686, npc.damage, 0, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(npc.position.X+40, npc.position.Y+40, 7, 0, 467, npc.damage, 0, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(npc.position.X+40, npc.position.Y+40, 0, 7, 467, npc.damage, 0, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(npc.position.X+40, npc.position.Y+40, 0, -7, 467, npc.damage, 0, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(npc.position.X+40, npc.position.Y+40, -7,-7, 686, npc.damage, 0, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(npc.position.X+40, npc.position.Y+40, 7, -7, 467, npc.damage, 0, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(npc.position.X+40, npc.position.Y+40, -7, 7, 467, npc.damage, 0, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(npc.position.X+40, npc.position.Y+40, 7, 7, 686, npc.damage, 0, Main.myPlayer, 0f, 0f); + } - - } - - if(!Main.expertMode && Main.rand.Next(320) == 0) - { - Main.PlaySound(29, (int)npc.position.X, (int)npc.position.Y, 97); - - for (int i = 0; i < 255; ++i) - { - if(Main.player[i].active && !Main.player[i].dead ) - { - //Main.player[i].Hurt(45, 1, false, false, "was roared to death.", false, -1); - } - } - } - - if(Main.expertMode && Main.rand.Next(310) == 0) - { - Main.PlaySound(29, (int)npc.position.X, (int)npc.position.Y, 97); - - for (int i = 0; i < 255; ++i) - { - if(Main.player[i].active && !Main.player[i].dead ) - { - //Main.player[i].Hurt(60, 1, false, false, "was roared to death.", false, -1); - } - } - } - - if(Main.rand.Next(380) == 0) - { - NPC.NewNPC((int)npc.position.X - 50, (int)npc.position.Y, mod.NPCType("Naga")); - } - - if(Main.rand.Next(380) == 0) - { - NPC.NewNPC((int)npc.position.Y + 100, (int)npc.position.Y, mod.NPCType("Quetzalcoatl")); - } - - - } - - Vector2 VelocityFPTP(Vector2 pos1, Vector2 pos2, float speed) - { - Vector2 move = pos2 - pos1; - return move * (speed / (float)System.Math.Sqrt(move.X * move.X + move.Y * move.Y)); - } - - public override void NPCLoot() - { - - if(Main.expertMode) - { - npc.DropBossBags(); - } - - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - - if(!Main.expertMode && Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SnakeDevourer")); - } - if(!Main.expertMode && Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Awakening")); - } - if(!Main.expertMode && Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LightningStaff")); - } - if(!Main.expertMode && Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("QuetzalcoatlStave")); - } - if(!Main.expertMode && Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TreasureGlaive")); - } - if(!Main.expertMode && Main.rand.Next(25) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FallenSnake")); - } - if(!Main.expertMode && Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Aquamarine"), Main.rand.Next(10, 18)); - } - if(!Main.expertMode &&Main.rand.Next(100) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StrangeEgg")); - } - if(Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrutalliskTrophy")); - } - if(!Main.expertMode &&Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrutalliskMask")); - } - TremorWorld.downedBrutallisk = true; -} -} - -}} \ No newline at end of file +} \ No newline at end of file diff --git a/NPCs/BrutalliskSpawnMobs.cs b/NPCs/BrutalliskSpawnMobs.cs index 45df308c..26db3655 100644 --- a/NPCs/BrutalliskSpawnMobs.cs +++ b/NPCs/BrutalliskSpawnMobs.cs @@ -1,4 +1,4 @@ - using System; +using System; using System.Diagnostics; using System.Collections.Generic; using System.IO; @@ -19,19 +19,19 @@ namespace Tremor.NPCs { public class BrutalliskSpawnMobs : ModPlayer - { - public override void PostUpdate() - { - const int XOffset = 1200; - const int YOffset = 1200; + { + public override void PostUpdate() + { + const int XOffset = 1200; + const int YOffset = 1200; - if (NPC.AnyNPCs(mod.NPCType("Brutallisk"))) - { + if (NPC.AnyNPCs(mod.NPCType("Brutallisk"))) + { if (Main.rand.Next(380) == 1) - NPC.NewNPC((int)Main.player[Main.myPlayer].Center.X + XOffset, (int)Main.player[Main.myPlayer].Center.Y - YOffset, mod.NPCType("Quetzalcoatl"), 0, NPC.NewNPC((int)Main.player[Main.myPlayer].Center.X + XOffset, (int)Main.player[Main.myPlayer].Center.Y + YOffset, mod.NPCType(""))); - if (Main.rand.Next(380) == 1) - NPC.NewNPC((int)Main.player[Main.myPlayer].Center.X - XOffset, (int)Main.player[Main.myPlayer].Center.Y - YOffset, mod.NPCType("Quetzalcoatl"), 0, NPC.NewNPC((int)Main.player[Main.myPlayer].Center.X + XOffset, (int)Main.player[Main.myPlayer].Center.Y + YOffset, mod.NPCType(""))); - } - } - } + NPC.NewNPC((int)Main.player[Main.myPlayer].Center.X + XOffset, (int)Main.player[Main.myPlayer].Center.Y - YOffset, mod.NPCType("Quetzalcoatl"), 0, NPC.NewNPC((int)Main.player[Main.myPlayer].Center.X + XOffset, (int)Main.player[Main.myPlayer].Center.Y + YOffset, mod.NPCType(""))); + if (Main.rand.Next(380) == 1) + NPC.NewNPC((int)Main.player[Main.myPlayer].Center.X - XOffset, (int)Main.player[Main.myPlayer].Center.Y - YOffset, mod.NPCType("Quetzalcoatl"), 0, NPC.NewNPC((int)Main.player[Main.myPlayer].Center.X + XOffset, (int)Main.player[Main.myPlayer].Center.Y + YOffset, mod.NPCType(""))); + } + } + } } diff --git a/NPCs/Brute.cs b/NPCs/Brute.cs index cd70e66f..2229c126 100644 --- a/NPCs/Brute.cs +++ b/NPCs/Brute.cs @@ -5,76 +5,78 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Brute : ModNPC +namespace Tremor.NPCs { + + public class Brute : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Brute"); Main.npcFrameCount[npc.type] = 8; } - - public override void SetDefaults() - { - npc.lifeMax = 5000; - npc.damage = 120; - npc.defense = 60; - npc.knockBackResist = 0.6f; - npc.width = 34; - npc.height = 62; - animationType = 534; - npc.aiStyle = 3; - aiType = 169; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit2; - npc.DeathSound = SoundID.NPCDeath21; - npc.value = Item.buyPrice(0, 0, 40, 0); - banner = npc.type; - bannerItem = mod.ItemType("BruteBanner"); - } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 60; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BruteGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BruteGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BruteGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BruteGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BruteGore3"), 1f); - } - else - { + public override void SetDefaults() + { + npc.lifeMax = 5000; + npc.damage = 120; + npc.defense = 60; + npc.knockBackResist = 0.6f; + npc.width = 34; + npc.height = 62; + animationType = 534; + npc.aiStyle = 3; + aiType = 169; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit2; + npc.DeathSound = SoundID.NPCDeath21; + npc.value = Item.buyPrice(0, 0, 40, 0); + banner = npc.type; + bannerItem = mod.ItemType("BruteBanner"); + } - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -2f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 60; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BruteGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BruteGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BruteGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BruteGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BruteGore3"), 1f); + } + else + { - public override void AI() - { -if (Main.rand.Next(1000) == 0) - { - Main.PlaySound(22, (int)npc.position.X, (int)npc.position.Y, 1); - } - } + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -2f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + } + } + } + + public override void AI() + { + if (Main.rand.Next(1000) == 0) + { + Main.PlaySound(22, (int)npc.position.X, (int)npc.position.Y, 1); + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.001f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.001f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/BucketheadZombie.cs b/NPCs/BucketheadZombie.cs index 3108bff6..5136d162 100644 --- a/NPCs/BucketheadZombie.cs +++ b/NPCs/BucketheadZombie.cs @@ -6,73 +6,75 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class BucketheadZombie : ModNPC +namespace Tremor.NPCs { + + public class BucketheadZombie : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Buckethead Zombie"); Main.npcFrameCount[npc.type] = 3; } - - public override void SetDefaults() - { - npc.lifeMax = 90; - npc.damage = 18; - npc.defense = 8; - npc.knockBackResist = 0.3f; - npc.width = 34; - npc.height = 48; -animationType = 3; - npc.aiStyle = 3; - npc.npcSlots = 0.8f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 6, 7); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 90; + npc.damage = 18; + npc.defense = 8; + npc.knockBackResist = 0.3f; + npc.width = 34; + npc.height = 48; + animationType = 3; + npc.aiStyle = 3; + npc.npcSlots = 0.8f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 0, 6, 7); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BucketheadZombieGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore2"), 1f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BucketheadZombieGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore2"), 1f); + } + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("UntreatedFlesh")); - }; - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("UntreatedFlesh")); + }; + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && y < Main.worldSurface ? 0.01f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && y < Main.worldSurface ? 0.01f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/CaveGolem.cs b/NPCs/CaveGolem.cs index 51ec0f81..21cf41f2 100644 --- a/NPCs/CaveGolem.cs +++ b/NPCs/CaveGolem.cs @@ -7,79 +7,81 @@ using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class CaveGolem : ModNPC +namespace Tremor.NPCs { + + public class CaveGolem : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Cave Golem"); Main.npcFrameCount[npc.type] = 20; } - - public override void SetDefaults() - { - npc.lifeMax = 80; - npc.damage = 20; - npc.defense = 17; - npc.knockBackResist = 0.3f; - aiType = 77; - npc.width = 36; - npc.height = 44; - animationType = 482; - npc.aiStyle = 3; - npc.npcSlots = 0.9f; - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath6; - npc.value = Item.buyPrice(0, 0, 4, 9); - banner = npc.type; - bannerItem = mod.ItemType("CaveGolemBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 80; + npc.damage = 20; + npc.defense = 17; + npc.knockBackResist = 0.3f; + aiType = 77; + npc.width = 36; + npc.height = 44; + animationType = 482; + npc.aiStyle = 3; + npc.npcSlots = 0.9f; + npc.HitSound = SoundID.NPCHit4; + npc.DeathSound = SoundID.NPCDeath6; + npc.value = Item.buyPrice(0, 0, 4, 9); + banner = npc.type; + bannerItem = mod.ItemType("CaveGolemBanner"); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CaveGolemGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CaveGolemGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CaveGolemGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CaveGolemGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CaveGolemGore3"), 1f); - } -} + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CaveGolemGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CaveGolemGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CaveGolemGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CaveGolemGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CaveGolemGore3"), 1f); + } + } + + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(30) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ColossusSword")); - } - } - } + if (Main.rand.Next(30) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ColossusSword")); + } + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && y > Main.rockLayer ? 0.01f : 0f; - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && y > Main.rockLayer ? 0.01f : 0f; + } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/Chef.cs b/NPCs/Chef.cs index 5b911f76..8a168822 100644 --- a/NPCs/Chef.cs +++ b/NPCs/Chef.cs @@ -6,10 +6,11 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { -[AutoloadHead] -public class Chef : ModNPC +namespace Tremor.NPCs { + [AutoloadHead] + public class Chef : ModNPC + { public override string Texture { get @@ -17,14 +18,14 @@ public override string Texture return "Tremor/NPCs/Chef"; } } - + public override string[] AltTextures { get { - return new string[] { "Tremor/NPCs/Chef"}; + return new string[] { "Tremor/NPCs/Chef" }; } - } + } public override bool Autoload(ref string name) { @@ -41,157 +42,158 @@ public override void SetStaticDefaults() NPCID.Sets.DangerDetectRange[npc.type] = 150; NPCID.Sets.AttackAverageChance[npc.type] = 30; NPCID.Sets.AttackType[npc.type] = 3; //this is the attack type, 0 (throwing), 1 (shooting), or 2 (magic). 3 (melee) - NPCID.Sets.AttackTime[npc.type] = 30; //this defines the npc attack speed - } - - public override void SetDefaults() - { - npc.townNPC = true; - npc.friendly = true; - npc.width = 30; - npc.height = 44; - npc.aiStyle = 7; - npc.damage = 10; - npc.defense = 15; - npc.lifeMax = 250; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.knockBackResist = 0.5f; - animationType = NPCID.GoblinTinkerer; - } + NPCID.Sets.AttackTime[npc.type] = 30; //this defines the npc attack speed + } + + public override void SetDefaults() + { + npc.townNPC = true; + npc.friendly = true; + npc.width = 30; + npc.height = 44; + npc.aiStyle = 7; + npc.damage = 10; + npc.defense = 15; + npc.lifeMax = 250; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.knockBackResist = 0.5f; + animationType = NPCID.GoblinTinkerer; + } public override bool CanTownNPCSpawn(int numTownNPCs, int money) { - if(NPC.downedBoss2) - { - return true; - } + if (NPC.downedBoss2) + { + return true; + } return false; } - public override string TownNPCName() - { - switch(WorldGen.genRand.Next(5)) - { - case 0: - return "Richard"; - case 1: - return "Oliver"; - case 2: - return "Alan"; - case 3: - return "Gordon"; - case 4: - return "Umeril"; - case 5: - return "Anthony"; - case 6: - return "Jerome"; - default: - return "Liam"; - } - } - - public override string GetChat() - { - switch(Main.rand.Next(6)) - { - case 0: - return "This crab is so undercooked, it's still singing under the sea!"; - case 1: - return "This needs more salt! And a dash of powdered blinkroot."; - case 2: - return "Any Oaf can make a bowl of soup, while I create culinary art"; - case 3: - return "Somebody have stolen my knife. I think I will cut this guy with the knife when I will find it."; - case 4: - return "No! I will not add vile powder to this flambe."; - case 5: - return "Hello there! How's it goin'?"; - default: - return "Do you know recipes of unusual food? No? THEN GO AND FIND THEM FOR ME OR I WILL CU-... Oh. Sorry."; - } - } - - public override void SetChatButtons(ref string button, ref string button2) - { - button = Lang.inter[28].Value; - } - - public override void OnChatButtonClicked(bool firstButton, ref bool shop) - { - if(firstButton) - { - shop = true; - } - } - - public override void SetupShop(Chest shop, ref int nextSlot) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("ButcherAxe")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("Knife")); - nextSlot++; - if(NPC.AnyNPCs(mod.NPCType("Farmer"))) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("Carrow")); - nextSlot++; - } - shop.item[nextSlot].SetDefaults(mod.ItemType("ChefHat")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("Durian")); - nextSlot++; - if(Main.bloodMoon) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("CursedPopcorn")); - nextSlot++; - } - if(NPC.downedBoss2) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("ChickenLegMace")); - nextSlot++; - } - } - - public override void TownNPCAttackStrength(ref int damage, ref float knockback) - { - damage = 25; - knockback = 4f; - } - - public override void TownNPCAttackCooldown(ref int cooldown, ref int randExtraCooldown) - { - cooldown = 10; - randExtraCooldown = 10; - } - - - public override void DrawTownAttackSwing(ref Texture2D item, ref int itemSize, ref float scale, ref Vector2 offset)//Allows you to customize how this town NPC's weapon is drawn when this NPC is swinging it (this NPC must have an attack type of 3). Item is the Texture2D instance of the item to be drawn (use Main.itemTexture[id of item]), itemSize is the width and height of the item's hitbox - { - scale = 1f; - item = Main.itemTexture[mod.ItemType("ButcherAxe")]; //this defines the item that this npc will use - itemSize = 40; - } - - public override void TownNPCAttackSwing(ref int itemWidth, ref int itemHeight) // Allows you to determine the width and height of the item this town NPC swings when it attacks, which controls the range of this NPC's swung weapon. - { - itemWidth = 50; - itemHeight = 50; - } - - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ChefGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ChefGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ChefGore3"), 1f); - } -} -}} \ No newline at end of file + public override string TownNPCName() + { + switch (WorldGen.genRand.Next(5)) + { + case 0: + return "Richard"; + case 1: + return "Oliver"; + case 2: + return "Alan"; + case 3: + return "Gordon"; + case 4: + return "Umeril"; + case 5: + return "Anthony"; + case 6: + return "Jerome"; + default: + return "Liam"; + } + } + + public override string GetChat() + { + switch (Main.rand.Next(6)) + { + case 0: + return "This crab is so undercooked, it's still singing under the sea!"; + case 1: + return "This needs more salt! And a dash of powdered blinkroot."; + case 2: + return "Any Oaf can make a bowl of soup, while I create culinary art"; + case 3: + return "Somebody have stolen my knife. I think I will cut this guy with the knife when I will find it."; + case 4: + return "No! I will not add vile powder to this flambe."; + case 5: + return "Hello there! How's it goin'?"; + default: + return "Do you know recipes of unusual food? No? THEN GO AND FIND THEM FOR ME OR I WILL CU-... Oh. Sorry."; + } + } + + public override void SetChatButtons(ref string button, ref string button2) + { + button = Lang.inter[28].Value; + } + + public override void OnChatButtonClicked(bool firstButton, ref bool shop) + { + if (firstButton) + { + shop = true; + } + } + + public override void SetupShop(Chest shop, ref int nextSlot) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("ButcherAxe")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("Knife")); + nextSlot++; + if (NPC.AnyNPCs(mod.NPCType("Farmer"))) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("Carrow")); + nextSlot++; + } + shop.item[nextSlot].SetDefaults(mod.ItemType("ChefHat")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("Durian")); + nextSlot++; + if (Main.bloodMoon) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("CursedPopcorn")); + nextSlot++; + } + if (NPC.downedBoss2) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("ChickenLegMace")); + nextSlot++; + } + } + + public override void TownNPCAttackStrength(ref int damage, ref float knockback) + { + damage = 25; + knockback = 4f; + } + + public override void TownNPCAttackCooldown(ref int cooldown, ref int randExtraCooldown) + { + cooldown = 10; + randExtraCooldown = 10; + } + + + public override void DrawTownAttackSwing(ref Texture2D item, ref int itemSize, ref float scale, ref Vector2 offset)//Allows you to customize how this town NPC's weapon is drawn when this NPC is swinging it (this NPC must have an attack type of 3). Item is the Texture2D instance of the item to be drawn (use Main.itemTexture[id of item]), itemSize is the width and height of the item's hitbox + { + scale = 1f; + item = Main.itemTexture[mod.ItemType("ButcherAxe")]; //this defines the item that this npc will use + itemSize = 40; + } + + public override void TownNPCAttackSwing(ref int itemWidth, ref int itemHeight) // Allows you to determine the width and height of the item this town NPC swings when it attacks, which controls the range of this NPC's swung weapon. + { + itemWidth = 50; + itemHeight = 50; + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ChefGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ChefGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ChefGore3"), 1f); + } + } + } +} \ No newline at end of file diff --git a/NPCs/Clamper.cs b/NPCs/Clamper.cs index 25dce9c3..404f5539 100644 --- a/NPCs/Clamper.cs +++ b/NPCs/Clamper.cs @@ -6,122 +6,122 @@ namespace Tremor.NPCs { - public class Clamper : ModNPC - { + public class Clamper : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Clamper"); Main.npcFrameCount[npc.type] = 3; } - - const float Distanse = 1200f; // диÑÑ‚Ð°Ð½Ñ†Ð¸Ñ Ð¾Ñ‚Ñ€Ñ‹Ð²Ð° кламперов - public override void SetDefaults() - { - npc.noTileCollide = true; - npc.noGravity = true; - npc.lifeMax = 5000; - npc.damage = 100; - npc.defense = 6; - npc.knockBackResist = 0f; - npc.width = 36; - npc.height = 33; - aiType = 6; - npc.aiStyle = 5; - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath14; - animationType = 2; - } + const float Distanse = 1200f; // диÑÑ‚Ð°Ð½Ñ†Ð¸Ñ Ð¾Ñ‚Ñ€Ñ‹Ð²Ð° кламперов - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { -NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("Clamper2")); - } -} + public override void SetDefaults() + { + npc.noTileCollide = true; + npc.noGravity = true; + npc.lifeMax = 5000; + npc.damage = 100; + npc.defense = 6; + npc.knockBackResist = 0f; + npc.width = 36; + npc.height = 33; + aiType = 6; + npc.aiStyle = 5; + npc.HitSound = SoundID.NPCHit4; + npc.DeathSound = SoundID.NPCDeath14; + animationType = 2; + } - public override void AI() - { - npc.knockBackResist = 0f; - if (npc.ai[2] == 1) - { - npc.velocity *= 0.999f; - return; - } - if (Main.player[Helper.GetNearestPlayer(npc.Center)].Distance(npc.position) > Distanse) - { - int n = NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("Clamper2")); - Main.npc[n].rotation = npc.rotation; - Main.npc[n].velocity = npc.velocity; - Main.npc[n].life = npc.life; - npc.active = false; - } - int index = (int)npc.ai[3]; - if (Main.npc[index].type != mod.NPCType("Motherboard") || !Main.npc[index].active) - npc.active = false; - if (Main.netMode != 1) - { - --npc.localAI[0]; - if ((double)npc.localAI[0] <= 0.0) - { - npc.localAI[0] = (float)Main.rand.Next(10, 26); - npc.ai[0] = (float)Main.rand.Next(-5, 14); - npc.ai[1] = (float)Main.rand.Next(-5, 14); - npc.netUpdate = true; - } - } - npc.TargetClosest(true); - float num1 = 0.2f; - float num2 = 10f; - if ((double)Main.npc[index].life < (double)Main.npc[index].lifeMax * 0.25) - num2 += 5f; - if ((double)Main.npc[index].life < (double)Main.npc[index].lifeMax * 0.1) - num2 += 5f; - float x = Main.npc[index].position.X + (float)(Main.npc[index].width / 2); - float y = Main.npc[index].position.Y + (float)(Main.npc[index].height / 2); - Vector2 vector2 = new Vector2(x, y); - float num3 = x + npc.ai[0]; - float num4 = y + npc.ai[1]; - float num5 = num3 - vector2.X; - float num6 = num4 - vector2.Y; - float num7 = (float)Math.Sqrt((double)num5 * (double)num5 + (double)num6 * (double)num6); - float num8 = num2 / num7; - float num9 = num5 * num8; - float num10 = num6 * num8; - if ((double)npc.position.X < (double)x + (double)num9) - { - npc.velocity.X += num1; - if ((double)npc.velocity.X < 0.0 && (double)num9 > 0.0) - npc.velocity.X *= 0.5f; - } - else if ((double)npc.position.X > (double)x + (double)num9) - { - npc.velocity.X -= num1; - if ((double)npc.velocity.X > 0.0 && (double)num9 < 0.0) - npc.velocity.X *= 0.5f; - } - if ((double)npc.position.Y < (double)y + (double)num10) - { - npc.velocity.Y += num1; - if ((double)npc.velocity.Y < 0.0 && (double)num10 > 0.0) - npc.velocity.Y *= 0.5f; - } - else if ((double)npc.position.Y > (double)y + (double)num10) - { - npc.velocity.Y -= num1; - if ((double)npc.velocity.Y > 0.0 && (double)num10 < 0.0) - npc.velocity.Y *= 0.5f; - } - if ((double)npc.velocity.X > 8.0) - npc.velocity.X = 8f; - if ((double)npc.velocity.X < -8.0) - npc.velocity.X = -8f; - if ((double)npc.velocity.Y > 8.0) - npc.velocity.Y = 8f; - if ((double)npc.velocity.Y < -8.0) - npc.velocity.Y = -8f; - npc.rotation = Helper.rotateBetween2Points(npc.Center, Main.player[npc.target].Center) + 3.14f; - } - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("Clamper2")); + } + } + + public override void AI() + { + npc.knockBackResist = 0f; + if (npc.ai[2] == 1) + { + npc.velocity *= 0.999f; + return; + } + if (Main.player[Helper.GetNearestPlayer(npc.Center)].Distance(npc.position) > Distanse) + { + int n = NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("Clamper2")); + Main.npc[n].rotation = npc.rotation; + Main.npc[n].velocity = npc.velocity; + Main.npc[n].life = npc.life; + npc.active = false; + } + int index = (int)npc.ai[3]; + if (Main.npc[index].type != mod.NPCType("Motherboard") || !Main.npc[index].active) + npc.active = false; + if (Main.netMode != 1) + { + --npc.localAI[0]; + if ((double)npc.localAI[0] <= 0.0) + { + npc.localAI[0] = (float)Main.rand.Next(10, 26); + npc.ai[0] = (float)Main.rand.Next(-5, 14); + npc.ai[1] = (float)Main.rand.Next(-5, 14); + npc.netUpdate = true; + } + } + npc.TargetClosest(true); + float num1 = 0.2f; + float num2 = 10f; + if ((double)Main.npc[index].life < (double)Main.npc[index].lifeMax * 0.25) + num2 += 5f; + if ((double)Main.npc[index].life < (double)Main.npc[index].lifeMax * 0.1) + num2 += 5f; + float x = Main.npc[index].position.X + (float)(Main.npc[index].width / 2); + float y = Main.npc[index].position.Y + (float)(Main.npc[index].height / 2); + Vector2 vector2 = new Vector2(x, y); + float num3 = x + npc.ai[0]; + float num4 = y + npc.ai[1]; + float num5 = num3 - vector2.X; + float num6 = num4 - vector2.Y; + float num7 = (float)Math.Sqrt((double)num5 * (double)num5 + (double)num6 * (double)num6); + float num8 = num2 / num7; + float num9 = num5 * num8; + float num10 = num6 * num8; + if ((double)npc.position.X < (double)x + (double)num9) + { + npc.velocity.X += num1; + if ((double)npc.velocity.X < 0.0 && (double)num9 > 0.0) + npc.velocity.X *= 0.5f; + } + else if ((double)npc.position.X > (double)x + (double)num9) + { + npc.velocity.X -= num1; + if ((double)npc.velocity.X > 0.0 && (double)num9 < 0.0) + npc.velocity.X *= 0.5f; + } + if ((double)npc.position.Y < (double)y + (double)num10) + { + npc.velocity.Y += num1; + if ((double)npc.velocity.Y < 0.0 && (double)num10 > 0.0) + npc.velocity.Y *= 0.5f; + } + else if ((double)npc.position.Y > (double)y + (double)num10) + { + npc.velocity.Y -= num1; + if ((double)npc.velocity.Y > 0.0 && (double)num10 < 0.0) + npc.velocity.Y *= 0.5f; + } + if ((double)npc.velocity.X > 8.0) + npc.velocity.X = 8f; + if ((double)npc.velocity.X < -8.0) + npc.velocity.X = -8f; + if ((double)npc.velocity.Y > 8.0) + npc.velocity.Y = 8f; + if ((double)npc.velocity.Y < -8.0) + npc.velocity.Y = -8f; + npc.rotation = Helper.rotateBetween2Points(npc.Center, Main.player[npc.target].Center) + 3.14f; + } + } } \ No newline at end of file diff --git a/NPCs/Clamper2.cs b/NPCs/Clamper2.cs index 048a0120..e0762387 100644 --- a/NPCs/Clamper2.cs +++ b/NPCs/Clamper2.cs @@ -5,37 +5,37 @@ namespace Tremor.NPCs { - public class Clamper2 : ModNPC - { + public class Clamper2 : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Clamper"); Main.npcFrameCount[npc.type] = 3; } - - const int SpeedMulti = 2; // Множитель ÑкороÑти - public override void SetDefaults() - { - npc.noTileCollide = true; - npc.noGravity = true; - npc.lifeMax = 2400; - npc.damage = 30; - npc.defense = 6; - npc.knockBackResist = 0.1f; - npc.width = 36; - npc.height = 33; - npc.aiStyle = 2; - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath14; - animationType = 2; - } + const int SpeedMulti = 2; // Множитель ÑкороÑти - public override void AI() - { - npc.knockBackResist = 0f; - npc.position += npc.velocity * (SpeedMulti - 1); - Lighting.AddLight(npc.Center, new Vector3(Color.OrangeRed.R / 75, Color.OrangeRed.G / 75, Color.OrangeRed.B / 75)); - } - } + public override void SetDefaults() + { + npc.noTileCollide = true; + npc.noGravity = true; + npc.lifeMax = 2400; + npc.damage = 30; + npc.defense = 6; + npc.knockBackResist = 0.1f; + npc.width = 36; + npc.height = 33; + npc.aiStyle = 2; + npc.HitSound = SoundID.NPCHit4; + npc.DeathSound = SoundID.NPCDeath14; + animationType = 2; + } + + public override void AI() + { + npc.knockBackResist = 0f; + npc.position += npc.velocity * (SpeedMulti - 1); + Lighting.AddLight(npc.Center, new Vector3(Color.OrangeRed.R / 75, Color.OrangeRed.G / 75, Color.OrangeRed.B / 75)); + } + } } \ No newline at end of file diff --git a/NPCs/CloudSlime.cs b/NPCs/CloudSlime.cs index b10702ce..920e261e 100644 --- a/NPCs/CloudSlime.cs +++ b/NPCs/CloudSlime.cs @@ -6,73 +6,75 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class CloudSlime : ModNPC +namespace Tremor.NPCs { + + public class CloudSlime : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Cloud Slime"); Main.npcFrameCount[npc.type] = 2; } - - public override void SetDefaults() - { - npc.lifeMax = 80; - npc.damage = 20; - npc.defense = 8; - npc.knockBackResist = 0.3f; - npc.width = 34; - npc.height = 28; - animationType = 138; - npc.aiStyle = 14; - aiType = 138; - npc.npcSlots = 1f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath4; - npc.value = Item.buyPrice(0, 0, 8, 9); - banner = npc.type; - bannerItem = mod.ItemType("CloudSlimeBanner"); - } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 60; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 15, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 15, 3.5f * (float)hitDirection, -3.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 15, 4.5f * (float)hitDirection, -4.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 15, 1.5f * (float)hitDirection, -1.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 15, 0.5f * (float)hitDirection, -0.5f, 0, default(Color), 0.7f); - } - } - else - { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 15, (float)hitDirection, -2f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 15, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 15, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 15, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 15, (float)hitDirection, -2f, 0, default(Color), 0.7f); - } - } - } + public override void SetDefaults() + { + npc.lifeMax = 80; + npc.damage = 20; + npc.defense = 8; + npc.knockBackResist = 0.3f; + npc.width = 34; + npc.height = 28; + animationType = 138; + npc.aiStyle = 14; + aiType = 138; + npc.npcSlots = 1f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath4; + npc.value = Item.buyPrice(0, 0, 8, 9); + banner = npc.type; + bannerItem = mod.ItemType("CloudSlimeBanner"); + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 60; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 15, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 15, 3.5f * (float)hitDirection, -3.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 15, 4.5f * (float)hitDirection, -4.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 15, 1.5f * (float)hitDirection, -1.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 15, 0.5f * (float)hitDirection, -0.5f, 0, default(Color), 0.7f); + } + } + else + { + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 15, (float)hitDirection, -2f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 15, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 15, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 15, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 15, (float)hitDirection, -2f, 0, default(Color), 0.7f); + } + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return Tremor.NoZoneAllowWater(spawnInfo) && spawnInfo.sky ? 0.02f : 0; - } -}} \ No newline at end of file + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return Tremor.NoZoneAllowWater(spawnInfo) && spawnInfo.sky ? 0.02f : 0; + } + } +} \ No newline at end of file diff --git a/NPCs/CogLord.cs b/NPCs/CogLord.cs index aec10f54..4a129c06 100644 --- a/NPCs/CogLord.cs +++ b/NPCs/CogLord.cs @@ -10,374 +10,374 @@ namespace Tremor.NPCs { [AutoloadBossHead] - public class CogLord : ModNPC - { + public class CogLord : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Cog Lord"); Main.npcFrameCount[npc.type] = 5; } - - //Framework - Vector2 CogHands = new Vector2(-1, -1); - //Bool variables - bool Ram - { - get { return ((this.CogHands.X == -1 && this.CogHands.Y == -1) || npc.ai[1] == 1); } - } - bool FirstAI = true; - bool SecondAI = true; - bool NeedCheck = false; - bool Flag = true; - bool Flag1 = true; - bool Flag2 = true; - bool Rockets = true; + //Framework + Vector2 CogHands = new Vector2(-1, -1); - //Float variables - float DistanseBlood = 150f; - float RotationSpeed = 0.3f; - float Rotation = 0.0f; - float LaserRotation = MathHelper.PiOver2; - float NewRotation = MathHelper.PiOver2; + //Bool variables + bool Ram + { + get { return ((this.CogHands.X == -1 && this.CogHands.Y == -1) || npc.ai[1] == 1); } + } + bool FirstAI = true; + bool SecondAI = true; + bool NeedCheck = false; + bool Flag = true; + bool Flag1 = true; + bool Flag2 = true; + bool Rockets = true; - //Int variables - int GetLaserDamage - { - get { return 30; } - } - int AnimationRate = 6; - int CurrentFrame = 0; - int TimeToAnimation = 6; - int Timer = 0; - int Timer2 = 0; - int ShootType = ProjectileID.HeatRay; - int LaserPosition = 20; - int ShootRate = 10; - int TimeToShoot = 4; - float PreviousRageRotation = 0; + //Float variables + float DistanseBlood = 150f; + float RotationSpeed = 0.3f; + float Rotation = 0.0f; + float LaserRotation = MathHelper.PiOver2; + float NewRotation = MathHelper.PiOver2; - //String variables - string LeftHandName = "CogLordHand"; - string RightHandName = "CogLordGun"; - public override void SetDefaults() - { - npc.lifeMax = 45000; - npc.damage = 25; - npc.defense = 5; - npc.knockBackResist = 0.0f; - npc.width = 86; - npc.height = 124; - npc.aiStyle = 11; - npc.noGravity = true; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath10; - npc.boss = true; - music = mod.GetSoundSlot(SoundType.Music, "Sounds/Music/Boss6"); - bossBag = mod.ItemType("CogLordBag"); - } + //Int variables + int GetLaserDamage + { + get { return 30; } + } + int AnimationRate = 6; + int CurrentFrame = 0; + int TimeToAnimation = 6; + int Timer = 0; + int Timer2 = 0; + int ShootType = ProjectileID.HeatRay; + int LaserPosition = 20; + int ShootRate = 10; + int TimeToShoot = 4; + float PreviousRageRotation = 0; - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 0.625f * bossLifeScale); - npc.damage = (int)(npc.damage * 0.6f); - } + //String variables + string LeftHandName = "CogLordHand"; + string RightHandName = "CogLordGun"; + public override void SetDefaults() + { + npc.lifeMax = 45000; + npc.damage = 25; + npc.defense = 5; + npc.knockBackResist = 0.0f; + npc.width = 86; + npc.height = 124; + npc.aiStyle = 11; + npc.noGravity = true; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit4; + npc.DeathSound = SoundID.NPCDeath10; + npc.boss = true; + music = mod.GetSoundSlot(SoundType.Music, "Sounds/Music/Boss6"); + bossBag = mod.ItemType("CogLordBag"); + } - public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) - { - spriteBatch.Draw(mod.GetTexture("NPCs/CogLordBody"), npc.Center - Main.screenPosition, null, Color.White, 0f, new Vector2(44, -18), 1f, SpriteEffects.None, 0f); - Texture2D drawTexture = Main.npcTexture[npc.type]; - Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); - Vector2 drawPos = new Vector2( - npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, - npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); - SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); - return false; - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 0.625f * bossLifeScale); + npc.damage = (int)(npc.damage * 0.6f); + } - public override void AI() - { - npc.TargetClosest(); - if (Main.dayTime) - { - this.Timer = 0; - } - if (NPC.AnyNPCs(mod.NPCType("CogLordProbe"))) - { - npc.dontTakeDamage = true; - } - else - npc.dontTakeDamage = false; - if (!Main.expertMode) - npc.position += npc.velocity * 1.7f; - else - npc.position += npc.velocity * 1.02f; - this.Timer++; - this.Animation(); - for (int i = 0; i < Main.dust.Length; i++) - { - if (Main.dust[i].type == DustID.Blood && npc.Distance(Main.dust[i].position) < this.DistanseBlood) - { - Main.dust[i].scale /= 1000000f; - Main.dust[i].active = false; - } - } - foreach (NPC npc2 in Main.npc) - { - if (npc2.type == 36) - { - npc2.active = false; - npc2.life = 0; - npc2.checkDead(); - } - } - foreach (var proj in Main.projectile) - { - if (proj.type == ProjectileID.Skull && Vector2.Distance(proj.Center, npc.Center) < 100f) - { - proj.active = false; - } - } - if (npc.life < npc.lifeMax * 0.6f && Flag) - { - Flag = false; - if (Main.expertMode) - this.CogMessage("Low health is detected. Launching support drones."); - else - this.CogMessage("Low health is detected. Launching support drone."); - if (Main.expertMode) - NPC.NewNPC((int)npc.Center.X - 100, (int)npc.Center.Y - 100, mod.NPCType("CogLordProbe"), 0, npc.whoAmI, 0, 200); - NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("CogLordProbe"), 0, npc.whoAmI, 0, 200); - } - if (npc.life < npc.lifeMax * 0.4f && Flag1) - { - Flag1 = false; - if (Main.expertMode) - this.CogMessage("Low health is detected. Launching support drones."); - else - this.CogMessage("Low health is detected. Launching support drone."); - if (Main.expertMode) - NPC.NewNPC((int)npc.Center.X - 100, (int)npc.Center.Y - 100, mod.NPCType("CogLordProbe"), 0, npc.whoAmI, 0, 200); - NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("CogLordProbe"), 0, npc.whoAmI, 0, 200); - } - if (npc.life < npc.lifeMax * 0.2f && Flag2) - { - Flag2 = false; - if (Main.expertMode) - this.CogMessage("Low health is detected. Launching support drones."); - else - this.CogMessage("Low health is detected. Launching support drone."); - if (Main.expertMode) - NPC.NewNPC((int)npc.Center.X - 100, (int)npc.Center.Y - 100, mod.NPCType("CogLordProbe"), 0, npc.whoAmI, 0, 200); - NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("CogLordProbe"), 0, npc.whoAmI, 0, 200); - } - if (this.FirstAI) - { - this.FirstAI = false; - } - else - { - if (this.SecondAI) - { - this.MakeHands(); - this.SecondAI = false; - this.NeedCheck = true; - } - } - if (!this.Ram) - { - if (this.NeedCheck) - this.CheckHands(); - if (this.CogHands.Y != -1 && this.NeedCheck) - { - Main.npc[(int)this.CogHands.Y].localAI[3] = 0; - } - } - else - { - if (this.Rockets) - { - this.Rockets = false; - this.CogMessage("Protocol 10 is activated: Preparing for rocket storm."); - } - npc.frame = GetFrame(5); - this.Rotation += this.RotationSpeed; - npc.rotation = this.Rotation; - if ((int)(Main.time % 120) == 0) - { - for (int k = 0; k < ((Main.expertMode) ? 2 : 1); k++) - { - Vector2 Velocity = Helper.VelocityToPoint(npc.Center, Helper.RandomPointInArea(new Vector2(Main.player[Main.myPlayer].Center.X - 10, Main.player[Main.myPlayer].Center.Y - 10), new Vector2(Main.player[Main.myPlayer].Center.X + 20, Main.player[Main.myPlayer].Center.Y + 20)), 20); - int i = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, Velocity.X, Velocity.Y, 134, (int)(this.GetLaserDamage * ((Main.expertMode) ? 3 : 2)), 1f); - Main.projectile[i].hostile = true; - Main.projectile[i].tileCollide = true; - Main.projectile[i].friendly = false; - } - } - if (this.NeedCheck) - this.CheckHands(); - if (this.CogHands.Y != -1 && this.NeedCheck) - { - Main.npc[(int)this.CogHands.Y].localAI[3] = 1; - } - } - if (this.Timer == 400) - { - this.CogMessage("Protocol 11 is activated: Clockwork laser cutter is being enabled."); - } - if (this.Timer >= 500 && this.Timer < 800) - { - this.PreviousRageRotation = 0f; - if (Main.netMode != 1) - { - this.LaserRotation += 0.01f; - if (--this.TimeToShoot <= 0) - { - this.TimeToShoot = this.ShootRate; - var ShootPos = npc.Center + new Vector2(0, 17); - var ShootVel = new Vector2(0, 7).RotatedBy(LaserRotation); - int[] i = new int[] - { - Projectile.NewProjectile(ShootPos, ShootVel, this.ShootType, this.GetLaserDamage, 1f), - Projectile.NewProjectile(ShootPos, ShootVel.RotatedBy(MathHelper.PiOver2), this.ShootType, this.GetLaserDamage, 1f), - Projectile.NewProjectile(ShootPos, ShootVel.RotatedBy(MathHelper.Pi), this.ShootType, this.GetLaserDamage, 1f), - Projectile.NewProjectile(ShootPos, ShootVel.RotatedBy(-MathHelper.PiOver2), this.ShootType, this.GetLaserDamage, 1f) - }; - for (int l = 0; l < i.Length; l++) - { - Main.projectile[i[l]].hostile = true; - Main.projectile[i[l]].tileCollide = false; - } - } - } - } - if (this.Timer >= 800 && this.Timer < 1200) - { - npc.velocity.X *= 2.00f; - npc.velocity.Y *= 2.00f; - Vector2 Vector = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height * 0.5f)); - { - float CLRad = (float)Math.Atan2((Vector.Y) - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), (Vector.X) - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); - npc.velocity.X = (float)(Math.Cos(CLRad) * 4) * -1; - npc.velocity.Y = (float)(Math.Sin(CLRad) * 4) * -1; - } - } - if (this.Timer == 1100) - { - this.CogMessage("Protocol 12 is activated: Summoning gears."); - } - if (this.Timer > 1200 && this.Timer < 1700) - { - if ((int)(Main.time % 15) == 0) - NPC.NewNPC((int)((Main.player[npc.target].position.X - 500) + Main.rand.Next(1000)), (int)((Main.player[npc.target].position.Y - 500) + Main.rand.Next(1000)), mod.NPCType("GogLordGog")); - } - if (this.Timer == 1600) - { - this.CogMessage("Protocol 13 is activated: Rocket attack incoming."); - } - if (this.Timer >= 1700 && this.Timer < 1775) - { - if (Helper.Chance(0.3f)) - { - var ShootPos = Main.player[npc.target].position + new Vector2(Main.rand.Next(-1000, 1000), -1000); - var ShootVel = new Vector2(Main.rand.NextFloat(-3f, 3f), Main.rand.NextFloat(15f, 20f)); - int i = Projectile.NewProjectile(ShootPos, ShootVel, 134, (int)(this.GetLaserDamage * ((Main.expertMode) ? 3 : 2)), 1f); - Main.projectile[i].hostile = true; - Main.projectile[i].tileCollide = true; - Main.projectile[i].friendly = false; - } - } - if (this.Timer > 1775) - { - this.Rockets = true; - this.Timer = 0; - } - this.Rotation = 0; - } + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) + { + spriteBatch.Draw(mod.GetTexture("NPCs/CogLordBody"), npc.Center - Main.screenPosition, null, Color.White, 0f, new Vector2(44, -18), 1f, SpriteEffects.None, 0f); + Texture2D drawTexture = Main.npcTexture[npc.type]; + Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); + Vector2 drawPos = new Vector2( + npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, + npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); + SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); + return false; + } - public void CheckHands() - { - if (this.CogHands.X != -1) - if (!((Main.npc[(int)this.CogHands.X].type == mod.NPCType(this.LeftHandName) && Main.npc[(int)this.CogHands.X].ai[1] == npc.whoAmI) && Main.npc[(int)this.CogHands.X].active)) - this.CogHands.X = -1; - if (this.CogHands.Y != -1) - if (!((Main.npc[(int)this.CogHands.Y].type == mod.NPCType(this.RightHandName) && Main.npc[(int)this.CogHands.Y].ai[1] == npc.whoAmI) && Main.npc[(int)this.CogHands.Y].active)) - this.CogHands.Y = -1; - } + public override void AI() + { + npc.TargetClosest(); + if (Main.dayTime) + { + this.Timer = 0; + } + if (NPC.AnyNPCs(mod.NPCType("CogLordProbe"))) + { + npc.dontTakeDamage = true; + } + else + npc.dontTakeDamage = false; + if (!Main.expertMode) + npc.position += npc.velocity * 1.7f; + else + npc.position += npc.velocity * 1.02f; + this.Timer++; + this.Animation(); + for (int i = 0; i < Main.dust.Length; i++) + { + if (Main.dust[i].type == DustID.Blood && npc.Distance(Main.dust[i].position) < this.DistanseBlood) + { + Main.dust[i].scale /= 1000000f; + Main.dust[i].active = false; + } + } + foreach (NPC npc2 in Main.npc) + { + if (npc2.type == 36) + { + npc2.active = false; + npc2.life = 0; + npc2.checkDead(); + } + } + foreach (var proj in Main.projectile) + { + if (proj.type == ProjectileID.Skull && Vector2.Distance(proj.Center, npc.Center) < 100f) + { + proj.active = false; + } + } + if (npc.life < npc.lifeMax * 0.6f && Flag) + { + Flag = false; + if (Main.expertMode) + this.CogMessage("Low health is detected. Launching support drones."); + else + this.CogMessage("Low health is detected. Launching support drone."); + if (Main.expertMode) + NPC.NewNPC((int)npc.Center.X - 100, (int)npc.Center.Y - 100, mod.NPCType("CogLordProbe"), 0, npc.whoAmI, 0, 200); + NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("CogLordProbe"), 0, npc.whoAmI, 0, 200); + } + if (npc.life < npc.lifeMax * 0.4f && Flag1) + { + Flag1 = false; + if (Main.expertMode) + this.CogMessage("Low health is detected. Launching support drones."); + else + this.CogMessage("Low health is detected. Launching support drone."); + if (Main.expertMode) + NPC.NewNPC((int)npc.Center.X - 100, (int)npc.Center.Y - 100, mod.NPCType("CogLordProbe"), 0, npc.whoAmI, 0, 200); + NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("CogLordProbe"), 0, npc.whoAmI, 0, 200); + } + if (npc.life < npc.lifeMax * 0.2f && Flag2) + { + Flag2 = false; + if (Main.expertMode) + this.CogMessage("Low health is detected. Launching support drones."); + else + this.CogMessage("Low health is detected. Launching support drone."); + if (Main.expertMode) + NPC.NewNPC((int)npc.Center.X - 100, (int)npc.Center.Y - 100, mod.NPCType("CogLordProbe"), 0, npc.whoAmI, 0, 200); + NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("CogLordProbe"), 0, npc.whoAmI, 0, 200); + } + if (this.FirstAI) + { + this.FirstAI = false; + } + else + { + if (this.SecondAI) + { + this.MakeHands(); + this.SecondAI = false; + this.NeedCheck = true; + } + } + if (!this.Ram) + { + if (this.NeedCheck) + this.CheckHands(); + if (this.CogHands.Y != -1 && this.NeedCheck) + { + Main.npc[(int)this.CogHands.Y].localAI[3] = 0; + } + } + else + { + if (this.Rockets) + { + this.Rockets = false; + this.CogMessage("Protocol 10 is activated: Preparing for rocket storm."); + } + npc.frame = GetFrame(5); + this.Rotation += this.RotationSpeed; + npc.rotation = this.Rotation; + if ((int)(Main.time % 120) == 0) + { + for (int k = 0; k < ((Main.expertMode) ? 2 : 1); k++) + { + Vector2 Velocity = Helper.VelocityToPoint(npc.Center, Helper.RandomPointInArea(new Vector2(Main.player[Main.myPlayer].Center.X - 10, Main.player[Main.myPlayer].Center.Y - 10), new Vector2(Main.player[Main.myPlayer].Center.X + 20, Main.player[Main.myPlayer].Center.Y + 20)), 20); + int i = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, Velocity.X, Velocity.Y, 134, (int)(this.GetLaserDamage * ((Main.expertMode) ? 3 : 2)), 1f); + Main.projectile[i].hostile = true; + Main.projectile[i].tileCollide = true; + Main.projectile[i].friendly = false; + } + } + if (this.NeedCheck) + this.CheckHands(); + if (this.CogHands.Y != -1 && this.NeedCheck) + { + Main.npc[(int)this.CogHands.Y].localAI[3] = 1; + } + } + if (this.Timer == 400) + { + this.CogMessage("Protocol 11 is activated: Clockwork laser cutter is being enabled."); + } + if (this.Timer >= 500 && this.Timer < 800) + { + this.PreviousRageRotation = 0f; + if (Main.netMode != 1) + { + this.LaserRotation += 0.01f; + if (--this.TimeToShoot <= 0) + { + this.TimeToShoot = this.ShootRate; + var ShootPos = npc.Center + new Vector2(0, 17); + var ShootVel = new Vector2(0, 7).RotatedBy(LaserRotation); + int[] i = new int[] + { + Projectile.NewProjectile(ShootPos, ShootVel, this.ShootType, this.GetLaserDamage, 1f), + Projectile.NewProjectile(ShootPos, ShootVel.RotatedBy(MathHelper.PiOver2), this.ShootType, this.GetLaserDamage, 1f), + Projectile.NewProjectile(ShootPos, ShootVel.RotatedBy(MathHelper.Pi), this.ShootType, this.GetLaserDamage, 1f), + Projectile.NewProjectile(ShootPos, ShootVel.RotatedBy(-MathHelper.PiOver2), this.ShootType, this.GetLaserDamage, 1f) + }; + for (int l = 0; l < i.Length; l++) + { + Main.projectile[i[l]].hostile = true; + Main.projectile[i[l]].tileCollide = false; + } + } + } + } + if (this.Timer >= 800 && this.Timer < 1200) + { + npc.velocity.X *= 2.00f; + npc.velocity.Y *= 2.00f; + Vector2 Vector = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height * 0.5f)); + { + float CLRad = (float)Math.Atan2((Vector.Y) - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), (Vector.X) - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); + npc.velocity.X = (float)(Math.Cos(CLRad) * 4) * -1; + npc.velocity.Y = (float)(Math.Sin(CLRad) * 4) * -1; + } + } + if (this.Timer == 1100) + { + this.CogMessage("Protocol 12 is activated: Summoning gears."); + } + if (this.Timer > 1200 && this.Timer < 1700) + { + if ((int)(Main.time % 15) == 0) + NPC.NewNPC((int)((Main.player[npc.target].position.X - 500) + Main.rand.Next(1000)), (int)((Main.player[npc.target].position.Y - 500) + Main.rand.Next(1000)), mod.NPCType("GogLordGog")); + } + if (this.Timer == 1600) + { + this.CogMessage("Protocol 13 is activated: Rocket attack incoming."); + } + if (this.Timer >= 1700 && this.Timer < 1775) + { + if (Helper.Chance(0.3f)) + { + var ShootPos = Main.player[npc.target].position + new Vector2(Main.rand.Next(-1000, 1000), -1000); + var ShootVel = new Vector2(Main.rand.NextFloat(-3f, 3f), Main.rand.NextFloat(15f, 20f)); + int i = Projectile.NewProjectile(ShootPos, ShootVel, 134, (int)(this.GetLaserDamage * ((Main.expertMode) ? 3 : 2)), 1f); + Main.projectile[i].hostile = true; + Main.projectile[i].tileCollide = true; + Main.projectile[i].friendly = false; + } + } + if (this.Timer > 1775) + { + this.Rockets = true; + this.Timer = 0; + } + this.Rotation = 0; + } - public void MakeHands() - { - this.CogHands.X = NPC.NewNPC((int)npc.Center.X - 50, (int)npc.Center.Y, mod.NPCType(LeftHandName), 0, 1, npc.whoAmI); - this.CogHands.Y = NPC.NewNPC((int)npc.Center.X + 50, (int)npc.Center.Y, mod.NPCType(RightHandName), 0, -1, npc.whoAmI); - } + public void CheckHands() + { + if (this.CogHands.X != -1) + if (!((Main.npc[(int)this.CogHands.X].type == mod.NPCType(this.LeftHandName) && Main.npc[(int)this.CogHands.X].ai[1] == npc.whoAmI) && Main.npc[(int)this.CogHands.X].active)) + this.CogHands.X = -1; + if (this.CogHands.Y != -1) + if (!((Main.npc[(int)this.CogHands.Y].type == mod.NPCType(this.RightHandName) && Main.npc[(int)this.CogHands.Y].ai[1] == npc.whoAmI) && Main.npc[(int)this.CogHands.Y].active)) + this.CogHands.Y = -1; + } + + public void MakeHands() + { + this.CogHands.X = NPC.NewNPC((int)npc.Center.X - 50, (int)npc.Center.Y, mod.NPCType(LeftHandName), 0, 1, npc.whoAmI); + this.CogHands.Y = NPC.NewNPC((int)npc.Center.X + 50, (int)npc.Center.Y, mod.NPCType(RightHandName), 0, -1, npc.whoAmI); + } - public void Animation() - { - if (--TimeToAnimation <= 0) - { - if (++CurrentFrame > 4) - CurrentFrame = 1; - TimeToAnimation = AnimationRate; - npc.frame = GetFrame(CurrentFrame); - } - } + public void Animation() + { + if (--TimeToAnimation <= 0) + { + if (++CurrentFrame > 4) + CurrentFrame = 1; + TimeToAnimation = AnimationRate; + npc.frame = GetFrame(CurrentFrame); + } + } - Rectangle GetFrame(int Number) - { - return new Rectangle(0, npc.frame.Height * (Number - 1), npc.frame.Width, npc.frame.Height); - } + Rectangle GetFrame(int Number) + { + return new Rectangle(0, npc.frame.Height * (Number - 1), npc.frame.Width, npc.frame.Height); + } - public void CogMessage(string Message) - { - string Text = "[CL-AI]: " + Message; - if (Main.netMode != 2) - { - Main.NewText("[CL-AI]: " + Message, 208, 137, 55); - } - else - { - //NetMessage.SendData(25, -1, -1, Text, 208, 137, 55, 150); - } - } - public override void NPCLoot() - { + public void CogMessage(string Message) + { + string Text = "[CL-AI]: " + Message; + if (Main.netMode != 2) + { + Main.NewText("[CL-AI]: " + Message, 208, 137, 55); + } + else + { + //NetMessage.SendData(25, -1, -1, Text, 208, 137, 55, 150); + } + } + public override void NPCLoot() + { TremorWorld.downedCogLord = true; - if (Main.netMode != 1) - { - if (Main.expertMode) - { - npc.DropBossBags(); - } - if (!Main.expertMode && Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrassChip")); - } - if (!Main.expertMode && Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CogLordMask")); - } - if (!Main.expertMode && Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrassRapier")); - } - if (!Main.expertMode && Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrassChainRepeater")); - } - if (!Main.expertMode && Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrassStave")); - } - if (Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CogLordTrophy")); - } - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 499, Main.rand.Next(6, 25)); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 500, Main.rand.Next(6, 25)); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrassNugget"), Main.rand.Next(18, 32)); - } - } - } + if (Main.netMode != 1) + { + if (Main.expertMode) + { + npc.DropBossBags(); + } + if (!Main.expertMode && Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrassChip")); + } + if (!Main.expertMode && Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CogLordMask")); + } + if (!Main.expertMode && Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrassRapier")); + } + if (!Main.expertMode && Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrassChainRepeater")); + } + if (!Main.expertMode && Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrassStave")); + } + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CogLordTrophy")); + } + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 499, Main.rand.Next(6, 25)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 500, Main.rand.Next(6, 25)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrassNugget"), Main.rand.Next(18, 32)); + } + } + } } \ No newline at end of file diff --git a/NPCs/CogLordArm.cs b/NPCs/CogLordArm.cs index 703eadbc..e75d8111 100644 --- a/NPCs/CogLordArm.cs +++ b/NPCs/CogLordArm.cs @@ -9,71 +9,71 @@ namespace Tremor.NPCs { - public class CogLordArm : ModNPC - { + public class CogLordArm : ModNPC + { public override void SetStaticDefaults() { Main.npcFrameCount[npc.type] = 2; } - - //Int variables - int AnimationRate = 6; - int CurrentFrame = 0; - int TimeToAnimation = 6; - //Float variables - float Dist = 150; - public override void SetDefaults() - { - npc.lifeMax = 1; - npc.knockBackResist = 0.5f; - npc.width = 104; - npc.height = 38; - npc.aiStyle = 0; - npc.noGravity = true; - npc.noTileCollide = true; - npc.dontTakeDamage = true; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.value = Item.buyPrice(0, 0, 5, 0); - } + //Int variables + int AnimationRate = 6; + int CurrentFrame = 0; + int TimeToAnimation = 6; - public override void AI() - { - if (--TimeToAnimation <= 0) - { - if (++CurrentFrame > 2) - CurrentFrame = 1; - TimeToAnimation = AnimationRate; - npc.frame = GetFrame(CurrentFrame); - } + //Float variables + float Dist = 150; + public override void SetDefaults() + { + npc.lifeMax = 1; + npc.knockBackResist = 0.5f; + npc.width = 104; + npc.height = 38; + npc.aiStyle = 0; + npc.noGravity = true; + npc.noTileCollide = true; + npc.dontTakeDamage = true; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.value = Item.buyPrice(0, 0, 5, 0); + } - if (Main.npc[(int)npc.ai[0]].type == mod.NPCType("CogLordArmSecond") && Main.npc[(int)npc.ai[0]].active) - { - npc.Center = Helper.CenterPoint(Main.npc[(int)npc.ai[3]].Center, Main.npc[(int)npc.ai[0]].Center); - npc.rotation = Helper.rotateBetween2Points(Main.npc[(int)npc.ai[3]].Center, Main.npc[(int)npc.ai[0]].Center); - if (npc.ai[1] == 0) npc.spriteDirection = -1; - else npc.spriteDirection = 1; - } - else - npc.life = -1; - } + public override void AI() + { + if (--TimeToAnimation <= 0) + { + if (++CurrentFrame > 2) + CurrentFrame = 1; + TimeToAnimation = AnimationRate; + npc.frame = GetFrame(CurrentFrame); + } - Rectangle GetFrame(int Number) - { - return new Rectangle(0, npc.frame.Height * (Number - 1), npc.frame.Width, npc.frame.Height); - } + if (Main.npc[(int)npc.ai[0]].type == mod.NPCType("CogLordArmSecond") && Main.npc[(int)npc.ai[0]].active) + { + npc.Center = Helper.CenterPoint(Main.npc[(int)npc.ai[3]].Center, Main.npc[(int)npc.ai[0]].Center); + npc.rotation = Helper.rotateBetween2Points(Main.npc[(int)npc.ai[3]].Center, Main.npc[(int)npc.ai[0]].Center); + if (npc.ai[1] == 0) npc.spriteDirection = -1; + else npc.spriteDirection = 1; + } + else + npc.life = -1; + } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Texture2D drawTexture = Main.npcTexture[npc.type]; - Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); - Vector2 drawPos = new Vector2( - npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, - npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); - SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); - return false; - } - } + Rectangle GetFrame(int Number) + { + return new Rectangle(0, npc.frame.Height * (Number - 1), npc.frame.Width, npc.frame.Height); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D drawTexture = Main.npcTexture[npc.type]; + Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); + Vector2 drawPos = new Vector2( + npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, + npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); + SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); + return false; + } + } } \ No newline at end of file diff --git a/NPCs/CogLordArmSecond.cs b/NPCs/CogLordArmSecond.cs index 3f63bfd1..637ec688 100644 --- a/NPCs/CogLordArmSecond.cs +++ b/NPCs/CogLordArmSecond.cs @@ -9,72 +9,72 @@ namespace Tremor.NPCs { - public class CogLordArmSecond : ModNPC - { + public class CogLordArmSecond : ModNPC + { public override void SetStaticDefaults() { Main.npcFrameCount[npc.type] = 2; } - - //Int variables - int AnimationRate = 6; - int CurrentFrame = 0; - int TimeToAnimation = 6; - //Float variables - float Dist = 150; - public override void SetDefaults() - { - npc.lifeMax = 1; - npc.knockBackResist = 0.5f; - npc.width = 112; - npc.height = 34; - npc.aiStyle = 0; - npc.noGravity = true; - npc.noTileCollide = true; - npc.dontTakeDamage = true; - npc.HitSound = SoundID.NPCHit1; - Main.npcFrameCount[npc.type] = 2; - npc.DeathSound = SoundID.NPCDeath1; - npc.value = Item.buyPrice(0, 0, 5, 0); - } + //Int variables + int AnimationRate = 6; + int CurrentFrame = 0; + int TimeToAnimation = 6; - public override void AI() - { - if (--TimeToAnimation <= 0) - { - if (++CurrentFrame > 2) - CurrentFrame = 1; - TimeToAnimation = AnimationRate; - npc.frame = GetFrame(CurrentFrame); - } + //Float variables + float Dist = 150; + public override void SetDefaults() + { + npc.lifeMax = 1; + npc.knockBackResist = 0.5f; + npc.width = 112; + npc.height = 34; + npc.aiStyle = 0; + npc.noGravity = true; + npc.noTileCollide = true; + npc.dontTakeDamage = true; + npc.HitSound = SoundID.NPCHit1; + Main.npcFrameCount[npc.type] = 2; + npc.DeathSound = SoundID.NPCDeath1; + npc.value = Item.buyPrice(0, 0, 5, 0); + } + + public override void AI() + { + if (--TimeToAnimation <= 0) + { + if (++CurrentFrame > 2) + CurrentFrame = 1; + TimeToAnimation = AnimationRate; + npc.frame = GetFrame(CurrentFrame); + } - if ((Main.npc[(int)npc.ai[0]].type == mod.NPCType("CogLordGun") || Main.npc[(int)npc.ai[0]].type == mod.NPCType("CogLordHand")) && Main.npc[(int)npc.ai[0]].active) - { - npc.Center = Helper.CenterPoint(Helper.CenterPoint(Main.npc[(int)npc.ai[3]].Center, Main.npc[(int)npc.ai[0]].Center), Main.npc[(int)npc.ai[0]].Center); - npc.rotation = Helper.rotateBetween2Points(Main.npc[(int)npc.ai[3]].Center, Main.npc[(int)npc.ai[0]].Center); - if (npc.ai[1] == 0) npc.spriteDirection = -1; - else npc.spriteDirection = 1; - } - else - npc.life = -1; - } + if ((Main.npc[(int)npc.ai[0]].type == mod.NPCType("CogLordGun") || Main.npc[(int)npc.ai[0]].type == mod.NPCType("CogLordHand")) && Main.npc[(int)npc.ai[0]].active) + { + npc.Center = Helper.CenterPoint(Helper.CenterPoint(Main.npc[(int)npc.ai[3]].Center, Main.npc[(int)npc.ai[0]].Center), Main.npc[(int)npc.ai[0]].Center); + npc.rotation = Helper.rotateBetween2Points(Main.npc[(int)npc.ai[3]].Center, Main.npc[(int)npc.ai[0]].Center); + if (npc.ai[1] == 0) npc.spriteDirection = -1; + else npc.spriteDirection = 1; + } + else + npc.life = -1; + } - Rectangle GetFrame(int Number) - { - return new Rectangle(0, npc.frame.Height * (Number - 1), npc.frame.Width, npc.frame.Height); - } + Rectangle GetFrame(int Number) + { + return new Rectangle(0, npc.frame.Height * (Number - 1), npc.frame.Width, npc.frame.Height); + } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Texture2D drawTexture = Main.npcTexture[npc.type]; - Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); - Vector2 drawPos = new Vector2( - npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, - npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); - SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); - return false; - } - } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D drawTexture = Main.npcTexture[npc.type]; + Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); + Vector2 drawPos = new Vector2( + npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, + npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); + SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); + return false; + } + } } \ No newline at end of file diff --git a/NPCs/CogLordGun.cs b/NPCs/CogLordGun.cs index 41d05cbc..5f62bc36 100644 --- a/NPCs/CogLordGun.cs +++ b/NPCs/CogLordGun.cs @@ -9,126 +9,126 @@ namespace Tremor.NPCs { - public class CogLordGun : ModNPC - { + public class CogLordGun : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Cog Lord Gun"); } - - const int ShootRate = 120; - const int ShootDamage = 20; - const float ShootKN = 1.0f; - const int ShootType = 88; - const float ShootSpeed = 5; - const int ShootCount = 10; - const int spread = 45; - const float spreadMult = 0.045f; - const float MaxDist = 250f; - int TimeToShoot = ShootRate; + const int ShootRate = 120; + const int ShootDamage = 20; + const float ShootKN = 1.0f; + const int ShootType = 88; + const float ShootSpeed = 5; + const int ShootCount = 10; + const int spread = 45; + const float spreadMult = 0.045f; + const float MaxDist = 250f; - public override void SetDefaults() - { - npc.lifeMax = 20000; - npc.damage = 80; - npc.defense = 20; - npc.knockBackResist = 0f; - npc.width = 88; - npc.height = 46; - npc.aiStyle = 12; - npc.noGravity = true; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath14; - npc.value = Item.buyPrice(0, 0, 5, 0); - } + int TimeToShoot = ShootRate; - public override void HitEffect(int hitDirection, double damage) - { - if (npc.life <= 0) - { - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CogLordGun"), 1f); + public override void SetDefaults() + { + npc.lifeMax = 20000; + npc.damage = 80; + npc.defense = 20; + npc.knockBackResist = 0f; + npc.width = 88; + npc.height = 46; + npc.aiStyle = 12; + npc.noGravity = true; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit4; + npc.DeathSound = SoundID.NPCDeath14; + npc.value = Item.buyPrice(0, 0, 5, 0); + } - } - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CogLordGun"), 1f); - bool FirstAI = true; - public override void AI() - { - if (FirstAI) - { - FirstAI = false; - MakeArms(); - } - if (Main.npc[(int)npc.ai[1]].type == mod.NPCType("CogLord") && Main.npc[(int)npc.ai[1]].active) - if (Main.player[Main.npc[(int)npc.ai[1]].target].active) - { - if (npc.localAI[3] == 0f) - { - npc.rotation = Helper.rotateBetween2Points(npc.Center, Main.player[Main.npc[(int)npc.ai[1]].target].Center); - if (--TimeToShoot <= 0) Shoot(); - } - } - if (NPC.AnyNPCs(mod.NPCType("CogLordProbe"))) - { - npc.dontTakeDamage = true; - } - else - { - npc.dontTakeDamage = false; - } - Vector2 CogLordCenter = Main.npc[(int)npc.ai[1]].Center; - Vector2 Distance = npc.Center - CogLordCenter; - if (Distance.Length() >= MaxDist) - { - Distance.Normalize(); - Distance *= MaxDist; - npc.Center = CogLordCenter + Distance; - } - } + } + } - void MakeArms() - { - int Arm = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("CogLordArm"), 0, 9999, 1, 1, npc.ai[1]); - int Arm2 = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("CogLordArmSecond"), 0, npc.whoAmI, 0, 1, Arm); - Main.npc[Arm].ai[0] = Arm2; - } + bool FirstAI = true; + public override void AI() + { + if (FirstAI) + { + FirstAI = false; + MakeArms(); + } + if (Main.npc[(int)npc.ai[1]].type == mod.NPCType("CogLord") && Main.npc[(int)npc.ai[1]].active) + if (Main.player[Main.npc[(int)npc.ai[1]].target].active) + { + if (npc.localAI[3] == 0f) + { + npc.rotation = Helper.rotateBetween2Points(npc.Center, Main.player[Main.npc[(int)npc.ai[1]].target].Center); + if (--TimeToShoot <= 0) Shoot(); + } + } + if (NPC.AnyNPCs(mod.NPCType("CogLordProbe"))) + { + npc.dontTakeDamage = true; + } + else + { + npc.dontTakeDamage = false; + } + Vector2 CogLordCenter = Main.npc[(int)npc.ai[1]].Center; + Vector2 Distance = npc.Center - CogLordCenter; + if (Distance.Length() >= MaxDist) + { + Distance.Normalize(); + Distance *= MaxDist; + npc.Center = CogLordCenter + Distance; + } + } - void Shoot() - { - TimeToShoot = ShootRate; - if (Main.npc[(int)npc.ai[1]].target != -1) - { - Vector2 velocity = Helper.VelocityToPoint(npc.Center, Main.player[Main.npc[(int)npc.ai[1]].target].Center, ShootSpeed); - for (int l = 0; l < 2; l++) - { - velocity.X = velocity.X + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - velocity.Y = velocity.Y + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - int i = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, velocity.X, velocity.Y, ShootType, ShootDamage, ShootKN); - Main.projectile[i].hostile = true; - Main.projectile[i].friendly = false; - } - } - } + void MakeArms() + { + int Arm = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("CogLordArm"), 0, 9999, 1, 1, npc.ai[1]); + int Arm2 = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("CogLordArmSecond"), 0, npc.whoAmI, 0, 1, Arm); + Main.npc[Arm].ai[0] = Arm2; + } - public override bool PreNPCLoot() - { - npc.aiStyle = -1; - npc.ai[1] = -1; - return false; - } + void Shoot() + { + TimeToShoot = ShootRate; + if (Main.npc[(int)npc.ai[1]].target != -1) + { + Vector2 velocity = Helper.VelocityToPoint(npc.Center, Main.player[Main.npc[(int)npc.ai[1]].target].Center, ShootSpeed); + for (int l = 0; l < 2; l++) + { + velocity.X = velocity.X + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.Y = velocity.Y + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + int i = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, velocity.X, velocity.Y, ShootType, ShootDamage, ShootKN); + Main.projectile[i].hostile = true; + Main.projectile[i].friendly = false; + } + } + } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Texture2D drawTexture = Main.npcTexture[npc.type]; - Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); - Vector2 drawPos = new Vector2( - npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, - npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); - SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); - return false; - } - } + public override bool PreNPCLoot() + { + npc.aiStyle = -1; + npc.ai[1] = -1; + return false; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D drawTexture = Main.npcTexture[npc.type]; + Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); + Vector2 drawPos = new Vector2( + npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, + npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); + SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); + return false; + } + } } \ No newline at end of file diff --git a/NPCs/CogLordHand.cs b/NPCs/CogLordHand.cs index 8d4d60e4..98abf2b3 100644 --- a/NPCs/CogLordHand.cs +++ b/NPCs/CogLordHand.cs @@ -9,109 +9,109 @@ namespace Tremor.NPCs { - public class CogLordHand : ModNPC - { + public class CogLordHand : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Cog Lord Hand"); } - - public override void SetDefaults() - { - npc.lifeMax = 20000; - npc.damage = 80; - npc.defense = 20; - npc.knockBackResist = 0f; - npc.width = 44; - npc.height = 84; - npc.aiStyle = 12; - npc.noGravity = true; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath14; - Main.npcFrameCount[npc.type] = 2; - npc.value = Item.buyPrice(0, 0, 5, 0); - } - const float MaxDist = 250f; - bool FirstAI = true; - int timer = 0; - public override void AI() - { - timer++; - if (FirstAI) - { - FirstAI = false; - MakeArms(); - } - if (NPC.AnyNPCs(mod.NPCType("CogLordProbe"))) - { - npc.dontTakeDamage = true; - } - else - npc.dontTakeDamage = false; - if (timer < 1000) - { - npc.frame = GetFrame(1); - npc.damage = 80; - } - if (timer >= 1000 && timer < 1500) - { - npc.frame = GetFrame(2); - npc.dontTakeDamage = true; - npc.damage = 120; - } - if (timer > 1500) - { - timer = 0; - } - Vector2 CogLordCenter = Main.npc[(int)npc.ai[1]].Center; - Vector2 Distance = npc.Center - CogLordCenter; - if (Distance.Length() >= MaxDist) - { - Distance.Normalize(); - Distance *= MaxDist; - npc.Center = CogLordCenter + Distance; - } - } + public override void SetDefaults() + { + npc.lifeMax = 20000; + npc.damage = 80; + npc.defense = 20; + npc.knockBackResist = 0f; + npc.width = 44; + npc.height = 84; + npc.aiStyle = 12; + npc.noGravity = true; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit4; + npc.DeathSound = SoundID.NPCDeath14; + Main.npcFrameCount[npc.type] = 2; + npc.value = Item.buyPrice(0, 0, 5, 0); + } - Rectangle GetFrame(int Number) - { - return new Rectangle(0, npc.frame.Height * (Number - 1), npc.frame.Width, npc.frame.Height); - } + const float MaxDist = 250f; + bool FirstAI = true; + int timer = 0; + public override void AI() + { + timer++; + if (FirstAI) + { + FirstAI = false; + MakeArms(); + } + if (NPC.AnyNPCs(mod.NPCType("CogLordProbe"))) + { + npc.dontTakeDamage = true; + } + else + npc.dontTakeDamage = false; + if (timer < 1000) + { + npc.frame = GetFrame(1); + npc.damage = 80; + } + if (timer >= 1000 && timer < 1500) + { + npc.frame = GetFrame(2); + npc.dontTakeDamage = true; + npc.damage = 120; + } + if (timer > 1500) + { + timer = 0; + } + Vector2 CogLordCenter = Main.npc[(int)npc.ai[1]].Center; + Vector2 Distance = npc.Center - CogLordCenter; + if (Distance.Length() >= MaxDist) + { + Distance.Normalize(); + Distance *= MaxDist; + npc.Center = CogLordCenter + Distance; + } + } - public override void HitEffect(int hitDirection, double damage) - { - if (npc.life <= 0) - { - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CogLordHand"), 1f); - } - } + Rectangle GetFrame(int Number) + { + return new Rectangle(0, npc.frame.Height * (Number - 1), npc.frame.Width, npc.frame.Height); + } - void MakeArms() - { - int Arm = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("CogLordArm"), 0, 9999, 1, 1, npc.ai[1]); - int Arm2 = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("CogLordArmSecond"), 0, npc.whoAmI, 0, 1, Arm); - Main.npc[Arm].ai[0] = Arm2; - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CogLordHand"), 1f); + } + } - public override bool PreNPCLoot() - { - npc.aiStyle = -1; - npc.ai[1] = -1; - return false; - } + void MakeArms() + { + int Arm = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("CogLordArm"), 0, 9999, 1, 1, npc.ai[1]); + int Arm2 = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("CogLordArmSecond"), 0, npc.whoAmI, 0, 1, Arm); + Main.npc[Arm].ai[0] = Arm2; + } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Texture2D drawTexture = Main.npcTexture[npc.type]; - Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); - Vector2 drawPos = new Vector2( - npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, - npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); - SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); - return false; - } - } + public override bool PreNPCLoot() + { + npc.aiStyle = -1; + npc.ai[1] = -1; + return false; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D drawTexture = Main.npcTexture[npc.type]; + Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); + Vector2 drawPos = new Vector2( + npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, + npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); + SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); + return false; + } + } } \ No newline at end of file diff --git a/NPCs/CogLordProbe.cs b/NPCs/CogLordProbe.cs index 3fc542b8..9e249fcf 100644 --- a/NPCs/CogLordProbe.cs +++ b/NPCs/CogLordProbe.cs @@ -9,61 +9,61 @@ namespace Tremor.NPCs { - public class CogLordProbe : ModNPC - { + public class CogLordProbe : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Cog Lord Probe"); } - - public override void SetDefaults() - { - npc.lifeMax = 4500; - //npc.damage = 250; - npc.defense = 10; - npc.knockBackResist = 0f; - npc.width = 42; - npc.height = 42; - npc.aiStyle = 14; - npc.noGravity = true; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath10; - npc.value = Item.buyPrice(0, 1, 0, 0); - } - int ShootRate = 4; - int TimeToShoot = 4; - public override void AI() - { - npc.position += npc.velocity * 1.7f; - npc.rotation = Helper.rotateBetween2Points(npc.Center, Main.npc[(int)npc.ai[0]].Center); - while (npc.Distance(Main.npc[(int)npc.ai[0]].position) > 1000) - { - npc.Center = Main.npc[(int)npc.ai[0]].Center; - } - if (--this.TimeToShoot <= 0) - { - this.TimeToShoot = this.ShootRate; - NPC parent = Main.npc[NPC.FindFirstNPC(mod.NPCType("CogLord"))]; - Vector2 Velocity = Helper.VelocityToPoint(npc.Center, parent.Center, 20); - int k = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, Velocity.X, Velocity.Y, mod.ProjectileType("CogLordLaser"), 100, 1f); - Main.projectile[k].friendly = false; - Main.projectile[k].tileCollide = false; - Main.projectile[k].hostile = true; - } - } + public override void SetDefaults() + { + npc.lifeMax = 4500; + //npc.damage = 250; + npc.defense = 10; + npc.knockBackResist = 0f; + npc.width = 42; + npc.height = 42; + npc.aiStyle = 14; + npc.noGravity = true; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit4; + npc.DeathSound = SoundID.NPCDeath10; + npc.value = Item.buyPrice(0, 1, 0, 0); + } - public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) - { - Texture2D drawTexture = Main.npcTexture[npc.type]; - Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); - Vector2 drawPos = new Vector2( - npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, - npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); - SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); - return false; - } - } + int ShootRate = 4; + int TimeToShoot = 4; + public override void AI() + { + npc.position += npc.velocity * 1.7f; + npc.rotation = Helper.rotateBetween2Points(npc.Center, Main.npc[(int)npc.ai[0]].Center); + while (npc.Distance(Main.npc[(int)npc.ai[0]].position) > 1000) + { + npc.Center = Main.npc[(int)npc.ai[0]].Center; + } + if (--this.TimeToShoot <= 0) + { + this.TimeToShoot = this.ShootRate; + NPC parent = Main.npc[NPC.FindFirstNPC(mod.NPCType("CogLord"))]; + Vector2 Velocity = Helper.VelocityToPoint(npc.Center, parent.Center, 20); + int k = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, Velocity.X, Velocity.Y, mod.ProjectileType("CogLordLaser"), 100, 1f); + Main.projectile[k].friendly = false; + Main.projectile[k].tileCollide = false; + Main.projectile[k].hostile = true; + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) + { + Texture2D drawTexture = Main.npcTexture[npc.type]; + Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); + Vector2 drawPos = new Vector2( + npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, + npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); + SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); + return false; + } + } } \ No newline at end of file diff --git a/NPCs/ColossalTortoise.cs b/NPCs/ColossalTortoise.cs index 1793fee1..0a905365 100644 --- a/NPCs/ColossalTortoise.cs +++ b/NPCs/ColossalTortoise.cs @@ -6,102 +6,104 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class ColossalTortoise : ModNPC +namespace Tremor.NPCs { + + public class ColossalTortoise : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Colossal Tortoise"); Main.npcFrameCount[npc.type] = 16; } - - public override void SetDefaults() - { - npc.lifeMax = 25000; - npc.damage = 200; - npc.defense = 300; - npc.knockBackResist = 0.0f; - npc.width = 146; - npc.height = 86; - animationType = 21; - npc.aiStyle = 3; - aiType = 28; - npc.npcSlots = 0.3f; - npc.HitSound = SoundID.NPCHit24; - npc.DeathSound = SoundID.NPCDeath10; - npc.value = Item.buyPrice(0, 4, 15, 0); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 25000; + npc.damage = 200; + npc.defense = 300; + npc.knockBackResist = 0.0f; + npc.width = 146; + npc.height = 86; + animationType = 21; + npc.aiStyle = 3; + aiType = 28; + npc.npcSlots = 0.3f; + npc.HitSound = SoundID.NPCHit24; + npc.DeathSound = SoundID.NPCDeath10; + npc.value = Item.buyPrice(0, 4, 15, 0); + } - public override void AI() - { + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } -Lighting.AddLight(npc.position, 1f, 0.3f, 0.3f); + public override void AI() + { - if(Main.rand.Next(750) == 0) - { - NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, 153); - } + Lighting.AddLight(npc.position, 1f, 0.3f, 0.3f); - } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GiantShell"), Main.rand.Next(1,3)); - } - if(Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LostTurtleKnife"), Main.rand.Next(10,55)); - } - } - } + if (Main.rand.Next(750) == 0) + { + NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, 153); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 60; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 3, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 3, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ColossusTortoiseGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ColossusTortoiseGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ColossusTortoiseGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ColossusTortoiseGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ColossusTortoiseGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ColossusTortoiseGore3"), 1f); - } - else - { + } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GiantShell"), Main.rand.Next(1, 3)); + } + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LostTurtleKnife"), Main.rand.Next(10, 55)); + } + } + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 60; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 3, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 3, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ColossusTortoiseGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ColossusTortoiseGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ColossusTortoiseGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ColossusTortoiseGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ColossusTortoiseGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ColossusTortoiseGore3"), 1f); + } + else + { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 3, (float)hitDirection, -2f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } - } + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 3, (float)hitDirection, -2f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + } + } + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneJungle && NPC.downedMoonlord && Main.hardMode && y < Main.worldSurface ? 0.0002f : 0f; + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneJungle && NPC.downedMoonlord && Main.hardMode && y < Main.worldSurface ? 0.0002f : 0f; - } - -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/CometHead.cs b/NPCs/CometHead.cs index 67eaaa7f..56745a12 100644 --- a/NPCs/CometHead.cs +++ b/NPCs/CometHead.cs @@ -5,86 +5,88 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -using System.Linq; +using System.Linq; using System.Collections.Generic; -namespace Tremor.NPCs { - -public class CometHead : ModNPC +namespace Tremor.NPCs { + + public class CometHead : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Comet Head"); Main.npcFrameCount[npc.type] = 3; } - - public override void SetDefaults() - { - npc.lifeMax = 600; - npc.damage = 130; - npc.defense = 65; - npc.knockBackResist = 0.5f; - npc.width = 20; - npc.height = 20; - animationType = 288; - aiType = 288; - npc.aiStyle = 56; - npc.npcSlots = 15f; - npc.noTileCollide = true; - npc.noGravity = true; - npc.HitSound = SoundID.NPCHit3; - npc.noGravity = true; - npc.DeathSound = SoundID.NPCDeath5; - npc.value = Item.buyPrice(0, 0, 4, 9); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 600; + npc.damage = 130; + npc.defense = 65; + npc.knockBackResist = 0.5f; + npc.width = 20; + npc.height = 20; + animationType = 288; + aiType = 288; + npc.aiStyle = 56; + npc.npcSlots = 15f; + npc.noTileCollide = true; + npc.noGravity = true; + npc.HitSound = SoundID.NPCHit3; + npc.noGravity = true; + npc.DeathSound = SoundID.NPCDeath5; + npc.value = Item.buyPrice(0, 0, 4, 9); + } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int[] TileArray2 = { mod.TileType("CometiteOreTile"), mod.TileType("HardCometiteOreTile") }; - return TileArray2.Contains(Main.tile[spawnInfo.spawnTileX, spawnInfo.spawnTileY].type) ? 15f : 0f; - } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CometiteOre"), Main.rand.Next(1,2)); - } - if(Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ChargedCrystal"), Main.rand.Next(1,2)); - } - } - } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); - } - } -} + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int[] TileArray2 = { mod.TileType("CometiteOreTile"), mod.TileType("HardCometiteOreTile") }; + return TileArray2.Contains(Main.tile[spawnInfo.spawnTileX, spawnInfo.spawnTileY].type) ? 15f : 0f; + } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CometiteOre"), Main.rand.Next(1, 2)); + } + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ChargedCrystal"), Main.rand.Next(1, 2)); + } + } + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); + } + } + } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/ConjurerSkeleton.cs b/NPCs/ConjurerSkeleton.cs index 4a8aa2ef..f7ae2576 100644 --- a/NPCs/ConjurerSkeleton.cs +++ b/NPCs/ConjurerSkeleton.cs @@ -13,7 +13,7 @@ public override void SetStaticDefaults() DisplayName.SetDefault("Conjurer Skeleton"); Main.npcFrameCount[npc.type] = 3; } - + public override void SetDefaults() { npc.width = 40; @@ -21,60 +21,60 @@ public override void SetDefaults() npc.damage = 16; npc.defense = 16; npc.lifeMax = 270; - npc.HitSound = SoundID.NPCHit2; + npc.HitSound = SoundID.NPCHit2; npc.DeathSound = SoundID.NPCDeath6; - npc.value = Item.buyPrice(0, 1, 5, 7); + npc.value = Item.buyPrice(0, 1, 5, 7); npc.knockBackResist = 0.5f; npc.aiStyle = 8; aiType = 29; animationType = 29; - banner = npc.type; - bannerItem = mod.ItemType("ConjurerSkeletonBanner"); + banner = npc.type; + bannerItem = mod.ItemType("ConjurerSkeletonBanner"); } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedBoss3 && y > Main.rockLayer ? 0.02f : 0f; - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedBoss3 && y > Main.rockLayer ? 0.02f : 0f; + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(6) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 2275); - }; - if(Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TornPapyrus")); - }; - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(6) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 2275); + }; + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TornPapyrus")); + }; + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadWarrior2Gore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadWarrior2Gore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); - } -} + } + } } } diff --git a/NPCs/CoreBug.cs b/NPCs/CoreBug.cs index 83d14740..0cbe97ee 100644 --- a/NPCs/CoreBug.cs +++ b/NPCs/CoreBug.cs @@ -6,70 +6,72 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class CoreBug : ModNPC +namespace Tremor.NPCs { + + public class CoreBug : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Space Bug"); Main.npcFrameCount[npc.type] = 6; } - - public override void SetDefaults() - { - npc.lifeMax = 150; - npc.damage = 18; - npc.defense = 10; - npc.knockBackResist = 0.6f; - npc.width = 38; - npc.height = 44; - animationType = 258; - npc.aiStyle = 3; - aiType = 258; - npc.npcSlots = 0.2f; - npc.HitSound = SoundID.NPCHit45; - npc.DeathSound = SoundID.NPCDeath47; - npc.value = Item.buyPrice(0, 0, 2, 24); - banner = npc.type; - bannerItem = mod.ItemType("CoreBugBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 150; + npc.damage = 18; + npc.defense = 10; + npc.knockBackResist = 0.6f; + npc.width = 38; + npc.height = 44; + animationType = 258; + npc.aiStyle = 3; + aiType = 258; + npc.npcSlots = 0.2f; + npc.HitSound = SoundID.NPCHit45; + npc.DeathSound = SoundID.NPCDeath47; + npc.value = Item.buyPrice(0, 0, 2, 24); + banner = npc.type; + bannerItem = mod.ItemType("CoreBugBanner"); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); - } - } -} + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void AI() - { -if (Main.rand.Next(4) == 0) - { - int num706 = Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 1f); - Main.dust[num706].velocity *= 0.3f; - } - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); + } + } + } + + public override void AI() + { + if (Main.rand.Next(4) == 0) + { + int num706 = Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 1f); + Main.dust[num706].velocity *= 0.3f; + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneMeteor ? 0.005f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneMeteor ? 0.005f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/CoreSlime.cs b/NPCs/CoreSlime.cs index ff968bdb..cee6b698 100644 --- a/NPCs/CoreSlime.cs +++ b/NPCs/CoreSlime.cs @@ -6,69 +6,71 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class CoreSlime : ModNPC +namespace Tremor.NPCs { + + public class CoreSlime : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Core Slime"); Main.npcFrameCount[npc.type] = 2; } - - public override void SetDefaults() - { - npc.lifeMax = 80; - npc.damage = 20; - npc.defense = 4; - npc.knockBackResist = 0.6f; - npc.width = 32; - npc.height = 22; - animationType = 1; - npc.aiStyle = 1; - npc.npcSlots = 0.1f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.value = Item.buyPrice(0, 0, 1, 50); - banner = npc.type; - bannerItem = mod.ItemType("CoreSlimeBanner"); - } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); - } - } -} + public override void SetDefaults() + { + npc.lifeMax = 80; + npc.damage = 20; + npc.defense = 4; + npc.knockBackResist = 0.6f; + npc.width = 32; + npc.height = 22; + animationType = 1; + npc.aiStyle = 1; + npc.npcSlots = 0.1f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.value = Item.buyPrice(0, 0, 1, 50); + banner = npc.type; + bannerItem = mod.ItemType("CoreSlimeBanner"); + } - public override void AI() - { -if (Main.rand.Next(4) == 0) - { - int num706 = Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 1f); - Main.dust[num706].velocity *= 0.3f; - } - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); + } + } + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void AI() + { + if (Main.rand.Next(4) == 0) + { + int num706 = Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 1f); + Main.dust[num706].velocity *= 0.3f; + } + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneMeteor ? 0.005f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneMeteor ? 0.005f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/Coretaur.cs b/NPCs/Coretaur.cs index f5477642..1b9ea1a7 100644 --- a/NPCs/Coretaur.cs +++ b/NPCs/Coretaur.cs @@ -7,87 +7,87 @@ using Terraria.ModLoader; namespace Tremor.NPCs { - public class Coretaur : ModNPC - { + public class Coretaur : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Coretaur"); Main.npcFrameCount[npc.type] = 14; } - - public override void SetDefaults() - { - npc.lifeMax = 1500; - npc.damage = 20; - npc.defense = 14; - npc.knockBackResist = 0f; - npc.width = 48; - npc.height = 40; - npc.aiStyle = 87; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath42; - npc.value = Item.buyPrice(0, 3, 0, 0); - animationType = NPCID.BigMimicHallow; - banner = npc.type; - bannerItem = mod.ItemType("CoretaurBanner"); - } + public override void SetDefaults() + { + npc.lifeMax = 1500; + npc.damage = 20; + npc.defense = 14; + npc.knockBackResist = 0f; + npc.width = 48; + npc.height = 40; + npc.aiStyle = 87; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath42; + npc.value = Item.buyPrice(0, 3, 0, 0); + animationType = NPCID.BigMimicHallow; + banner = npc.type; + bannerItem = mod.ItemType("CoretaurBanner"); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MinotaurHorn")); - }; - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MinotaurHorn")); + }; + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CoretaurGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CoretaurGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CoretaurGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CoretaurGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CoretaurGore3"), 1f); - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); - } - } -} - public override void AI() - { -if (Main.rand.Next(4) == 0) - { - int num706 = Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 1f); - Main.dust[num706].velocity *= 0.3f; - } - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CoretaurGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CoretaurGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CoretaurGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CoretaurGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CoretaurGore3"), 1f); + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); + } + } + } + + public override void AI() + { + if (Main.rand.Next(4) == 0) + { + int num706 = Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 1f); + Main.dust[num706].velocity *= 0.3f; + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedBoss3 && spawnInfo.spawnTileY > Main.maxTilesY - 200 ? 0.005f : 0f; - } -} + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedBoss3 && spawnInfo.spawnTileY > Main.maxTilesY - 200 ? 0.005f : 0f; + } + } } \ No newline at end of file diff --git a/NPCs/CorruptedBicholmere.cs b/NPCs/CorruptedBicholmere.cs index 1bdf4afb..2f16d7b6 100644 --- a/NPCs/CorruptedBicholmere.cs +++ b/NPCs/CorruptedBicholmere.cs @@ -7,76 +7,78 @@ using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class CorruptedBicholmere : ModNPC +namespace Tremor.NPCs { + + public class CorruptedBicholmere : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Corrupted Bicholmere"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 300; - npc.damage = 28; - npc.defense = 11; - npc.knockBackResist = 0.3f; - npc.width = 62; - npc.height = 46; - animationType = 244; - npc.aiStyle = 1; - npc.npcSlots = 0.9f; - npc.HitSound = SoundID.NPCHit47; - npc.DeathSound = SoundID.NPCDeath23; - npc.value = Item.buyPrice(0, 0, 5, 0); - banner = npc.type; - bannerItem = mod.ItemType("CorruptedBicholmereBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 300; + npc.damage = 28; + npc.defense = 11; + npc.knockBackResist = 0.3f; + npc.width = 62; + npc.height = 46; + animationType = 244; + npc.aiStyle = 1; + npc.npcSlots = 0.9f; + npc.HitSound = SoundID.NPCHit47; + npc.DeathSound = SoundID.NPCDeath23; + npc.value = Item.buyPrice(0, 0, 5, 0); + banner = npc.type; + bannerItem = mod.ItemType("CorruptedBicholmereBanner"); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CorruptedBihcolmereGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CorruptedBicholmereGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CorruptedBicholmereGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CorruptedBicholmereGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CorruptedBicholmereGore3"), 1f); - } -} + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 68); - }; - } - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CorruptedBihcolmereGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CorruptedBicholmereGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CorruptedBicholmereGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CorruptedBicholmereGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CorruptedBicholmereGore3"), 1f); + } + } + + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 68); + }; + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneCorrupt && y > Main.rockLayer ? 0.05f : 0f; - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneCorrupt && y > Main.rockLayer ? 0.05f : 0f; + } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/CreatorofNightmares.cs b/NPCs/CreatorofNightmares.cs index 249850c8..0bc07094 100644 --- a/NPCs/CreatorofNightmares.cs +++ b/NPCs/CreatorofNightmares.cs @@ -6,78 +6,80 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class CreatorofNightmares : ModNPC +namespace Tremor.NPCs { + + public class CreatorofNightmares : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Creator of Nightmares"); Main.npcFrameCount[npc.type] = 16; } - - public override void SetDefaults() - { - npc.lifeMax = 6000; - npc.damage = 155; - npc.defense = 38; - npc.knockBackResist = 0.3f; - npc.width = 34; - npc.height = 54; - animationType = 460; - npc.aiStyle = 3; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit1; - aiType = 604; - npc.DeathSound = SoundID.NPCDeath52; - npc.value = Item.buyPrice(0, 3, 1, 0); - banner = npc.type; - bannerItem = mod.ItemType("CreatorofNightmaresBanner"); - } + public override void SetDefaults() + { + npc.lifeMax = 6000; + npc.damage = 155; + npc.defense = 38; + npc.knockBackResist = 0.3f; + npc.width = 34; + npc.height = 54; + animationType = 460; + npc.aiStyle = 3; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit1; + aiType = 604; + npc.DeathSound = SoundID.NPCDeath52; + npc.value = Item.buyPrice(0, 3, 1, 0); + banner = npc.type; + bannerItem = mod.ItemType("CreatorofNightmaresBanner"); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrokenHeroArmorplate")); - } - } - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrokenHeroArmorplate")); + } + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Gore.NewGore(npc.position, npc.velocity, 99, 1f); - Gore.NewGore(npc.position, npc.velocity, 99, 1f); - Gore.NewGore(npc.position, npc.velocity, 99, 1f); - Gore.NewGore(npc.position, npc.velocity, 99, 1f); - Gore.NewGore(npc.position, npc.velocity, 99, 1f); - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - } - } -} + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + } + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return Tremor.NormalSpawn(spawnInfo) && spawnInfo.spawnTileY < Main.rockLayer && NPC.downedMoonlord && Main.eclipse ? 0.01f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return Tremor.NormalSpawn(spawnInfo) && spawnInfo.spawnTileY < Main.rockLayer && NPC.downedMoonlord && Main.eclipse ? 0.01f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/Crimer.cs b/NPCs/Crimer.cs index b0b3f497..e449d5cc 100644 --- a/NPCs/Crimer.cs +++ b/NPCs/Crimer.cs @@ -6,60 +6,62 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Crimer : ModNPC +namespace Tremor.NPCs { + + public class Crimer : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Crimer"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 250; - npc.damage = 70; - npc.defense = 12; - npc.knockBackResist = 0.5f; - npc.width = 40; - npc.height = 40; -animationType = 121; - npc.aiStyle = 14; -npc.noGravity = true; - npc.npcSlots = 0.7f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath6; - npc.value = Item.buyPrice(0, 0, 5, 0); - banner = npc.type; - bannerItem = mod.ItemType("CrimerBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 250; + npc.damage = 70; + npc.defense = 12; + npc.knockBackResist = 0.5f; + npc.width = 40; + npc.height = 40; + animationType = 121; + npc.aiStyle = 14; + npc.noGravity = true; + npc.npcSlots = 0.7f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath6; + npc.value = Item.buyPrice(0, 0, 5, 0); + banner = npc.type; + bannerItem = mod.ItemType("CrimerBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } -NPC.NewNPC((int)npc.position.X, (int)npc.position.Y - 48, 183); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + NPC.NewNPC((int)npc.position.X, (int)npc.position.Y - 48, 183); + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneCrimson && Main.hardMode && y < Main.worldSurface ? 0.02f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneCrimson && Main.hardMode && y < Main.worldSurface ? 0.02f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/CrimsonBicholmere.cs b/NPCs/CrimsonBicholmere.cs index 914003c7..15a970f9 100644 --- a/NPCs/CrimsonBicholmere.cs +++ b/NPCs/CrimsonBicholmere.cs @@ -7,76 +7,78 @@ using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class CrimsonBicholmere : ModNPC +namespace Tremor.NPCs { + + public class CrimsonBicholmere : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Crimson Bicholmere"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 325; - npc.damage = 28; - npc.defense = 11; - npc.knockBackResist = 0.3f; - npc.width = 62; - npc.height = 46; - animationType = 244; - npc.aiStyle = 1; - npc.npcSlots = 0.6f; - npc.HitSound = SoundID.NPCHit47; - npc.DeathSound = SoundID.NPCDeath23; - npc.value = Item.buyPrice(0, 0, 5, 25); - banner = npc.type; - bannerItem = mod.ItemType("CrimsonBicholmereBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 325; + npc.damage = 28; + npc.defense = 11; + npc.knockBackResist = 0.3f; + npc.width = 62; + npc.height = 46; + animationType = 244; + npc.aiStyle = 1; + npc.npcSlots = 0.6f; + npc.HitSound = SoundID.NPCHit47; + npc.DeathSound = SoundID.NPCDeath23; + npc.value = Item.buyPrice(0, 0, 5, 25); + banner = npc.type; + bannerItem = mod.ItemType("CrimsonBicholmereBanner"); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CrimsonBicholmereGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CrimsonBicholmereGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CrimsonBicholmereGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CrimsonBicholmereGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CrimsonBicholmereGore3"), 1f); - } -} + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 1330); - }; - } - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CrimsonBicholmereGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CrimsonBicholmereGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CrimsonBicholmereGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CrimsonBicholmereGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CrimsonBicholmereGore3"), 1f); + } + } + + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 1330); + }; + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneCrimson && y > Main.rockLayer ? 0.01f : 0f; - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneCrimson && y > Main.rockLayer ? 0.01f : 0f; + } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/CyberKing.cs b/NPCs/CyberKing.cs index a1bae903..ba3bec70 100644 --- a/NPCs/CyberKing.cs +++ b/NPCs/CyberKing.cs @@ -10,422 +10,422 @@ namespace Tremor.NPCs { [AutoloadBossHead] - public class CyberKing : ModNPC - { + public class CyberKing : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Cyber King"); Main.npcFrameCount[npc.type] = 6; } - - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CyberKingGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CyberKingGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CyberKingGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CyberKingGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CyberKingGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CyberKingGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CyberKingGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CyberKingGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CyberKingGore3"), 1f); - } -} - public override void SetDefaults() - { - npc.aiStyle = -1; - npc.lifeMax = 60000; - npc.damage = 80; - npc.defense = 65; - npc.knockBackResist = 0f; - npc.width = 70; - npc.height = 68; - npc.value = Item.buyPrice(0, 20, 0, 0); - npc.boss = true; - npc.lavaImmune = true; - npc.noGravity = true; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath6; - music = MusicID.Boss2; - bossBag = mod.ItemType("CyberKingBag"); - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CyberKingGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CyberKingGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CyberKingGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CyberKingGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CyberKingGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CyberKingGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CyberKingGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CyberKingGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CyberKingGore3"), 1f); + } + } + + public override void SetDefaults() + { + npc.aiStyle = -1; + npc.lifeMax = 60000; + npc.damage = 80; + npc.defense = 65; + npc.knockBackResist = 0f; + npc.width = 70; + npc.height = 68; + npc.value = Item.buyPrice(0, 20, 0, 0); + npc.boss = true; + npc.lavaImmune = true; + npc.noGravity = true; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit4; + npc.DeathSound = SoundID.NPCDeath6; + music = MusicID.Boss2; + bossBag = mod.ItemType("CyberKingBag"); + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 0.625f * bossLifeScale); - npc.damage = (int)(npc.damage * 0.6f); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 0.625f * bossLifeScale); + npc.damage = (int)(npc.damage * 0.6f); + } - public override void AI() - { + public override void AI() + { -Lighting.AddLight(npc.position, 1f, 0.3f, 0.3f); + Lighting.AddLight(npc.position, 1f, 0.3f, 0.3f); - if(Main.rand.Next(900) == 0) - { - NPC.NewNPC((int)npc.position.X + 60, (int)npc.position.Y, mod.NPCType("Cybermite")); - NPC.NewNPC((int)npc.position.X - 60, (int)npc.position.Y, mod.NPCType("Cybermite")); - NPC.NewNPC((int)npc.position.X, (int)npc.position.Y+60, mod.NPCType("Cybermite")); - NPC.NewNPC((int)npc.position.X, (int)npc.position.Y-60, mod.NPCType("Cybermite")); - } + if (Main.rand.Next(900) == 0) + { + NPC.NewNPC((int)npc.position.X + 60, (int)npc.position.Y, mod.NPCType("Cybermite")); + NPC.NewNPC((int)npc.position.X - 60, (int)npc.position.Y, mod.NPCType("Cybermite")); + NPC.NewNPC((int)npc.position.X, (int)npc.position.Y + 60, mod.NPCType("Cybermite")); + NPC.NewNPC((int)npc.position.X, (int)npc.position.Y - 60, mod.NPCType("Cybermite")); + } -bool allDead = false; -for(int i = 0; i < Main.player.Length; i++) -{ - if(Main.player[i].dead) allDead = true; -} + bool allDead = false; + for (int i = 0; i < Main.player.Length; i++) + { + if (Main.player[i].dead) allDead = true; + } - if (Main.dayTime || allDead) - { - if (npc.velocity.X > 0f) - { - npc.velocity.X = npc.velocity.X + 0.75f; - } - else - { - npc.velocity.X = npc.velocity.X - 0.75f; - } - npc.velocity.Y = npc.velocity.Y - 0.1f; - npc.rotation = npc.velocity.X * 0.05f; - } - else if (npc.ai[0] == 0f) - { - if (npc.ai[2] == 0f) - { - npc.TargetClosest(true); - if (npc.Center.X < Main.player[npc.target].Center.X) - { - npc.ai[2] = 1f; - } - else - { - npc.ai[2] = -1f; - } - } - npc.TargetClosest(true); - int num1319 = 800; - float num1320 = Math.Abs(npc.Center.X - Main.player[npc.target].Center.X); - if (npc.Center.X < Main.player[npc.target].Center.X && npc.ai[2] < 0f && num1320 > (float)num1319) - { - npc.ai[2] = 0f; - } - if (npc.Center.X > Main.player[npc.target].Center.X && npc.ai[2] > 0f && num1320 > (float)num1319) - { - npc.ai[2] = 0f; - } - float num1321 = 0.45f; - float num1322 = 7f; - if ((double)npc.life < (double)npc.lifeMax * 0.75) - { - num1321 = 0.55f; - num1322 = 8f; - } - if ((double)npc.life < (double)npc.lifeMax * 0.5) - { - num1321 = 0.7f; - num1322 = 10f; - } - if ((double)npc.life < (double)npc.lifeMax * 0.25) - { - num1321 = 0.8f; - num1322 = 11f; - } - npc.velocity.X = npc.velocity.X + npc.ai[2] * num1321; - if (npc.velocity.X > num1322) - { - npc.velocity.X = num1322; - } - if (npc.velocity.X < -num1322) - { - npc.velocity.X = -num1322; - } - float num1323 = Main.player[npc.target].position.Y - (npc.position.Y + (float)npc.height); - if (num1323 < 150f) - { - npc.velocity.Y = npc.velocity.Y - 0.2f; - } - if (num1323 > 200f) - { - npc.velocity.Y = npc.velocity.Y + 0.2f; - } - if (npc.velocity.Y > 8f) - { - npc.velocity.Y = 8f; - } - if (npc.velocity.Y < -8f) - { - npc.velocity.Y = -8f; - } - npc.rotation = npc.velocity.X * 0.05f; - if ((num1320 < 500f || npc.ai[3] < 0f) && npc.position.Y < Main.player[npc.target].position.Y) - { - npc.ai[3] += 1f; - int num1324 = 13; - if ((double)npc.life < (double)npc.lifeMax * 0.75) - { - num1324 = 12; - } - if ((double)npc.life < (double)npc.lifeMax * 0.5) - { - num1324 = 11; - } - if ((double)npc.life < (double)npc.lifeMax * 0.25) - { - num1324 = 10; - } - num1324++; - if (npc.ai[3] > (float)num1324) - { - npc.ai[3] = (float)(-(float)num1324); - } - if (npc.ai[3] == 0f && Main.netMode != 1) - { - Vector2 vector159 = new Vector2(npc.Center.X, npc.Center.Y); - vector159.X += npc.velocity.X * 7f; - float num1325 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector159.X; - float num1326 = Main.player[npc.target].Center.Y - vector159.Y; - float num1327 = (float)Math.Sqrt((double)(num1325 * num1325 + num1326 * num1326)); - float num1328 = 6f; - if ((double)npc.life < (double)npc.lifeMax * 0.75) - { - num1328 = 7f; - } - if ((double)npc.life < (double)npc.lifeMax * 0.5) - { - num1328 = 8f; - } - if ((double)npc.life < (double)npc.lifeMax * 0.25) - { - num1328 = 9f; - } - num1327 = num1328 / num1327; - num1325 *= num1327; - num1326 *= num1327; - Projectile.NewProjectile(vector159.X, vector159.Y, num1325, num1326, mod.ProjectileType("CyberRingPro"), 42, 0f, Main.myPlayer, 0f, 0f); - } - } - else if (npc.ai[3] < 0f) - { - npc.ai[3] += 1f; - } - if (Main.netMode != 1) - { - npc.ai[1] += (float)Main.rand.Next(1, 4); - if (npc.ai[1] > 800f && num1320 < 600f) - { - npc.ai[0] = -1f; - } - } - } - else if (npc.ai[0] == 1f) - { - npc.TargetClosest(true); - float num1329 = 0.15f; - float num1330 = 7f; - if ((double)npc.life < (double)npc.lifeMax * 0.75) - { - num1329 = 0.17f; - num1330 = 8f; - } - if ((double)npc.life < (double)npc.lifeMax * 0.5) - { - num1329 = 0.2f; - num1330 = 9f; - } - if ((double)npc.life < (double)npc.lifeMax * 0.25) - { - num1329 = 0.25f; - num1330 = 10f; - } - num1329 -= 0.05f; - num1330 -= 1f; - if (npc.Center.X < Main.player[npc.target].Center.X) - { - npc.velocity.X = npc.velocity.X + num1329; - if (npc.velocity.X < 0f) - { - npc.velocity.X = npc.velocity.X * 0.98f; - } - } - if (npc.Center.X > Main.player[npc.target].Center.X) - { - npc.velocity.X = npc.velocity.X - num1329; - if (npc.velocity.X > 0f) - { - npc.velocity.X = npc.velocity.X * 0.98f; - } - } - if (npc.velocity.X > num1330 || npc.velocity.X < -num1330) - { - npc.velocity.X = npc.velocity.X * 0.95f; - } - float num1331 = Main.player[npc.target].position.Y - (npc.position.Y + (float)npc.height); - if (num1331 < 180f) - { - npc.velocity.Y = npc.velocity.Y - 0.1f; - } - if (num1331 > 200f) - { - npc.velocity.Y = npc.velocity.Y + 0.1f; - } - if (npc.velocity.Y > 6f) - { - npc.velocity.Y = 6f; - } - if (npc.velocity.Y < -6f) - { - npc.velocity.Y = -6f; - } - npc.rotation = npc.velocity.X * 0.01f; - if (Main.netMode != 1) - { - npc.ai[3] += 1f; - int num1332 = 15; - if ((double)npc.life < (double)npc.lifeMax * 0.75) - { - num1332 = 14; - } - if ((double)npc.life < (double)npc.lifeMax * 0.5) - { - num1332 = 12; - } - if ((double)npc.life < (double)npc.lifeMax * 0.25) - { - num1332 = 10; - } - if ((double)npc.life < (double)npc.lifeMax * 0.1) - { - num1332 = 8; - } - num1332 += 3; - if (npc.ai[3] >= (float)num1332) - { - npc.ai[3] = 0f; - Vector2 vector160 = new Vector2(npc.Center.X, npc.position.Y + (float)npc.height - 14f); - int i2 = (int)(vector160.X / 16f); - int j2 = (int)(vector160.Y / 16f); - if (!WorldGen.SolidTile(i2, j2)) - { - float num1333 = npc.velocity.Y; - if (num1333 < 0f) - { - num1333 = 0f; - } - num1333 += 3f; - float speedX2 = npc.velocity.X * 0.25f; - Projectile.NewProjectile(vector160.X, vector160.Y, speedX2, num1333, mod.ProjectileType("RedPulsePro"), 42, 0f, Main.myPlayer, (float)Main.rand.Next(5), 0f); - } - } - } - if (Main.netMode != 1) - { - npc.ai[1] += (float)Main.rand.Next(1, 4); - if (npc.ai[1] > 600f) - { - npc.ai[0] = -1f; - } - } - } - else if (npc.ai[0] == 2f) - { - npc.TargetClosest(true); - Vector2 vector161 = new Vector2(npc.Center.X, npc.Center.Y - 20f); - float num1334 = (float)Main.rand.Next(-1000, 1001); - float num1335 = (float)Main.rand.Next(-1000, 1001); - float num1336 = (float)Math.Sqrt((double)(num1334 * num1334 + num1335 * num1335)); - float num1337 = 15f; - npc.velocity *= 0.95f; - num1336 = num1337 / num1336; - num1334 *= num1336; - num1335 *= num1336; - npc.rotation += 0.2f; - vector161.X += num1334 * 4f; - vector161.Y += num1335 * 4f; - npc.ai[3] += 1f; - int num1338 = 7; - if ((double)npc.life < (double)npc.lifeMax * 0.75) - { - num1338--; - } - if ((double)npc.life < (double)npc.lifeMax * 0.5) - { - num1338 -= 2; - } - if ((double)npc.life < (double)npc.lifeMax * 0.25) - { - num1338 -= 3; - } - if ((double)npc.life < (double)npc.lifeMax * 0.1) - { - num1338 -= 4; - } - if (npc.ai[3] > (float)num1338) - { - npc.ai[3] = 0f; - Projectile.NewProjectile(vector161.X, vector161.Y, num1334, num1335, mod.ProjectileType("PurplePulsePro"), 30, 0f, Main.myPlayer, 0f, 0f); - } - if (Main.netMode != 1) - { - npc.ai[1] += (float)Main.rand.Next(1, 4); - if (npc.ai[1] > 500f) - { - npc.ai[0] = -1f; - } - } - } - if (npc.ai[0] == -1f) - { - int num1339 = Main.rand.Next(3); - npc.TargetClosest(true); - if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) > 1000f) - { - num1339 = 0; - } - npc.ai[0] = (float)num1339; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - return; - } + if (Main.dayTime || allDead) + { + if (npc.velocity.X > 0f) + { + npc.velocity.X = npc.velocity.X + 0.75f; + } + else + { + npc.velocity.X = npc.velocity.X - 0.75f; + } + npc.velocity.Y = npc.velocity.Y - 0.1f; + npc.rotation = npc.velocity.X * 0.05f; + } + else if (npc.ai[0] == 0f) + { + if (npc.ai[2] == 0f) + { + npc.TargetClosest(true); + if (npc.Center.X < Main.player[npc.target].Center.X) + { + npc.ai[2] = 1f; + } + else + { + npc.ai[2] = -1f; + } + } + npc.TargetClosest(true); + int num1319 = 800; + float num1320 = Math.Abs(npc.Center.X - Main.player[npc.target].Center.X); + if (npc.Center.X < Main.player[npc.target].Center.X && npc.ai[2] < 0f && num1320 > (float)num1319) + { + npc.ai[2] = 0f; + } + if (npc.Center.X > Main.player[npc.target].Center.X && npc.ai[2] > 0f && num1320 > (float)num1319) + { + npc.ai[2] = 0f; + } + float num1321 = 0.45f; + float num1322 = 7f; + if ((double)npc.life < (double)npc.lifeMax * 0.75) + { + num1321 = 0.55f; + num1322 = 8f; + } + if ((double)npc.life < (double)npc.lifeMax * 0.5) + { + num1321 = 0.7f; + num1322 = 10f; + } + if ((double)npc.life < (double)npc.lifeMax * 0.25) + { + num1321 = 0.8f; + num1322 = 11f; + } + npc.velocity.X = npc.velocity.X + npc.ai[2] * num1321; + if (npc.velocity.X > num1322) + { + npc.velocity.X = num1322; + } + if (npc.velocity.X < -num1322) + { + npc.velocity.X = -num1322; + } + float num1323 = Main.player[npc.target].position.Y - (npc.position.Y + (float)npc.height); + if (num1323 < 150f) + { + npc.velocity.Y = npc.velocity.Y - 0.2f; + } + if (num1323 > 200f) + { + npc.velocity.Y = npc.velocity.Y + 0.2f; + } + if (npc.velocity.Y > 8f) + { + npc.velocity.Y = 8f; + } + if (npc.velocity.Y < -8f) + { + npc.velocity.Y = -8f; + } + npc.rotation = npc.velocity.X * 0.05f; + if ((num1320 < 500f || npc.ai[3] < 0f) && npc.position.Y < Main.player[npc.target].position.Y) + { + npc.ai[3] += 1f; + int num1324 = 13; + if ((double)npc.life < (double)npc.lifeMax * 0.75) + { + num1324 = 12; + } + if ((double)npc.life < (double)npc.lifeMax * 0.5) + { + num1324 = 11; + } + if ((double)npc.life < (double)npc.lifeMax * 0.25) + { + num1324 = 10; + } + num1324++; + if (npc.ai[3] > (float)num1324) + { + npc.ai[3] = (float)(-(float)num1324); + } + if (npc.ai[3] == 0f && Main.netMode != 1) + { + Vector2 vector159 = new Vector2(npc.Center.X, npc.Center.Y); + vector159.X += npc.velocity.X * 7f; + float num1325 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector159.X; + float num1326 = Main.player[npc.target].Center.Y - vector159.Y; + float num1327 = (float)Math.Sqrt((double)(num1325 * num1325 + num1326 * num1326)); + float num1328 = 6f; + if ((double)npc.life < (double)npc.lifeMax * 0.75) + { + num1328 = 7f; + } + if ((double)npc.life < (double)npc.lifeMax * 0.5) + { + num1328 = 8f; + } + if ((double)npc.life < (double)npc.lifeMax * 0.25) + { + num1328 = 9f; + } + num1327 = num1328 / num1327; + num1325 *= num1327; + num1326 *= num1327; + Projectile.NewProjectile(vector159.X, vector159.Y, num1325, num1326, mod.ProjectileType("CyberRingPro"), 42, 0f, Main.myPlayer, 0f, 0f); + } + } + else if (npc.ai[3] < 0f) + { + npc.ai[3] += 1f; + } + if (Main.netMode != 1) + { + npc.ai[1] += (float)Main.rand.Next(1, 4); + if (npc.ai[1] > 800f && num1320 < 600f) + { + npc.ai[0] = -1f; + } + } + } + else if (npc.ai[0] == 1f) + { + npc.TargetClosest(true); + float num1329 = 0.15f; + float num1330 = 7f; + if ((double)npc.life < (double)npc.lifeMax * 0.75) + { + num1329 = 0.17f; + num1330 = 8f; + } + if ((double)npc.life < (double)npc.lifeMax * 0.5) + { + num1329 = 0.2f; + num1330 = 9f; + } + if ((double)npc.life < (double)npc.lifeMax * 0.25) + { + num1329 = 0.25f; + num1330 = 10f; + } + num1329 -= 0.05f; + num1330 -= 1f; + if (npc.Center.X < Main.player[npc.target].Center.X) + { + npc.velocity.X = npc.velocity.X + num1329; + if (npc.velocity.X < 0f) + { + npc.velocity.X = npc.velocity.X * 0.98f; + } + } + if (npc.Center.X > Main.player[npc.target].Center.X) + { + npc.velocity.X = npc.velocity.X - num1329; + if (npc.velocity.X > 0f) + { + npc.velocity.X = npc.velocity.X * 0.98f; + } + } + if (npc.velocity.X > num1330 || npc.velocity.X < -num1330) + { + npc.velocity.X = npc.velocity.X * 0.95f; + } + float num1331 = Main.player[npc.target].position.Y - (npc.position.Y + (float)npc.height); + if (num1331 < 180f) + { + npc.velocity.Y = npc.velocity.Y - 0.1f; + } + if (num1331 > 200f) + { + npc.velocity.Y = npc.velocity.Y + 0.1f; + } + if (npc.velocity.Y > 6f) + { + npc.velocity.Y = 6f; + } + if (npc.velocity.Y < -6f) + { + npc.velocity.Y = -6f; + } + npc.rotation = npc.velocity.X * 0.01f; + if (Main.netMode != 1) + { + npc.ai[3] += 1f; + int num1332 = 15; + if ((double)npc.life < (double)npc.lifeMax * 0.75) + { + num1332 = 14; + } + if ((double)npc.life < (double)npc.lifeMax * 0.5) + { + num1332 = 12; + } + if ((double)npc.life < (double)npc.lifeMax * 0.25) + { + num1332 = 10; + } + if ((double)npc.life < (double)npc.lifeMax * 0.1) + { + num1332 = 8; + } + num1332 += 3; + if (npc.ai[3] >= (float)num1332) + { + npc.ai[3] = 0f; + Vector2 vector160 = new Vector2(npc.Center.X, npc.position.Y + (float)npc.height - 14f); + int i2 = (int)(vector160.X / 16f); + int j2 = (int)(vector160.Y / 16f); + if (!WorldGen.SolidTile(i2, j2)) + { + float num1333 = npc.velocity.Y; + if (num1333 < 0f) + { + num1333 = 0f; + } + num1333 += 3f; + float speedX2 = npc.velocity.X * 0.25f; + Projectile.NewProjectile(vector160.X, vector160.Y, speedX2, num1333, mod.ProjectileType("RedPulsePro"), 42, 0f, Main.myPlayer, (float)Main.rand.Next(5), 0f); + } + } + } + if (Main.netMode != 1) + { + npc.ai[1] += (float)Main.rand.Next(1, 4); + if (npc.ai[1] > 600f) + { + npc.ai[0] = -1f; + } + } + } + else if (npc.ai[0] == 2f) + { + npc.TargetClosest(true); + Vector2 vector161 = new Vector2(npc.Center.X, npc.Center.Y - 20f); + float num1334 = (float)Main.rand.Next(-1000, 1001); + float num1335 = (float)Main.rand.Next(-1000, 1001); + float num1336 = (float)Math.Sqrt((double)(num1334 * num1334 + num1335 * num1335)); + float num1337 = 15f; + npc.velocity *= 0.95f; + num1336 = num1337 / num1336; + num1334 *= num1336; + num1335 *= num1336; + npc.rotation += 0.2f; + vector161.X += num1334 * 4f; + vector161.Y += num1335 * 4f; + npc.ai[3] += 1f; + int num1338 = 7; + if ((double)npc.life < (double)npc.lifeMax * 0.75) + { + num1338--; + } + if ((double)npc.life < (double)npc.lifeMax * 0.5) + { + num1338 -= 2; + } + if ((double)npc.life < (double)npc.lifeMax * 0.25) + { + num1338 -= 3; + } + if ((double)npc.life < (double)npc.lifeMax * 0.1) + { + num1338 -= 4; + } + if (npc.ai[3] > (float)num1338) + { + npc.ai[3] = 0f; + Projectile.NewProjectile(vector161.X, vector161.Y, num1334, num1335, mod.ProjectileType("PurplePulsePro"), 30, 0f, Main.myPlayer, 0f, 0f); + } + if (Main.netMode != 1) + { + npc.ai[1] += (float)Main.rand.Next(1, 4); + if (npc.ai[1] > 500f) + { + npc.ai[0] = -1f; + } + } + } + if (npc.ai[0] == -1f) + { + int num1339 = Main.rand.Next(3); + npc.TargetClosest(true); + if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) > 1000f) + { + num1339 = 0; + } + npc.ai[0] = (float)num1339; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + return; + } - } + } - public override void NPCLoot() - { - if(Main.expertMode) - { - npc.DropBossBags(); - } - if (Main.netMode != 1) - { - int CenterX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int CenterY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; + public override void NPCLoot() + { + if (Main.expertMode) + { + npc.DropBossBags(); + } + if (Main.netMode != 1) + { + int CenterX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int CenterY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; - if(!Main.expertMode && Main.rand.Next(1) == 0) - { - Helper.DropItem(new Rectangle((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height), new Drop(mod.ItemType("RedStorm"), 1, 1), new Drop(mod.ItemType("ShockwaveClaymore"), 1, 1), new Drop(mod.ItemType("CyberCutter"), 1, 1)); - } - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 499, Main.rand.Next(6,25)); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 500, Main.rand.Next(6,25)); + if (!Main.expertMode && Main.rand.Next(1) == 0) + { + Helper.DropItem(new Rectangle((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height), new Drop(mod.ItemType("RedStorm"), 1, 1), new Drop(mod.ItemType("ShockwaveClaymore"), 1, 1), new Drop(mod.ItemType("CyberCutter"), 1, 1)); + } + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 499, Main.rand.Next(6, 25)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 500, Main.rand.Next(6, 25)); - if(Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CyberKingTrophy")); - } - if(!Main.expertMode && Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CyberKingMask")); - } - TremorWorld.downedCyberKing = true; - } - } - } + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CyberKingTrophy")); + } + if (!Main.expertMode && Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CyberKingMask")); + } + TremorWorld.downedCyberKing = true; + } + } + } } \ No newline at end of file diff --git a/NPCs/Cybermite.cs b/NPCs/Cybermite.cs index 6a2671cd..5f32fac6 100644 --- a/NPCs/Cybermite.cs +++ b/NPCs/Cybermite.cs @@ -10,53 +10,53 @@ namespace Tremor.NPCs { - public class Cybermite : ModNPC - { + public class Cybermite : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Cybermite"); } - public override void SetDefaults() - { - npc.aiStyle = 63; - npc.lifeMax = 600; - npc.damage = 70; - npc.defense = 25; - npc.knockBackResist = 0f; - npc.width = 74; - npc.height = 74; - npc.lavaImmune = true; - npc.noGravity = true; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath6; - } - - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CybermiteGore"), 1f); - } -} - - public Vector2 bossCenter - { - get { return npc.Center; } - set { npc.position = value - new Vector2(npc.width / 2, npc.height / 2); } - } - - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 0.625f * bossLifeScale); - npc.damage = (int)(npc.damage * 0.6f); - } - - public override void AI() - { -Lighting.AddLight(bossCenter, 1f, 0.3f, 0.3f); - } - } + public override void SetDefaults() + { + npc.aiStyle = 63; + npc.lifeMax = 600; + npc.damage = 70; + npc.defense = 25; + npc.knockBackResist = 0f; + npc.width = 74; + npc.height = 74; + npc.lavaImmune = true; + npc.noGravity = true; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit4; + npc.DeathSound = SoundID.NPCDeath6; + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CybermiteGore"), 1f); + } + } + + public Vector2 bossCenter + { + get { return npc.Center; } + set { npc.position = value - new Vector2(npc.width / 2, npc.height / 2); } + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 0.625f * bossLifeScale); + npc.damage = (int)(npc.damage * 0.6f); + } + + public override void AI() + { + Lighting.AddLight(bossCenter, 1f, 0.3f, 0.3f); + } + } } \ No newline at end of file diff --git a/NPCs/DarkDruid.cs b/NPCs/DarkDruid.cs index 52f35470..97e03cee 100644 --- a/NPCs/DarkDruid.cs +++ b/NPCs/DarkDruid.cs @@ -6,111 +6,113 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class DarkDruid : ModNPC +namespace Tremor.NPCs { + + public class DarkDruid : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Dark Druid"); Main.npcFrameCount[npc.type] = 15; } - - public override void SetDefaults() - { - npc.lifeMax = 300; - npc.damage = 25; - npc.defense = 2; - npc.knockBackResist = 0.3f; - npc.width = 36; - npc.height = 44; -animationType = 21; - npc.aiStyle = 3; - npc.npcSlots = 1f; - npc.HitSound = SoundID.NPCHit2; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 6, 50); - banner = npc.type; - bannerItem = mod.ItemType("DarkDruidBanner"); - } + public override void SetDefaults() + { + npc.lifeMax = 300; + npc.damage = 25; + npc.defense = 2; + npc.knockBackResist = 0.3f; + npc.width = 36; + npc.height = 44; + animationType = 21; + npc.aiStyle = 3; + npc.npcSlots = 1f; + npc.HitSound = SoundID.NPCHit2; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 0, 6, 50); + banner = npc.type; + bannerItem = mod.ItemType("DarkDruidBanner"); + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } - public override void AI() - { - if(Main.rand.Next(160) == 0) - { - NPC.NewNPC((int)npc.position.X - 50, (int)npc.position.Y, mod.NPCType("DarkDruidMinion")); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } + + public override void AI() + { + if (Main.rand.Next(160) == 0) + { + NPC.NewNPC((int)npc.position.X - 50, (int)npc.position.Y, mod.NPCType("DarkDruidMinion")); + } -if (Main.rand.Next(1000) == 0) - { - Main.PlaySound(105, (int)npc.position.X, (int)npc.position.Y, 1); - } -if (Main.rand.Next(1000) == 0) - { - Main.PlaySound(91, (int)npc.position.X, (int)npc.position.Y, 1); - } - } + if (Main.rand.Next(1000) == 0) + { + Main.PlaySound(105, (int)npc.position.X, (int)npc.position.Y, 1); + } + if (Main.rand.Next(1000) == 0) + { + Main.PlaySound(91, (int)npc.position.X, (int)npc.position.Y, 1); + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DarkDruidGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DarkDruidGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DarkDruidGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DarkDruidGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); + } + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DarkDruidMask")); - }; - if(Main.rand.Next(8) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 178); - }; - if(Main.rand.Next(8) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 180); - }; - if(Main.rand.Next(8) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 182); - }; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TearsofDeath"), Main.rand.Next(1, 5)); - }; - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DarkDruidMask")); + }; + if (Main.rand.Next(8) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 178); + }; + if (Main.rand.Next(8) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 180); + }; + if (Main.rand.Next(8) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 182); + }; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TearsofDeath"), Main.rand.Next(1, 5)); + }; + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.bloodMoon && y < Main.worldSurface ? 0.004f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.bloodMoon && y < Main.worldSurface ? 0.004f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/DarkDruidMinion.cs b/NPCs/DarkDruidMinion.cs index 46084800..9248d12f 100644 --- a/NPCs/DarkDruidMinion.cs +++ b/NPCs/DarkDruidMinion.cs @@ -6,65 +6,67 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class DarkDruidMinion : ModNPC +namespace Tremor.NPCs { + + public class DarkDruidMinion : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Dark Druid Minion"); Main.npcFrameCount[npc.type] = 15; } - - public override void SetDefaults() - { - npc.lifeMax = 30; - npc.damage = 20; - npc.defense = 5; - npc.knockBackResist = 0.3f; - npc.width = 36; - npc.height = 44; -animationType = 21; - npc.aiStyle = 3; - //npc.npcSlots = 1f; - npc.HitSound = SoundID.NPCHit2; - aiType = 77; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 0, 0); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 30; + npc.damage = 20; + npc.defense = 5; + npc.knockBackResist = 0.3f; + npc.width = 36; + npc.height = 44; + animationType = 21; + npc.aiStyle = 3; + //npc.npcSlots = 1f; + npc.HitSound = SoundID.NPCHit2; + aiType = 77; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 0, 0, 0); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 58); - }; - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 58); + }; + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); - } -} -}} \ No newline at end of file + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); + } + } + } +} \ No newline at end of file diff --git a/NPCs/DarkServant.cs b/NPCs/DarkServant.cs index ba64b997..6f71c8b1 100644 --- a/NPCs/DarkServant.cs +++ b/NPCs/DarkServant.cs @@ -7,64 +7,66 @@ using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class DarkServant : ModNPC +namespace Tremor.NPCs { + + public class DarkServant : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Dark Servant"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 1000; - npc.damage = 140; - npc.defense = 30; - npc.knockBackResist = 0.3f; - npc.width = 70; - npc.height = 46; - animationType = 244; - npc.aiStyle = 41; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.value = Item.buyPrice(0, 0, 0, 0); - } + + public override void SetDefaults() + { + npc.lifeMax = 1000; + npc.damage = 140; + npc.defense = 30; + npc.knockBackResist = 0.3f; + npc.width = 70; + npc.height = 46; + animationType = 244; + npc.aiStyle = 41; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.value = Item.buyPrice(0, 0, 0, 0); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); - } - Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); - Gore.NewGore(npc.position, npc.velocity, 99, 1f); - Gore.NewGore(npc.position, npc.velocity, 99, 1f); - Gore.NewGore(npc.position, npc.velocity, 99, 1f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); + } + Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + } + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - - if(Main.rand.Next(6) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DarkGel")); - } - } - } -}} \ No newline at end of file + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + + if (Main.rand.Next(6) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DarkGel")); + } + } + } + } +} \ No newline at end of file diff --git a/NPCs/DarkSlime.cs b/NPCs/DarkSlime.cs index 980ec491..64c66775 100644 --- a/NPCs/DarkSlime.cs +++ b/NPCs/DarkSlime.cs @@ -7,61 +7,63 @@ using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class DarkSlime : ModNPC +namespace Tremor.NPCs { + + public class DarkSlime : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Dark Slime"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 600; - npc.damage = 125; - npc.defense = 40; - npc.knockBackResist = 0.3f; - npc.width = 30; - npc.height = 23; - animationType = 244; - npc.aiStyle = 41; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.value = Item.buyPrice(0, 0, 0, 0); - } + + public override void SetDefaults() + { + npc.lifeMax = 600; + npc.damage = 125; + npc.defense = 40; + npc.knockBackResist = 0.3f; + npc.width = 30; + npc.height = 23; + animationType = 244; + npc.aiStyle = 41; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.value = Item.buyPrice(0, 0, 0, 0); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); - } - Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); - Gore.NewGore(npc.position, npc.velocity, 99, 1f); - Gore.NewGore(npc.position, npc.velocity, 99, 1f); - Gore.NewGore(npc.position, npc.velocity, 99, 1f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); + } + Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + } + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - - if(Main.rand.Next(8) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DarkGel"), Main.rand.Next(1,2)); - } - } - } -}} \ No newline at end of file + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + + if (Main.rand.Next(8) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DarkGel"), Main.rand.Next(1, 2)); + } + } + } + } +} \ No newline at end of file diff --git a/NPCs/DeepwaterVilefish.cs b/NPCs/DeepwaterVilefish.cs index a3bacc94..8771c9ff 100644 --- a/NPCs/DeepwaterVilefish.cs +++ b/NPCs/DeepwaterVilefish.cs @@ -7,71 +7,73 @@ using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class DeepwaterVilefish : ModNPC +namespace Tremor.NPCs { + + public class DeepwaterVilefish : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Deepwater Vilefish"); Main.npcFrameCount[npc.type] = 6; } - - public override void SetDefaults() - { - npc.lifeMax = 50; - npc.damage = 12; - npc.defense = 3; - npc.knockBackResist = 0.3f; - npc.width = 62; - npc.height = 46; - animationType = 241; - npc.aiStyle = 16; - npc.npcSlots = 1f; - npc.HitSound = SoundID.NPCHit47; - npc.DeathSound = SoundID.NPCDeath23; - npc.value = Item.buyPrice(0, 0, 0, 3); - banner = npc.type; - bannerItem = mod.ItemType("DeepwaterVilefishBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 50; + npc.damage = 12; + npc.defense = 3; + npc.knockBackResist = 0.3f; + npc.width = 62; + npc.height = 46; + animationType = 241; + npc.aiStyle = 16; + npc.npcSlots = 1f; + npc.HitSound = SoundID.NPCHit47; + npc.DeathSound = SoundID.NPCDeath23; + npc.value = Item.buyPrice(0, 0, 0, 3); + banner = npc.type; + bannerItem = mod.ItemType("DeepwaterVilefishBanner"); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - } -} + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 68); - }; - } - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + } + } + + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 68); + }; + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return spawnInfo.player.ZoneCorrupt && y > Main.rockLayer ? 0.05f : 0f; - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return spawnInfo.player.ZoneCorrupt && y > Main.rockLayer ? 0.05f : 0f; + } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/Deimos.cs b/NPCs/Deimos.cs index 971417a6..badc6e2d 100644 --- a/NPCs/Deimos.cs +++ b/NPCs/Deimos.cs @@ -6,110 +6,112 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Deimos : ModNPC +namespace Tremor.NPCs { + + public class Deimos : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Deimos"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 10000; - npc.damage = 180; - npc.defense = 100; - npc.knockBackResist = 0.0f; - npc.width = 145; - npc.height = 145; - animationType = 82; - npc.noGravity = true; - npc.noTileCollide = true; - npc.aiStyle = 22; - aiType = 226; - npc.npcSlots = 5f; - npc.HitSound = SoundID.NPCHit54; - npc.DeathSound = SoundID.NPCDeath52; - npc.value = Item.buyPrice(0, 10, 15, 12); - banner = npc.type; - bannerItem = mod.ItemType("DeimosBanner"); - } - public override void AI() - { -if (Main.rand.Next(6) == 0) - { - Dust.NewDust(npc.position, npc.width, npc.height, 27, 0f, 0f, 200, npc.color, 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 70, 0f, 0f, 200, npc.color, 1f); - } - } + public override void SetDefaults() + { + npc.lifeMax = 10000; + npc.damage = 180; + npc.defense = 100; + npc.knockBackResist = 0.0f; + npc.width = 145; + npc.height = 145; + animationType = 82; + npc.noGravity = true; + npc.noTileCollide = true; + npc.aiStyle = 22; + aiType = 226; + npc.npcSlots = 5f; + npc.HitSound = SoundID.NPCHit54; + npc.DeathSound = SoundID.NPCDeath52; + npc.value = Item.buyPrice(0, 10, 15, 12); + banner = npc.type; + bannerItem = mod.ItemType("DeimosBanner"); + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void AI() + { + if (Main.rand.Next(6) == 0) + { + Dust.NewDust(npc.position, npc.width, npc.height, 27, 0f, 0f, 200, npc.color, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 70, 0f, 0f, 200, npc.color, 1f); + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.05f : 0f; - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EyeofOblivion")); - } - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CarbonSteel"), Main.rand.Next(2,15)); - } - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ToothofAbraxas"), Main.rand.Next(2,16)); - } - } - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.05f : 0f; + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 60; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 70, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - } - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - } - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 70, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3.7f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DeimosGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DeimosGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DeimosGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DeimosGore3"), 1f); - } - else - { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - } - } -} -}} \ No newline at end of file + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EyeofOblivion")); + } + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CarbonSteel"), Main.rand.Next(2, 15)); + } + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ToothofAbraxas"), Main.rand.Next(2, 16)); + } + } + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 60; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 70, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + } + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + } + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 70, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3.7f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DeimosGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DeimosGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DeimosGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DeimosGore3"), 1f); + } + else + { + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + } + } + } + } +} \ No newline at end of file diff --git a/NPCs/DesertMimic.cs b/NPCs/DesertMimic.cs index c66f55dc..94c4753c 100644 --- a/NPCs/DesertMimic.cs +++ b/NPCs/DesertMimic.cs @@ -5,50 +5,50 @@ namespace Tremor.NPCs { - public class DesertMimic : ModNPC - { + public class DesertMimic : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Desert Mimic"); Main.npcFrameCount[npc.type] = 14; } - - public override void SetDefaults() - { - npc.lifeMax = 3500; - npc.damage = 90; - npc.defense = 34; - npc.knockBackResist = 0f; - npc.width = 48; - npc.height = 40; - npc.aiStyle = 87; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath6; - npc.value = Item.buyPrice(0, 3, 0, 0); - animationType = NPCID.BigMimicHallow; - } - public override void NPCLoot() - { -if (Main.netMode != 1) -{ -int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; -int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; -int halfLength = npc.width / 2 / 16 + 1; -Helper.DropItem(new Rectangle((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height), new Drop(mod.ItemType("AntlionFury"), 1, 1), new Drop(mod.ItemType("Hurricane"), 1, 2), new Drop(mod.ItemType("SandShuriken"), 1, 2), new Drop(mod.ItemType("CrawlerHook"), 1, 1), new Drop(0, 0, 0)); -Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 500, Main.rand.Next(10)); -Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 499, Main.rand.Next(10)); -Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 327); -} -} + public override void SetDefaults() + { + npc.lifeMax = 3500; + npc.damage = 90; + npc.defense = 34; + npc.knockBackResist = 0f; + npc.width = 48; + npc.height = 40; + npc.aiStyle = 87; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit4; + npc.DeathSound = SoundID.NPCDeath6; + npc.value = Item.buyPrice(0, 3, 0, 0); + animationType = NPCID.BigMimicHallow; + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && spawnInfo.player.ZoneDesert && y > Main.rockLayer ? 0.01f : 0f; - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + Helper.DropItem(new Rectangle((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height), new Drop(mod.ItemType("AntlionFury"), 1, 1), new Drop(mod.ItemType("Hurricane"), 1, 2), new Drop(mod.ItemType("SandShuriken"), 1, 2), new Drop(mod.ItemType("CrawlerHook"), 1, 1), new Drop(0, 0, 0)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 500, Main.rand.Next(10)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 499, Main.rand.Next(10)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 327); + } + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && spawnInfo.player.ZoneDesert && y > Main.rockLayer ? 0.01f : 0f; + } + } } \ No newline at end of file diff --git a/NPCs/DesertPrincess.cs b/NPCs/DesertPrincess.cs index 72399690..c3518795 100644 --- a/NPCs/DesertPrincess.cs +++ b/NPCs/DesertPrincess.cs @@ -9,528 +9,528 @@ namespace Tremor.NPCs { - public class DesertPrincess : ModNPC - { + public class DesertPrincess : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Desert Princess"); Main.npcFrameCount[npc.type] = 2; } - - public override void SetDefaults() - { - npc.npcSlots = 5f; - npc.aiStyle = -1; - aiType = -1; - npc.damage = 110; - npc.width = 77; - npc.height = 72; - npc.defense = 45; - npc.lifeMax = 22000; - npc.knockBackResist = 0f; + + public override void SetDefaults() + { + npc.npcSlots = 5f; + npc.aiStyle = -1; + aiType = -1; + npc.damage = 110; + npc.width = 77; + npc.height = 72; + npc.defense = 45; + npc.lifeMax = 22000; + npc.knockBackResist = 0f; npc.scale = 1f; - for (int k = 0; k < npc.buffImmune.Length; k++) - { - npc.buffImmune[k] = true; - } - npc.lavaImmune = true; - npc.noGravity = true; - npc.value = Item.buyPrice(0, 15, 0, 0); - npc.HitSound = SoundID.NPCHit45; - npc.DeathSound = SoundID.NPCDeath47; - } + for (int k = 0; k < npc.buffImmune.Length; k++) + { + npc.buffImmune[k] = true; + } + npc.lavaImmune = true; + npc.noGravity = true; + npc.value = Item.buyPrice(0, 15, 0, 0); + npc.HitSound = SoundID.NPCHit45; + npc.DeathSound = SoundID.NPCDeath47; + } - Rectangle GetFrame(int Number) - { - return new Rectangle(0, npc.frame.Height * (Number - 1), npc.frame.Width, npc.frame.Height); - } + Rectangle GetFrame(int Number) + { + return new Rectangle(0, npc.frame.Height * (Number - 1), npc.frame.Width, npc.frame.Height); + } - int CurrentFrame = 0; - int TimeToAnimation = 4; - public override void AI() - { - if (--TimeToAnimation <= 0) - { - if (++CurrentFrame > 2) - CurrentFrame = 1; - TimeToAnimation = 4; - npc.frame = GetFrame(CurrentFrame + 0); - } - Player player = Main.player[npc.target]; - int num1305 = 3; - npc.noTileCollide = false; - npc.noGravity = true; - npc.damage = npc.defDamage; - if (npc.target < 0 || player.dead || !player.active) - { - npc.TargetClosest(true); - if (player.dead) - { - npc.ai[0] = -1f; - } - } - else - { - Vector2 vector205 = player.Center - npc.Center; - if (npc.ai[0] > 1f && vector205.Length() > 1000f) - { - npc.ai[0] = 1f; - } - } - if (npc.ai[0] == -1f) - { - Vector2 value50 = new Vector2(0f, -8f); - npc.velocity = (npc.velocity * 9f + value50) / 10f; - npc.noTileCollide = true; - npc.dontTakeDamage = true; - return; - } - if (npc.ai[0] == 0f) - { - npc.TargetClosest(true); - if (npc.Center.X < player.Center.X - 2f) - { - npc.direction = 1; - } - if (npc.Center.X > player.Center.X + 2f) - { - npc.direction = -1; - } - npc.spriteDirection = npc.direction; - npc.rotation = (npc.rotation * 9f + npc.velocity.X * 0.1f) / 10f; - if (npc.collideX) - { - npc.velocity.X = npc.velocity.X * (-npc.oldVelocity.X * 0.5f); - if (npc.velocity.X > 16f) - { - npc.velocity.X = 16f; - } - if (npc.velocity.X < -16f) - { - npc.velocity.X = -16f; - } - } - if (npc.collideY) - { - npc.velocity.Y = npc.velocity.Y * (-npc.oldVelocity.Y * 0.5f); - if (npc.velocity.Y > 16f) - { - npc.velocity.Y = 16f; - } - if (npc.velocity.Y < -16f) - { - npc.velocity.Y = -16f; - } - } - Vector2 value51 = player.Center - npc.Center; - value51.Y -= 200f; - if (value51.Length() > 800f) - { - npc.ai[0] = 1f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - } - else if (value51.Length() > 80f) - { - float scaleFactor15 = 12f; - float num1306 = 60f; - value51.Normalize(); - value51 *= scaleFactor15; - npc.velocity = (npc.velocity * (num1306 - 1f) + value51) / num1306; - } - else if (npc.velocity.Length() > 2f) - { - npc.velocity *= 0.95f; - } - else if (npc.velocity.Length() < 1f) - { - npc.velocity *= 1.05f; - } - npc.ai[1] += 1f; - if (npc.justHit) - { - npc.ai[1] += (float)Main.rand.Next(10, 30); - } - if (npc.ai[1] >= 180f && Main.netMode != 1) - { - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - npc.netUpdate = true; - while (npc.ai[0] == 0f) - { - int num1307 = Main.rand.Next(3); - if (num1307 == 0 && Collision.CanHit(npc.Center, 1, 1, player.Center, 1, 1)) - { - npc.ai[0] = 2f; - } - else if (num1307 == 1) - { - npc.ai[0] = 3f; - } - else if (num1307 == 2 && NPC.CountNPCS(mod.NPCType("DesertPrincess2")) < num1305) - { - npc.ai[0] = 4f; - } - } - return; - } - } - else - { - if (npc.ai[0] == 1f) - { - npc.collideX = false; - npc.collideY = false; - npc.noTileCollide = true; - if (npc.target < 0 || !player.active || player.dead) - { - npc.TargetClosest(true); - } - if (npc.velocity.X < 0f) - { - npc.direction = -1; - } - else if (npc.velocity.X > 0f) - { - npc.direction = 1; - } - npc.spriteDirection = npc.direction; - npc.rotation = (npc.rotation * 9f + npc.velocity.X * 0.08f) / 10f; - Vector2 value52 = player.Center - npc.Center; - if (value52.Length() < 300f && !Collision.SolidCollision(npc.position, npc.width, npc.height)) - { - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - } - float scaleFactor16 = 14f + value52.Length() / 100f; - float num1308 = 25f; - value52.Normalize(); - value52 *= scaleFactor16; - npc.velocity = (npc.velocity * (num1308 - 1f) + value52) / num1308; - return; - } - if (npc.ai[0] == 2f) - { - npc.damage = (int)((double)npc.defDamage * 0.85); - if (npc.target < 0 || !player.active || player.dead) - { - npc.TargetClosest(true); - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - } - if (player.Center.X - 10f < npc.Center.X) - { - npc.direction = -1; - } - else if (player.Center.X + 10f > npc.Center.X) - { - npc.direction = 1; - } - npc.spriteDirection = npc.direction; - npc.rotation = (npc.rotation * 4f + npc.velocity.X * 0.1f) / 5f; - if (npc.collideX) - { - npc.velocity.X = npc.velocity.X * (-npc.oldVelocity.X * 0.5f); - if (npc.velocity.X > 16f) - { - npc.velocity.X = 16f; - } - if (npc.velocity.X < -16f) - { - npc.velocity.X = -16f; - } - } - if (npc.collideY) - { - npc.velocity.Y = npc.velocity.Y * (-npc.oldVelocity.Y * 0.5f); - if (npc.velocity.Y > 16f) - { - npc.velocity.Y = 16f; - } - if (npc.velocity.Y < -16f) - { - npc.velocity.Y = -16f; - } - } - Vector2 value53 = player.Center - npc.Center; - value53.Y -= 20f; - npc.ai[2] += 0.0222222228f; - if (Main.expertMode) - { - npc.ai[2] += 0.0166666675f; - } - float scaleFactor17 = 4f + npc.ai[2] + value53.Length() / 120f; - float num1309 = 20f; - value53.Normalize(); - value53 *= scaleFactor17; - npc.velocity = (npc.velocity * (num1309 - 1f) + value53) / num1309; - npc.ai[1] += 1f; - if (npc.ai[1] > 240f || !Collision.CanHit(npc.Center, 1, 1, player.Center, 1, 1)) - { - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - return; - } - } - else - { - if (npc.ai[0] == 3f) - { - npc.noTileCollide = true; - if (npc.velocity.X < 0f) - { - npc.direction = -1; - } - else - { - npc.direction = 1; - } - npc.spriteDirection = npc.direction; - npc.rotation = (npc.rotation * 4f + npc.velocity.X * 0.07f) / 5f; - Vector2 value54 = player.Center - npc.Center; - value54.Y -= 12f; - if (npc.Center.X > player.Center.X) - { - value54.X += 400f; - } - else - { - value54.X -= 400f; - } - if (Math.Abs(npc.Center.X - player.Center.X) > 350f && Math.Abs(npc.Center.Y - player.Center.Y) < 20f) - { - npc.ai[0] = 3.1f; - npc.ai[1] = 0f; - } - npc.ai[1] += 0.0333333351f; - float scaleFactor18 = 8f + npc.ai[1]; - float num1310 = 8f; - value54.Normalize(); - value54 *= scaleFactor18; - npc.velocity = (npc.velocity * (num1310 - 1f) + value54) / num1310; - return; - } - if (npc.ai[0] == 3.1f) - { - npc.noTileCollide = true; - npc.rotation = (npc.rotation * 4f + npc.velocity.X * 0.07f) / 5f; - Vector2 vector206 = player.Center - npc.Center; - vector206.Y -= 12f; - float scaleFactor19 = 16f; - float num1311 = 32f; - vector206.Normalize(); - vector206 *= scaleFactor19; - npc.velocity = (npc.velocity * (num1311 - 1f) + vector206) / num1311; - if (npc.velocity.X < 0f) - { - npc.direction = -1; - } - else - { - npc.direction = 1; - } - npc.spriteDirection = npc.direction; - npc.ai[1] += 1f; - if (npc.ai[1] > 10f) - { - npc.velocity = vector206; - if (npc.velocity.X < 0f) - { - npc.direction = -1; - } - else - { - npc.direction = 1; - } - npc.ai[0] = 3.2f; - npc.ai[1] = 0f; - npc.ai[1] = (float)npc.direction; - return; - } - } - else - { - if (npc.ai[0] == 3.2f) - { - npc.damage = (int)((double)npc.defDamage * 1.3); - npc.collideX = false; - npc.collideY = false; - npc.noTileCollide = true; - npc.ai[2] += 0.0333333351f; - npc.velocity.X = (16f + npc.ai[2]) * npc.ai[1]; - if ((npc.ai[1] > 0f && npc.Center.X > player.Center.X + 260f) || (npc.ai[1] < 0f && npc.Center.X < player.Center.X - 260f)) - { - if (!Collision.SolidCollision(npc.position, npc.width, npc.height)) - { - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - } - else if (Math.Abs(npc.Center.X - player.Center.X) > 800f) - { - npc.ai[0] = 1f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - } - } - npc.rotation = (npc.rotation * 4f + npc.velocity.X * 0.07f) / 5f; - return; - } - if (npc.ai[0] == 4f) - { - npc.ai[0] = 0f; - npc.TargetClosest(true); - if (Main.netMode != 1) - { - npc.ai[1] = -1f; - npc.ai[2] = -1f; - for (int num1312 = 0; num1312 < 1000; num1312++) - { - int num1313 = (int)player.Center.X / 16; - int num1314 = (int)player.Center.Y / 16; - int num1315 = 30 + num1312 / 50; - int num1316 = 20 + num1312 / 75; - num1313 += Main.rand.Next(-num1315, num1315 + 1); - num1314 += Main.rand.Next(-num1316, num1316 + 1); - if (!WorldGen.SolidTile(num1313, num1314)) - { - while (!WorldGen.SolidTile(num1313, num1314) && (double)num1314 < Main.worldSurface) - { - num1314++; - } - if ((new Vector2((float)(num1313 * 16 + 8), (float)(num1314 * 16 + 8)) - player.Center).Length() < 600f) - { - npc.ai[0] = 4.1f; - npc.ai[1] = (float)num1313; - npc.ai[2] = (float)num1314; - break; - } - } - } - } - npc.netUpdate = true; - return; - } - if (npc.ai[0] == 4.1f) - { - if (npc.velocity.X < -2f) - { - npc.direction = -1; - } - else if (npc.velocity.X > 2f) - { - npc.direction = 1; - } - npc.spriteDirection = npc.direction; - npc.rotation = (npc.rotation * 9f + npc.velocity.X * 0.1f) / 10f; - npc.noTileCollide = true; - int num1317 = (int)npc.ai[1]; - int num1318 = (int)npc.ai[2]; - float x2 = (float)(num1317 * 16 + 8); - float y2 = (float)(num1318 * 16 - 20); - Vector2 vector207 = new Vector2(x2, y2); - vector207 -= npc.Center; - float num1319 = 6f + vector207.Length() / 150f; - if (num1319 > 10f) - { - num1319 = 10f; - } - float num1320 = 40f; - if (vector207.Length() < 10f) - { - npc.ai[0] = 4.2f; - } - vector207.Normalize(); - vector207 *= num1319; - npc.velocity = (npc.velocity * (num1320 - 1f) + vector207) / num1320; - return; - } - if (npc.ai[0] == 4.2f) - { - npc.rotation = (npc.rotation * 9f + npc.velocity.X * 0.1f) / 10f; - npc.noTileCollide = true; - int num1321 = (int)npc.ai[1]; - int num1322 = (int)npc.ai[2]; - float x3 = (float)(num1321 * 16 + 8); - float y3 = (float)(num1322 * 16 - 20); - Vector2 vector208 = new Vector2(x3, y3); - vector208 -= npc.Center; - float num1323 = 4f; - float num1324 = 2f; - if (Main.netMode != 1 && vector208.Length() < 4f) - { - int num1325 = 70; - if (Main.expertMode) - { - num1325 = (int)((double)num1325 * 0.75); - } - npc.ai[3] += 1f; - if (npc.ai[3] == (float)num1325) - { - NPC.NewNPC(num1321 * 16 + 8, num1322 * 16, mod.NPCType("DesertPrincess2"), npc.whoAmI, 0f, 0f, 0f, 0f, 255); - } - else if (npc.ai[3] == (float)(num1325 * 2)) - { - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - if (NPC.CountNPCS(mod.NPCType("DesertPrincess2")) < num1305 && Main.rand.Next(3) != 0) - { - npc.ai[0] = 4f; - } - else if (Collision.SolidCollision(npc.position, npc.width, npc.height)) - { - npc.ai[0] = 1f; - } - } - } - if (vector208.Length() > num1323) - { - vector208.Normalize(); - vector208 *= num1323; - } - npc.velocity = (npc.velocity * (num1324 - 1f) + vector208) / num1324; - return; - } - } - } - } - } + int CurrentFrame = 0; + int TimeToAnimation = 4; + public override void AI() + { + if (--TimeToAnimation <= 0) + { + if (++CurrentFrame > 2) + CurrentFrame = 1; + TimeToAnimation = 4; + npc.frame = GetFrame(CurrentFrame + 0); + } + Player player = Main.player[npc.target]; + int num1305 = 3; + npc.noTileCollide = false; + npc.noGravity = true; + npc.damage = npc.defDamage; + if (npc.target < 0 || player.dead || !player.active) + { + npc.TargetClosest(true); + if (player.dead) + { + npc.ai[0] = -1f; + } + } + else + { + Vector2 vector205 = player.Center - npc.Center; + if (npc.ai[0] > 1f && vector205.Length() > 1000f) + { + npc.ai[0] = 1f; + } + } + if (npc.ai[0] == -1f) + { + Vector2 value50 = new Vector2(0f, -8f); + npc.velocity = (npc.velocity * 9f + value50) / 10f; + npc.noTileCollide = true; + npc.dontTakeDamage = true; + return; + } + if (npc.ai[0] == 0f) + { + npc.TargetClosest(true); + if (npc.Center.X < player.Center.X - 2f) + { + npc.direction = 1; + } + if (npc.Center.X > player.Center.X + 2f) + { + npc.direction = -1; + } + npc.spriteDirection = npc.direction; + npc.rotation = (npc.rotation * 9f + npc.velocity.X * 0.1f) / 10f; + if (npc.collideX) + { + npc.velocity.X = npc.velocity.X * (-npc.oldVelocity.X * 0.5f); + if (npc.velocity.X > 16f) + { + npc.velocity.X = 16f; + } + if (npc.velocity.X < -16f) + { + npc.velocity.X = -16f; + } + } + if (npc.collideY) + { + npc.velocity.Y = npc.velocity.Y * (-npc.oldVelocity.Y * 0.5f); + if (npc.velocity.Y > 16f) + { + npc.velocity.Y = 16f; + } + if (npc.velocity.Y < -16f) + { + npc.velocity.Y = -16f; + } + } + Vector2 value51 = player.Center - npc.Center; + value51.Y -= 200f; + if (value51.Length() > 800f) + { + npc.ai[0] = 1f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + } + else if (value51.Length() > 80f) + { + float scaleFactor15 = 12f; + float num1306 = 60f; + value51.Normalize(); + value51 *= scaleFactor15; + npc.velocity = (npc.velocity * (num1306 - 1f) + value51) / num1306; + } + else if (npc.velocity.Length() > 2f) + { + npc.velocity *= 0.95f; + } + else if (npc.velocity.Length() < 1f) + { + npc.velocity *= 1.05f; + } + npc.ai[1] += 1f; + if (npc.justHit) + { + npc.ai[1] += (float)Main.rand.Next(10, 30); + } + if (npc.ai[1] >= 180f && Main.netMode != 1) + { + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + npc.netUpdate = true; + while (npc.ai[0] == 0f) + { + int num1307 = Main.rand.Next(3); + if (num1307 == 0 && Collision.CanHit(npc.Center, 1, 1, player.Center, 1, 1)) + { + npc.ai[0] = 2f; + } + else if (num1307 == 1) + { + npc.ai[0] = 3f; + } + else if (num1307 == 2 && NPC.CountNPCS(mod.NPCType("DesertPrincess2")) < num1305) + { + npc.ai[0] = 4f; + } + } + return; + } + } + else + { + if (npc.ai[0] == 1f) + { + npc.collideX = false; + npc.collideY = false; + npc.noTileCollide = true; + if (npc.target < 0 || !player.active || player.dead) + { + npc.TargetClosest(true); + } + if (npc.velocity.X < 0f) + { + npc.direction = -1; + } + else if (npc.velocity.X > 0f) + { + npc.direction = 1; + } + npc.spriteDirection = npc.direction; + npc.rotation = (npc.rotation * 9f + npc.velocity.X * 0.08f) / 10f; + Vector2 value52 = player.Center - npc.Center; + if (value52.Length() < 300f && !Collision.SolidCollision(npc.position, npc.width, npc.height)) + { + npc.ai[0] = 0f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + } + float scaleFactor16 = 14f + value52.Length() / 100f; + float num1308 = 25f; + value52.Normalize(); + value52 *= scaleFactor16; + npc.velocity = (npc.velocity * (num1308 - 1f) + value52) / num1308; + return; + } + if (npc.ai[0] == 2f) + { + npc.damage = (int)((double)npc.defDamage * 0.85); + if (npc.target < 0 || !player.active || player.dead) + { + npc.TargetClosest(true); + npc.ai[0] = 0f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + } + if (player.Center.X - 10f < npc.Center.X) + { + npc.direction = -1; + } + else if (player.Center.X + 10f > npc.Center.X) + { + npc.direction = 1; + } + npc.spriteDirection = npc.direction; + npc.rotation = (npc.rotation * 4f + npc.velocity.X * 0.1f) / 5f; + if (npc.collideX) + { + npc.velocity.X = npc.velocity.X * (-npc.oldVelocity.X * 0.5f); + if (npc.velocity.X > 16f) + { + npc.velocity.X = 16f; + } + if (npc.velocity.X < -16f) + { + npc.velocity.X = -16f; + } + } + if (npc.collideY) + { + npc.velocity.Y = npc.velocity.Y * (-npc.oldVelocity.Y * 0.5f); + if (npc.velocity.Y > 16f) + { + npc.velocity.Y = 16f; + } + if (npc.velocity.Y < -16f) + { + npc.velocity.Y = -16f; + } + } + Vector2 value53 = player.Center - npc.Center; + value53.Y -= 20f; + npc.ai[2] += 0.0222222228f; + if (Main.expertMode) + { + npc.ai[2] += 0.0166666675f; + } + float scaleFactor17 = 4f + npc.ai[2] + value53.Length() / 120f; + float num1309 = 20f; + value53.Normalize(); + value53 *= scaleFactor17; + npc.velocity = (npc.velocity * (num1309 - 1f) + value53) / num1309; + npc.ai[1] += 1f; + if (npc.ai[1] > 240f || !Collision.CanHit(npc.Center, 1, 1, player.Center, 1, 1)) + { + npc.ai[0] = 0f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + return; + } + } + else + { + if (npc.ai[0] == 3f) + { + npc.noTileCollide = true; + if (npc.velocity.X < 0f) + { + npc.direction = -1; + } + else + { + npc.direction = 1; + } + npc.spriteDirection = npc.direction; + npc.rotation = (npc.rotation * 4f + npc.velocity.X * 0.07f) / 5f; + Vector2 value54 = player.Center - npc.Center; + value54.Y -= 12f; + if (npc.Center.X > player.Center.X) + { + value54.X += 400f; + } + else + { + value54.X -= 400f; + } + if (Math.Abs(npc.Center.X - player.Center.X) > 350f && Math.Abs(npc.Center.Y - player.Center.Y) < 20f) + { + npc.ai[0] = 3.1f; + npc.ai[1] = 0f; + } + npc.ai[1] += 0.0333333351f; + float scaleFactor18 = 8f + npc.ai[1]; + float num1310 = 8f; + value54.Normalize(); + value54 *= scaleFactor18; + npc.velocity = (npc.velocity * (num1310 - 1f) + value54) / num1310; + return; + } + if (npc.ai[0] == 3.1f) + { + npc.noTileCollide = true; + npc.rotation = (npc.rotation * 4f + npc.velocity.X * 0.07f) / 5f; + Vector2 vector206 = player.Center - npc.Center; + vector206.Y -= 12f; + float scaleFactor19 = 16f; + float num1311 = 32f; + vector206.Normalize(); + vector206 *= scaleFactor19; + npc.velocity = (npc.velocity * (num1311 - 1f) + vector206) / num1311; + if (npc.velocity.X < 0f) + { + npc.direction = -1; + } + else + { + npc.direction = 1; + } + npc.spriteDirection = npc.direction; + npc.ai[1] += 1f; + if (npc.ai[1] > 10f) + { + npc.velocity = vector206; + if (npc.velocity.X < 0f) + { + npc.direction = -1; + } + else + { + npc.direction = 1; + } + npc.ai[0] = 3.2f; + npc.ai[1] = 0f; + npc.ai[1] = (float)npc.direction; + return; + } + } + else + { + if (npc.ai[0] == 3.2f) + { + npc.damage = (int)((double)npc.defDamage * 1.3); + npc.collideX = false; + npc.collideY = false; + npc.noTileCollide = true; + npc.ai[2] += 0.0333333351f; + npc.velocity.X = (16f + npc.ai[2]) * npc.ai[1]; + if ((npc.ai[1] > 0f && npc.Center.X > player.Center.X + 260f) || (npc.ai[1] < 0f && npc.Center.X < player.Center.X - 260f)) + { + if (!Collision.SolidCollision(npc.position, npc.width, npc.height)) + { + npc.ai[0] = 0f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + } + else if (Math.Abs(npc.Center.X - player.Center.X) > 800f) + { + npc.ai[0] = 1f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + } + } + npc.rotation = (npc.rotation * 4f + npc.velocity.X * 0.07f) / 5f; + return; + } + if (npc.ai[0] == 4f) + { + npc.ai[0] = 0f; + npc.TargetClosest(true); + if (Main.netMode != 1) + { + npc.ai[1] = -1f; + npc.ai[2] = -1f; + for (int num1312 = 0; num1312 < 1000; num1312++) + { + int num1313 = (int)player.Center.X / 16; + int num1314 = (int)player.Center.Y / 16; + int num1315 = 30 + num1312 / 50; + int num1316 = 20 + num1312 / 75; + num1313 += Main.rand.Next(-num1315, num1315 + 1); + num1314 += Main.rand.Next(-num1316, num1316 + 1); + if (!WorldGen.SolidTile(num1313, num1314)) + { + while (!WorldGen.SolidTile(num1313, num1314) && (double)num1314 < Main.worldSurface) + { + num1314++; + } + if ((new Vector2((float)(num1313 * 16 + 8), (float)(num1314 * 16 + 8)) - player.Center).Length() < 600f) + { + npc.ai[0] = 4.1f; + npc.ai[1] = (float)num1313; + npc.ai[2] = (float)num1314; + break; + } + } + } + } + npc.netUpdate = true; + return; + } + if (npc.ai[0] == 4.1f) + { + if (npc.velocity.X < -2f) + { + npc.direction = -1; + } + else if (npc.velocity.X > 2f) + { + npc.direction = 1; + } + npc.spriteDirection = npc.direction; + npc.rotation = (npc.rotation * 9f + npc.velocity.X * 0.1f) / 10f; + npc.noTileCollide = true; + int num1317 = (int)npc.ai[1]; + int num1318 = (int)npc.ai[2]; + float x2 = (float)(num1317 * 16 + 8); + float y2 = (float)(num1318 * 16 - 20); + Vector2 vector207 = new Vector2(x2, y2); + vector207 -= npc.Center; + float num1319 = 6f + vector207.Length() / 150f; + if (num1319 > 10f) + { + num1319 = 10f; + } + float num1320 = 40f; + if (vector207.Length() < 10f) + { + npc.ai[0] = 4.2f; + } + vector207.Normalize(); + vector207 *= num1319; + npc.velocity = (npc.velocity * (num1320 - 1f) + vector207) / num1320; + return; + } + if (npc.ai[0] == 4.2f) + { + npc.rotation = (npc.rotation * 9f + npc.velocity.X * 0.1f) / 10f; + npc.noTileCollide = true; + int num1321 = (int)npc.ai[1]; + int num1322 = (int)npc.ai[2]; + float x3 = (float)(num1321 * 16 + 8); + float y3 = (float)(num1322 * 16 - 20); + Vector2 vector208 = new Vector2(x3, y3); + vector208 -= npc.Center; + float num1323 = 4f; + float num1324 = 2f; + if (Main.netMode != 1 && vector208.Length() < 4f) + { + int num1325 = 70; + if (Main.expertMode) + { + num1325 = (int)((double)num1325 * 0.75); + } + npc.ai[3] += 1f; + if (npc.ai[3] == (float)num1325) + { + NPC.NewNPC(num1321 * 16 + 8, num1322 * 16, mod.NPCType("DesertPrincess2"), npc.whoAmI, 0f, 0f, 0f, 0f, 255); + } + else if (npc.ai[3] == (float)(num1325 * 2)) + { + npc.ai[0] = 0f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + if (NPC.CountNPCS(mod.NPCType("DesertPrincess2")) < num1305 && Main.rand.Next(3) != 0) + { + npc.ai[0] = 4f; + } + else if (Collision.SolidCollision(npc.position, npc.width, npc.height)) + { + npc.ai[0] = 1f; + } + } + } + if (vector208.Length() > num1323) + { + vector208.Normalize(); + vector208 *= num1323; + } + npc.velocity = (npc.velocity * (num1324 - 1f) + vector208) / num1324; + return; + } + } + } + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - return spawnInfo.player.ZoneJungle && NPC.downedPlantBoss ? 0.001f : 0f; - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + return spawnInfo.player.ZoneJungle && NPC.downedPlantBoss ? 0.001f : 0f; + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 0.6f * bossLifeScale); - npc.damage = (int)(npc.damage * 0.6f); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 0.6f * bossLifeScale); + npc.damage = (int)(npc.damage * 0.6f); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - Helper.DropItem(new Rectangle((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height), new Drop(mod.ItemType("DesertExplorerVisage"), 1, 1), new Drop(mod.ItemType("DesertExplorerGreaves"), 1, 2), new Drop(mod.ItemType("DesertExplorerBreastplate"), 1, 2)); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 500, Main.rand.Next(5, 15)); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 499, Main.rand.Next(5, 15)); - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + Helper.DropItem(new Rectangle((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height), new Drop(mod.ItemType("DesertExplorerVisage"), 1, 1), new Drop(mod.ItemType("DesertExplorerGreaves"), 1, 2), new Drop(mod.ItemType("DesertExplorerBreastplate"), 1, 2)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 500, Main.rand.Next(5, 15)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 499, Main.rand.Next(5, 15)); + } } - } + } } \ No newline at end of file diff --git a/NPCs/DesertPrincess2.cs b/NPCs/DesertPrincess2.cs index 79337f79..2edb6646 100644 --- a/NPCs/DesertPrincess2.cs +++ b/NPCs/DesertPrincess2.cs @@ -16,53 +16,53 @@ public override void SetStaticDefaults() DisplayName.SetDefault("Desert Wasp"); Main.npcFrameCount[npc.type] = 2; } - + public override void SetDefaults() { - npc.npcSlots = 5f; - npc.aiStyle = -1; - aiType = -1; - npc.damage = 65; - npc.width = 56; - npc.height = 56; - npc.defense = 45; - npc.lifeMax = 2500; - npc.knockBackResist = 0f; - for (int k = 0; k < npc.buffImmune.Length; k++) - { - npc.buffImmune[k] = true; - } - npc.lavaImmune = true; - npc.noGravity = true; - npc.HitSound = SoundID.NPCHit45; - npc.DeathSound = SoundID.NPCDeath47; - } + npc.npcSlots = 5f; + npc.aiStyle = -1; + aiType = -1; + npc.damage = 65; + npc.width = 56; + npc.height = 56; + npc.defense = 45; + npc.lifeMax = 2500; + npc.knockBackResist = 0f; + for (int k = 0; k < npc.buffImmune.Length; k++) + { + npc.buffImmune[k] = true; + } + npc.lavaImmune = true; + npc.noGravity = true; + npc.HitSound = SoundID.NPCHit45; + npc.DeathSound = SoundID.NPCDeath47; + } - Rectangle GetFrame(int Number) - { - return new Rectangle(0, npc.frame.Height * (Number - 1), npc.frame.Width, npc.frame.Height); - } + Rectangle GetFrame(int Number) + { + return new Rectangle(0, npc.frame.Height * (Number - 1), npc.frame.Width, npc.frame.Height); + } - int CurrentFrame = 0; - int TimeToAnimation = 4; - public override void AI() + int CurrentFrame = 0; + int TimeToAnimation = 4; + public override void AI() { - if (--TimeToAnimation <= 0) - { - if (++CurrentFrame > 2) - CurrentFrame = 1; - TimeToAnimation = 4; - npc.frame = GetFrame(CurrentFrame + 0); - } - int num1305 = 3; + if (--TimeToAnimation <= 0) + { + if (++CurrentFrame > 2) + CurrentFrame = 1; + TimeToAnimation = 4; + npc.frame = GetFrame(CurrentFrame + 0); + } + int num1305 = 3; npc.noTileCollide = false; npc.noGravity = true; npc.damage = npc.defDamage; - if (npc.target < 0 || Main.player[npc.target].dead || !Main.player[npc.target].active) + if (npc.target < 0 || Main.player[npc.target].dead || !Main.player[npc.target].active) { npc.TargetClosest(true); Vector2 vector204 = Main.player[npc.target].Center - npc.Center; - if (Main.player[npc.target].dead || vector204.Length() > 3000f) + if (Main.player[npc.target].dead || vector204.Length() > 3000f) { npc.ai[0] = -1f; } @@ -70,12 +70,12 @@ public override void AI() else { Vector2 vector205 = Main.player[npc.target].Center - npc.Center; - if (npc.ai[0] > 1f && vector205.Length() > 1000f) + if (npc.ai[0] > 1f && vector205.Length() > 1000f) { npc.ai[0] = 1f; } } - if (npc.ai[0] == -1f) + if (npc.ai[0] == -1f) { Vector2 value50 = new Vector2(0f, -8f); npc.velocity = (npc.velocity * 9f + value50) / 10f; @@ -83,90 +83,90 @@ public override void AI() npc.dontTakeDamage = true; return; } - if (npc.ai[0] == 0f) + if (npc.ai[0] == 0f) { npc.TargetClosest(true); - if (npc.Center.X < Main.player[npc.target].Center.X - 2f) + if (npc.Center.X < Main.player[npc.target].Center.X - 2f) { npc.direction = 1; } - if (npc.Center.X > Main.player[npc.target].Center.X + 2f) + if (npc.Center.X > Main.player[npc.target].Center.X + 2f) { npc.direction = -1; } npc.spriteDirection = npc.direction; npc.rotation = (npc.rotation * 9f + npc.velocity.X * 0.1f) / 10f; - if (npc.collideX) + if (npc.collideX) { npc.velocity.X = npc.velocity.X * (-npc.oldVelocity.X * 0.5f); if (npc.velocity.X > 4f) { - npc.velocity.X = 4f; + npc.velocity.X = 4f; } - if (npc.velocity.X < -4f) + if (npc.velocity.X < -4f) { - npc.velocity.X = -4f; + npc.velocity.X = -4f; } } - if (npc.collideY) + if (npc.collideY) { npc.velocity.Y = npc.velocity.Y * (-npc.oldVelocity.Y * 0.5f); - if (npc.velocity.Y > 4f) + if (npc.velocity.Y > 4f) { - npc.velocity.Y = 4f; + npc.velocity.Y = 4f; } - if (npc.velocity.Y < -4f) + if (npc.velocity.Y < -4f) { - npc.velocity.Y = -4f; + npc.velocity.Y = -4f; } } Vector2 value51 = Main.player[npc.target].Center - npc.Center; value51.Y -= 200f; - if (value51.Length() > 800f) + if (value51.Length() > 800f) { npc.ai[0] = 1f; npc.ai[1] = 0f; npc.ai[2] = 0f; npc.ai[3] = 0f; - } - else if (value51.Length() > 80f) + } + else if (value51.Length() > 80f) { float scaleFactor15 = 6f; float num1306 = 30f; value51.Normalize(); value51 *= scaleFactor15; npc.velocity = (npc.velocity * (num1306 - 1f) + value51) / num1306; - } - else if (npc.velocity.Length() > 2f) + } + else if (npc.velocity.Length() > 2f) { npc.velocity *= 0.95f; - } - else if (npc.velocity.Length() < 1f) + } + else if (npc.velocity.Length() < 1f) { npc.velocity *= 1.05f; } npc.ai[1] += 1f; - if (npc.justHit) + if (npc.justHit) { npc.ai[1] += (float)Main.rand.Next(10, 30); } - if (npc.ai[1] >= 180f && Main.netMode != 1) + if (npc.ai[1] >= 180f && Main.netMode != 1) { npc.ai[1] = 0f; npc.ai[2] = 0f; npc.ai[3] = 0f; npc.netUpdate = true; - while (npc.ai[0] == 0f) + while (npc.ai[0] == 0f) { int num1307 = Main.rand.Next(3); - if (num1307 == 0 && Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].Center, 1, 1)) + if (num1307 == 0 && Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].Center, 1, 1)) { npc.ai[0] = 2f; - } - else if (num1307 == 1) + } + else if (num1307 == 1) { npc.ai[0] = 3f; - } + } else if (num1307 == 2 && NPC.CountNPCS(mod.NPCType("DesertPrincess2")) < num1305) { npc.ai[0] = 4f; @@ -175,18 +175,18 @@ public override void AI() return; } } - else + else { - if (npc.ai[0] == 1f) + if (npc.ai[0] == 1f) { npc.collideX = false; npc.collideY = false; npc.noTileCollide = true; - if (npc.target < 0 || !Main.player[npc.target].active || Main.player[npc.target].dead) + if (npc.target < 0 || !Main.player[npc.target].active || Main.player[npc.target].dead) { npc.TargetClosest(true); } - if (npc.velocity.X < 0f) + if (npc.velocity.X < 0f) { npc.direction = -1; } @@ -197,7 +197,7 @@ public override void AI() npc.spriteDirection = npc.direction; npc.rotation = (npc.rotation * 9f + npc.velocity.X * 0.08f) / 10f; Vector2 value52 = Main.player[npc.target].Center - npc.Center; - if (value52.Length() < 300f && !Collision.SolidCollision(npc.position, npc.width, npc.height)) + if (value52.Length() < 300f && !Collision.SolidCollision(npc.position, npc.width, npc.height)) { npc.ai[0] = 0f; npc.ai[1] = 0f; @@ -211,10 +211,10 @@ public override void AI() npc.velocity = (npc.velocity * (num1308 - 1f) + value52) / num1308; return; } - if (npc.ai[0] == 2f) + if (npc.ai[0] == 2f) { npc.damage = (int)((double)npc.defDamage * 0.5); - if (npc.target < 0 || !Main.player[npc.target].active || Main.player[npc.target].dead) + if (npc.target < 0 || !Main.player[npc.target].active || Main.player[npc.target].dead) { npc.TargetClosest(true); npc.ai[0] = 0f; @@ -222,44 +222,44 @@ public override void AI() npc.ai[2] = 0f; npc.ai[3] = 0f; } - if (Main.player[npc.target].Center.X - 10f < npc.Center.X) + if (Main.player[npc.target].Center.X - 10f < npc.Center.X) { npc.direction = -1; - } + } else if (Main.player[npc.target].Center.X + 10f > npc.Center.X) { npc.direction = 1; } npc.spriteDirection = npc.direction; npc.rotation = (npc.rotation * 4f + npc.velocity.X * 0.1f) / 5f; - if (npc.collideX) + if (npc.collideX) { npc.velocity.X = npc.velocity.X * (-npc.oldVelocity.X * 0.5f); - if (npc.velocity.X > 4f) + if (npc.velocity.X > 4f) { - npc.velocity.X = 4f; + npc.velocity.X = 4f; } - if (npc.velocity.X < -4f) + if (npc.velocity.X < -4f) { - npc.velocity.X = -4f; + npc.velocity.X = -4f; } } - if (npc.collideY) + if (npc.collideY) { npc.velocity.Y = npc.velocity.Y * (-npc.oldVelocity.Y * 0.5f); - if (npc.velocity.Y > 4f) + if (npc.velocity.Y > 4f) { - npc.velocity.Y = 4f; + npc.velocity.Y = 4f; } - if (npc.velocity.Y < -4f) + if (npc.velocity.Y < -4f) { - npc.velocity.Y = -4f; + npc.velocity.Y = -4f; } } Vector2 value53 = Main.player[npc.target].Center - npc.Center; value53.Y -= 20f; npc.ai[2] += 0.0222222228f; - if (Main.expertMode) + if (Main.expertMode) { npc.ai[2] += 0.0166666675f; } @@ -269,7 +269,7 @@ public override void AI() value53 *= scaleFactor17; npc.velocity = (npc.velocity * (num1309 - 1f) + value53) / num1309; npc.ai[1] += 1f; - if (npc.ai[1] > 240f || !Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].Center, 1, 1)) + if (npc.ai[1] > 240f || !Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].Center, 1, 1)) { npc.ai[0] = 0f; npc.ai[1] = 0f; @@ -278,15 +278,15 @@ public override void AI() return; } } - else + else { - if (npc.ai[0] == 3f) + if (npc.ai[0] == 3f) { npc.noTileCollide = true; - if (npc.velocity.X < 0f) + if (npc.velocity.X < 0f) { npc.direction = -1; - } + } else { npc.direction = 1; @@ -295,55 +295,55 @@ public override void AI() npc.rotation = (npc.rotation * 4f + npc.velocity.X * 0.07f) / 5f; Vector2 value54 = Main.player[npc.target].Center - npc.Center; value54.Y -= 12f; - if (npc.Center.X > Main.player[npc.target].Center.X) + if (npc.Center.X > Main.player[npc.target].Center.X) { value54.X += 400f; - } + } else { value54.X -= 400f; } - if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) > 350f && Math.Abs(npc.Center.Y - Main.player[npc.target].Center.Y) < 20f) + if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) > 350f && Math.Abs(npc.Center.Y - Main.player[npc.target].Center.Y) < 20f) { npc.ai[0] = 3.1f; npc.ai[1] = 0f; } npc.ai[1] += 0.0333333351f; float scaleFactor18 = 8f + npc.ai[1]; - float num1310 = 4f; + float num1310 = 4f; value54.Normalize(); value54 *= scaleFactor18; npc.velocity = (npc.velocity * (num1310 - 1f) + value54) / num1310; return; } - if (npc.ai[0] == 3.1f) + if (npc.ai[0] == 3.1f) { npc.noTileCollide = true; npc.rotation = (npc.rotation * 4f + npc.velocity.X * 0.07f) / 5f; Vector2 vector206 = Main.player[npc.target].Center - npc.Center; vector206.Y -= 12f; float scaleFactor19 = 16f; - float num1311 = 8f; + float num1311 = 8f; vector206.Normalize(); vector206 *= scaleFactor19; npc.velocity = (npc.velocity * (num1311 - 1f) + vector206) / num1311; - if (npc.velocity.X < 0f) + if (npc.velocity.X < 0f) { npc.direction = -1; - } + } else { npc.direction = 1; } npc.spriteDirection = npc.direction; npc.ai[1] += 1f; - if (npc.ai[1] > 10f) + if (npc.ai[1] > 10f) { npc.velocity = vector206; - if (npc.velocity.X < 0f) + if (npc.velocity.X < 0f) { npc.direction = -1; - } + } else { npc.direction = 1; @@ -354,9 +354,9 @@ public override void AI() return; } } - else + else { - if (npc.ai[0] == 3.2f) + if (npc.ai[0] == 3.2f) { npc.damage = (int)((double)npc.defDamage * 1.3); npc.collideX = false; @@ -364,15 +364,15 @@ public override void AI() npc.noTileCollide = true; npc.ai[2] += 0.0333333351f; npc.velocity.X = (16f + npc.ai[2]) * npc.ai[1]; - if ((npc.ai[1] > 0f && npc.Center.X > Main.player[npc.target].Center.X + 260f) || (npc.ai[1] < 0f && npc.Center.X < Main.player[npc.target].Center.X - 260f)) + if ((npc.ai[1] > 0f && npc.Center.X > Main.player[npc.target].Center.X + 260f) || (npc.ai[1] < 0f && npc.Center.X < Main.player[npc.target].Center.X - 260f)) { - if (!Collision.SolidCollision(npc.position, npc.width, npc.height)) + if (!Collision.SolidCollision(npc.position, npc.width, npc.height)) { npc.ai[0] = 0f; npc.ai[1] = 0f; npc.ai[2] = 0f; npc.ai[3] = 0f; - } + } else if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) > 800f) { npc.ai[0] = 1f; @@ -384,15 +384,15 @@ public override void AI() npc.rotation = (npc.rotation * 4f + npc.velocity.X * 0.07f) / 5f; return; } - if (npc.ai[0] == 4f) + if (npc.ai[0] == 4f) { npc.ai[0] = 0f; npc.TargetClosest(true); - if (Main.netMode != 1) + if (Main.netMode != 1) { npc.ai[1] = -1f; npc.ai[2] = -1f; - for (int num1312 = 0; num1312 < 1000; num1312++) + for (int num1312 = 0; num1312 < 1000; num1312++) { int num1313 = (int)Main.player[npc.target].Center.X / 16; int num1314 = (int)Main.player[npc.target].Center.Y / 16; @@ -400,13 +400,13 @@ public override void AI() int num1316 = 20 + num1312 / 75; num1313 += Main.rand.Next(-num1315, num1315 + 1); num1314 += Main.rand.Next(-num1316, num1316 + 1); - if (!WorldGen.SolidTile(num1313, num1314)) + if (!WorldGen.SolidTile(num1313, num1314)) { - while (!WorldGen.SolidTile(num1313, num1314) && (double)num1314 < Main.worldSurface) + while (!WorldGen.SolidTile(num1313, num1314) && (double)num1314 < Main.worldSurface) { num1314++; } - if ((new Vector2((float)(num1313 * 16 + 8), (float)(num1314 * 16 + 8)) - Main.player[npc.target].Center).Length() < 600f) + if ((new Vector2((float)(num1313 * 16 + 8), (float)(num1314 * 16 + 8)) - Main.player[npc.target].Center).Length() < 600f) { npc.ai[0] = 4.1f; npc.ai[1] = (float)num1313; @@ -419,13 +419,13 @@ public override void AI() npc.netUpdate = true; return; } - if (npc.ai[0] == 4.1f) + if (npc.ai[0] == 4.1f) { - if (npc.velocity.X < -2f) + if (npc.velocity.X < -2f) { npc.direction = -1; - } - else if (npc.velocity.X > 2f) + } + else if (npc.velocity.X > 2f) { npc.direction = 1; } @@ -439,11 +439,12 @@ public override void AI() Vector2 vector207 = new Vector2(x2, y2); vector207 -= npc.Center; float num1319 = 6f + vector207.Length() / 150f; - if (num1319 > 10f) { + if (num1319 > 10f) + { num1319 = 10f; } - float num1320 = 10f; - if (vector207.Length() < 10f) + float num1320 = 10f; + if (vector207.Length() < 10f) { npc.ai[0] = 4.2f; } @@ -452,7 +453,7 @@ public override void AI() npc.velocity = (npc.velocity * (num1320 - 1f) + vector207) / num1320; return; } - if (npc.ai[0] == 4.2f) + if (npc.ai[0] == 4.2f) { npc.rotation = (npc.rotation * 9f + npc.velocity.X * 0.1f) / 10f; npc.noTileCollide = true; @@ -464,19 +465,19 @@ public override void AI() vector208 -= npc.Center; float num1323 = 4f; float num1324 = 2f; - if (Main.netMode != 1 && vector208.Length() < 4f) + if (Main.netMode != 1 && vector208.Length() < 4f) { int num1325 = 70; - if (Main.expertMode) + if (Main.expertMode) { num1325 = (int)((double)num1325 * 0.75); } npc.ai[3] += 1f; - if (npc.ai[3] == (float)num1325) + if (npc.ai[3] == (float)num1325) { NPC.NewNPC(num1321 * 16 + 8, num1322 * 16, mod.NPCType("DesertPrincess2"), npc.whoAmI, 0f, 0f, 0f, 0f, 255); } - else if (npc.ai[3] == (float)(num1325 * 2)) + else if (npc.ai[3] == (float)(num1325 * 2)) { npc.ai[0] = 0f; npc.ai[1] = 0f; @@ -485,14 +486,14 @@ public override void AI() if (NPC.CountNPCS(mod.NPCType("DesertPrincess2")) < num1305 && Main.rand.Next(3) != 0) { npc.ai[0] = 4f; - } - else if (Collision.SolidCollision(npc.position, npc.width, npc.height)) + } + else if (Collision.SolidCollision(npc.position, npc.width, npc.height)) { npc.ai[0] = 1f; } } } - if (vector208.Length() > num1323) + if (vector208.Length() > num1323) { vector208.Normalize(); vector208 *= num1323; diff --git a/NPCs/DevilishTortoise.cs b/NPCs/DevilishTortoise.cs index 429ab8a5..1d5c59b9 100644 --- a/NPCs/DevilishTortoise.cs +++ b/NPCs/DevilishTortoise.cs @@ -6,75 +6,77 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class DevilishTortoise : ModNPC +namespace Tremor.NPCs { + + public class DevilishTortoise : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Devil Tortoise"); Main.npcFrameCount[npc.type] = 8; } - - public override void SetDefaults() - { - npc.lifeMax = 400; - npc.damage = 90; - npc.defense = 32; - npc.knockBackResist = 0f; - npc.width = 64; - npc.height = 48; - npc.lavaImmune = true; - animationType = 153; - npc.aiStyle = 39; - npc.npcSlots = 2f; - npc.HitSound = SoundID.NPCHit2; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 8, 9); - banner = npc.type; - bannerItem = mod.ItemType("DevilishTortoiseBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 400; + npc.damage = 90; + npc.defense = 32; + npc.knockBackResist = 0f; + npc.width = 64; + npc.height = 48; + npc.lavaImmune = true; + animationType = 153; + npc.aiStyle = 39; + npc.npcSlots = 2f; + npc.HitSound = SoundID.NPCHit2; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 0, 8, 9); + banner = npc.type; + bannerItem = mod.ItemType("DevilishTortoiseBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && spawnInfo.spawnTileY > Main.maxTilesY - 200 ? 0.02f : 0; - } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DevilishTortoiseGore"), 1f); - } - else - { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && spawnInfo.spawnTileY > Main.maxTilesY - 200 ? 0.02f : 0; + } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DevilishTortoiseGore"), 1f); + } + else + { + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + } + } + } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/DevourerofPlanets.cs b/NPCs/DevourerofPlanets.cs index 545b8763..b8e4b8dc 100644 --- a/NPCs/DevourerofPlanets.cs +++ b/NPCs/DevourerofPlanets.cs @@ -6,101 +6,103 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class DevourerofPlanets : ModNPC +namespace Tremor.NPCs { + + public class DevourerofPlanets : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Devourer of Planets"); Main.npcFrameCount[npc.type] = 2; } - - public override void SetDefaults() - { - npc.lifeMax = 15000; - npc.damage = 130; - npc.defense = 132; - npc.knockBackResist = 0f; - npc.width = 50; - npc.height = 78; - animationType = 6; - aiType = 6; - npc.aiStyle = 5; - npc.npcSlots = 0.5f; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit37; - npc.noGravity = true; - npc.DeathSound = SoundID.NPCDeath40; - npc.value = Item.buyPrice(0, 2, 25, 9); - banner = npc.type; - bannerItem = mod.ItemType("DevourerofPlanetsBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 15000; + npc.damage = 130; + npc.defense = 132; + npc.knockBackResist = 0f; + npc.width = 50; + npc.height = 78; + animationType = 6; + aiType = 6; + npc.aiStyle = 5; + npc.npcSlots = 0.5f; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit37; + npc.noGravity = true; + npc.DeathSound = SoundID.NPCDeath40; + npc.value = Item.buyPrice(0, 2, 25, 9); + banner = npc.type; + bannerItem = mod.ItemType("DevourerofPlanetsBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HuskofDusk"), Main.rand.Next(2,5)); - } - if(Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EyeofOblivion"), Main.rand.Next(1)); - } - if(Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("NightCore"), Main.rand.Next(1)); - } - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HuskofDusk"), Main.rand.Next(2, 5)); + } + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EyeofOblivion"), Main.rand.Next(1)); + } + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("NightCore"), Main.rand.Next(1)); + } + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return Main.hardMode && TremorWorld.downedTrinity && !spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.005f : 0f; - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return Main.hardMode && TremorWorld.downedTrinity && !spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.005f : 0f; + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DevourerofPlanetsGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DevourerofPlanetsGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DevourerofPlanetsGore3"), 1f); - } - else - { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 27, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 22, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DevourerofPlanetsGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DevourerofPlanetsGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DevourerofPlanetsGore3"), 1f); + } + else + { + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 27, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 22, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, (float)hitDirection, -1f, 0, default(Color), 0.7f); + } + } + } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/Dinictis.cs b/NPCs/Dinictis.cs index caba00e2..482d483d 100644 --- a/NPCs/Dinictis.cs +++ b/NPCs/Dinictis.cs @@ -7,74 +7,76 @@ using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Dinictis : ModNPC +namespace Tremor.NPCs { + + public class Dinictis : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Dinichthys"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 800; - npc.damage = 95; - npc.defense = 20; - npc.knockBackResist = 0.3f; - npc.width = 34; - npc.height = 48; - animationType = 65; - npc.aiStyle = 16; - npc.npcSlots = 1f; - npc.HitSound = SoundID.NPCHit31; - npc.noGravity = true; - npc.DeathSound = SoundID.NPCDeath6; - npc.value = Item.buyPrice(0, 0, 7, 9); - banner = npc.type; - bannerItem = mod.ItemType("DinictisBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 800; + npc.damage = 95; + npc.defense = 20; + npc.knockBackResist = 0.3f; + npc.width = 34; + npc.height = 48; + animationType = 65; + npc.aiStyle = 16; + npc.npcSlots = 1f; + npc.HitSound = SoundID.NPCHit31; + npc.noGravity = true; + npc.DeathSound = SoundID.NPCDeath6; + npc.value = Item.buyPrice(0, 0, 7, 9); + banner = npc.type; + bannerItem = mod.ItemType("DinictisBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DinictisGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DinictisGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DinictisGore3"), 1f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DinictisGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DinictisGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DinictisGore3"), 1f); + } + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(35) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Sharking")); - }; - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(35) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Sharking")); + }; + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && (tile == 53 || tile == 112 || tile == 116 || tile == 234) && Tremor.NoZoneAllowWater(spawnInfo) && spawnInfo.water) && Main.hardMode && y < Main.rockLayer && (x < 250 || x > Main.maxTilesX - 250) && !spawnInfo.playerSafe ? 0.01f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && (tile == 53 || tile == 112 || tile == 116 || tile == 234) && Tremor.NoZoneAllowWater(spawnInfo) && spawnInfo.water) && Main.hardMode && y < Main.rockLayer && (x < 250 || x > Main.maxTilesX - 250) && !spawnInfo.playerSafe ? 0.01f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/DragonMini.cs b/NPCs/DragonMini.cs index 46bd9556..97d13b27 100644 --- a/NPCs/DragonMini.cs +++ b/NPCs/DragonMini.cs @@ -8,47 +8,47 @@ namespace Tremor.NPCs { - public class DragonMini : ModNPC - { + public class DragonMini : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Baby Dragon"); } - public override void SetDefaults() - { - npc.noTileCollide = true; - npc.noGravity = true; - npc.lifeMax = 150; - npc.damage = 19; - npc.defense = 4; - npc.knockBackResist = 0.5f; - npc.width = 64; - npc.height = 42; - aiType = 6; - npc.aiStyle = 5; - animationType = 2; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - Main.npcFrameCount[npc.type] = 2; - } + public override void SetDefaults() + { + npc.noTileCollide = true; + npc.noGravity = true; + npc.lifeMax = 150; + npc.damage = 19; + npc.defense = 4; + npc.knockBackResist = 0.5f; + npc.width = 64; + npc.height = 42; + aiType = 6; + npc.aiStyle = 5; + animationType = 2; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + Main.npcFrameCount[npc.type] = 2; + } - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - if(Main.expertMode) - target.AddBuff(156, 180); - } + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + if (Main.expertMode) + target.AddBuff(156, 180); + } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Texture2D drawTexture = Main.npcTexture[npc.type]; - Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); - Vector2 drawPos = new Vector2( - npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, - npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); - SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); - return false; - } - } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D drawTexture = Main.npcTexture[npc.type]; + Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); + Vector2 drawPos = new Vector2( + npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, + npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); + SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); + return false; + } + } } \ No newline at end of file diff --git a/NPCs/DragonSkull.cs b/NPCs/DragonSkull.cs index 774730db..51142e9e 100644 --- a/NPCs/DragonSkull.cs +++ b/NPCs/DragonSkull.cs @@ -6,92 +6,94 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class DragonSkull : ModNPC +namespace Tremor.NPCs { + + public class DragonSkull : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Dragon Skull"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 900; - npc.damage = 80; - npc.defense = 32; - npc.knockBackResist = 0f; - npc.width = 64; - npc.height = 48; - animationType = 34; - npc.aiStyle = 10; - npc.npcSlots = 0.5f; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit2; - npc.noGravity = true; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 15, 9); - banner = npc.type; - bannerItem = mod.ItemType("DragonSkullBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 900; + npc.damage = 80; + npc.defense = 32; + npc.knockBackResist = 0f; + npc.width = 64; + npc.height = 48; + animationType = 34; + npc.aiStyle = 10; + npc.npcSlots = 0.5f; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit2; + npc.noGravity = true; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 0, 15, 9); + banner = npc.type; + bannerItem = mod.ItemType("DragonSkullBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && spawnInfo.spawnTileY > Main.maxTilesY - 200 ? 0.03f : 0; - } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DragonSkullGore"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DragonSkullGore2"), 1f); - } - else - { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } - } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && spawnInfo.spawnTileY > Main.maxTilesY - 200 ? 0.03f : 0; + } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DragonSkullGore"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DragonSkullGore2"), 1f); + } + else + { + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + } + } + } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DragonBreath"), Main.rand.Next(30,40)); - } - } - } + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DragonBreath"), Main.rand.Next(30, 40)); + } + } + } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/Dragon_BodyB.cs b/NPCs/Dragon_BodyB.cs index 111076b7..97684a10 100644 --- a/NPCs/Dragon_BodyB.cs +++ b/NPCs/Dragon_BodyB.cs @@ -16,45 +16,45 @@ public override void SetStaticDefaults() DisplayName.SetDefault("Ancient Dragon"); Main.npcFrameCount[npc.type] = 2; } - + public override void SetDefaults() { - npc.npcSlots = 5f; - npc.width = 78; - npc.height = 98; - npc.defense = 12; - npc.lifeMax = 3100; - npc.damage = 28; - npc.aiStyle = 6; - aiType = -1; - animationType = 10; - npc.knockBackResist = 0f; - npc.boss = true; - npc.value = Item.buyPrice(0, 25, 0, 0); - npc.alpha = 255; - npc.behindTiles = true; - npc.noGravity = true; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.netAlways = true; - music = MusicID.Boss1; - } - + npc.npcSlots = 5f; + npc.width = 78; + npc.height = 98; + npc.defense = 12; + npc.lifeMax = 3100; + npc.damage = 28; + npc.aiStyle = 6; + aiType = -1; + animationType = 10; + npc.knockBackResist = 0f; + npc.boss = true; + npc.value = Item.buyPrice(0, 25, 0, 0); + npc.alpha = 255; + npc.behindTiles = true; + npc.noGravity = true; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.netAlways = true; + music = MusicID.Boss1; + } + public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) { return false; } - int time = 0; + int time = 0; public override void AI() { if (!Main.npc[(int)npc.ai[1]].active) - { - npc.life = 0; - npc.HitEffect(0, 10.0); - npc.active = false; - } + { + npc.life = 0; + npc.HitEffect(0, 10.0); + npc.active = false; + } if (Main.npc[(int)npc.ai[1]].alpha < 128) { npc.alpha -= 42; @@ -63,50 +63,50 @@ public override void AI() npc.alpha = 0; } } - if (npc.life < npc.lifeMax / 2 && Main.netMode != 1 && time == 0 && Main.rand.Next(9000) == 0) - { - time = 1; - int i = NPC.NewNPC((int)(npc.position.X + (float)(npc.width / 2)), (int)(npc.position.Y + (float)npc.height), mod.NPCType("DragonMini"), 0, 0f, 0f, 0f, 0f, 255); - npc.frame = GetFrame(2); - if (Main.netMode == 2 && i < 200) - { - //NetMessage.SendData(23, -1, -1, "", i, 0f, 0f, 0f, 0, 0, 0); - } - npc.netUpdate = true; - } - } + if (npc.life < npc.lifeMax / 2 && Main.netMode != 1 && time == 0 && Main.rand.Next(9000) == 0) + { + time = 1; + int i = NPC.NewNPC((int)(npc.position.X + (float)(npc.width / 2)), (int)(npc.position.Y + (float)npc.height), mod.NPCType("DragonMini"), 0, 0f, 0f, 0f, 0f, 255); + npc.frame = GetFrame(2); + if (Main.netMode == 2 && i < 200) + { + //NetMessage.SendData(23, -1, -1, "", i, 0f, 0f, 0f, 0, 0, 0); + } + npc.netUpdate = true; + } + } - Rectangle GetFrame(int Number) - { - return new Rectangle(0, npc.frame.Height * (Number - 1), npc.frame.Width, npc.frame.Height); - } + Rectangle GetFrame(int Number) + { + return new Rectangle(0, npc.frame.Height * (Number - 1), npc.frame.Width, npc.frame.Height); + } - public override bool CheckActive() + public override bool CheckActive() { return false; } - + public override bool PreNPCLoot() { return false; } - + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { npc.lifeMax = (int)(npc.lifeMax * 0.55f * bossLifeScale); npc.damage = (int)(npc.damage * 0.75f); } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Texture2D drawTexture = Main.npcTexture[npc.type]; - Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); - Vector2 drawPos = new Vector2( - npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, - npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); - SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); - return false; - } - } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D drawTexture = Main.npcTexture[npc.type]; + Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); + Vector2 drawPos = new Vector2( + npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, + npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); + SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); + return false; + } + } } \ No newline at end of file diff --git a/NPCs/Dragon_HeadB.cs b/NPCs/Dragon_HeadB.cs index d5e7a539..b5fefc76 100644 --- a/NPCs/Dragon_HeadB.cs +++ b/NPCs/Dragon_HeadB.cs @@ -8,136 +8,136 @@ namespace Tremor.NPCs { [AutoloadBossHead] - public class Dragon_HeadB : ModNPC - { + public class Dragon_HeadB : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Ancient Dragon"); } - bool TailSpawned = false; + bool TailSpawned = false; - public static int ShootRate = 20; - const int ShootDamage = 58; - const float ShootKN = 1.0f; - const int ShootType = 100; - const float ShootSpeed = 10; - const int ShootCount = 5; - const int spread = 2; - const float spreadMult = 0.045f; + public static int ShootRate = 20; + const int ShootDamage = 58; + const float ShootKN = 1.0f; + const int ShootType = 100; + const float ShootSpeed = 10; + const int ShootCount = 5; + const int spread = 2; + const float spreadMult = 0.045f; - const int ShootSound = 62; - const int ShootSoundStyle = 1; + const int ShootSound = 62; + const int ShootSoundStyle = 1; - int TimeToShoot = ShootRate; - public override void SetDefaults() - { + int TimeToShoot = ShootRate; + public override void SetDefaults() + { npc.damage = 28; npc.npcSlots = 5f; npc.width = 78; npc.height = 132; npc.defense = 12; - npc.lifeMax = 3100; - npc.aiStyle = 6; - npc.npcSlots = 1f; - npc.noTileCollide = true; - npc.behindTiles = true; - npc.friendly = false; - npc.dontTakeDamage = false; - npc.noGravity = true; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.buffImmune[24] = true; - npc.buffImmune[67] = true; - npc.lavaImmune = true; + npc.lifeMax = 3100; + npc.aiStyle = 6; + npc.npcSlots = 1f; + npc.noTileCollide = true; + npc.behindTiles = true; + npc.friendly = false; + npc.dontTakeDamage = false; + npc.noGravity = true; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.buffImmune[24] = true; + npc.buffImmune[67] = true; + npc.lavaImmune = true; music = MusicID.Boss2; npc.boss = true; - bossBag = mod.ItemType("AncientDragonBag"); - } - - public override void NPCLoot() - { - - if(Main.expertMode) - { - npc.DropBossBags(); - } - - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - - if(!Main.expertMode && Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AncientDragonMask")); - } - if(Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AncientDragonTrophy")); - } - if(!Main.expertMode && Main.rand.Next(1) == 0) - { - Helper.DropItem(new Rectangle((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height), new Drop(mod.ItemType("AncientTimesEdge"), 1, 1), new Drop(mod.ItemType("DragonHead"), 1, 1), new Drop(mod.ItemType("Swordstorm"), 1, 1), new Drop(0, 0, 0)); - } - TremorWorld.downedAncientDragon = true; - - } - } - - - public override void AI() - { - npc.position += npc.velocity * (2 - 1); - - if (!TailSpawned) - { - int Previous = npc.whoAmI; - for (int num36 = 0; num36 < 19; num36++) - { - int lol = 0; - if (num36 >= 0 && num36 < 18) - { - lol = NPC.NewNPC((int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.width / 2), mod.NPCType("Dragon_BodyB"), npc.whoAmI); - } - else - { - lol = NPC.NewNPC((int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.width / 2), mod.NPCType("Dragon_LegB"), npc.whoAmI); - } - Main.npc[lol].realLife = npc.whoAmI; - Main.npc[lol].ai[2] = (float)npc.whoAmI; - Main.npc[lol].ai[1] = (float)Previous; - Main.npc[Previous].ai[0] = (float)lol; - //NetMessage.SendData(23, -1, -1, "", lol, 0f, 0f, 0f, 0); - Previous = lol; - } - TailSpawned = true; - } - - if ((int)(Main.time % 180) == 0) - { - Vector2 vector = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height / 2)); - float birdRotation = (float)Math.Atan2(vector.Y - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), vector.X - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); - npc.velocity.X = (float)(Math.Cos(birdRotation) * 7) * -1; - npc.velocity.Y = (float)(Math.Sin(birdRotation) * 7) * -1; - npc.netUpdate = true; - } - } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Texture2D drawTexture = Main.npcTexture[npc.type]; - Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); - - Vector2 drawPos = new Vector2( - npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, - npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); - - SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); - - return false; - } - } + bossBag = mod.ItemType("AncientDragonBag"); + } + + public override void NPCLoot() + { + + if (Main.expertMode) + { + npc.DropBossBags(); + } + + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + + if (!Main.expertMode && Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AncientDragonMask")); + } + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AncientDragonTrophy")); + } + if (!Main.expertMode && Main.rand.Next(1) == 0) + { + Helper.DropItem(new Rectangle((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height), new Drop(mod.ItemType("AncientTimesEdge"), 1, 1), new Drop(mod.ItemType("DragonHead"), 1, 1), new Drop(mod.ItemType("Swordstorm"), 1, 1), new Drop(0, 0, 0)); + } + TremorWorld.downedAncientDragon = true; + + } + } + + + public override void AI() + { + npc.position += npc.velocity * (2 - 1); + + if (!TailSpawned) + { + int Previous = npc.whoAmI; + for (int num36 = 0; num36 < 19; num36++) + { + int lol = 0; + if (num36 >= 0 && num36 < 18) + { + lol = NPC.NewNPC((int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.width / 2), mod.NPCType("Dragon_BodyB"), npc.whoAmI); + } + else + { + lol = NPC.NewNPC((int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.width / 2), mod.NPCType("Dragon_LegB"), npc.whoAmI); + } + Main.npc[lol].realLife = npc.whoAmI; + Main.npc[lol].ai[2] = (float)npc.whoAmI; + Main.npc[lol].ai[1] = (float)Previous; + Main.npc[Previous].ai[0] = (float)lol; + //NetMessage.SendData(23, -1, -1, "", lol, 0f, 0f, 0f, 0); + Previous = lol; + } + TailSpawned = true; + } + + if ((int)(Main.time % 180) == 0) + { + Vector2 vector = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height / 2)); + float birdRotation = (float)Math.Atan2(vector.Y - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), vector.X - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); + npc.velocity.X = (float)(Math.Cos(birdRotation) * 7) * -1; + npc.velocity.Y = (float)(Math.Sin(birdRotation) * 7) * -1; + npc.netUpdate = true; + } + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D drawTexture = Main.npcTexture[npc.type]; + Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); + + Vector2 drawPos = new Vector2( + npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, + npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); + + SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); + + return false; + } + } } \ No newline at end of file diff --git a/NPCs/Dragon_LegB.cs b/NPCs/Dragon_LegB.cs index 681ee727..6a3d750f 100644 --- a/NPCs/Dragon_LegB.cs +++ b/NPCs/Dragon_LegB.cs @@ -15,45 +15,45 @@ public override void SetStaticDefaults() { DisplayName.SetDefault("Ancient Dragon"); } - + public override void SetDefaults() { - npc.npcSlots = 5f; - npc.width = 78; - npc.height = 128; - npc.defense = 12; - npc.lifeMax = 3100; - npc.damage = 28; - npc.aiStyle = 6; - Main.npcFrameCount[npc.type] = 1; - aiType = -1; - animationType = 10; - npc.knockBackResist = 0f; - npc.boss = true; - npc.value = Item.buyPrice(0, 25, 0, 0); - npc.alpha = 255; - npc.behindTiles = true; - npc.noGravity = true; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.netAlways = true; - music = MusicID.Boss1; - } - + npc.npcSlots = 5f; + npc.width = 78; + npc.height = 128; + npc.defense = 12; + npc.lifeMax = 3100; + npc.damage = 28; + npc.aiStyle = 6; + Main.npcFrameCount[npc.type] = 1; + aiType = -1; + animationType = 10; + npc.knockBackResist = 0f; + npc.boss = true; + npc.value = Item.buyPrice(0, 25, 0, 0); + npc.alpha = 255; + npc.behindTiles = true; + npc.noGravity = true; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.netAlways = true; + music = MusicID.Boss1; + } + public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) { return false; } - + public override void AI() { if (!Main.npc[(int)npc.ai[1]].active) - { - npc.life = 0; - npc.HitEffect(0, 10.0); - npc.active = false; - } + { + npc.life = 0; + npc.HitEffect(0, 10.0); + npc.active = false; + } if (Main.npc[(int)npc.ai[1]].alpha < 128) { npc.alpha -= 42; @@ -63,33 +63,33 @@ public override void AI() } } } - + public override bool CheckActive() { return false; } - + public override bool PreNPCLoot() { return false; } - + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { npc.lifeMax = (int)(npc.lifeMax * 0.55f * bossLifeScale); npc.damage = (int)(npc.damage * 0.75f); } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Texture2D drawTexture = Main.npcTexture[npc.type]; - Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); - Vector2 drawPos = new Vector2( - npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, - npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); - SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); - return false; - } - } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D drawTexture = Main.npcTexture[npc.type]; + Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); + Vector2 drawPos = new Vector2( + npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, + npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); + SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); + return false; + } + } } \ No newline at end of file diff --git a/NPCs/Dranix.cs b/NPCs/Dranix.cs index 1c442645..ca2abaa1 100644 --- a/NPCs/Dranix.cs +++ b/NPCs/Dranix.cs @@ -6,87 +6,89 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Dranix : ModNPC +namespace Tremor.NPCs { + + public class Dranix : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Dranix"); Main.npcFrameCount[npc.type] = 10; } - - public override void SetDefaults() - { - npc.lifeMax = 1600; - npc.damage = 110; - npc.defense = 20; - npc.knockBackResist = 0.3f; - npc.width = 56; - npc.height = 48; - aiType = 429; - animationType = 429; - npc.aiStyle = 3; - npc.npcSlots = 0.2f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 6, 9); - banner = npc.type; - bannerItem = mod.ItemType("DranixBanner"); - } - public override void AI() - { + public override void SetDefaults() + { + npc.lifeMax = 1600; + npc.damage = 110; + npc.defense = 20; + npc.knockBackResist = 0.3f; + npc.width = 56; + npc.height = 48; + aiType = 429; + animationType = 429; + npc.aiStyle = 3; + npc.npcSlots = 0.2f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 0, 6, 9); + banner = npc.type; + bannerItem = mod.ItemType("DranixBanner"); + } -if (Main.rand.Next(1000) == 0) - { - Main.PlaySound(22, (int)npc.position.X, (int)npc.position.Y, 1); - } - } + public override void AI() + { - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + if (Main.rand.Next(1000) == 0) + { + Main.PlaySound(22, (int)npc.position.X, (int)npc.position.Y, 1); + } + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Doomstone")); - } - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Doomstone")); + } + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DranixGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DranixGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DranixGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DranixGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DranixGore3"), 1f); + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DranixGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DranixGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DranixGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DranixGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DranixGore3"), 1f); - } -} + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return Main.hardMode && NPC.downedMoonlord && !spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.04f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return Main.hardMode && NPC.downedMoonlord && !spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.04f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/DreadBeetle.cs b/NPCs/DreadBeetle.cs index db6b3829..7e4ed65d 100644 --- a/NPCs/DreadBeetle.cs +++ b/NPCs/DreadBeetle.cs @@ -6,70 +6,72 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class DreadBeetle : ModNPC +namespace Tremor.NPCs { + + public class DreadBeetle : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Dread Beetle"); Main.npcFrameCount[npc.type] = 6; } - - public override void SetDefaults() - { - npc.lifeMax = 1800; - npc.damage = 150; - npc.defense = 30; - npc.knockBackResist = 0.6f; - npc.width = 38; - npc.height = 44; - animationType = 258; - npc.aiStyle = 3; - aiType = 258; - npc.npcSlots = 0.2f; - npc.HitSound = SoundID.NPCHit45; - npc.DeathSound = SoundID.NPCDeath47; - npc.value = Item.buyPrice(0, 0, 8, 24); - banner = npc.type; - npc.noGravity = false; - bannerItem = mod.ItemType("DreadBeetleBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 1800; + npc.damage = 150; + npc.defense = 30; + npc.knockBackResist = 0.6f; + npc.width = 38; + npc.height = 44; + animationType = 258; + npc.aiStyle = 3; + aiType = 258; + npc.npcSlots = 0.2f; + npc.HitSound = SoundID.NPCHit45; + npc.DeathSound = SoundID.NPCDeath47; + npc.value = Item.buyPrice(0, 0, 8, 24); + banner = npc.type; + npc.noGravity = false; + bannerItem = mod.ItemType("DreadBeetleBanner"); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Doomstone")); - } - } - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DreadGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DreadGore2"), 1f); - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Doomstone")); + } + } + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DreadGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DreadGore2"), 1f); + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return Main.hardMode && NPC.downedMoonlord && !spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.04f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return Main.hardMode && NPC.downedMoonlord && !spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.04f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/DungeonKeeper.cs b/NPCs/DungeonKeeper.cs index 3b65f074..ce7d7a26 100644 --- a/NPCs/DungeonKeeper.cs +++ b/NPCs/DungeonKeeper.cs @@ -5,75 +5,77 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class DungeonKeeper : ModNPC +namespace Tremor.NPCs { + + public class DungeonKeeper : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Dungeon Keeper"); Main.npcFrameCount[npc.type] = 15; } - - public override void SetDefaults() - { - npc.lifeMax = 250; - aiType = 77; - npc.damage = 20; - npc.defense = 32; - npc.knockBackResist = 0.05f; - npc.width = 32; - npc.height = 50; - animationType = 21; - npc.aiStyle = 3; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath6; - npc.value = Item.buyPrice(0, 0, 8, 0); - banner = npc.type; - bannerItem = mod.ItemType("DungeonKeeperBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 250; + aiType = 77; + npc.damage = 20; + npc.defense = 32; + npc.knockBackResist = 0.05f; + npc.width = 32; + npc.height = 50; + animationType = 21; + npc.aiStyle = 3; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit4; + npc.DeathSound = SoundID.NPCDeath6; + npc.value = Item.buyPrice(0, 0, 8, 0); + banner = npc.type; + bannerItem = mod.ItemType("DungeonKeeperBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/KeeperGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/KeeperGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/KeeperGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/KeeperGore3"), 1f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/KeeperGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/KeeperGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/KeeperGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/KeeperGore3"), 1f); + } + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(25) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ShadowReaper")); - } - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(25) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ShadowReaper")); + } + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.01f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.01f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/ElderObserver.cs b/NPCs/ElderObserver.cs index 1d84f05b..04229eda 100644 --- a/NPCs/ElderObserver.cs +++ b/NPCs/ElderObserver.cs @@ -6,125 +6,127 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class ElderObserver : ModNPC +namespace Tremor.NPCs { + + public class ElderObserver : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Elder Observer"); Main.npcFrameCount[npc.type] = 4; } - - const int ShootRate = 220; // ×àñòîòà âûñòðåëà - const int ShootDamage = 20; // Óðîí îò ëàçåðà. - const float ShootKN = 1.0f; // Îòáðàñûâàíèå - const int ShootType = 100; // Òèï ïðîäæåêòàéëà êîòîðûì áóäåò ïðîèçâåä¸í âûñòðåë. - const float ShootSpeed = 4; // Ýòî, ÿ òàê ïîíèìàþ, âëèÿåò íà äàëüíîñòü âûñòðåëà - int TimeToShoot = ShootRate; // Âðåìÿ äî âûñòðåëà. + const int ShootRate = 220; // ×àñòîòà âûñòðåëà + const int ShootDamage = 20; // Óðîí îò ëàçåðà. + const float ShootKN = 1.0f; // Îòáðàñûâàíèå + const int ShootType = 100; // Òèï ïðîäæåêòàéëà êîòîðûì áóäåò ïðîèçâåä¸í âûñòðåë. + const float ShootSpeed = 4; // Ýòî, ÿ òàê ïîíèìàþ, âëèÿåò íà äàëüíîñòü âûñòðåëà - public override void SetDefaults() - { - npc.lifeMax = 3000; - npc.damage = 90; - npc.defense = 32; - npc.knockBackResist = 0f; - npc.width = 130; - npc.height = 130; - animationType = 82; - npc.aiStyle = 22; - npc.npcSlots = 0.5f; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit31; - npc.noGravity = true; - npc.DeathSound = SoundID.NPCDeath6; - npc.value = Item.buyPrice(0, 0, 55, 9); - banner = npc.type; - bannerItem = mod.ItemType("ElderObserverBanner"); - } + int TimeToShoot = ShootRate; // Âðåìÿ äî âûñòðåëà. - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 3000; + npc.damage = 90; + npc.defense = 32; + npc.knockBackResist = 0f; + npc.width = 130; + npc.height = 130; + animationType = 82; + npc.aiStyle = 22; + npc.npcSlots = 0.5f; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit31; + npc.noGravity = true; + npc.DeathSound = SoundID.NPCDeath6; + npc.value = Item.buyPrice(0, 0, 55, 9); + banner = npc.type; + bannerItem = mod.ItemType("ElderObserverBanner"); + } - public override void AI() - { - // Âñÿêàÿ äè÷ü - if (--TimeToShoot <= 0 && npc.target != -1) Shoot(); //  ýòîé ñòðîêå èç ïåðåìåííîé TimeToShot îòíèìàåòñÿ 1, è åñëè TimeToShot < èëè = 0, òî âûçûâàåòñÿ ìåòîä Shoot() - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } + public override void AI() + { + // Âñÿêàÿ äè÷ü + if (--TimeToShoot <= 0 && npc.target != -1) Shoot(); //  ýòîé ñòðîêå èç ïåðåìåííîé TimeToShot îòíèìàåòñÿ 1, è åñëè TimeToShot < èëè = 0, òî âûçûâàåòñÿ ìåòîä Shoot() + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && Main.expertMode && Main.bloodMoon && y < Main.worldSurface ? 0.002f : 0f; - } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ElderObserverGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ElderObserverGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ElderObserverGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ElderObserverGore4"), 1f); - } - else - { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } - } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Spearaxe")); - } - if(Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ScarredReaper")); - }; - } - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && Main.expertMode && Main.bloodMoon && y < Main.worldSurface ? 0.002f : 0f; + } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ElderObserverGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ElderObserverGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ElderObserverGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ElderObserverGore4"), 1f); + } + else + { + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + } + } + } + + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Spearaxe")); + } + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ScarredReaper")); + }; + } + } - void Shoot() - { - TimeToShoot = ShootRate; // Óñòàíàâëèâàåì êóëäàóí âûñòðåëó - Vector2 velocity = VelocityFPTP(npc.Center, Main.player[npc.target].Center, ShootSpeed); // Òóò ìû ïîëó÷èì íóæíóþ velocity (ïîÿñíåíèå àðãóìåíòîâ íèæå) - // 1 àðãóìåíò - ïîçèöèÿ èç êîòîðîé áóäåò âûëåòàòü âûñòðåë - // 2 àðãóìåíò - ïîçèöèÿ â êîòîðóþ îí äîëæåí ïîëåòåòü - // 3 àðãóìåíò - ñêîðîñòü âûñòðåëà - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, velocity.X, velocity.Y, ShootType, ShootDamage, ShootKN); - } + void Shoot() + { + TimeToShoot = ShootRate; // Óñòàíàâëèâàåì êóëäàóí âûñòðåëó + Vector2 velocity = VelocityFPTP(npc.Center, Main.player[npc.target].Center, ShootSpeed); // Òóò ìû ïîëó÷èì íóæíóþ velocity (ïîÿñíåíèå àðãóìåíòîâ íèæå) + // 1 àðãóìåíò - ïîçèöèÿ èç êîòîðîé áóäåò âûëåòàòü âûñòðåë + // 2 àðãóìåíò - ïîçèöèÿ â êîòîðóþ îí äîëæåí ïîëåòåòü + // 3 àðãóìåíò - ñêîðîñòü âûñòðåëà + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, velocity.X, velocity.Y, ShootType, ShootDamage, ShootKN); + } - Vector2 VelocityFPTP(Vector2 pos1, Vector2 pos2, float speed) - { - Vector2 move = pos2 - pos1; - return move * (speed / (float)System.Math.Sqrt(move.X * move.X + move.Y * move.Y)); - } -}} \ No newline at end of file + Vector2 VelocityFPTP(Vector2 pos1, Vector2 pos2, float speed) + { + Vector2 move = pos2 - pos1; + return move * (speed / (float)System.Math.Sqrt(move.X * move.X + move.Y * move.Y)); + } + } +} \ No newline at end of file diff --git a/NPCs/Elf.cs b/NPCs/Elf.cs index 65d3f030..ede2a679 100644 --- a/NPCs/Elf.cs +++ b/NPCs/Elf.cs @@ -6,10 +6,11 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { -[AutoloadHead] -public class Elf : ModNPC +namespace Tremor.NPCs { + [AutoloadHead] + public class Elf : ModNPC + { public override string Texture { get @@ -17,14 +18,14 @@ public override string Texture return "Tremor/NPCs/Elf"; } } - + public override string[] AltTextures { get { - return new string[] { "Tremor/NPCs/Elf"}; + return new string[] { "Tremor/NPCs/Elf" }; } - } + } public override bool Autoload(ref string name) { @@ -44,21 +45,21 @@ public override void SetStaticDefaults() NPCID.Sets.AttackAverageChance[npc.type] = 30; } - public override void SetDefaults() - { - npc.townNPC = true; - npc.friendly = true; - npc.width = 36; - npc.height = 44; - npc.aiStyle = 7; - npc.damage = 20; - npc.defense = 15; - npc.lifeMax = 250; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.knockBackResist = 0.5f; - animationType = NPCID.Guide; - } + public override void SetDefaults() + { + npc.townNPC = true; + npc.friendly = true; + npc.width = 36; + npc.height = 44; + npc.aiStyle = 7; + npc.damage = 20; + npc.defense = 15; + npc.lifeMax = 250; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.knockBackResist = 0.5f; + animationType = NPCID.Guide; + } public override bool CanTownNPCSpawn(int numTownNPCs, int money) { @@ -80,113 +81,114 @@ public override bool CanTownNPCSpawn(int numTownNPCs, int money) } - public override string TownNPCName() - { - switch(WorldGen.genRand.Next(4)) - { - case 0: - return "Nick"; - case 1: - return "Elfie"; - case 2: - return "Jingle"; - case 3: - return "Chippy"; - case 4: - return "Sparkle"; - case 5: - return "Twinkle"; - case 6: - return "Elvis"; - case 7: - return "Peppermint"; - default: - return "Snowflake"; - } - } - - public override string GetChat() - { - switch(Main.rand.Next(6)) - { - case 0: - return "What do you know about reindeers?"; - case 1: - return "I can give you some presents but... You've been naughty this year."; - case 2: - return "I am Santa's favorite elf!"; - case 3: - return "Jingle bells, jingle bells, jingle all the way!"; - case 4: - return "Someone threw a snowball at me. I don't know who did it but I will find him and throw a snowball at him too."; - default: - return "I licked an icicle one fine day. It resulted in not much fun."; - } - } - - public override void SetChatButtons(ref string button, ref string button2) - { - button = Lang.inter[28].Value; - } - - public override void OnChatButtonClicked(bool firstButton, ref bool shop) - { - if(firstButton) - { - shop = true; - } - } - - public override void SetupShop(Chest shop, ref int nextSlot) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("RedChristmasStocking")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("BlueChristmasStocking")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("GreenChristmasStocking")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("CandyCane")); - nextSlot++; - if(NPC.downedBoss1) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("SnowShotgun")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("CandyBow")); - nextSlot++; - } - if(NPC.downedBoss3) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("TheSnowBall")); - nextSlot++; - } - if(Main.hardMode) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("Blizzard")); - nextSlot++; - } - } - - public override void TownNPCAttackStrength(ref int damage, ref float knockback) - { - damage = 20; - knockback = 4f; - } - - public override void TownNPCAttackCooldown(ref int cooldown, ref int randExtraCooldown) - { - cooldown = 10; - randExtraCooldown = 10; - } - - public override void TownNPCAttackProj(ref int projType, ref int attackDelay) - { - projType = 1; - attackDelay = 2; - } - - public override void TownNPCAttackProjSpeed(ref float multiplier, ref float gravityCorrection, ref float randomOffset) - { - multiplier = 12f; - randomOffset = 2f; - } -}} \ No newline at end of file + public override string TownNPCName() + { + switch (WorldGen.genRand.Next(4)) + { + case 0: + return "Nick"; + case 1: + return "Elfie"; + case 2: + return "Jingle"; + case 3: + return "Chippy"; + case 4: + return "Sparkle"; + case 5: + return "Twinkle"; + case 6: + return "Elvis"; + case 7: + return "Peppermint"; + default: + return "Snowflake"; + } + } + + public override string GetChat() + { + switch (Main.rand.Next(6)) + { + case 0: + return "What do you know about reindeers?"; + case 1: + return "I can give you some presents but... You've been naughty this year."; + case 2: + return "I am Santa's favorite elf!"; + case 3: + return "Jingle bells, jingle bells, jingle all the way!"; + case 4: + return "Someone threw a snowball at me. I don't know who did it but I will find him and throw a snowball at him too."; + default: + return "I licked an icicle one fine day. It resulted in not much fun."; + } + } + + public override void SetChatButtons(ref string button, ref string button2) + { + button = Lang.inter[28].Value; + } + + public override void OnChatButtonClicked(bool firstButton, ref bool shop) + { + if (firstButton) + { + shop = true; + } + } + + public override void SetupShop(Chest shop, ref int nextSlot) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("RedChristmasStocking")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("BlueChristmasStocking")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("GreenChristmasStocking")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("CandyCane")); + nextSlot++; + if (NPC.downedBoss1) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("SnowShotgun")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("CandyBow")); + nextSlot++; + } + if (NPC.downedBoss3) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("TheSnowBall")); + nextSlot++; + } + if (Main.hardMode) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("Blizzard")); + nextSlot++; + } + } + + public override void TownNPCAttackStrength(ref int damage, ref float knockback) + { + damage = 20; + knockback = 4f; + } + + public override void TownNPCAttackCooldown(ref int cooldown, ref int randExtraCooldown) + { + cooldown = 10; + randExtraCooldown = 10; + } + + public override void TownNPCAttackProj(ref int projType, ref int attackDelay) + { + projType = 1; + attackDelay = 2; + } + + public override void TownNPCAttackProjSpeed(ref float multiplier, ref float gravityCorrection, ref float randomOffset) + { + multiplier = 12f; + randomOffset = 2f; + } + } +} \ No newline at end of file diff --git a/NPCs/EliteBloodmoonWarrior.cs b/NPCs/EliteBloodmoonWarrior.cs index 0fedc16b..ec0518f0 100644 --- a/NPCs/EliteBloodmoonWarrior.cs +++ b/NPCs/EliteBloodmoonWarrior.cs @@ -6,76 +6,78 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class EliteBloodmoonWarrior : ModNPC +namespace Tremor.NPCs { + + public class EliteBloodmoonWarrior : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Elite Bloodmoon Warrior"); Main.npcFrameCount[npc.type] = 20; } - - public override void SetDefaults() - { - npc.lifeMax = 1750; - npc.damage = 135; - npc.defense = 36; - npc.knockBackResist = 0.1f; - npc.width = 36; - npc.height = 44; - animationType = 482; - npc.aiStyle = 26; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath6; - npc.value = Item.buyPrice(0, 0, 50, 7); - banner = npc.type; - bannerItem = mod.ItemType("EliteBloodmoonWarriorBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 1750; + npc.damage = 135; + npc.defense = 36; + npc.knockBackResist = 0.1f; + npc.width = 36; + npc.height = 44; + animationType = 482; + npc.aiStyle = 26; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit4; + npc.DeathSound = SoundID.NPCDeath6; + npc.value = Item.buyPrice(0, 0, 50, 7); + banner = npc.type; + bannerItem = mod.ItemType("EliteBloodmoonWarriorBanner"); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SkullTeeth")); - }; - } - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EliteGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EliteGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EliteGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EliteGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EliteGore3"), 1f); - } -} + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SkullTeeth")); + }; + } + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EliteGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EliteGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EliteGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EliteGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EliteGore3"), 1f); + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMechBossAny && Main.bloodMoon && y < Main.worldSurface ? 0.03f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMechBossAny && Main.bloodMoon && y < Main.worldSurface ? 0.03f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/EnragedBat.cs b/NPCs/EnragedBat.cs index c0192ac8..9d7d7fe5 100644 --- a/NPCs/EnragedBat.cs +++ b/NPCs/EnragedBat.cs @@ -6,61 +6,63 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class EnragedBat : ModNPC +namespace Tremor.NPCs { + + public class EnragedBat : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Enraged Bat"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 1000; - npc.damage = 110; - npc.defense = 20; - npc.knockBackResist = 0.3f; - npc.width = 56; - npc.height = 48; - animationType = 93; - npc.aiStyle = 14; - npc.npcSlots = 0.2f; - npc.HitSound = SoundID.NPCHit1; - npc.noGravity = true; - npc.DeathSound = SoundID.NPCDeath4; - npc.value = Item.buyPrice(0, 0, 6, 9); - banner = npc.type; - bannerItem = mod.ItemType("EnragedBatBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 1000; + npc.damage = 110; + npc.defense = 20; + npc.knockBackResist = 0.3f; + npc.width = 56; + npc.height = 48; + animationType = 93; + npc.aiStyle = 14; + npc.npcSlots = 0.2f; + npc.HitSound = SoundID.NPCHit1; + npc.noGravity = true; + npc.DeathSound = SoundID.NPCDeath4; + npc.value = Item.buyPrice(0, 0, 6, 9); + banner = npc.type; + bannerItem = mod.ItemType("EnragedBatBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EnragedGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EnragedGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EnragedGore2"), 1f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EnragedGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EnragedGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EnragedGore2"), 1f); + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return Main.hardMode && NPC.downedMoonlord && !spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.1f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return Main.hardMode && NPC.downedMoonlord && !spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.1f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/EvilCorn.cs b/NPCs/EvilCorn.cs index f2128e72..a151219d 100644 --- a/NPCs/EvilCorn.cs +++ b/NPCs/EvilCorn.cs @@ -14,76 +14,76 @@ 3 ÑоÑтоÑние - поÑле полёта на неÑколько Ñеку namespace Tremor.NPCs { [AutoloadBossHead] - public class EvilCorn : ModNPC - { + public class EvilCorn : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Evil Corn"); Main.npcFrameCount[npc.type] = 22; } - - #region "КонÑтанты Ð´Ð»Ñ Ð½Ð°Ñтойки AI" - const int simpleAttakStateTime = 120; // Ð’Ñ€ÐµÐ¼Ñ ÐºÐ¾Ñ‚Ð¾Ñ€Ð¾Ðµ он будет ÑтоÑÑ‚ÑŒ на меÑте и бить - const int simpleDefenseStateTime = 120; // Ð’Ñ€ÐµÐ¼Ñ ÐºÐ¾Ñ‚Ð¾Ñ€Ð¾Ðµ он будет ÑтоÑÑ‚ÑŒ и хилитÑÑ - const int normalAttackStateTime = 180; // Ð’Ñ€ÐµÐ¼Ñ ÐºÐ¾Ñ‚Ð¾Ñ€Ð¾Ðµ он будет летать за игроком и бить его - const int normalDefenseStateTime = 45; - const int simpleAttakAnimTime = 30; // ДлительноÑÑ‚ÑŒ анимации атаки (лучше не менÑÑ‚ÑŒ, а попроÑить менÑ...) - const int simpleCangeLeversTime = 12; // ДлительноÑÑ‚ÑŒ анимации ЛиÑтьем (тоже что и Ñ Ð°Ñ‚Ð°ÐºÐ¾Ð¹...) + #region "КонÑтанты Ð´Ð»Ñ Ð½Ð°Ñтойки AI" + const int simpleAttakStateTime = 120; // Ð’Ñ€ÐµÐ¼Ñ ÐºÐ¾Ñ‚Ð¾Ñ€Ð¾Ðµ он будет ÑтоÑÑ‚ÑŒ на меÑте и бить + const int simpleDefenseStateTime = 120; // Ð’Ñ€ÐµÐ¼Ñ ÐºÐ¾Ñ‚Ð¾Ñ€Ð¾Ðµ он будет ÑтоÑÑ‚ÑŒ и хилитÑÑ + const int normalAttackStateTime = 180; // Ð’Ñ€ÐµÐ¼Ñ ÐºÐ¾Ñ‚Ð¾Ñ€Ð¾Ðµ он будет летать за игроком и бить его + const int normalDefenseStateTime = 45; + + const int simpleAttakAnimTime = 30; // ДлительноÑÑ‚ÑŒ анимации атаки (лучше не менÑÑ‚ÑŒ, а попроÑить менÑ...) + const int simpleCangeLeversTime = 12; // ДлительноÑÑ‚ÑŒ анимации ЛиÑтьем (тоже что и Ñ Ð°Ñ‚Ð°ÐºÐ¾Ð¹...) - const float SimpleHitDist = 125f; // ДиÑÑ‚Ð°Ð½Ñ†Ð¸Ñ Ð¾Ð±Ñ‹Ñ‡Ð½Ð¾Ð³Ð¾ удара - #endregion + const float SimpleHitDist = 125f; // ДиÑÑ‚Ð°Ð½Ñ†Ð¸Ñ Ð¾Ð±Ñ‹Ñ‡Ð½Ð¾Ð³Ð¾ удара + #endregion - #region "Переменные Ð´Ð»Ñ Ñ€Ð°Ð±Ð¾Ñ‚Ñ‹ Ñ AI" - int State = 0; - // 0 - парит на меÑте, при приближении бьёт - // 1 - парит на меÑте, Ñкрыт в Ñвоих лиÑÑ‚ÑŒÑÑ… - // 2 - летает за игроком Ð¼Ð°Ñ…Ð°Ñ Ð»Ð¸ÑÑ‚ÑŒÑми - int stateTime = simpleAttakStateTime; - // Ð’Ñ€ÐµÐ¼Ñ Ð´Ð¾ Ð·Ð°Ð²ÐµÑ€ÑˆÐµÐ½Ð¸Ñ Ñ‚ÐµÐºÑƒÑ‰ÐµÐ³Ð¾ дейÑÑ‚Ð²Ð¸Ñ - int nowHitPlayerLeft = 0; - // Ð’Ñ€ÐµÐ¼Ñ Ð´Ð¾ Ð·Ð°Ð²ÐµÑ€ÑˆÐµÐ½Ð¸Ñ Ñ‚ÐµÐºÑƒÑ‰ÐµÐ¹ анимации удара влево - int nowHitPlayerRight = 0; - // Ð’Ñ€ÐµÐ¼Ñ Ð´Ð¾ Ð·Ð°Ð²ÐµÑ€ÑˆÐµÐ½Ð¸Ñ Ñ‚ÐµÐºÑƒÑ‰ÐµÐ¹ анимации удара вправо - int nowCangeLeavs = 0; - // Ð’Ñ€ÐµÐ¼Ñ Ð´Ð¾ Ð·Ð°Ð²ÐµÑ€ÑˆÐµÐ½Ð¸Ñ Ñ‚ÐµÐºÑƒÑˆÐµÐ¹ анимации Ñмены лиÑтьев - #endregion + #region "Переменные Ð´Ð»Ñ Ñ€Ð°Ð±Ð¾Ñ‚Ñ‹ Ñ AI" + int State = 0; + // 0 - парит на меÑте, при приближении бьёт + // 1 - парит на меÑте, Ñкрыт в Ñвоих лиÑÑ‚ÑŒÑÑ… + // 2 - летает за игроком Ð¼Ð°Ñ…Ð°Ñ Ð»Ð¸ÑÑ‚ÑŒÑми + int stateTime = simpleAttakStateTime; + // Ð’Ñ€ÐµÐ¼Ñ Ð´Ð¾ Ð·Ð°Ð²ÐµÑ€ÑˆÐµÐ½Ð¸Ñ Ñ‚ÐµÐºÑƒÑ‰ÐµÐ³Ð¾ дейÑÑ‚Ð²Ð¸Ñ + int nowHitPlayerLeft = 0; + // Ð’Ñ€ÐµÐ¼Ñ Ð´Ð¾ Ð·Ð°Ð²ÐµÑ€ÑˆÐµÐ½Ð¸Ñ Ñ‚ÐµÐºÑƒÑ‰ÐµÐ¹ анимации удара влево + int nowHitPlayerRight = 0; + // Ð’Ñ€ÐµÐ¼Ñ Ð´Ð¾ Ð·Ð°Ð²ÐµÑ€ÑˆÐµÐ½Ð¸Ñ Ñ‚ÐµÐºÑƒÑ‰ÐµÐ¹ анимации удара вправо + int nowCangeLeavs = 0; + // Ð’Ñ€ÐµÐ¼Ñ Ð´Ð¾ Ð·Ð°Ð²ÐµÑ€ÑˆÐµÐ½Ð¸Ñ Ñ‚ÐµÐºÑƒÑˆÐµÐ¹ анимации Ñмены лиÑтьев + #endregion - public override void SetDefaults() - { - npc.lifeMax = 3000; - npc.damage = 30; - npc.defense = 12; - npc.knockBackResist = 0f; - npc.width = 155; - npc.height = 93; - npc.aiStyle = -1; - npc.noGravity = false; - npc.noTileCollide = false; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.boss = true; - npc.value = Item.buyPrice(0, 3, 25, 0); - music = 19; - bossBag = mod.ItemType("EvilCornBag"); - } - // ТУТ ЕЩЕ ÐÐСТРОЙКИ !!! - const int damage0 = 20; // Урон в первом ÑоÑтоÑнии - const int defense0 = 2; // Ð‘Ñ€Ð¾Ð½Ñ Ð² первом ÑоÑтоÑнии - const int damage1 = 10; // Урон во втором ÑоÑтоÑнии - const int defense1 = 4; // Ð‘Ñ€Ð¾Ð½Ñ Ð²Ð¾ втором ÑоÑтоÑнии - const int damage2 = 30; // Урон в 3 ÑоÑтоÑнии - const int defense2 = 3; // Ð‘Ñ€Ð¾Ð½Ñ Ð² 3 ÑоÑтоÑнии - const int damage3 = 30; // Урон в 4 ÑоÑтоÑнии - const int defense3 = 4; // Ð‘Ñ€Ð¾Ð½Ñ Ð² 4 ÑоÑтоÑнии + public override void SetDefaults() + { + npc.lifeMax = 3000; + npc.damage = 30; + npc.defense = 12; + npc.knockBackResist = 0f; + npc.width = 155; + npc.height = 93; + npc.aiStyle = -1; + npc.noGravity = false; + npc.noTileCollide = false; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.boss = true; + npc.value = Item.buyPrice(0, 3, 25, 0); + music = 19; + bossBag = mod.ItemType("EvilCornBag"); + } + // ТУТ ЕЩЕ ÐÐСТРОЙКИ !!! + const int damage0 = 20; // Урон в первом ÑоÑтоÑнии + const int defense0 = 2; // Ð‘Ñ€Ð¾Ð½Ñ Ð² первом ÑоÑтоÑнии + const int damage1 = 10; // Урон во втором ÑоÑтоÑнии + const int defense1 = 4; // Ð‘Ñ€Ð¾Ð½Ñ Ð²Ð¾ втором ÑоÑтоÑнии + const int damage2 = 30; // Урон в 3 ÑоÑтоÑнии + const int defense2 = 3; // Ð‘Ñ€Ð¾Ð½Ñ Ð² 3 ÑоÑтоÑнии + const int damage3 = 30; // Урон в 4 ÑоÑтоÑнии + const int defense3 = 4; // Ð‘Ñ€Ð¾Ð½Ñ Ð² 4 ÑоÑтоÑнии - #region "Вылёт попкорна при ударе" - public override void OnHitByItem(Player player, Item item, int damage, float knockback, bool crit) - { - if (Main.rand.Next(2) == 0) - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Popcorn"), 0); - base.OnHitByItem(player, item, damage, knockback, crit); - } + #region "Вылёт попкорна при ударе" + public override void OnHitByItem(Player player, Item item, int damage, float knockback, bool crit) + { + if (Main.rand.Next(2) == 0) + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Popcorn"), 0); + base.OnHitByItem(player, item, damage, knockback, crit); + } public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { @@ -91,611 +91,611 @@ public override void ScaleExpertStats(int numPlayers, float bossLifeScale) npc.damage = (int)(npc.damage * 0.6f); } - public override void OnHitByProjectile(Projectile projectile, int damage, float knockback, bool crit) - { - if (Main.rand.Next(2) == 0) - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Popcorn"), 0); - base.OnHitByProjectile(projectile, damage, knockback, crit); - } - #endregion + public override void OnHitByProjectile(Projectile projectile, int damage, float knockback, bool crit) + { + if (Main.rand.Next(2) == 0) + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Popcorn"), 0); + base.OnHitByProjectile(projectile, damage, knockback, crit); + } + #endregion - #region "Работа Ñ Ð°Ð½Ð¸Ð¼Ð°Ñ†Ð¸ÐµÐ¹" - int _2_Frame = 17; - int FrameNow = 0; - bool needState3SetFrame = true; - void PlayAnimation() - { - npc.rotation = 0; - if (nowHitPlayerLeft > 0 || nowHitPlayerRight > 0) - { - if (nowHitPlayerLeft > 0) - if (nowHitPlayerLeft % 6 == 0) - { - npc.frame = getFrame(nowHitPlayerLeft / 6 + 1); - FrameNow = nowHitPlayerLeft / 6 + 1; - } - if (nowHitPlayerRight > 0) - if (nowHitPlayerRight % 6 == 0) - { - npc.frame = getFrame(nowHitPlayerRight / 6 + 6); - FrameNow = nowHitPlayerLeft / 6 + 6; - } - return; - } - if (nowCangeLeavs > 0) - { - if (State == 0 || State == 2) - { - if (nowCangeLeavs % 6 == 0) - { - if (nowCangeLeavs > 6) - { - npc.frame = getFrame(12); - FrameNow = 12; - } - else - { - npc.frame = getFrame(13); - FrameNow = 13; - } - } - } - else - { - if (nowCangeLeavs % 6 == 0) - { - if (nowCangeLeavs > 6) - { - npc.frame = getFrame(13); - FrameNow = 13; - } - else - { - npc.frame = getFrame(12); - FrameNow = 12; - } - } - } - } - else - { - if (State == 0) - if (nowHitPlayerLeft <= 0 && nowHitPlayerRight <= 0) - { - npc.frame = getFrame(1); - FrameNow = 1; - } - if (State == 1) - { - npc.frame = getFrame(14); - FrameNow = 14; - } - if (State == 2) - { - if (stateTime % 3 == 0) - { - npc.frame = getFrame(_2_Frame); - FrameNow = _2_Frame; - _2_Frame++; - if (_2_Frame > 20) - _2_Frame = 17; - } - } - if (State == 3) - { - if (needState3SetFrame) - npc.frame = getFrame(14); - needState3SetFrame = false; - } - } - } + #region "Работа Ñ Ð°Ð½Ð¸Ð¼Ð°Ñ†Ð¸ÐµÐ¹" + int _2_Frame = 17; + int FrameNow = 0; + bool needState3SetFrame = true; + void PlayAnimation() + { + npc.rotation = 0; + if (nowHitPlayerLeft > 0 || nowHitPlayerRight > 0) + { + if (nowHitPlayerLeft > 0) + if (nowHitPlayerLeft % 6 == 0) + { + npc.frame = getFrame(nowHitPlayerLeft / 6 + 1); + FrameNow = nowHitPlayerLeft / 6 + 1; + } + if (nowHitPlayerRight > 0) + if (nowHitPlayerRight % 6 == 0) + { + npc.frame = getFrame(nowHitPlayerRight / 6 + 6); + FrameNow = nowHitPlayerLeft / 6 + 6; + } + return; + } + if (nowCangeLeavs > 0) + { + if (State == 0 || State == 2) + { + if (nowCangeLeavs % 6 == 0) + { + if (nowCangeLeavs > 6) + { + npc.frame = getFrame(12); + FrameNow = 12; + } + else + { + npc.frame = getFrame(13); + FrameNow = 13; + } + } + } + else + { + if (nowCangeLeavs % 6 == 0) + { + if (nowCangeLeavs > 6) + { + npc.frame = getFrame(13); + FrameNow = 13; + } + else + { + npc.frame = getFrame(12); + FrameNow = 12; + } + } + } + } + else + { + if (State == 0) + if (nowHitPlayerLeft <= 0 && nowHitPlayerRight <= 0) + { + npc.frame = getFrame(1); + FrameNow = 1; + } + if (State == 1) + { + npc.frame = getFrame(14); + FrameNow = 14; + } + if (State == 2) + { + if (stateTime % 3 == 0) + { + npc.frame = getFrame(_2_Frame); + FrameNow = _2_Frame; + _2_Frame++; + if (_2_Frame > 20) + _2_Frame = 17; + } + } + if (State == 3) + { + if (needState3SetFrame) + npc.frame = getFrame(14); + needState3SetFrame = false; + } + } + } - Rectangle getFrame(int Index) - { - Index--; - Rectangle rect = new Rectangle(0, 93 * Index, 155, 93); - if (++Index > 13) - rect.Y += 2; - else - rect.Y += 1; - return rect; - } - #endregion + Rectangle getFrame(int Index) + { + Index--; + Rectangle rect = new Rectangle(0, 93 * Index, 155, 93); + if (++Index > 13) + rect.Y += 2; + else + rect.Y += 1; + return rect; + } + #endregion - bool NeedPrepere = true; - List Stadyes = new List() { 0, 1, 2, 3 }; - int NextStady = -1; - void RechangeStage() - { - if (NextStady == -1) - { - if (Stadyes.Contains(State)) - Stadyes.Remove(State); - if (Stadyes.Count <= 0) { Stadyes = new List() { 0, 1, 2, 3 }; Stadyes.Remove(State); } - int ID = Main.rand.Next(0, Stadyes.Count); - NextStady = Stadyes[ID]; - Stadyes.RemoveAt(ID); - } + bool NeedPrepere = true; + List Stadyes = new List() { 0, 1, 2, 3 }; + int NextStady = -1; + void RechangeStage() + { + if (NextStady == -1) + { + if (Stadyes.Contains(State)) + Stadyes.Remove(State); + if (Stadyes.Count <= 0) { Stadyes = new List() { 0, 1, 2, 3 }; Stadyes.Remove(State); } + int ID = Main.rand.Next(0, Stadyes.Count); + NextStady = Stadyes[ID]; + Stadyes.RemoveAt(ID); + } - switch (State) - { - case 0: - #region "Оброботка перехода Ñ Ð¿ÐµÑ€Ð²Ð¾Ð¹ Ñтадии" - switch (NextStady) - { - case 1: - if (NeedPrepere) - { - nowCangeLeavs = simpleCangeLeversTime; - NeedPrepere = false; - break; - } - if (--nowCangeLeavs <= 0) - { - npc.damage = damage1; - npc.defense = defense1; - State = 1; - stateTime = simpleDefenseStateTime; - NeedPrepere = true; - NextStady = -1; - } - break; - case 2: - npc.damage = damage2; - npc.defense = defense2; - npc.noGravity = true; - npc.noTileCollide = true; - npc.aiStyle = 5; - State = 2; - stateTime = normalAttackStateTime; - NextStady = -1; - break; - case 3: - if (NeedPrepere) - { - nowCangeLeavs = simpleCangeLeversTime; - NeedPrepere = false; - break; - } - if (--nowCangeLeavs <= 0) - { - npc.damage = damage3; - npc.defense = defense3; - State = 3; - stateTime = normalDefenseStateTime; - NeedPrepere = true; - NextStady = -1; - needState3SetFrame = true; - } - break; - } - #endregion - break; - case 1: - #region "Оброботка перехода Ñ Ð²Ñ‚Ð¾Ñ€Ð¾Ð¹ Ñтадии" - switch (NextStady) - { - case 0: - if (NeedPrepere) - { - nowCangeLeavs = simpleCangeLeversTime; - NeedPrepere = false; - break; - } - if (--nowCangeLeavs <= 0) - { - npc.damage = damage0; - npc.defense = defense0; - State = 0; - stateTime = simpleAttakStateTime; - NeedPrepere = true; - NextStady = -1; - } - break; - case 2: - if (NeedPrepere) - { - nowCangeLeavs = simpleCangeLeversTime; - NeedPrepere = false; - break; - } - if (--nowCangeLeavs <= 0) - { - npc.damage = damage2; - npc.defense = defense2; - npc.noGravity = true; - npc.noTileCollide = true; - npc.aiStyle = 5; - State = 2; - stateTime = normalAttackStateTime; - NeedPrepere = true; - NextStady = -1; - } - break; - case 3: - npc.damage = damage3; - npc.defense = defense3; - State = 3; - stateTime = normalDefenseStateTime; - NextStady = -1; - needState3SetFrame = true; - break; - } - #endregion - break; - case 2: - #region "Оброботка перехода Ñ Ñ‚Ñ€ÐµÑ‚ÑŒÐµÐ¹ Ñтадии" - switch (NextStady) - { - case 0: - npc.velocity.X = 0; - npc.damage = damage0; - npc.defense = defense0; - npc.noGravity = false; - npc.noTileCollide = false; - npc.aiStyle = -1; - State = 0; - stateTime = simpleAttakStateTime; - NextStady = -1; - break; - case 1: - if (NeedPrepere) - { - npc.velocity.X = 0; - npc.noGravity = false; - npc.noTileCollide = false; - npc.aiStyle = -1; - nowCangeLeavs = simpleCangeLeversTime; - NeedPrepere = false; - break; - } - if (--nowCangeLeavs <= 0) - { - npc.damage = damage1; - npc.defense = defense1; - State = 1; - stateTime = simpleDefenseStateTime; - NeedPrepere = true; - NextStady = -1; - } - break; - case 3: - if (NeedPrepere) - { - npc.velocity.X = 0; - npc.noGravity = false; - npc.noTileCollide = false; - npc.aiStyle = -1; - nowCangeLeavs = simpleCangeLeversTime; - NeedPrepere = false; - break; - } - if (--nowCangeLeavs <= 0) - { - npc.damage = damage3; - npc.defense = defense3; - State = 3; - stateTime = normalDefenseStateTime; - NeedPrepere = true; - NextStady = -1; - needState3SetFrame = true; - } - break; - } - #endregion - break; - case 3: - #region "Оброботка перехода Ñ Ñ‡ÐµÑ‚Ð²Ñ‘Ñ€Ñ‚Ð¾Ð¹ Ñтадии" - switch (NextStady) - { - case 0: - if (NeedPrepere) - { - nowCangeLeavs = simpleCangeLeversTime; - NeedPrepere = false; - break; - } - if (--nowCangeLeavs <= 0) - { - npc.damage = damage0; - npc.defense = defense0; - State = 0; - stateTime = simpleAttakStateTime; - NeedPrepere = true; - NextStady = -1; - } - break; - case 1: - npc.damage = damage1; - npc.defense = defense1; - State = 1; - stateTime = simpleDefenseStateTime; - NextStady = -1; - break; - case 2: - if (NeedPrepere) - { - nowCangeLeavs = simpleCangeLeversTime; - NeedPrepere = false; - break; - } - if (--nowCangeLeavs <= 0) - { - npc.noGravity = true; - npc.noTileCollide = true; - npc.aiStyle = 5; - npc.damage = damage2; - npc.defense = defense2; - State = 2; - stateTime = normalAttackStateTime; - NeedPrepere = true; - NextStady = -1; - } - break; - } - #endregion - break; - } - } + switch (State) + { + case 0: + #region "Оброботка перехода Ñ Ð¿ÐµÑ€Ð²Ð¾Ð¹ Ñтадии" + switch (NextStady) + { + case 1: + if (NeedPrepere) + { + nowCangeLeavs = simpleCangeLeversTime; + NeedPrepere = false; + break; + } + if (--nowCangeLeavs <= 0) + { + npc.damage = damage1; + npc.defense = defense1; + State = 1; + stateTime = simpleDefenseStateTime; + NeedPrepere = true; + NextStady = -1; + } + break; + case 2: + npc.damage = damage2; + npc.defense = defense2; + npc.noGravity = true; + npc.noTileCollide = true; + npc.aiStyle = 5; + State = 2; + stateTime = normalAttackStateTime; + NextStady = -1; + break; + case 3: + if (NeedPrepere) + { + nowCangeLeavs = simpleCangeLeversTime; + NeedPrepere = false; + break; + } + if (--nowCangeLeavs <= 0) + { + npc.damage = damage3; + npc.defense = defense3; + State = 3; + stateTime = normalDefenseStateTime; + NeedPrepere = true; + NextStady = -1; + needState3SetFrame = true; + } + break; + } + #endregion + break; + case 1: + #region "Оброботка перехода Ñ Ð²Ñ‚Ð¾Ñ€Ð¾Ð¹ Ñтадии" + switch (NextStady) + { + case 0: + if (NeedPrepere) + { + nowCangeLeavs = simpleCangeLeversTime; + NeedPrepere = false; + break; + } + if (--nowCangeLeavs <= 0) + { + npc.damage = damage0; + npc.defense = defense0; + State = 0; + stateTime = simpleAttakStateTime; + NeedPrepere = true; + NextStady = -1; + } + break; + case 2: + if (NeedPrepere) + { + nowCangeLeavs = simpleCangeLeversTime; + NeedPrepere = false; + break; + } + if (--nowCangeLeavs <= 0) + { + npc.damage = damage2; + npc.defense = defense2; + npc.noGravity = true; + npc.noTileCollide = true; + npc.aiStyle = 5; + State = 2; + stateTime = normalAttackStateTime; + NeedPrepere = true; + NextStady = -1; + } + break; + case 3: + npc.damage = damage3; + npc.defense = defense3; + State = 3; + stateTime = normalDefenseStateTime; + NextStady = -1; + needState3SetFrame = true; + break; + } + #endregion + break; + case 2: + #region "Оброботка перехода Ñ Ñ‚Ñ€ÐµÑ‚ÑŒÐµÐ¹ Ñтадии" + switch (NextStady) + { + case 0: + npc.velocity.X = 0; + npc.damage = damage0; + npc.defense = defense0; + npc.noGravity = false; + npc.noTileCollide = false; + npc.aiStyle = -1; + State = 0; + stateTime = simpleAttakStateTime; + NextStady = -1; + break; + case 1: + if (NeedPrepere) + { + npc.velocity.X = 0; + npc.noGravity = false; + npc.noTileCollide = false; + npc.aiStyle = -1; + nowCangeLeavs = simpleCangeLeversTime; + NeedPrepere = false; + break; + } + if (--nowCangeLeavs <= 0) + { + npc.damage = damage1; + npc.defense = defense1; + State = 1; + stateTime = simpleDefenseStateTime; + NeedPrepere = true; + NextStady = -1; + } + break; + case 3: + if (NeedPrepere) + { + npc.velocity.X = 0; + npc.noGravity = false; + npc.noTileCollide = false; + npc.aiStyle = -1; + nowCangeLeavs = simpleCangeLeversTime; + NeedPrepere = false; + break; + } + if (--nowCangeLeavs <= 0) + { + npc.damage = damage3; + npc.defense = defense3; + State = 3; + stateTime = normalDefenseStateTime; + NeedPrepere = true; + NextStady = -1; + needState3SetFrame = true; + } + break; + } + #endregion + break; + case 3: + #region "Оброботка перехода Ñ Ñ‡ÐµÑ‚Ð²Ñ‘Ñ€Ñ‚Ð¾Ð¹ Ñтадии" + switch (NextStady) + { + case 0: + if (NeedPrepere) + { + nowCangeLeavs = simpleCangeLeversTime; + NeedPrepere = false; + break; + } + if (--nowCangeLeavs <= 0) + { + npc.damage = damage0; + npc.defense = defense0; + State = 0; + stateTime = simpleAttakStateTime; + NeedPrepere = true; + NextStady = -1; + } + break; + case 1: + npc.damage = damage1; + npc.defense = defense1; + State = 1; + stateTime = simpleDefenseStateTime; + NextStady = -1; + break; + case 2: + if (NeedPrepere) + { + nowCangeLeavs = simpleCangeLeversTime; + NeedPrepere = false; + break; + } + if (--nowCangeLeavs <= 0) + { + npc.noGravity = true; + npc.noTileCollide = true; + npc.aiStyle = 5; + npc.damage = damage2; + npc.defense = defense2; + State = 2; + stateTime = normalAttackStateTime; + NeedPrepere = true; + NextStady = -1; + } + break; + } + #endregion + break; + } + } - #region "Урон в здоровье во Ð²Ñ€ÐµÐ¼Ñ 2 Ñтадии" - public override void ModifyHitByItem(Player player, Item item, ref int damage, ref float knockback, ref bool crit) - { - if (State == 1) // ЕÑли Ð²Ñ‚Ð¾Ñ€Ð°Ñ ÑÑ‚Ð°Ð´Ð¸Ñ (в ней идёт конвертирование урона в хп), то - { - int hpBeforeHeal = npc.life; // СохранÑем в переменную текущее хп - npc.life += damage; // ДобавлÑем в хп моба урон который должны нанеÑти - if (npc.life > npc.lifeMax) // ЕÑли теперь хп больше макÑ. хп, уменьшаем до макÑ. хп - npc.life = npc.lifeMax; - if (npc.lifeMax - hpBeforeHeal > 0) // ЕÑли отхил произошол - npc.HealEffect(npc.lifeMax - hpBeforeHeal); // Показываем Ñффект Ð»ÐµÑ‡ÐµÐ½Ð¸Ñ Ð½Ð° то хп, которое воÑÑтановил моб - damage = 0; // Убираем урон - } - base.ModifyHitByItem(player, item, ref damage, ref knockback, ref crit); - } + #region "Урон в здоровье во Ð²Ñ€ÐµÐ¼Ñ 2 Ñтадии" + public override void ModifyHitByItem(Player player, Item item, ref int damage, ref float knockback, ref bool crit) + { + if (State == 1) // ЕÑли Ð²Ñ‚Ð¾Ñ€Ð°Ñ ÑÑ‚Ð°Ð´Ð¸Ñ (в ней идёт конвертирование урона в хп), то + { + int hpBeforeHeal = npc.life; // СохранÑем в переменную текущее хп + npc.life += damage; // ДобавлÑем в хп моба урон который должны нанеÑти + if (npc.life > npc.lifeMax) // ЕÑли теперь хп больше макÑ. хп, уменьшаем до макÑ. хп + npc.life = npc.lifeMax; + if (npc.lifeMax - hpBeforeHeal > 0) // ЕÑли отхил произошол + npc.HealEffect(npc.lifeMax - hpBeforeHeal); // Показываем Ñффект Ð»ÐµÑ‡ÐµÐ½Ð¸Ñ Ð½Ð° то хп, которое воÑÑтановил моб + damage = 0; // Убираем урон + } + base.ModifyHitByItem(player, item, ref damage, ref knockback, ref crit); + } - public override void ModifyHitByProjectile(Projectile projectile, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) - { - if (State == 1) // ЕÑли Ð²Ñ‚Ð¾Ñ€Ð°Ñ ÑÑ‚Ð°Ð´Ð¸Ñ (в ней идёт конвертирование урона в хп), то - { - npc.life += damage; // ДобавлÑем в хп моба урон который должны нанеÑти - int hpBeforeHeal = npc.life; // СохранÑем в переменную текущее хп - if (npc.life > npc.lifeMax) // ЕÑли теперь хп больше макÑ. хп, уменьшаем до макÑ. хп - npc.life = npc.lifeMax; - if (npc.lifeMax - hpBeforeHeal > 0) // ЕÑли отхил произошол - npc.HealEffect(npc.lifeMax - hpBeforeHeal); // Показываем Ñффект Ð»ÐµÑ‡ÐµÐ½Ð¸Ñ Ð½Ð° то хп, которое воÑÑтановил моб - damage = 0; // Убираем урон - } - base.ModifyHitByProjectile(projectile, ref damage, ref knockback, ref crit, ref hitDirection); - } - #endregion + public override void ModifyHitByProjectile(Projectile projectile, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) + { + if (State == 1) // ЕÑли Ð²Ñ‚Ð¾Ñ€Ð°Ñ ÑÑ‚Ð°Ð´Ð¸Ñ (в ней идёт конвертирование урона в хп), то + { + npc.life += damage; // ДобавлÑем в хп моба урон который должны нанеÑти + int hpBeforeHeal = npc.life; // СохранÑем в переменную текущее хп + if (npc.life > npc.lifeMax) // ЕÑли теперь хп больше макÑ. хп, уменьшаем до макÑ. хп + npc.life = npc.lifeMax; + if (npc.lifeMax - hpBeforeHeal > 0) // ЕÑли отхил произошол + npc.HealEffect(npc.lifeMax - hpBeforeHeal); // Показываем Ñффект Ð»ÐµÑ‡ÐµÐ½Ð¸Ñ Ð½Ð° то хп, которое воÑÑтановил моб + damage = 0; // Убираем урон + } + base.ModifyHitByProjectile(projectile, ref damage, ref knockback, ref crit, ref hitDirection); + } + #endregion - public override void AI() - { - if (Helper.GetNearestPlayer(npc.Center, true) != -1 && !Main.dayTime) - { - // Ð’ завиÑимоÑти от ÑоÑтоÑниÑ, вызываютÑÑ Ñ€Ð°Ð·Ð½Ñ‹Ðµ методы AI - switch (State) - { - case 0: - SimpleAttak(); // парит на меÑте, при приближении бьёт - break; - case 1: - SimpleDeffense(); // парит на меÑте, Ñкрыт в Ñвоих лиÑÑ‚ÑŒÑÑ… - break; - case 2: - NormalAttak(); // летает за игроком Ð¼Ð°Ñ…Ð°Ñ Ð»Ð¸ÑÑ‚ÑŒÑми - break; - case 3: - NormalDefense(); // летает за игроком Ð¼Ð°Ñ…Ð°Ñ Ð»Ð¸ÑÑ‚ÑŒÑми - break; - } - PlayAnimation(); // Проигрываем анимацию - } - else - { - npc.velocity = new Vector2(0, -25); - if (npc.Distance(Main.player[Helper.GetNearestPlayer(npc.Center)].position) > 2500f) - npc.life = -1; - } - } + public override void AI() + { + if (Helper.GetNearestPlayer(npc.Center, true) != -1 && !Main.dayTime) + { + // Ð’ завиÑимоÑти от ÑоÑтоÑниÑ, вызываютÑÑ Ñ€Ð°Ð·Ð½Ñ‹Ðµ методы AI + switch (State) + { + case 0: + SimpleAttak(); // парит на меÑте, при приближении бьёт + break; + case 1: + SimpleDeffense(); // парит на меÑте, Ñкрыт в Ñвоих лиÑÑ‚ÑŒÑÑ… + break; + case 2: + NormalAttak(); // летает за игроком Ð¼Ð°Ñ…Ð°Ñ Ð»Ð¸ÑÑ‚ÑŒÑми + break; + case 3: + NormalDefense(); // летает за игроком Ð¼Ð°Ñ…Ð°Ñ Ð»Ð¸ÑÑ‚ÑŒÑми + break; + } + PlayAnimation(); // Проигрываем анимацию + } + else + { + npc.velocity = new Vector2(0, -25); + if (npc.Distance(Main.player[Helper.GetNearestPlayer(npc.Center)].position) > 2500f) + npc.life = -1; + } + } - #region "Методы работы первой Ñтадии" - void SimpleAttak() // парит на меÑте, при приближении бьёт - { - // ЕÑли Ð²Ñ€ÐµÐ¼Ñ Ð´ÐµÐ¹ÑÑ‚Ð²Ð¸Ñ Ð¿Ð¾Ð´Ð¾ÑˆÐ»Ð¾ к концу (тут его и уменьшаем) и не идёт анимации удара, то изменить Ñтадию - if (--stateTime <= 0 && nowHitPlayerLeft <= 0 && nowHitPlayerRight <= 0) - { - RechangeStage(); - return; - } - // ЕÑли анимаций нет (а значит ÑÑ‚Ð°Ð´Ð¸Ñ Ð½Ðµ менÑетÑÑ, так как переход на Ñледующую Ñтадию проходит Ñ Ð°Ð½Ð¸Ð¼Ð°Ñ†Ð¸ÐµÐ¹ лиÑтьев) то пробуем ударить кого-то - if (nowHitPlayerRight <= 0 && nowHitPlayerLeft <= 0 && nowCangeLeavs <= 0 && stateTime > 0) - SimpleAttak_Hit(); - // Уменьшаем Ð²Ñ€ÐµÐ¼Ñ Ð´Ð¾ конца удара - if (nowHitPlayerLeft > 0) - nowHitPlayerLeft--; - if (nowHitPlayerRight > 0) - nowHitPlayerRight--; - } + #region "Методы работы первой Ñтадии" + void SimpleAttak() // парит на меÑте, при приближении бьёт + { + // ЕÑли Ð²Ñ€ÐµÐ¼Ñ Ð´ÐµÐ¹ÑÑ‚Ð²Ð¸Ñ Ð¿Ð¾Ð´Ð¾ÑˆÐ»Ð¾ к концу (тут его и уменьшаем) и не идёт анимации удара, то изменить Ñтадию + if (--stateTime <= 0 && nowHitPlayerLeft <= 0 && nowHitPlayerRight <= 0) + { + RechangeStage(); + return; + } + // ЕÑли анимаций нет (а значит ÑÑ‚Ð°Ð´Ð¸Ñ Ð½Ðµ менÑетÑÑ, так как переход на Ñледующую Ñтадию проходит Ñ Ð°Ð½Ð¸Ð¼Ð°Ñ†Ð¸ÐµÐ¹ лиÑтьев) то пробуем ударить кого-то + if (nowHitPlayerRight <= 0 && nowHitPlayerLeft <= 0 && nowCangeLeavs <= 0 && stateTime > 0) + SimpleAttak_Hit(); + // Уменьшаем Ð²Ñ€ÐµÐ¼Ñ Ð´Ð¾ конца удара + if (nowHitPlayerLeft > 0) + nowHitPlayerLeft--; + if (nowHitPlayerRight > 0) + nowHitPlayerRight--; + } - void SimpleAttak_Hit() - { - // Получаем ближайшего живого игрока, и еÑли таких нет, то прерываем метод - int Target = Helper.GetNearestPlayer(npc.Center, true); - if (Target == -1) - return; - // ЕÑли диÑÑ‚Ð°Ð½Ñ†Ð¸Ñ Ð´Ð¾ ближайшего живого игрока Ð½Ð¾Ñ€Ð¼Ð°Ð»ÑŒÐ½Ð°Ñ Ð´Ð»Ñ ÑƒÐ´Ð°Ñ€Ð° - бьём - if (npc.Distance(Main.player[Target].Center) <= SimpleHitDist) - { - // Тут проиÑходит выбор - в какую Ñторону бить. - if (Main.player[Target].position.X < npc.position.X) - nowHitPlayerLeft = simpleAttakAnimTime; - else - nowHitPlayerRight = simpleAttakAnimTime; - } - } - #endregion // парит на меÑте, при приближении бьёт // парит на меÑте, при приближении бьёт// парит на меÑте, при приближении бьёт + void SimpleAttak_Hit() + { + // Получаем ближайшего живого игрока, и еÑли таких нет, то прерываем метод + int Target = Helper.GetNearestPlayer(npc.Center, true); + if (Target == -1) + return; + // ЕÑли диÑÑ‚Ð°Ð½Ñ†Ð¸Ñ Ð´Ð¾ ближайшего живого игрока Ð½Ð¾Ñ€Ð¼Ð°Ð»ÑŒÐ½Ð°Ñ Ð´Ð»Ñ ÑƒÐ´Ð°Ñ€Ð° - бьём + if (npc.Distance(Main.player[Target].Center) <= SimpleHitDist) + { + // Тут проиÑходит выбор - в какую Ñторону бить. + if (Main.player[Target].position.X < npc.position.X) + nowHitPlayerLeft = simpleAttakAnimTime; + else + nowHitPlayerRight = simpleAttakAnimTime; + } + } + #endregion // парит на меÑте, при приближении бьёт // парит на меÑте, при приближении бьёт// парит на меÑте, при приближении бьёт - void SimpleDeffense() // парит на меÑте, Ñкрыт в Ñвоих лиÑÑ‚ÑŒÑÑ… - { - if (--stateTime <= 0) - { - RechangeStage(); - } - } + void SimpleDeffense() // парит на меÑте, Ñкрыт в Ñвоих лиÑÑ‚ÑŒÑÑ… + { + if (--stateTime <= 0) + { + RechangeStage(); + } + } - void NormalAttak() // летает за игроком Ð¼Ð°Ñ…Ð°Ñ Ð»Ð¸ÑÑ‚ÑŒÑми - { - if (--stateTime <= 0) - { - RechangeStage(); - return; - } - npc.position += npc.velocity; // Увеличиваем ÑкороÑÑ‚ÑŒ вдвое - } + void NormalAttak() // летает за игроком Ð¼Ð°Ñ…Ð°Ñ Ð»Ð¸ÑÑ‚ÑŒÑми + { + if (--stateTime <= 0) + { + RechangeStage(); + return; + } + npc.position += npc.velocity; // Увеличиваем ÑкороÑÑ‚ÑŒ вдвое + } - int FrameYOffset = 0; - bool FirstAction = true; - bool needTP = true; - int TimeToNS = 6; - const int TimeToNSConst = 6; - void NormalDefense() - { - if (stateTime > 30) - --stateTime; - if (stateTime <= 30) - { - npc.dontTakeDamage = true; - if (stateTime <= 0) - { - npc.dontTakeDamage = false; - NextStady = 2; - RechangeStage(); - FrameYOffset = 0; - FirstAction = true; - needTP = true; - return; - } - if (FirstAction) - { - if (npc.velocity.Y <= 0) - { - if (Main.rand.Next(6) == 0) - for (int x = (int)npc.position.X; x < (npc.position.X + npc.width); x++) - Dust.NewDust(new Vector2(x, npc.position.Y + npc.height), 1, 1, Terraria.ID.DustID.GoldCoin); - npc.frame = getFrame(22); - npc.frame.Y -= FrameYOffset; - FrameYOffset += 4; - if (FrameYOffset >= npc.height) - { - FirstAction = false; - FrameYOffset = 0; - } - } - } - else - { - if (npc.velocity.Y > 0) - return; - if (needTP) - { - needTP = false; - TeleportOnPlayer(); - } - while (!WorldGen.SolidTile((int)npc.Center.X / 16, ((int)npc.position.Y + npc.height) / 16 + 1)) - npc.position.Y += 8; - if (Main.rand.Next(6) == 0) - for (int x = (int)npc.position.X; x < (npc.position.X + npc.width); x++) - Dust.NewDust(new Vector2(x, npc.position.Y + npc.height), 1, 1, Terraria.ID.DustID.GoldCoin); - npc.frame = getFrame(21); - npc.frame.Y += FrameYOffset; - FrameYOffset += 8; - if (FrameYOffset >= npc.height) - { - npc.frame = getFrame(14); - if (--TimeToNS >= 1) - return; - TimeToNS = TimeToNSConst; - stateTime = -1; - } - } - } - } + int FrameYOffset = 0; + bool FirstAction = true; + bool needTP = true; + int TimeToNS = 6; + const int TimeToNSConst = 6; + void NormalDefense() + { + if (stateTime > 30) + --stateTime; + if (stateTime <= 30) + { + npc.dontTakeDamage = true; + if (stateTime <= 0) + { + npc.dontTakeDamage = false; + NextStady = 2; + RechangeStage(); + FrameYOffset = 0; + FirstAction = true; + needTP = true; + return; + } + if (FirstAction) + { + if (npc.velocity.Y <= 0) + { + if (Main.rand.Next(6) == 0) + for (int x = (int)npc.position.X; x < (npc.position.X + npc.width); x++) + Dust.NewDust(new Vector2(x, npc.position.Y + npc.height), 1, 1, Terraria.ID.DustID.GoldCoin); + npc.frame = getFrame(22); + npc.frame.Y -= FrameYOffset; + FrameYOffset += 4; + if (FrameYOffset >= npc.height) + { + FirstAction = false; + FrameYOffset = 0; + } + } + } + else + { + if (npc.velocity.Y > 0) + return; + if (needTP) + { + needTP = false; + TeleportOnPlayer(); + } + while (!WorldGen.SolidTile((int)npc.Center.X / 16, ((int)npc.position.Y + npc.height) / 16 + 1)) + npc.position.Y += 8; + if (Main.rand.Next(6) == 0) + for (int x = (int)npc.position.X; x < (npc.position.X + npc.width); x++) + Dust.NewDust(new Vector2(x, npc.position.Y + npc.height), 1, 1, Terraria.ID.DustID.GoldCoin); + npc.frame = getFrame(21); + npc.frame.Y += FrameYOffset; + FrameYOffset += 8; + if (FrameYOffset >= npc.height) + { + npc.frame = getFrame(14); + if (--TimeToNS >= 1) + return; + TimeToNS = TimeToNSConst; + stateTime = -1; + } + } + } + } - void TeleportOnPlayer() - { - npc.Teleport(new Vector2(Main.player[Helper.GetNearestPlayer(npc.Center, true)].position.X - npc.width / 2, Main.player[Helper.GetNearestPlayer(npc.Center, true)].position.Y - npc.height), -1); - } + void TeleportOnPlayer() + { + npc.Teleport(new Vector2(Main.player[Helper.GetNearestPlayer(npc.Center, true)].position.X - npc.width / 2, Main.player[Helper.GetNearestPlayer(npc.Center, true)].position.Y - npc.height), -1); + } - public override void NPCLoot() - { - if(Main.expertMode) - { - npc.DropBossBags(); - } - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; + public override void NPCLoot() + { + if (Main.expertMode) + { + npc.DropBossBags(); + } + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; - if(!Main.expertMode && Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EvilCornMask")); - } - if(Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EvilCornTrophy")); - } - if(!Main.expertMode && Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrayKnightHelmet")); - } - if(!Main.expertMode && Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrayKnightBreastplate")); - } - if(!Main.expertMode && Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("KnightGreaves")); - } - if(!Main.expertMode && Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CornSword")); - } - if(!Main.expertMode && Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Corn"), Main.rand.Next(25, 48)); - } - if(!Main.expertMode && !Main.player[Main.myPlayer].HasItem(mod.ItemType("FarmerShovel"))) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FarmerShovel")); - } - if(!Main.expertMode && Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CornJavelin"), Main.rand.Next(15, 45)); - } - TremorWorld.downedEvilCorn = true; + if (!Main.expertMode && Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EvilCornMask")); + } + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EvilCornTrophy")); + } + if (!Main.expertMode && Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrayKnightHelmet")); + } + if (!Main.expertMode && Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GrayKnightBreastplate")); + } + if (!Main.expertMode && Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("KnightGreaves")); + } + if (!Main.expertMode && Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CornSword")); + } + if (!Main.expertMode && Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Corn"), Main.rand.Next(25, 48)); + } + if (!Main.expertMode && !Main.player[Main.myPlayer].HasItem(mod.ItemType("FarmerShovel"))) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FarmerShovel")); + } + if (!Main.expertMode && Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CornJavelin"), Main.rand.Next(15, 45)); + } + TremorWorld.downedEvilCorn = true; - } - } + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CornGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CornGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CornGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CornGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CornGore4"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CornGore4"), 1f); - } -} - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CornGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CornGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CornGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CornGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CornGore4"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CornGore4"), 1f); + } + } + } } \ No newline at end of file diff --git a/NPCs/EvolvedZombie.cs b/NPCs/EvolvedZombie.cs index bf119af4..2f85b871 100644 --- a/NPCs/EvolvedZombie.cs +++ b/NPCs/EvolvedZombie.cs @@ -6,78 +6,80 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class EvolvedZombie : ModNPC +namespace Tremor.NPCs { + + public class EvolvedZombie : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Evolved Zombie"); Main.npcFrameCount[npc.type] = 8; } - - public override void SetDefaults() - { - npc.lifeMax = 1200; - npc.damage = 110; - npc.defense = 7; - npc.knockBackResist = 0.3f; - npc.width = 34; - npc.height = 46; - animationType = 525; - npc.aiStyle = 3; - aiType = 525; - npc.npcSlots = 0.3f; - npc.HitSound = SoundID.NPCHit37; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 4, 7); - banner = npc.type; - bannerItem = mod.ItemType("EvolvedZombieBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 1200; + npc.damage = 110; + npc.defense = 7; + npc.knockBackResist = 0.3f; + npc.width = 34; + npc.height = 46; + animationType = 525; + npc.aiStyle = 3; + aiType = 525; + npc.npcSlots = 0.3f; + npc.HitSound = SoundID.NPCHit37; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 0, 4, 7); + banner = npc.type; + bannerItem = mod.ItemType("EvolvedZombieBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore5"), 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, Color.White, 3f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, Color.White, 2f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, Color.White, 3f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore5"), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, Color.White, 3f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, Color.White, 2f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, Color.White, 3f); + } + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ConcentratedEther")); - }; - } - } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.03f : 0f; - } -}} \ No newline at end of file + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ConcentratedEther")); + }; + } + } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.03f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/EvolvedZombie2.cs b/NPCs/EvolvedZombie2.cs index a1d03937..80c5d6d7 100644 --- a/NPCs/EvolvedZombie2.cs +++ b/NPCs/EvolvedZombie2.cs @@ -6,78 +6,80 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class EvolvedZombie2 : ModNPC +namespace Tremor.NPCs { + + public class EvolvedZombie2 : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Evolved Zombie"); Main.npcFrameCount[npc.type] = 8; } - - public override void SetDefaults() - { - npc.lifeMax = 1000; - npc.damage = 110; - npc.defense = 7; - npc.knockBackResist = 0.3f; - npc.width = 34; - npc.height = 46; - animationType = 525; - npc.aiStyle = 3; - aiType = 525; - npc.npcSlots = 0.3f; - npc.HitSound = SoundID.NPCHit37; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 6, 7); - banner = npc.type; - bannerItem = mod.ItemType("EvolvedZombieBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 1000; + npc.damage = 110; + npc.defense = 7; + npc.knockBackResist = 0.3f; + npc.width = 34; + npc.height = 46; + animationType = 525; + npc.aiStyle = 3; + aiType = 525; + npc.npcSlots = 0.3f; + npc.HitSound = SoundID.NPCHit37; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 0, 6, 7); + banner = npc.type; + bannerItem = mod.ItemType("EvolvedZombieBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore4"), 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, Color.White, 3f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, Color.White, 2f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, Color.White, 3f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore4"), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, Color.White, 3f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, Color.White, 2f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, Color.White, 3f); + } + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ConcentratedEther")); - }; - } - } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.03f : 0f; - } -}} \ No newline at end of file + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ConcentratedEther")); + }; + } + } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.03f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/EvolvedZombie3.cs b/NPCs/EvolvedZombie3.cs index fdd89f55..46757d20 100644 --- a/NPCs/EvolvedZombie3.cs +++ b/NPCs/EvolvedZombie3.cs @@ -6,78 +6,80 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class EvolvedZombie3 : ModNPC +namespace Tremor.NPCs { + + public class EvolvedZombie3 : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Evolved Zombie"); Main.npcFrameCount[npc.type] = 8; } - - public override void SetDefaults() - { - npc.lifeMax = 1100; - npc.damage = 110; - npc.defense = 7; - npc.knockBackResist = 0.3f; - npc.width = 34; - npc.height = 46; - animationType = 525; - npc.aiStyle = 3; - aiType = 525; - npc.npcSlots = 0.3f; - npc.HitSound = SoundID.NPCHit37; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 6, 7); - banner = npc.type; - bannerItem = mod.ItemType("EvolvedZombieBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 1100; + npc.damage = 110; + npc.defense = 7; + npc.knockBackResist = 0.3f; + npc.width = 34; + npc.height = 46; + animationType = 525; + npc.aiStyle = 3; + aiType = 525; + npc.npcSlots = 0.3f; + npc.HitSound = SoundID.NPCHit37; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 0, 6, 7); + banner = npc.type; + bannerItem = mod.ItemType("EvolvedZombieBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore3"), 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, Color.White, 3f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, Color.White, 2f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, Color.White, 3f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/EvolvGore3"), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, Color.White, 3f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, Color.White, 2f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, Color.White, 3f); + } + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ConcentratedEther")); - }; - } - } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.03f : 0f; - } -}} \ No newline at end of file + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ConcentratedEther")); + }; + } + } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.03f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/ExuberantHound.cs b/NPCs/ExuberantHound.cs index 25420889..e44e803b 100644 --- a/NPCs/ExuberantHound.cs +++ b/NPCs/ExuberantHound.cs @@ -5,152 +5,154 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class ExuberantHound : ModNPC +namespace Tremor.NPCs { + + public class ExuberantHound : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Exuberant Hound"); Main.npcFrameCount[npc.type] = 12; } - - public override void SetDefaults() - { - npc.lifeMax = 3000; - npc.damage = 120; + + public override void SetDefaults() + { + npc.lifeMax = 3000; + npc.damage = 120; npc.defense = 60; - npc.knockBackResist = 0.2f; - npc.width = 50; - npc.height = 44; - animationType = 423; - npc.aiStyle = 26; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit18; - npc.DeathSound = SoundID.NPCDeath21; - npc.value = Item.buyPrice(0, 0, 40, 0); - banner = npc.type; - bannerItem = mod.ItemType("ExuberantHoundBanner"); - } + npc.knockBackResist = 0.2f; + npc.width = 50; + npc.height = 44; + animationType = 423; + npc.aiStyle = 26; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit18; + npc.DeathSound = SoundID.NPCDeath21; + npc.value = Item.buyPrice(0, 0, 40, 0); + banner = npc.type; + bannerItem = mod.ItemType("ExuberantHoundBanner"); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 60; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ExuberantHoundGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ExuberantHoundGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ExuberantHoundGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ExuberantHoundGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ExuberantHoundGore3"), 1f); - } - else - { + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 60; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ExuberantHoundGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ExuberantHoundGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ExuberantHoundGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ExuberantHoundGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ExuberantHoundGore3"), 1f); + } + else + { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 226, (float)hitDirection, -2f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } - } + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 226, (float)hitDirection, -2f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, (float)hitDirection, -1f, 0, default(Color), 0.7f); + } + } + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ConcentratedEther"), Main.rand.Next(2,4)); - }; - if(Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ToothofAbraxas"), Main.rand.Next(1,2)); - }; - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ConcentratedEther"), Main.rand.Next(2, 4)); + }; + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ToothofAbraxas"), Main.rand.Next(1, 2)); + }; + } + } - public override void AI() - { - Vector2 vector72 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num738 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector72.X; - float num739 = Main.player[npc.target].position.Y - vector72.Y; - float num740 = (float)Math.Sqrt((double)(num738 * num738 + num739 * num739)); + public override void AI() + { + Vector2 vector72 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num738 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector72.X; + float num739 = Main.player[npc.target].position.Y - vector72.Y; + float num740 = (float)Math.Sqrt((double)(num738 * num738 + num739 * num739)); - if (npc.ai[2] == 1f) - { - npc.ai[1] += 1f; - npc.velocity.X = npc.velocity.X * 0.7f; - if (npc.ai[1] < 30f) - { - Vector2 vector73 = npc.Center + Vector2.UnitX * (float)npc.spriteDirection * -20f; - Dust dust11 = Main.dust[Dust.NewDust(vector73, 0, 0, 242, 0f, 0f, 0, default(Color), 1f)]; - Vector2 vector74 = Vector2.UnitY.RotatedByRandom(6.2831854820251465); - dust11.position = vector73 + vector74 * 20f; - dust11.velocity = -vector74 * 2f; - dust11.scale = 0.5f + vector74.X * (float)(-(float)npc.spriteDirection); - dust11.fadeIn = 1f; - dust11.noGravity = true; - } - else if (npc.ai[1] == 30f) - { - for (int num743 = 0; num743 < 20; num743++) - { - Vector2 vector75 = npc.Center + Vector2.UnitX * (float)npc.spriteDirection * -20f; - Dust dust12 = Main.dust[Dust.NewDust(vector75, 0, 0, 242, 0f, 0f, 0, default(Color), 1f)]; - Vector2 vector76 = Vector2.UnitY.RotatedByRandom(6.2831854820251465); - dust12.position = vector75 + vector76 * 4f; - dust12.velocity = vector76 * 4f + Vector2.UnitX * Main.rand.NextFloat() * (float)npc.spriteDirection * -5f; - dust12.scale = 0.5f + vector76.X * (float)(-(float)npc.spriteDirection); - dust12.fadeIn = 1f; - dust12.noGravity = true; - } - } - if (npc.velocity.X > -0.5f && npc.velocity.X < 0.5f) - { - npc.velocity.X = 0f; - } - if (npc.ai[1] == 30f && Main.netMode != 1) - { - int num744 = Main.expertMode ? 35 : 50; - Projectile.NewProjectile(npc.Center.X + (float)(npc.spriteDirection * -20), npc.Center.Y, (float)(npc.spriteDirection * -7), 0f, 435, num744, 0f, Main.myPlayer, (float)npc.target, 0f); - } - if (npc.ai[1] >= 60f) - { - npc.ai[1] = (float)(-(float)Main.rand.Next(320, 601)); - npc.ai[2] = 0f; - } - } - else - { - npc.ai[1] += 1f; - if (npc.ai[1] >= 180f && num740 < 500f && npc.velocity.Y == 0f) - { - npc.ai[1] = 0f; - npc.ai[2] = 1f; - npc.netUpdate = true; - } - else if (npc.velocity.Y == 0f && num740 < 100f && Math.Abs(npc.velocity.X) > 3f && ((npc.Center.X < Main.player[npc.target].Center.X && npc.velocity.X > 0f) || (npc.Center.X > Main.player[npc.target].Center.X && npc.velocity.X < 0f))) - { - npc.velocity.Y = npc.velocity.Y - 4f; - } - } - } + if (npc.ai[2] == 1f) + { + npc.ai[1] += 1f; + npc.velocity.X = npc.velocity.X * 0.7f; + if (npc.ai[1] < 30f) + { + Vector2 vector73 = npc.Center + Vector2.UnitX * (float)npc.spriteDirection * -20f; + Dust dust11 = Main.dust[Dust.NewDust(vector73, 0, 0, 242, 0f, 0f, 0, default(Color), 1f)]; + Vector2 vector74 = Vector2.UnitY.RotatedByRandom(6.2831854820251465); + dust11.position = vector73 + vector74 * 20f; + dust11.velocity = -vector74 * 2f; + dust11.scale = 0.5f + vector74.X * (float)(-(float)npc.spriteDirection); + dust11.fadeIn = 1f; + dust11.noGravity = true; + } + else if (npc.ai[1] == 30f) + { + for (int num743 = 0; num743 < 20; num743++) + { + Vector2 vector75 = npc.Center + Vector2.UnitX * (float)npc.spriteDirection * -20f; + Dust dust12 = Main.dust[Dust.NewDust(vector75, 0, 0, 242, 0f, 0f, 0, default(Color), 1f)]; + Vector2 vector76 = Vector2.UnitY.RotatedByRandom(6.2831854820251465); + dust12.position = vector75 + vector76 * 4f; + dust12.velocity = vector76 * 4f + Vector2.UnitX * Main.rand.NextFloat() * (float)npc.spriteDirection * -5f; + dust12.scale = 0.5f + vector76.X * (float)(-(float)npc.spriteDirection); + dust12.fadeIn = 1f; + dust12.noGravity = true; + } + } + if (npc.velocity.X > -0.5f && npc.velocity.X < 0.5f) + { + npc.velocity.X = 0f; + } + if (npc.ai[1] == 30f && Main.netMode != 1) + { + int num744 = Main.expertMode ? 35 : 50; + Projectile.NewProjectile(npc.Center.X + (float)(npc.spriteDirection * -20), npc.Center.Y, (float)(npc.spriteDirection * -7), 0f, 435, num744, 0f, Main.myPlayer, (float)npc.target, 0f); + } + if (npc.ai[1] >= 60f) + { + npc.ai[1] = (float)(-(float)Main.rand.Next(320, 601)); + npc.ai[2] = 0f; + } + } + else + { + npc.ai[1] += 1f; + if (npc.ai[1] >= 180f && num740 < 500f && npc.velocity.Y == 0f) + { + npc.ai[1] = 0f; + npc.ai[2] = 1f; + npc.netUpdate = true; + } + else if (npc.velocity.Y == 0f && num740 < 100f && Math.Abs(npc.velocity.X) > 3f && ((npc.Center.X < Main.player[npc.target].Center.X && npc.velocity.X > 0f) || (npc.Center.X > Main.player[npc.target].Center.X && npc.velocity.X < 0f))) + { + npc.velocity.Y = npc.velocity.Y - 4f; + } + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.001f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.001f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/FallenWarrior1.cs b/NPCs/FallenWarrior1.cs index d31873d6..a89ebdb4 100644 --- a/NPCs/FallenWarrior1.cs +++ b/NPCs/FallenWarrior1.cs @@ -5,75 +5,77 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class FallenWarrior1 : ModNPC +namespace Tremor.NPCs { + + public class FallenWarrior1 : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Fallen Warrior"); Main.npcFrameCount[npc.type] = 15; } - - public override void SetDefaults() - { - npc.lifeMax = 1000; - npc.damage = 140; - npc.defense = 82; - npc.knockBackResist = 0.05f; - npc.width = 32; - npc.height = 50; - animationType = 21; - npc.aiStyle = 3; - aiType = 273; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 8, 0); - banner = npc.type; - bannerItem = mod.ItemType("FallenWarriorBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 1000; + npc.damage = 140; + npc.defense = 82; + npc.knockBackResist = 0.05f; + npc.width = 32; + npc.height = 50; + animationType = 21; + npc.aiStyle = 3; + aiType = 273; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit4; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 0, 8, 0); + banner = npc.type; + bannerItem = mod.ItemType("FallenWarriorBanner"); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AncientArmorPlate")); - } - } - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FWGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FWGore3"), 1f); - } -} + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AncientArmorPlate")); + } + } + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FWGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FWGore3"), 1f); + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDungeon && NPC.downedMoonlord && Main.hardMode && y > Main.rockLayer ? 0.01f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDungeon && NPC.downedMoonlord && Main.hardMode && y > Main.rockLayer ? 0.01f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/FallenWarrior2.cs b/NPCs/FallenWarrior2.cs index 4a28426f..2a5e4040 100644 --- a/NPCs/FallenWarrior2.cs +++ b/NPCs/FallenWarrior2.cs @@ -5,75 +5,77 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class FallenWarrior2 : ModNPC +namespace Tremor.NPCs { + + public class FallenWarrior2 : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Fallen Warrior"); Main.npcFrameCount[npc.type] = 15; } - - public override void SetDefaults() - { - npc.lifeMax = 1200; - npc.damage = 150; - npc.defense = 72; - npc.knockBackResist = 0.05f; - npc.width = 32; - npc.height = 50; - animationType = 21; - npc.aiStyle = 3; - aiType = 273; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 8, 0); - banner = npc.type; - bannerItem = mod.ItemType("FallenWarriorBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 1200; + npc.damage = 150; + npc.defense = 72; + npc.knockBackResist = 0.05f; + npc.width = 32; + npc.height = 50; + animationType = 21; + npc.aiStyle = 3; + aiType = 273; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit4; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 0, 8, 0); + banner = npc.type; + bannerItem = mod.ItemType("FallenWarriorBanner"); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AncientArmorPlate")); - } - } - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FWGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FWGore2"), 1f); - } -} + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AncientArmorPlate")); + } + } + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FWGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FWGore2"), 1f); + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDungeon && NPC.downedMoonlord && Main.hardMode && y > Main.rockLayer ? 0.01f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDungeon && NPC.downedMoonlord && Main.hardMode && y > Main.rockLayer ? 0.01f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/FallenWarrior3.cs b/NPCs/FallenWarrior3.cs index ba412481..5435bd9a 100644 --- a/NPCs/FallenWarrior3.cs +++ b/NPCs/FallenWarrior3.cs @@ -5,75 +5,77 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class FallenWarrior3 : ModNPC +namespace Tremor.NPCs { + + public class FallenWarrior3 : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Fallen Warrior"); Main.npcFrameCount[npc.type] = 15; } - - public override void SetDefaults() - { - npc.lifeMax = 1500; - npc.damage = 130; - npc.defense = 62; - npc.knockBackResist = 0.05f; - npc.width = 32; - npc.height = 50; - animationType = 21; - npc.aiStyle = 3; - aiType = 273; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 8, 0); - banner = npc.type; - bannerItem = mod.ItemType("FallenWarriorBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 1500; + npc.damage = 130; + npc.defense = 62; + npc.knockBackResist = 0.05f; + npc.width = 32; + npc.height = 50; + animationType = 21; + npc.aiStyle = 3; + aiType = 273; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit4; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 0, 8, 0); + banner = npc.type; + bannerItem = mod.ItemType("FallenWarriorBanner"); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AncientArmorPlate")); - } - } - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FWGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FWGore4"), 1f); - } -} + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AncientArmorPlate")); + } + } + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FWGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FWGore4"), 1f); + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDungeon && NPC.downedMoonlord && Main.hardMode && y > Main.rockLayer ? 0.01f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDungeon && NPC.downedMoonlord && Main.hardMode && y > Main.rockLayer ? 0.01f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/Farmer.cs b/NPCs/Farmer.cs index 877fcdf1..03d40b6d 100644 --- a/NPCs/Farmer.cs +++ b/NPCs/Farmer.cs @@ -6,10 +6,11 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { -[AutoloadHead] -public class Farmer : ModNPC +namespace Tremor.NPCs { + [AutoloadHead] + public class Farmer : ModNPC + { public override string Texture { get @@ -22,9 +23,9 @@ public override string[] AltTextures { get { - return new string[] { "Tremor/NPCs/Farmer"}; + return new string[] { "Tremor/NPCs/Farmer" }; } - } + } public override bool Autoload(ref string name) { name = "Farmer"; @@ -43,21 +44,21 @@ public override void SetStaticDefaults() NPCID.Sets.AttackAverageChance[npc.type] = 30; } - public override void SetDefaults() - { - npc.townNPC = true; - npc.friendly = true; - npc.width = 30; - npc.height = 48; - npc.aiStyle = 7; - npc.damage = 20; - npc.defense = 15; - npc.lifeMax = 250; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.knockBackResist = 0.5f; - animationType = NPCID.Nurse; - } + public override void SetDefaults() + { + npc.townNPC = true; + npc.friendly = true; + npc.width = 30; + npc.height = 48; + npc.aiStyle = 7; + npc.damage = 20; + npc.defense = 15; + npc.lifeMax = 250; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.knockBackResist = 0.5f; + animationType = NPCID.Nurse; + } public override bool CanTownNPCSpawn(int numTownNPCs, int money) { @@ -79,146 +80,147 @@ public override bool CanTownNPCSpawn(int numTownNPCs, int money) } - public override string TownNPCName() - { - switch(WorldGen.genRand.Next(4)) - { - case 0: - return "Trillian"; - case 1: - return "Penelope"; - case 2: - return "Emily"; - case 3: - return "Abigail"; - case 4: - return "Alma"; - case 5: - return "Alexandra"; - default: - return "Peg"; - } - } - - public override string GetChat() - { - switch(Main.rand.Next(6)) - { - case 0: - return "I wonder who had the idea of growing such an evil corn? Don't look at me like this, I have nothing to do with."; - case 1: - return "There are so many wonderful and amazing plants in this world but there is nothing more amazing like a corn!"; - case 2: - return "Uh... Oh... Did you came to buy a corn? I'm afraid that it can become evil too."; - case 3: - return "Don't use chemicals on your plants! Chemicals make them being evil and crazy!"; - case 4: - return "Don't you dare to offer me to eat popcorn! After those bad events I just can't eat anything that contains corn!"; - default: - return "Take some water... Add ebonkoi... Wallow some deathweed dust... Mix everything... Oh! Hello! Want to buy something?"; - } - } - - public override void SetChatButtons(ref string button, ref string button2) - { - button = Lang.inter[28].Value; - } - - public override void OnChatButtonClicked(bool firstButton, ref bool shop) - { - if(firstButton) - { - shop = true; - } - } - - public override void SetupShop(Chest shop, ref int nextSlot) - { - //shop.item[nextSlot].SetDefaults(mod.ItemType("CornSeed")); - //nextSlot++; - if(!NPC.downedBoss1) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("Pitchfork")); - nextSlot++; - } - if(Main.dayTime) - { - shop.item[nextSlot].SetDefaults(307); - nextSlot++; - } - if(!Main.dayTime) - { - shop.item[nextSlot].SetDefaults(308); - nextSlot++; - } - if(NPC.downedSlimeKing) - { - shop.item[nextSlot].SetDefaults(311); - nextSlot++; - } - if(NPC.downedBoss2) - { - shop.item[nextSlot].SetDefaults(309); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("EggPlant")); - nextSlot++; - } - - if(Main.hardMode) - { - shop.item[nextSlot].SetDefaults(312); - nextSlot++; - } - - if (Main.player[Main.myPlayer].HasItem(mod.ItemType("Carrow"))) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("Carrot"), false); - nextSlot++; - } + public override string TownNPCName() + { + switch (WorldGen.genRand.Next(4)) + { + case 0: + return "Trillian"; + case 1: + return "Penelope"; + case 2: + return "Emily"; + case 3: + return "Abigail"; + case 4: + return "Alma"; + case 5: + return "Alexandra"; + default: + return "Peg"; + } + } + + public override string GetChat() + { + switch (Main.rand.Next(6)) + { + case 0: + return "I wonder who had the idea of growing such an evil corn? Don't look at me like this, I have nothing to do with."; + case 1: + return "There are so many wonderful and amazing plants in this world but there is nothing more amazing like a corn!"; + case 2: + return "Uh... Oh... Did you came to buy a corn? I'm afraid that it can become evil too."; + case 3: + return "Don't use chemicals on your plants! Chemicals make them being evil and crazy!"; + case 4: + return "Don't you dare to offer me to eat popcorn! After those bad events I just can't eat anything that contains corn!"; + default: + return "Take some water... Add ebonkoi... Wallow some deathweed dust... Mix everything... Oh! Hello! Want to buy something?"; + } + } - if(Main.bloodMoon) - { - shop.item[nextSlot].SetDefaults(310); - nextSlot++; - } - } - - public override void TownNPCAttackStrength(ref int damage, ref float knockback) - { - damage = 20; - knockback = 4f; - } - - public override void TownNPCAttackCooldown(ref int cooldown, ref int randExtraCooldown) - { - cooldown = 10; - randExtraCooldown = 10; - } - - public override void TownNPCAttackProj(ref int projType, ref int attackDelay) - { - projType = mod.ProjectileType("TomatoPro"); - attackDelay = 4; - } - - public override void TownNPCAttackProjSpeed(ref float multiplier, ref float gravityCorrection, ref float randomOffset) - { - multiplier = 12f; - randomOffset = 2f; - } - - - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FarmerGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FarmerGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FarmerGore3"), 1f); - } -} -}} \ No newline at end of file + public override void SetChatButtons(ref string button, ref string button2) + { + button = Lang.inter[28].Value; + } + + public override void OnChatButtonClicked(bool firstButton, ref bool shop) + { + if (firstButton) + { + shop = true; + } + } + + public override void SetupShop(Chest shop, ref int nextSlot) + { + //shop.item[nextSlot].SetDefaults(mod.ItemType("CornSeed")); + //nextSlot++; + if (!NPC.downedBoss1) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("Pitchfork")); + nextSlot++; + } + if (Main.dayTime) + { + shop.item[nextSlot].SetDefaults(307); + nextSlot++; + } + if (!Main.dayTime) + { + shop.item[nextSlot].SetDefaults(308); + nextSlot++; + } + if (NPC.downedSlimeKing) + { + shop.item[nextSlot].SetDefaults(311); + nextSlot++; + } + if (NPC.downedBoss2) + { + shop.item[nextSlot].SetDefaults(309); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("EggPlant")); + nextSlot++; + } + + if (Main.hardMode) + { + shop.item[nextSlot].SetDefaults(312); + nextSlot++; + } + + if (Main.player[Main.myPlayer].HasItem(mod.ItemType("Carrow"))) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("Carrot"), false); + nextSlot++; + } + + if (Main.bloodMoon) + { + shop.item[nextSlot].SetDefaults(310); + nextSlot++; + } + } + + public override void TownNPCAttackStrength(ref int damage, ref float knockback) + { + damage = 20; + knockback = 4f; + } + + public override void TownNPCAttackCooldown(ref int cooldown, ref int randExtraCooldown) + { + cooldown = 10; + randExtraCooldown = 10; + } + + public override void TownNPCAttackProj(ref int projType, ref int attackDelay) + { + projType = mod.ProjectileType("TomatoPro"); + attackDelay = 4; + } + + public override void TownNPCAttackProjSpeed(ref float multiplier, ref float gravityCorrection, ref float randomOffset) + { + multiplier = 12f; + randomOffset = 2f; + } + + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FarmerGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FarmerGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FarmerGore3"), 1f); + } + } + } +} \ No newline at end of file diff --git a/NPCs/FatFlinx.cs b/NPCs/FatFlinx.cs index e969522a..b4a6a98e 100644 --- a/NPCs/FatFlinx.cs +++ b/NPCs/FatFlinx.cs @@ -7,78 +7,80 @@ using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class FatFlinx : ModNPC +namespace Tremor.NPCs { + + public class FatFlinx : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Fat Flinx"); Main.npcFrameCount[npc.type] = 12; } - - public override void SetDefaults() - { - npc.lifeMax = 3000; - npc.damage = 110; - npc.defense = 45; - npc.knockBackResist = 0.9f; - npc.width = 46; - npc.height = 46; - animationType = 185; - npc.aiStyle = 3; - aiType = 166; - npc.npcSlots = 0.3f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath23; - npc.value = Item.buyPrice(0, 0, 9, 15); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 3000; + npc.damage = 110; + npc.defense = 45; + npc.knockBackResist = 0.9f; + npc.width = 46; + npc.height = 46; + animationType = 185; + npc.aiStyle = 3; + aiType = 166; + npc.npcSlots = 0.3f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath23; + npc.value = Item.buyPrice(0, 0, 9, 15); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(NPC.downedMoonlord && Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); - } - } - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FFGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FFGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FFGore1"), 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - } -} + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (NPC.downedMoonlord && Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); + } + } + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FFGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FFGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FFGore1"), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return Main.hardMode && NPC.downedMoonlord && spawnInfo.player.ZoneSnow && y > Main.rockLayer ? 0.1f : 0f; - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return Main.hardMode && NPC.downedMoonlord && spawnInfo.player.ZoneSnow && y > Main.rockLayer ? 0.1f : 0f; + } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/FireBeetle.cs b/NPCs/FireBeetle.cs index 7124962a..4e9f67e9 100644 --- a/NPCs/FireBeetle.cs +++ b/NPCs/FireBeetle.cs @@ -6,88 +6,90 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class FireBeetle : ModNPC +namespace Tremor.NPCs { + + public class FireBeetle : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Fire Beetle"); Main.npcFrameCount[npc.type] = 6; } - - public override void SetDefaults() - { - npc.lifeMax = 3000; - npc.damage = 150; - npc.defense = 72; - npc.knockBackResist = 0.1f; - npc.width = 40; - npc.height = 40; - animationType = 508; - npc.aiStyle = 3; - aiType = 508; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit41; - npc.buffImmune[20] = true; - npc.buffImmune[24] = true; - npc.buffImmune[39] = true; - npc.buffImmune[31] = false; - npc.DeathSound = SoundID.NPCDeath44; - npc.value = Item.buyPrice(0, 0, 12, 0); - banner = npc.type; - bannerItem = mod.ItemType("FireBeetleBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 3000; + npc.damage = 150; + npc.defense = 72; + npc.knockBackResist = 0.1f; + npc.width = 40; + npc.height = 40; + animationType = 508; + npc.aiStyle = 3; + aiType = 508; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit41; + npc.buffImmune[20] = true; + npc.buffImmune[24] = true; + npc.buffImmune[39] = true; + npc.buffImmune[31] = false; + npc.DeathSound = SoundID.NPCDeath44; + npc.value = Item.buyPrice(0, 0, 12, 0); + banner = npc.type; + bannerItem = mod.ItemType("FireBeetleBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 175, 3); - } - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FireFragment"), 3); - } - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 175, 3); + } + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FireFragment"), 3); + } + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FBGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FBGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FBGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FBGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FBGore2"), 1f); - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); - } - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FBGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FBGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FBGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FBGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FBGore2"), 1f); + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); + } + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && NPC.downedMoonlord && Tremor.NoZoneAllowWater(spawnInfo)) && y > Main.rockLayer ? 0.01f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && NPC.downedMoonlord && Tremor.NoZoneAllowWater(spawnInfo)) && y > Main.rockLayer ? 0.01f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/FlamingReaper.cs b/NPCs/FlamingReaper.cs index 3b4f7fb6..48364afb 100644 --- a/NPCs/FlamingReaper.cs +++ b/NPCs/FlamingReaper.cs @@ -7,47 +7,49 @@ using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class FlamingReaper : ModNPC +namespace Tremor.NPCs { + + public class FlamingReaper : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Flaming Reaper"); } - - public override void SetDefaults() - { - npc.lifeMax = 100; - npc.damage = 60; - npc.defense = 24; - npc.knockBackResist = 0f; - npc.width = 34; - npc.height = 34; - animationType = 0; - npc.aiStyle = 63; - npc.noGravity = true; - npc.npcSlots = 15f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath6; - npc.value = Item.buyPrice(0, 0, 0, 9); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 100; + npc.damage = 60; + npc.defense = 24; + npc.knockBackResist = 0f; + npc.width = 34; + npc.height = 34; + animationType = 0; + npc.aiStyle = 63; + npc.noGravity = true; + npc.npcSlots = 15f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath6; + npc.value = Item.buyPrice(0, 0, 0, 9); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - } -} + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + } + } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/Flayer.cs b/NPCs/Flayer.cs index ad99c878..6cd56cdf 100644 --- a/NPCs/Flayer.cs +++ b/NPCs/Flayer.cs @@ -13,7 +13,7 @@ public override void SetStaticDefaults() DisplayName.SetDefault("Flayer"); Main.npcFrameCount[npc.type] = 7; } - + public override void SetDefaults() { npc.width = 40; @@ -23,46 +23,46 @@ public override void SetDefaults() npc.lifeMax = 1000; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; - npc.value = Item.buyPrice(0, 0, 85, 7); + npc.value = Item.buyPrice(0, 0, 85, 7); npc.knockBackResist = 0.5f; npc.aiStyle = 3; aiType = 434; - npc.aiStyle = 3; + npc.aiStyle = 3; animationType = 434; - banner = npc.type; - bannerItem = mod.ItemType("FlayerBanner"); + banner = npc.type; + bannerItem = mod.ItemType("FlayerBanner"); } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FlayerGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FlayerGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FlayerGore4"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FlayerGore4"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FlayerGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FlayerGore3"), 1f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FlayerGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FlayerGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FlayerGore4"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FlayerGore4"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FlayerGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FlayerGore3"), 1f); + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedPlantBoss && Main.bloodMoon && y < Main.worldSurface ? 0.01f : 0f; - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedPlantBoss && Main.bloodMoon && y < Main.worldSurface ? 0.01f : 0f; + } } } diff --git a/NPCs/FlyingJelly.cs b/NPCs/FlyingJelly.cs index 28c8091c..f8023beb 100644 --- a/NPCs/FlyingJelly.cs +++ b/NPCs/FlyingJelly.cs @@ -6,19 +6,20 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class FlyingJelly : ModNPC +namespace Tremor.NPCs { + + public class FlyingJelly : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Flying Jelly"); Main.npcFrameCount[npc.type] = 6; } - - public override void SetDefaults() - { + + public override void SetDefaults() + { npc.width = 30; npc.height = 30; npc.damage = 28; @@ -28,37 +29,38 @@ public override void SetDefaults() npc.DeathSound = SoundID.NPCDeath28; npc.knockBackResist = 0.1f; aiType = 472; - npc.noGravity = true; - npc.aiStyle = 86; + npc.noGravity = true; + npc.aiStyle = 86; animationType = 472; - } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 60; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - } - else - { + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 60; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + } + else + { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 226, (float)hitDirection, -2f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } - } + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 226, (float)hitDirection, -2f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, (float)hitDirection, -1f, 0, default(Color), 0.7f); + } + } + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/FlyingLeech.cs b/NPCs/FlyingLeech.cs index 528ed288..680190ae 100644 --- a/NPCs/FlyingLeech.cs +++ b/NPCs/FlyingLeech.cs @@ -6,46 +6,48 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class FlyingLeech : ModNPC +namespace Tremor.NPCs { + + public class FlyingLeech : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Flying Leech"); Main.npcFrameCount[npc.type] = 2; } - - public override void SetDefaults() - { - npc.lifeMax = 80; - npc.damage = 20; - npc.defense = 10; - npc.knockBackResist = 0.5f; - npc.width = 74; - npc.height = 42; - animationType = 2; - npc.aiStyle = 2; - npc.noGravity = true; - npc.npcSlots = 1f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.value = Item.buyPrice(0, 0, 32, 20); - banner = npc.type; - bannerItem = mod.ItemType("FlyingLeechBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 80; + npc.damage = 20; + npc.defense = 10; + npc.knockBackResist = 0.5f; + npc.width = 74; + npc.height = 42; + animationType = 2; + npc.aiStyle = 2; + npc.noGravity = true; + npc.npcSlots = 1f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.value = Item.buyPrice(0, 0, 32, 20); + banner = npc.type; + bannerItem = mod.ItemType("FlyingLeechBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedBoss2 && spawnInfo.player.ZoneCrimson && y < Main.worldSurface ? 0.02f : 0; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedBoss2 && spawnInfo.player.ZoneCrimson && y < Main.worldSurface ? 0.02f : 0; + } + } +} \ No newline at end of file diff --git a/NPCs/ForestSpirit.cs b/NPCs/ForestSpirit.cs index 61bb1873..42ca437b 100644 --- a/NPCs/ForestSpirit.cs +++ b/NPCs/ForestSpirit.cs @@ -10,58 +10,58 @@ namespace Tremor.NPCs { -public class ForestSpirit : ModNPC -{ + public class ForestSpirit : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Forest Spirit"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 180; - npc.damage = 15; - npc.defense = 10; - npc.knockBackResist = 0.3f; - npc.width = 34; - npc.height = 48; - animationType = 316; - npc.aiStyle = 22; - npc.npcSlots = 0.4f; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit44; - npc.noGravity = true; - npc.DeathSound = SoundID.NPCDeath58; - npc.value = Item.buyPrice(0, 0, 4, 15); - banner = npc.type; - bannerItem = mod.ItemType("ForestSpiritBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 180; + npc.damage = 15; + npc.defense = 10; + npc.knockBackResist = 0.3f; + npc.width = 34; + npc.height = 48; + animationType = 316; + npc.aiStyle = 22; + npc.npcSlots = 0.4f; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit44; + npc.noGravity = true; + npc.DeathSound = SoundID.NPCDeath58; + npc.value = Item.buyPrice(0, 0, 4, 15); + banner = npc.type; + bannerItem = mod.ItemType("ForestSpiritBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if (npc.life <= 0) - { - for (int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - } - } + } + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedBoss2 && !Main.dayTime && y < Main.worldSurface ? 0.1f : 0f; - } - } - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedBoss2 && !Main.dayTime && y < Main.worldSurface ? 0.1f : 0f; + } + } +} diff --git a/NPCs/ForgeMaster.cs b/NPCs/ForgeMaster.cs index b00e4fce..4c643144 100644 --- a/NPCs/ForgeMaster.cs +++ b/NPCs/ForgeMaster.cs @@ -6,10 +6,11 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { -[AutoloadHead] -public class ForgeMaster : ModNPC +namespace Tremor.NPCs { + [AutoloadHead] + public class ForgeMaster : ModNPC + { public override string Texture { get @@ -17,14 +18,14 @@ public override string Texture return "Tremor/NPCs/ForgeMaster"; } } - + public override string[] AltTextures { get { - return new string[] { "Tremor/NPCs/ForgeMaster"}; + return new string[] { "Tremor/NPCs/ForgeMaster" }; } - } + } public override bool Autoload(ref string name) { @@ -45,21 +46,21 @@ public override void SetStaticDefaults() } - public override void SetDefaults() - { - npc.townNPC = true; - npc.friendly = true; - npc.width = 28; - npc.height = 48; - npc.aiStyle = 7; - npc.damage = 10; - npc.defense = 15; - npc.lifeMax = 250; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.knockBackResist = 0.5f; - animationType = NPCID.Guide; - } + public override void SetDefaults() + { + npc.townNPC = true; + npc.friendly = true; + npc.width = 28; + npc.height = 48; + npc.aiStyle = 7; + npc.damage = 10; + npc.defense = 15; + npc.lifeMax = 250; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.knockBackResist = 0.5f; + animationType = NPCID.Guide; + } public override bool CanTownNPCSpawn(int numTownNPCs, int money) { @@ -80,200 +81,201 @@ public override bool CanTownNPCSpawn(int numTownNPCs, int money) return false; } - public override string TownNPCName() - { - switch(WorldGen.genRand.Next(5)) - { - case 0: - return "Gefest"; - case 1: - return "Aule"; - case 2: - return "Agarorn"; - case 3: - return "Treak"; - case 4: - return "Haymer"; - default: - return "Golan"; - } - } + public override string TownNPCName() + { + switch (WorldGen.genRand.Next(5)) + { + case 0: + return "Gefest"; + case 1: + return "Aule"; + case 2: + return "Agarorn"; + case 3: + return "Treak"; + case 4: + return "Haymer"; + default: + return "Golan"; + } + } - public override string GetChat() - { - switch(Main.rand.Next(6)) - { - case 0: - return "You can't lift my hammer? Not surprising! That's because you are not worthy!"; - case 1: - return "Strangely but nobody uses hammers for making bars. How do you just put ore into furnaces and get bars!? That is insane!"; - case 2: - return "Valar Morghulis! Oh wait, that's not the Braavos! Forget what I've said."; - case 3: - return "What? You ask me who am I?! I am the son of the Vulcan and the Vulcan is the mighty anvilborn!"; - case 4: - return "My bars are better because I make them with my hammer. If you won't buy my bars I will make a bar from you."; - case 5: - return "You wonder why people call me Forge Master!? What means you don't believe I'm the real Master of Forges!?"; - default: - return "Be careful when working with forges. I got burnt once when I was taking off a bar from it. That's why I'm wearing such armor!"; - } - } + public override string GetChat() + { + switch (Main.rand.Next(6)) + { + case 0: + return "You can't lift my hammer? Not surprising! That's because you are not worthy!"; + case 1: + return "Strangely but nobody uses hammers for making bars. How do you just put ore into furnaces and get bars!? That is insane!"; + case 2: + return "Valar Morghulis! Oh wait, that's not the Braavos! Forget what I've said."; + case 3: + return "What? You ask me who am I?! I am the son of the Vulcan and the Vulcan is the mighty anvilborn!"; + case 4: + return "My bars are better because I make them with my hammer. If you won't buy my bars I will make a bar from you."; + case 5: + return "You wonder why people call me Forge Master!? What means you don't believe I'm the real Master of Forges!?"; + default: + return "Be careful when working with forges. I got burnt once when I was taking off a bar from it. That's why I'm wearing such armor!"; + } + } - public override void SetChatButtons(ref string button, ref string button2) - { - button = Lang.inter[28].Value; - } + public override void SetChatButtons(ref string button, ref string button2) + { + button = Lang.inter[28].Value; + } - public override void OnChatButtonClicked(bool firstButton, ref bool shop) - { - if(firstButton) - { - shop = true; - } - } + public override void OnChatButtonClicked(bool firstButton, ref bool shop) + { + if (firstButton) + { + shop = true; + } + } - public override void SetupShop(Chest shop, ref int nextSlot) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("GreatAnvil")); - nextSlot++; - if(Main.dayTime) - { - shop.item[nextSlot].SetDefaults(ItemID.CopperBar); - nextSlot++; - shop.item[nextSlot].SetDefaults(ItemID.IronBar); - nextSlot++; - shop.item[nextSlot].SetDefaults(ItemID.SilverBar); - nextSlot++; - } - if(!Main.dayTime) - { - shop.item[nextSlot].SetDefaults(ItemID.TinBar); - nextSlot++; - shop.item[nextSlot].SetDefaults(ItemID.LeadBar); - nextSlot++; - shop.item[nextSlot].SetDefaults(ItemID.TungstenBar); - nextSlot++; - } + public override void SetupShop(Chest shop, ref int nextSlot) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("GreatAnvil")); + nextSlot++; + if (Main.dayTime) + { + shop.item[nextSlot].SetDefaults(ItemID.CopperBar); + nextSlot++; + shop.item[nextSlot].SetDefaults(ItemID.IronBar); + nextSlot++; + shop.item[nextSlot].SetDefaults(ItemID.SilverBar); + nextSlot++; + } + if (!Main.dayTime) + { + shop.item[nextSlot].SetDefaults(ItemID.TinBar); + nextSlot++; + shop.item[nextSlot].SetDefaults(ItemID.LeadBar); + nextSlot++; + shop.item[nextSlot].SetDefaults(ItemID.TungstenBar); + nextSlot++; + } - if(NPC.downedBoss2 && Main.dayTime) - { - shop.item[nextSlot].SetDefaults(ItemID.GoldBar); - nextSlot++; - } - if(NPC.downedBoss2 && !Main.dayTime) - { - shop.item[nextSlot].SetDefaults(ItemID.PlatinumBar); - nextSlot++; - } - if(NPC.downedBoss2) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("PoisonRod")); - nextSlot++; - } + if (NPC.downedBoss2 && Main.dayTime) + { + shop.item[nextSlot].SetDefaults(ItemID.GoldBar); + nextSlot++; + } + if (NPC.downedBoss2 && !Main.dayTime) + { + shop.item[nextSlot].SetDefaults(ItemID.PlatinumBar); + nextSlot++; + } + if (NPC.downedBoss2) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("PoisonRod")); + nextSlot++; + } - if(NPC.downedBoss3 && Main.dayTime) - { - shop.item[nextSlot].SetDefaults(ItemID.DemoniteBar); - nextSlot++; - } - if(NPC.downedBoss3 && !Main.dayTime) - { - shop.item[nextSlot].SetDefaults(ItemID.CrimtaneBar); - nextSlot++; - } - if(NPC.downedBoss3) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("BurningHammer")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("PerfectBehemoth")); - nextSlot++; - } + if (NPC.downedBoss3 && Main.dayTime) + { + shop.item[nextSlot].SetDefaults(ItemID.DemoniteBar); + nextSlot++; + } + if (NPC.downedBoss3 && !Main.dayTime) + { + shop.item[nextSlot].SetDefaults(ItemID.CrimtaneBar); + nextSlot++; + } + if (NPC.downedBoss3) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("BurningHammer")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("PerfectBehemoth")); + nextSlot++; + } - if(Main.hardMode) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("GoldenMace")); - nextSlot++; - shop.item[nextSlot].SetDefaults(ItemID.HellstoneBar); - nextSlot++; - } + if (Main.hardMode) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("GoldenMace")); + nextSlot++; + shop.item[nextSlot].SetDefaults(ItemID.HellstoneBar); + nextSlot++; + } - if(NPC.downedMechBossAny && Main.dayTime) - { - shop.item[nextSlot].SetDefaults(ItemID.CobaltBar); - nextSlot++; - shop.item[nextSlot].SetDefaults(ItemID.MythrilBar); - nextSlot++; - shop.item[nextSlot].SetDefaults(ItemID.AdamantiteBar); - nextSlot++; - } - if(NPC.downedMechBossAny && !Main.dayTime) - { - shop.item[nextSlot].SetDefaults(ItemID.PalladiumBar); - nextSlot++; - shop.item[nextSlot].SetDefaults(ItemID.OrichalcumBar); - nextSlot++; - shop.item[nextSlot].SetDefaults(ItemID.TitaniumBar); - nextSlot++; - } + if (NPC.downedMechBossAny && Main.dayTime) + { + shop.item[nextSlot].SetDefaults(ItemID.CobaltBar); + nextSlot++; + shop.item[nextSlot].SetDefaults(ItemID.MythrilBar); + nextSlot++; + shop.item[nextSlot].SetDefaults(ItemID.AdamantiteBar); + nextSlot++; + } + if (NPC.downedMechBossAny && !Main.dayTime) + { + shop.item[nextSlot].SetDefaults(ItemID.PalladiumBar); + nextSlot++; + shop.item[nextSlot].SetDefaults(ItemID.OrichalcumBar); + nextSlot++; + shop.item[nextSlot].SetDefaults(ItemID.TitaniumBar); + nextSlot++; + } - if(NPC.downedPlantBoss) - { - shop.item[nextSlot].SetDefaults(ItemID.HallowedBar); - nextSlot++; - } + if (NPC.downedPlantBoss) + { + shop.item[nextSlot].SetDefaults(ItemID.HallowedBar); + nextSlot++; + } - if(NPC.downedGolemBoss) - { - shop.item[nextSlot].SetDefaults(ItemID.ChlorophyteBar); - nextSlot++; - } + if (NPC.downedGolemBoss) + { + shop.item[nextSlot].SetDefaults(ItemID.ChlorophyteBar); + nextSlot++; + } - if(NPC.downedAncientCultist) - { - shop.item[nextSlot].SetDefaults(ItemID.SpectreBar); - nextSlot++; - } - } + if (NPC.downedAncientCultist) + { + shop.item[nextSlot].SetDefaults(ItemID.SpectreBar); + nextSlot++; + } + } - public override void TownNPCAttackStrength(ref int damage, ref float knockback) - { - damage = 22; - knockback = 3f; - } + public override void TownNPCAttackStrength(ref int damage, ref float knockback) + { + damage = 22; + knockback = 3f; + } - public override void TownNPCAttackCooldown(ref int cooldown, ref int randExtraCooldown) - { - cooldown = 10; - randExtraCooldown = 10; - } + public override void TownNPCAttackCooldown(ref int cooldown, ref int randExtraCooldown) + { + cooldown = 10; + randExtraCooldown = 10; + } - public override void TownNPCAttackProj(ref int projType, ref int attackDelay) - { - projType = mod.ProjectileType("BurningHammerPro"); - attackDelay = 4; - } + public override void TownNPCAttackProj(ref int projType, ref int attackDelay) + { + projType = mod.ProjectileType("BurningHammerPro"); + attackDelay = 4; + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BlackSmithGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BlackSmithGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BlackSmithGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BlackSmithGore4"), 1f); + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BlackSmithGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BlackSmithGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BlackSmithGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/BlackSmithGore4"), 1f); - } -} + } + } - public override void TownNPCAttackProjSpeed(ref float multiplier, ref float gravityCorrection, ref float randomOffset) - { - multiplier = 12f; - randomOffset = 2f; - } -}} \ No newline at end of file + public override void TownNPCAttackProjSpeed(ref float multiplier, ref float gravityCorrection, ref float randomOffset) + { + multiplier = 12f; + randomOffset = 2f; + } + } +} \ No newline at end of file diff --git a/NPCs/FrostBeetle.cs b/NPCs/FrostBeetle.cs index b5e181c5..d7acddf5 100644 --- a/NPCs/FrostBeetle.cs +++ b/NPCs/FrostBeetle.cs @@ -6,96 +6,98 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class FrostBeetle : ModNPC +namespace Tremor.NPCs { + + public class FrostBeetle : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Frost Beetle"); Main.npcFrameCount[npc.type] = 6; } - - public override void SetDefaults() - { - npc.lifeMax = 3000; - npc.damage = 150; - npc.defense = 72; - npc.knockBackResist = 0.1f; - npc.width = 40; - npc.height = 40; - animationType = 508; - npc.aiStyle = 3; - aiType = 508; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit41; - npc.buffImmune[20] = true; - npc.buffImmune[24] = true; - npc.buffImmune[39] = true; - npc.buffImmune[31] = false; - npc.DeathSound = SoundID.NPCDeath44; - npc.value = Item.buyPrice(0, 0, 12, 0); - banner = npc.type; - bannerItem = mod.ItemType("FrostBeetleBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 3000; + npc.damage = 150; + npc.defense = 72; + npc.knockBackResist = 0.1f; + npc.width = 40; + npc.height = 40; + animationType = 508; + npc.aiStyle = 3; + aiType = 508; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit41; + npc.buffImmune[20] = true; + npc.buffImmune[24] = true; + npc.buffImmune[39] = true; + npc.buffImmune[31] = false; + npc.DeathSound = SoundID.NPCDeath44; + npc.value = Item.buyPrice(0, 0, 12, 0); + banner = npc.type; + bannerItem = mod.ItemType("FrostBeetleBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 593, 3); - } - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 664, 3); - } - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FrostCore"), 3); - } - if(NPC.downedMoonlord && Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); - } - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 593, 3); + } + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 664, 3); + } + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FrostCore"), 3); + } + if (NPC.downedMoonlord && Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); + } + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IBGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IBGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IBGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IBGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IBGore2"), 1f); - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); - } - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IBGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IBGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IBGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IBGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IBGore2"), 1f); + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); + } + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return Main.hardMode && NPC.downedMoonlord && spawnInfo.player.ZoneSnow && y > Main.rockLayer ? 0.01f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return Main.hardMode && NPC.downedMoonlord && spawnInfo.player.ZoneSnow && y > Main.rockLayer ? 0.01f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/FrostKing.cs b/NPCs/FrostKing.cs index 6988bd94..a8176114 100644 --- a/NPCs/FrostKing.cs +++ b/NPCs/FrostKing.cs @@ -10,314 +10,314 @@ namespace Tremor.NPCs { [AutoloadBossHead] - public class FrostKing : ModNPC - { + public class FrostKing : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Frost King"); Main.npcFrameCount[npc.type] = 8; } - - private float timeToNextFrame = 0; - private int frame = 0; - public override void SetDefaults() - { - npc.aiStyle = -1; - npc.lifeMax = 60000; - npc.damage = 78; - npc.defense = 65; - npc.knockBackResist = 0f; - npc.width = 252; - npc.height = 254; - npc.value = Item.buyPrice(0, 0, 15, 0); - npc.npcSlots = 1; - npc.boss = true; - npc.lavaImmune = true; - npc.noGravity = true; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit41; - bossBag = mod.ItemType("FrostKingBag"); - npc.DeathSound = SoundID.NPCDeath44; - } + private float timeToNextFrame = 0; + private int frame = 0; - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FrostKingGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FrostKingGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FrostKingGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FrostKingGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FrostKingGore4"), 1f); - } -} + public override void SetDefaults() + { + npc.aiStyle = -1; + npc.lifeMax = 60000; + npc.damage = 78; + npc.defense = 65; + npc.knockBackResist = 0f; + npc.width = 252; + npc.height = 254; + npc.value = Item.buyPrice(0, 0, 15, 0); + npc.npcSlots = 1; + npc.boss = true; + npc.lavaImmune = true; + npc.noGravity = true; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit41; + bossBag = mod.ItemType("FrostKingBag"); + npc.DeathSound = SoundID.NPCDeath44; + } - private float timeToAtack = 2; - private float vel = 2.5f; - private float lifeTime = 0; - private int minTimeToAtack = 3; - private int maxTimeToAtack = 5; - private Vector2 localTargPos = new Vector2(666, 666); - private int mode = 0; - private float atackTimer = 0; - private float atackLenghtTimer = 0; - private float preAtack = 0; + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FrostKingGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FrostKingGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FrostKingGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FrostKingGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FrostKingGore4"), 1f); + } + } - public Vector2 bossCenter - { - get { return npc.Center; } - set { npc.position = value - new Vector2(npc.width / 2, npc.height / 2); } - } + private float timeToAtack = 2; + private float vel = 2.5f; + private float lifeTime = 0; + private int minTimeToAtack = 3; + private int maxTimeToAtack = 5; + private Vector2 localTargPos = new Vector2(666, 666); + private int mode = 0; + private float atackTimer = 0; + private float atackLenghtTimer = 0; + private float preAtack = 0; - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 0.625f * bossLifeScale); - npc.damage = (int)(npc.damage * 0.6f); - } + public Vector2 bossCenter + { + get { return npc.Center; } + set { npc.position = value - new Vector2(npc.width / 2, npc.height / 2); } + } - private void findNewLocalTargetPos () - { - float a = Main.rand.Next(0, (int)(Math.PI) * 200) / 100f; - float r = Main.rand.Next(0, 5000) / 100f; - localTargPos = new Vector2((float)Math.Cos(a) * r, (float)Math.Sin(a) * r); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 0.625f * bossLifeScale); + npc.damage = (int)(npc.damage * 0.6f); + } - public override void AI() - { -bool allDead = false; -for(int i = 0; i < Main.player.Length; i++) -{ - if(Main.player[i].dead) allDead = true; -} + private void findNewLocalTargetPos() + { + float a = Main.rand.Next(0, (int)(Math.PI) * 200) / 100f; + float r = Main.rand.Next(0, 5000) / 100f; + localTargPos = new Vector2((float)Math.Cos(a) * r, (float)Math.Sin(a) * r); + } + + public override void AI() + { + bool allDead = false; + for (int i = 0; i < Main.player.Length; i++) + { + if (Main.player[i].dead) allDead = true; + } - if (allDead) - { - if (npc.velocity.X > 0f) - { - npc.velocity.X = npc.velocity.X + 0.75f; - } - else - { - npc.velocity.X = npc.velocity.X - 0.75f; - } - npc.velocity.Y = npc.velocity.Y - 0.1f; - npc.rotation = npc.velocity.X * 0.05f; - } + if (allDead) + { + if (npc.velocity.X > 0f) + { + npc.velocity.X = npc.velocity.X + 0.75f; + } + else + { + npc.velocity.X = npc.velocity.X - 0.75f; + } + npc.velocity.Y = npc.velocity.Y - 0.1f; + npc.rotation = npc.velocity.X * 0.05f; + } - lifeTime += 0.016f; - Player player = Main.player[npc.target]; - Vector2 targetPos = player.Center + localTargPos ; - if (localTargPos == new Vector2(666, 666) || Vector2.Distance(bossCenter, targetPos) < 5) - { - findNewLocalTargetPos(); - } - Lighting.AddLight(bossCenter, 0.8f, 0.8f, 1f); - if (mode == 0) - { - bossCenter = Vector2.Lerp(bossCenter, targetPos, 0.01f); - } - else if (mode == 1) - { - bossCenter = Vector2.Lerp(bossCenter, targetPos, 0.005f); - if (preAtack > 0) - { - preAtack -= 0.016f; - } - else - { - if (atackLenghtTimer > 0) - { - atackLenghtTimer -= 0.016f; - if (atackTimer > 0) - { - atackTimer -= 0.016f; - } - else - { - for (int i = 0; i < 30; i++) - { - float angle = Main.rand.Next(0, (int)(Math.PI) * 200) / 100f; - Vector2 velocity = new Vector2((float)Math.Cos(angle), (float)Math.Sin(angle)) * 25; - Projectile.NewProjectile(bossCenter.X - 90, bossCenter.Y + 7, velocity.X, velocity.Y, 349, 20, 5); - } - atackTimer = 0.3f; - } - } - else - { - mode = 0; - } - } - } - else if (mode == 2) - { - bossCenter = Vector2.Lerp(bossCenter, targetPos, 0.005f); - if (preAtack>0) - { - preAtack -= 0.016f; - } - else - { - if (atackLenghtTimer>0) - { - atackLenghtTimer -= 0.016f; - if (atackTimer>0) - { - atackTimer -= 0.016f; - } - else - { - Vector2 shootPos = bossCenter + new Vector2(88, 32); - float angle = (float)Math.Atan2(targetPos.Y - shootPos.Y, targetPos.X - shootPos.X) + Main.rand.Next((int)(Math.PI * -100f), (int)(Math.PI * 100f)) / 3600f; - Vector2 velocity = new Vector2((float)Math.Cos(angle), (float)Math.Sin(angle)) * 20; - Projectile.NewProjectile(shootPos.X, shootPos.Y, velocity.X, velocity.Y, 348, 40, 5); - atackTimer = 1; - } - } - else - { - mode = 0; - } - } - } - else - { - bossCenter = Vector2.Lerp(bossCenter, targetPos, 0.005f); - if (preAtack>0) - { - preAtack -= 0.016f; - } - else - { - if (atackLenghtTimer > 0) - { - atackLenghtTimer -= 0.016f; - if (atackTimer>0) - { - atackTimer -= 0.016f; - } - else - { - Vector2 shootPos = bossCenter + new Vector2(-90, 25); - Projectile.NewProjectile(shootPos.X, shootPos.Y, -20, 0, 464, 40, 5); - shootPos = bossCenter + new Vector2(90, 25); - Projectile.NewProjectile(shootPos.X, shootPos.Y, 20, 0, 464, 40, 5); - atackTimer = 3; - } - } - else - { - mode = 0; - } - } - } - if (timeToNextFrame > 0) - { - timeToNextFrame -= 0.016f; - } - else - { - if (mode == 0) - { - timeToNextFrame = 0.1f; - if (frame < 4) - { - frame++; - } - else - { - frame = 0; - } - } - else - { - frame = 4 + mode; - } - } - if (timeToAtack > 0) - { - timeToAtack -= 0.016f; - } - else - { - Shoot(player, Main.rand.Next(0, 3)); - } - if (Vector2.Distance(targetPos, bossCenter) > 10000 && Main.dayTime) - { - npc.active = false; - } - } + lifeTime += 0.016f; + Player player = Main.player[npc.target]; + Vector2 targetPos = player.Center + localTargPos; + if (localTargPos == new Vector2(666, 666) || Vector2.Distance(bossCenter, targetPos) < 5) + { + findNewLocalTargetPos(); + } + Lighting.AddLight(bossCenter, 0.8f, 0.8f, 1f); + if (mode == 0) + { + bossCenter = Vector2.Lerp(bossCenter, targetPos, 0.01f); + } + else if (mode == 1) + { + bossCenter = Vector2.Lerp(bossCenter, targetPos, 0.005f); + if (preAtack > 0) + { + preAtack -= 0.016f; + } + else + { + if (atackLenghtTimer > 0) + { + atackLenghtTimer -= 0.016f; + if (atackTimer > 0) + { + atackTimer -= 0.016f; + } + else + { + for (int i = 0; i < 30; i++) + { + float angle = Main.rand.Next(0, (int)(Math.PI) * 200) / 100f; + Vector2 velocity = new Vector2((float)Math.Cos(angle), (float)Math.Sin(angle)) * 25; + Projectile.NewProjectile(bossCenter.X - 90, bossCenter.Y + 7, velocity.X, velocity.Y, 349, 20, 5); + } + atackTimer = 0.3f; + } + } + else + { + mode = 0; + } + } + } + else if (mode == 2) + { + bossCenter = Vector2.Lerp(bossCenter, targetPos, 0.005f); + if (preAtack > 0) + { + preAtack -= 0.016f; + } + else + { + if (atackLenghtTimer > 0) + { + atackLenghtTimer -= 0.016f; + if (atackTimer > 0) + { + atackTimer -= 0.016f; + } + else + { + Vector2 shootPos = bossCenter + new Vector2(88, 32); + float angle = (float)Math.Atan2(targetPos.Y - shootPos.Y, targetPos.X - shootPos.X) + Main.rand.Next((int)(Math.PI * -100f), (int)(Math.PI * 100f)) / 3600f; + Vector2 velocity = new Vector2((float)Math.Cos(angle), (float)Math.Sin(angle)) * 20; + Projectile.NewProjectile(shootPos.X, shootPos.Y, velocity.X, velocity.Y, 348, 40, 5); + atackTimer = 1; + } + } + else + { + mode = 0; + } + } + } + else + { + bossCenter = Vector2.Lerp(bossCenter, targetPos, 0.005f); + if (preAtack > 0) + { + preAtack -= 0.016f; + } + else + { + if (atackLenghtTimer > 0) + { + atackLenghtTimer -= 0.016f; + if (atackTimer > 0) + { + atackTimer -= 0.016f; + } + else + { + Vector2 shootPos = bossCenter + new Vector2(-90, 25); + Projectile.NewProjectile(shootPos.X, shootPos.Y, -20, 0, 464, 40, 5); + shootPos = bossCenter + new Vector2(90, 25); + Projectile.NewProjectile(shootPos.X, shootPos.Y, 20, 0, 464, 40, 5); + atackTimer = 3; + } + } + else + { + mode = 0; + } + } + } + if (timeToNextFrame > 0) + { + timeToNextFrame -= 0.016f; + } + else + { + if (mode == 0) + { + timeToNextFrame = 0.1f; + if (frame < 4) + { + frame++; + } + else + { + frame = 0; + } + } + else + { + frame = 4 + mode; + } + } + if (timeToAtack > 0) + { + timeToAtack -= 0.016f; + } + else + { + Shoot(player, Main.rand.Next(0, 3)); + } + if (Vector2.Distance(targetPos, bossCenter) > 10000 && Main.dayTime) + { + npc.active = false; + } + } - private void Shoot(Player player, int type) - { - mode = type + 1; - if (type == 0) - { - timeToAtack = Main.rand.Next(5 + minTimeToAtack, 5 + maxTimeToAtack + 1); - atackLenghtTimer = 5; - } - else if (type == 1) - { - timeToAtack = Main.rand.Next(5 + minTimeToAtack, 5 + maxTimeToAtack + 1); - atackLenghtTimer = 5; - } - else - { - timeToAtack = Main.rand.Next(7 + minTimeToAtack, 9 + maxTimeToAtack + 1); - atackLenghtTimer = 7; - } - preAtack = 0.5f; - } + private void Shoot(Player player, int type) + { + mode = type + 1; + if (type == 0) + { + timeToAtack = Main.rand.Next(5 + minTimeToAtack, 5 + maxTimeToAtack + 1); + atackLenghtTimer = 5; + } + else if (type == 1) + { + timeToAtack = Main.rand.Next(5 + minTimeToAtack, 5 + maxTimeToAtack + 1); + atackLenghtTimer = 5; + } + else + { + timeToAtack = Main.rand.Next(7 + minTimeToAtack, 9 + maxTimeToAtack + 1); + atackLenghtTimer = 7; + } + preAtack = 0.5f; + } - private float clamp(float value, float min, float max) - { - if (value < min) - { - return min; - } - else if (value > max) - { - return max; - } - else - { - return value; - } - } + private float clamp(float value, float min, float max) + { + if (value < min) + { + return min; + } + else if (value > max) + { + return max; + } + else + { + return value; + } + } - public override void FindFrame(int frameHeight) - { - npc.frame.Y = frameHeight * frame + 2; - } + public override void FindFrame(int frameHeight) + { + npc.frame.Y = frameHeight * frame + 2; + } - public override void NPCLoot() - { - if(Main.expertMode) - { - npc.DropBossBags(); - } - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; + public override void NPCLoot() + { + if (Main.expertMode) + { + npc.DropBossBags(); + } + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; - if(!Main.expertMode && Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FrostKingMask")); - } - if(Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FrostKingTrophy")); - } - if(!Main.expertMode && Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FrostoneOre"), Main.rand.Next(24, 42)); - } - TremorWorld.downedFrostKing = true; - } - } - } + if (!Main.expertMode && Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FrostKingMask")); + } + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FrostKingTrophy")); + } + if (!Main.expertMode && Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FrostoneOre"), Main.rand.Next(24, 42)); + } + TremorWorld.downedFrostKing = true; + } + } + } } diff --git a/NPCs/FungusBeetle.cs b/NPCs/FungusBeetle.cs index 78f35572..c7c129b1 100644 --- a/NPCs/FungusBeetle.cs +++ b/NPCs/FungusBeetle.cs @@ -6,86 +6,87 @@ using Terraria.ModLoader; -namespace Tremor.NPCs { +namespace Tremor.NPCs +{ [AutoloadBossHead] - public class FungusBeetle : ModNPC - { + public class FungusBeetle : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Fungus Beetle"); Main.npcFrameCount[npc.type] = 4; } - - Vector2 Hands = new Vector2(-1, -1); - public override void SetDefaults() - { - npc.lifeMax = 4200; - npc.width = 214; - npc.height = 114; - animationType = 82; - npc.damage = 30; - npc.defense = 25; - npc.knockBackResist = 0f; - npc.aiStyle = 14; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit35; - npc.noGravity = true; - npc.DeathSound = SoundID.NPCDeath57; - npc.color = Color.White; - npc.boss = true; - npc.noTileCollide = true; - bossBag = mod.ItemType("FungusBeetleBag"); - } - + + Vector2 Hands = new Vector2(-1, -1); + public override void SetDefaults() + { + npc.lifeMax = 4200; + npc.width = 214; + npc.height = 114; + animationType = 82; + npc.damage = 30; + npc.defense = 25; + npc.knockBackResist = 0f; + npc.aiStyle = 14; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit35; + npc.noGravity = true; + npc.DeathSound = SoundID.NPCDeath57; + npc.color = Color.White; + npc.boss = true; + npc.noTileCollide = true; + bossBag = mod.ItemType("FungusBeetleBag"); + } + public override void NPCLoot() { - if(Main.expertMode) - { - npc.DropBossBags(); - } - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(!Main.expertMode && Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FungusBeetleMask")); - } - if(Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FungusBeetleTrophy")); - } - if(!Main.expertMode ) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FungusElement"), Main.rand.Next(10, 23)); - } - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 28, Main.rand.Next(9, 22)); - TremorWorld.downedFungusBeetle = true; + if (Main.expertMode) + { + npc.DropBossBags(); + } + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (!Main.expertMode && Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FungusBeetleMask")); + } + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FungusBeetleTrophy")); + } + if (!Main.expertMode) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FungusElement"), Main.rand.Next(10, 23)); + } + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 28, Main.rand.Next(9, 22)); + TremorWorld.downedFungusBeetle = true; + } + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FungusBeetleGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FungusBeetleGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FungusBeetleGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FungusBeetleGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FungusBeetleGore4"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FungusBeetleGore4"), 1f); + for (int k = 0; k < 10; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 67, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + } + + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 67, (float)hitDirection, -1f, 0, default(Color), 0.7f); + } } - } - - public override void HitEffect(int hitDirection, double damage) - { - if (npc.life <= 0) - { - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FungusBeetleGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FungusBeetleGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FungusBeetleGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FungusBeetleGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FungusBeetleGore4"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FungusBeetleGore4"), 1f); - for (int k = 0; k < 10; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 67, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - } - - for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 67, (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { @@ -93,237 +94,237 @@ public override void ScaleExpertStats(int numPlayers, float bossLifeScale) npc.damage = (int)(npc.damage * 0.6f); } - const string Boss_Left_Hand_Type = "Violeum_LeftArm"; - const string Boss_Right_Hand_Type = "Violeum_RightArm"; - const string Boss_Up_Hand_Type = "Violeum_LeftArm"; - const string Boss_Down_Hand_Type = "Violeum_RightArm"; - - void MakeHands() - { - Hands.X = NPC.NewNPC((int)npc.Center.X - 50, (int)npc.Center.Y, mod.NPCType(Boss_Left_Hand_Type), 0, 1, npc.whoAmI); - Hands.Y = NPC.NewNPC((int)npc.Center.X + 50, (int)npc.Center.Y, mod.NPCType(Boss_Right_Hand_Type), 0, -1, npc.whoAmI); - Hands.Y = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y - 1000, mod.NPCType(Boss_Down_Hand_Type), 0, -1, npc.whoAmI); - Hands.Y = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y + 1000, mod.NPCType(Boss_Up_Hand_Type), 0, -1, npc.whoAmI); - } - - void CheckHands() - { - if (Hands.X != -1) - if (!((Main.npc[(int)Hands.X].type == mod.NPCType(Boss_Left_Hand_Type) && Main.npc[(int)Hands.X].ai[1] == npc.whoAmI) && Main.npc[(int)Hands.X].active)) - Hands.X = -1; - if (Hands.Y != -1) - if (!((Main.npc[(int)Hands.Y].type == mod.NPCType(Boss_Right_Hand_Type) && Main.npc[(int)Hands.Y].ai[1] == npc.whoAmI) && Main.npc[(int)Hands.Y].active)) - Hands.Y = -1; - if (Hands.X != -1) - if (!((Main.npc[(int)Hands.X].type == mod.NPCType(Boss_Up_Hand_Type) && Main.npc[(int)Hands.X].ai[1] == npc.whoAmI) && Main.npc[(int)Hands.X].active)) - Hands.X = -1; - if (Hands.Y != -1) - if (!((Main.npc[(int)Hands.Y].type == mod.NPCType(Boss_Down_Hand_Type) && Main.npc[(int)Hands.Y].ai[1] == npc.whoAmI) && Main.npc[(int)Hands.Y].active)) - Hands.Y = -1; - } - - public override void ModifyHitByProjectile(Projectile projectile, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) - { - CheckHands(); - if (Hands.Y != -1) - damage /= 10; - } - - public override void ModifyHitByItem(Player player, Item item, ref int damage, ref float knockback, ref bool crit) - { - CheckHands(); - if (Hands.Y != -1) - damage /= 10; - } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - CheckHands(); - if (Hands.Y != -1) - damage /= 10; - } - - public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit) - { - CheckHands(); - if (Hands.Y != -1) - damage /= 10; - } - - float customAi1; - bool FirstState = false; - bool SecondState = false; - public override void AI() - { + const string Boss_Left_Hand_Type = "Violeum_LeftArm"; + const string Boss_Right_Hand_Type = "Violeum_RightArm"; + const string Boss_Up_Hand_Type = "Violeum_LeftArm"; + const string Boss_Down_Hand_Type = "Violeum_RightArm"; + + void MakeHands() + { + Hands.X = NPC.NewNPC((int)npc.Center.X - 50, (int)npc.Center.Y, mod.NPCType(Boss_Left_Hand_Type), 0, 1, npc.whoAmI); + Hands.Y = NPC.NewNPC((int)npc.Center.X + 50, (int)npc.Center.Y, mod.NPCType(Boss_Right_Hand_Type), 0, -1, npc.whoAmI); + Hands.Y = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y - 1000, mod.NPCType(Boss_Down_Hand_Type), 0, -1, npc.whoAmI); + Hands.Y = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y + 1000, mod.NPCType(Boss_Up_Hand_Type), 0, -1, npc.whoAmI); + } + + void CheckHands() + { + if (Hands.X != -1) + if (!((Main.npc[(int)Hands.X].type == mod.NPCType(Boss_Left_Hand_Type) && Main.npc[(int)Hands.X].ai[1] == npc.whoAmI) && Main.npc[(int)Hands.X].active)) + Hands.X = -1; + if (Hands.Y != -1) + if (!((Main.npc[(int)Hands.Y].type == mod.NPCType(Boss_Right_Hand_Type) && Main.npc[(int)Hands.Y].ai[1] == npc.whoAmI) && Main.npc[(int)Hands.Y].active)) + Hands.Y = -1; + if (Hands.X != -1) + if (!((Main.npc[(int)Hands.X].type == mod.NPCType(Boss_Up_Hand_Type) && Main.npc[(int)Hands.X].ai[1] == npc.whoAmI) && Main.npc[(int)Hands.X].active)) + Hands.X = -1; + if (Hands.Y != -1) + if (!((Main.npc[(int)Hands.Y].type == mod.NPCType(Boss_Down_Hand_Type) && Main.npc[(int)Hands.Y].ai[1] == npc.whoAmI) && Main.npc[(int)Hands.Y].active)) + Hands.Y = -1; + } + + public override void ModifyHitByProjectile(Projectile projectile, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) + { + CheckHands(); + if (Hands.Y != -1) + damage /= 10; + } + + public override void ModifyHitByItem(Player player, Item item, ref int damage, ref float knockback, ref bool crit) + { + CheckHands(); + if (Hands.Y != -1) + damage /= 10; + } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + CheckHands(); + if (Hands.Y != -1) + damage /= 10; + } + + public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit) + { + CheckHands(); + if (Hands.Y != -1) + damage /= 10; + } + + float customAi1; + bool FirstState = false; + bool SecondState = false; + public override void AI() + { npc.position -= npc.velocity * 0.05f; - if (NPC.AnyNPCs(mod.NPCType("GreatFungusBug"))) - { - npc.dontTakeDamage = true; - } - if (!NPC.AnyNPCs(mod.NPCType("GreatFungusBug"))) - { - npc.dontTakeDamage = false; - } - -bool allDead = false; -for(int i = 0; i < Main.player.Length; i++) -{ -if(Main.player[i].dead) allDead = true; -} - -if (allDead) -{ -if (npc.velocity.X > 0f) -{ -npc.velocity.X = npc.velocity.X + 0.75f; -} -else -{ -npc.velocity.X = npc.velocity.X - 0.75f; -} -npc.velocity.Y = npc.velocity.Y - 0.1f; -npc.rotation = npc.velocity.X * 0.05f; -} - - if(Main.rand.Next(120) == 0 && !Main.expertMode) - { - NPC.NewNPC((int)npc.Center.X - 70, (int)npc.Center.Y, 261); - } - - if(Main.rand.Next(110) == 0 && Main.expertMode) - { - NPC.NewNPC((int)npc.Center.X - 70, (int)npc.Center.Y, 261); - } - - if(Main.rand.Next(200) == 0) - { - NPC.NewNPC((int)npc.Center.X - 70, (int)npc.Center.Y, mod.NPCType("LittleMushroomBug")); - } - - if(Main.rand.Next(500) == 0) - { - NPC.NewNPC((int)npc.Center.X - 70, (int)npc.Center.Y, mod.NPCType("GreatFungusBug")); - } - - if (npc.life > npc.lifeMax / 2) - { - FirstState = true; - } - - if (npc.life < npc.lifeMax / 2) - { - SecondState = true; - } - - if (Main.rand.Next(2) == 0) - { - int num706 = Dust.NewDust(npc.position, npc.width, npc.height, 67, 0f, 0f, 200, npc.color, 0.5f); - Main.dust[num706].velocity *= 0.6f; - } - if (FirstState) - { - npc.TargetClosest(); - npc.netUpdate = false; - npc.ai[1]++; - - npc.TargetClosest(true); - Vector2 PTC = Main.player[npc.target].position + new Vector2(npc.width / 2, npc.height / 2); - Vector2 NPos = npc.position + new Vector2(npc.width / 2, npc.height / 2); - npc.netUpdate = true; - - customAi1 += (Main.rand.Next(2, 5) * 0.1f) * npc.scale; - npc.netUpdate = true; - - npc.ai[1] += (Main.rand.Next(2, 5) * 0.1f) * npc.scale; - if (npc.ai[1] >= 10f) - { - npc.TargetClosest(true); - if (Main.rand.Next(60) == 0) - { - Vector2 vector8 = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height / 2)); - float rotation = (float)Math.Atan2(vector8.Y - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), vector8.X - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); - npc.velocity.X = (float)(Math.Cos(rotation) * 14) * -1; - npc.velocity.Y = (float)(Math.Sin(rotation) * 14) * -1; - npc.ai[1] = 1f; - npc.netUpdate = true; - } - } - - int num60; - this.npc.TargetClosest(true); - - if (Main.player[this.npc.target].position.Y - 150 > this.npc.position.Y) - { - this.npc.directionY = 1; - } - else - { - this.npc.directionY = -1; - } - - if (this.npc.direction == -1 && this.npc.velocity.X > -2f) - { - this.npc.velocity.X = this.npc.velocity.X - 0.4f; - if (this.npc.velocity.X > 2f) - { - this.npc.velocity.X = this.npc.velocity.X - 0.4f; - } - else - { - if (this.npc.velocity.X > 0f) - { - this.npc.velocity.X = this.npc.velocity.X + 0.08f; - } - } - if (this.npc.velocity.X < -2f) - { - this.npc.velocity.X = -2f; - } - } - else - { - if (this.npc.direction == 1 && this.npc.velocity.X < 4f) - { - this.npc.velocity.X = this.npc.velocity.X + 0.1f; - if (this.npc.velocity.X < -2f) - { - this.npc.velocity.X = this.npc.velocity.X + 0.1f; - } - else - { - if (this.npc.velocity.X < 0f) - { - this.npc.velocity.X = this.npc.velocity.X - 0.08f; - } - } - if (this.npc.velocity.X > 2f) - { - this.npc.velocity.X = 2f; - } - } - } - if (this.npc.directionY == -1 && (double)this.npc.velocity.Y > -1.5) - { - this.npc.velocity.Y = this.npc.velocity.Y - 0.08f; - - if ((double)this.npc.velocity.Y < -1.5) - { - this.npc.velocity.Y = -1.5f; - } - } - else - { - if (this.npc.directionY == 1 && (double)this.npc.velocity.Y < 1.5) - { - this.npc.velocity.Y = this.npc.velocity.Y + 0.08f; - if ((double)this.npc.velocity.Y > 1.5) - { - this.npc.velocity.Y = 1.5f; - } - } - } - } - } - } + if (NPC.AnyNPCs(mod.NPCType("GreatFungusBug"))) + { + npc.dontTakeDamage = true; + } + if (!NPC.AnyNPCs(mod.NPCType("GreatFungusBug"))) + { + npc.dontTakeDamage = false; + } + + bool allDead = false; + for (int i = 0; i < Main.player.Length; i++) + { + if (Main.player[i].dead) allDead = true; + } + + if (allDead) + { + if (npc.velocity.X > 0f) + { + npc.velocity.X = npc.velocity.X + 0.75f; + } + else + { + npc.velocity.X = npc.velocity.X - 0.75f; + } + npc.velocity.Y = npc.velocity.Y - 0.1f; + npc.rotation = npc.velocity.X * 0.05f; + } + + if (Main.rand.Next(120) == 0 && !Main.expertMode) + { + NPC.NewNPC((int)npc.Center.X - 70, (int)npc.Center.Y, 261); + } + + if (Main.rand.Next(110) == 0 && Main.expertMode) + { + NPC.NewNPC((int)npc.Center.X - 70, (int)npc.Center.Y, 261); + } + + if (Main.rand.Next(200) == 0) + { + NPC.NewNPC((int)npc.Center.X - 70, (int)npc.Center.Y, mod.NPCType("LittleMushroomBug")); + } + + if (Main.rand.Next(500) == 0) + { + NPC.NewNPC((int)npc.Center.X - 70, (int)npc.Center.Y, mod.NPCType("GreatFungusBug")); + } + + if (npc.life > npc.lifeMax / 2) + { + FirstState = true; + } + + if (npc.life < npc.lifeMax / 2) + { + SecondState = true; + } + + if (Main.rand.Next(2) == 0) + { + int num706 = Dust.NewDust(npc.position, npc.width, npc.height, 67, 0f, 0f, 200, npc.color, 0.5f); + Main.dust[num706].velocity *= 0.6f; + } + if (FirstState) + { + npc.TargetClosest(); + npc.netUpdate = false; + npc.ai[1]++; + + npc.TargetClosest(true); + Vector2 PTC = Main.player[npc.target].position + new Vector2(npc.width / 2, npc.height / 2); + Vector2 NPos = npc.position + new Vector2(npc.width / 2, npc.height / 2); + npc.netUpdate = true; + + customAi1 += (Main.rand.Next(2, 5) * 0.1f) * npc.scale; + npc.netUpdate = true; + + npc.ai[1] += (Main.rand.Next(2, 5) * 0.1f) * npc.scale; + if (npc.ai[1] >= 10f) + { + npc.TargetClosest(true); + if (Main.rand.Next(60) == 0) + { + Vector2 vector8 = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height / 2)); + float rotation = (float)Math.Atan2(vector8.Y - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), vector8.X - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); + npc.velocity.X = (float)(Math.Cos(rotation) * 14) * -1; + npc.velocity.Y = (float)(Math.Sin(rotation) * 14) * -1; + npc.ai[1] = 1f; + npc.netUpdate = true; + } + } + + int num60; + this.npc.TargetClosest(true); + + if (Main.player[this.npc.target].position.Y - 150 > this.npc.position.Y) + { + this.npc.directionY = 1; + } + else + { + this.npc.directionY = -1; + } + + if (this.npc.direction == -1 && this.npc.velocity.X > -2f) + { + this.npc.velocity.X = this.npc.velocity.X - 0.4f; + if (this.npc.velocity.X > 2f) + { + this.npc.velocity.X = this.npc.velocity.X - 0.4f; + } + else + { + if (this.npc.velocity.X > 0f) + { + this.npc.velocity.X = this.npc.velocity.X + 0.08f; + } + } + if (this.npc.velocity.X < -2f) + { + this.npc.velocity.X = -2f; + } + } + else + { + if (this.npc.direction == 1 && this.npc.velocity.X < 4f) + { + this.npc.velocity.X = this.npc.velocity.X + 0.1f; + if (this.npc.velocity.X < -2f) + { + this.npc.velocity.X = this.npc.velocity.X + 0.1f; + } + else + { + if (this.npc.velocity.X < 0f) + { + this.npc.velocity.X = this.npc.velocity.X - 0.08f; + } + } + if (this.npc.velocity.X > 2f) + { + this.npc.velocity.X = 2f; + } + } + } + if (this.npc.directionY == -1 && (double)this.npc.velocity.Y > -1.5) + { + this.npc.velocity.Y = this.npc.velocity.Y - 0.08f; + + if ((double)this.npc.velocity.Y < -1.5) + { + this.npc.velocity.Y = -1.5f; + } + } + else + { + if (this.npc.directionY == 1 && (double)this.npc.velocity.Y < 1.5) + { + this.npc.velocity.Y = this.npc.velocity.Y + 0.08f; + if ((double)this.npc.velocity.Y > 1.5) + { + this.npc.velocity.Y = 1.5f; + } + } + } + } + } + } } \ No newline at end of file diff --git a/NPCs/GGiantSlime.cs b/NPCs/GGiantSlime.cs index 5d8d54b4..d312d2aa 100644 --- a/NPCs/GGiantSlime.cs +++ b/NPCs/GGiantSlime.cs @@ -7,74 +7,76 @@ using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class GGiantSlime : ModNPC +namespace Tremor.NPCs { + + public class GGiantSlime : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Green Slime"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 500; - npc.damage = 90; - npc.defense = 30; - npc.knockBackResist = 0.3f; - npc.width = 70; - npc.alpha = 175; - npc.color = new Color(0, 220, 40, 100); - npc.height = 46; - animationType = 244; - npc.aiStyle = 1; - aiType = 138; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath23; - npc.value = Item.buyPrice(0, 0, 12, 15); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 500; + npc.damage = 90; + npc.defense = 30; + npc.knockBackResist = 0.3f; + npc.width = 70; + npc.alpha = 175; + npc.color = new Color(0, 220, 40, 100); + npc.height = 46; + animationType = 244; + npc.aiStyle = 1; + aiType = 138; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath23; + npc.value = Item.buyPrice(0, 0, 12, 15); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); - } - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 1, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); - } -} + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); + } + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 1, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); + } + } public override float SpawnChance(NPCSpawnInfo spawnInfo) { return spawnInfo.spawnTileY < Main.rockLayer && Main.hardMode && Tremor.NoInvasion(spawnInfo) && NPC.downedMoonlord && Main.dayTime ? 0.02f : 0f; } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 23); - }; - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 23); + }; + } + } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/Galasquid.cs b/NPCs/Galasquid.cs index bc56a96f..2c492e1e 100644 --- a/NPCs/Galasquid.cs +++ b/NPCs/Galasquid.cs @@ -8,119 +8,119 @@ namespace Tremor.NPCs { - public class Galasquid : ModNPC - { + public class Galasquid : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Galasquid"); Main.npcFrameCount[npc.type] = 5; } - - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GalasquidGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GalasquidGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GalasquidGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GalasquidGore2"), 1f); - } - } - public override void SetDefaults() - { - npc.aiStyle = -1; - npc.lifeMax = 4250; - npc.damage = 125; - npc.defense = 75; - animationType = 82; - npc.knockBackResist = 0.03f; - npc.width = 40; - npc.height = 60; - npc.value = Item.buyPrice(0, 2, 0, 0); - npc.noGravity = true; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GalasquidGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GalasquidGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GalasquidGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GalasquidGore2"), 1f); + } + } + + public override void SetDefaults() + { + npc.aiStyle = -1; + npc.lifeMax = 4250; + npc.damage = 125; + npc.defense = 75; + animationType = 82; + npc.knockBackResist = 0.03f; + npc.width = 40; + npc.height = 60; + npc.value = Item.buyPrice(0, 2, 0, 0); + npc.noGravity = true; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; npc.buffImmune[20] = true; npc.buffImmune[24] = true; npc.buffImmune[39] = true; npc.npcSlots = 10f; - } + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 0.625f * bossLifeScale); - npc.damage = (int)(npc.damage * 0.6f); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 0.625f * bossLifeScale); + npc.damage = (int)(npc.damage * 0.6f); + } - public override void AI() - { - float num1971 = 5f; - float moveSpeed = 0.15f; - npc.TargetClosest(true); - Vector2 desiredVelocity4 = Main.player[npc.target].Center - npc.Center + new Vector2(0f, -250f); - float num1972 = desiredVelocity4.Length(); - if (num1972 < 20f) - { - desiredVelocity4 = npc.velocity; - } - else if (num1972 < 40f) - { - desiredVelocity4.Normalize(); - desiredVelocity4 *= num1971 * 0.35f; - } - else if (num1972 < 80f) - { - desiredVelocity4.Normalize(); - desiredVelocity4 *= num1971 * 0.65f; - } - else - { - desiredVelocity4.Normalize(); - desiredVelocity4 *= num1971; - } - npc.SimpleFlyMovement(desiredVelocity4, moveSpeed); - npc.rotation = npc.velocity.X * 0.1f; - if ((npc.ai[0] += 1f) >= 70f) - { - npc.ai[0] = 0f; - if (Main.netMode != 1) - { - Vector2 vector283 = Vector2.Zero; - while (Math.Abs(vector283.X) < 1.5f) - { - vector283 = Vector2.UnitY.RotatedByRandom(1.5707963705062866) * new Vector2(5f, 3f); - } - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vector283.X, vector283.Y, 435, 60, 0f, Main.myPlayer, 0f, (float)npc.whoAmI); - return; - } - } -} + public override void AI() + { + float num1971 = 5f; + float moveSpeed = 0.15f; + npc.TargetClosest(true); + Vector2 desiredVelocity4 = Main.player[npc.target].Center - npc.Center + new Vector2(0f, -250f); + float num1972 = desiredVelocity4.Length(); + if (num1972 < 20f) + { + desiredVelocity4 = npc.velocity; + } + else if (num1972 < 40f) + { + desiredVelocity4.Normalize(); + desiredVelocity4 *= num1971 * 0.35f; + } + else if (num1972 < 80f) + { + desiredVelocity4.Normalize(); + desiredVelocity4 *= num1971 * 0.65f; + } + else + { + desiredVelocity4.Normalize(); + desiredVelocity4 *= num1971; + } + npc.SimpleFlyMovement(desiredVelocity4, moveSpeed); + npc.rotation = npc.velocity.X * 0.1f; + if ((npc.ai[0] += 1f) >= 70f) + { + npc.ai[0] = 0f; + if (Main.netMode != 1) + { + Vector2 vector283 = Vector2.Zero; + while (Math.Abs(vector283.X) < 1.5f) + { + vector283 = Vector2.UnitY.RotatedByRandom(1.5707963705062866) * new Vector2(5f, 3f); + } + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vector283.X, vector283.Y, 435, 60, 0f, Main.myPlayer, 0f, (float)npc.whoAmI); + return; + } + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return spawnInfo.spawnTileY < Main.rockLayer && NPC.downedMoonlord && tile == mod.TileType("CometiteOreTile") || tile == mod.TileType("HardCometiteOreTile") ? 0.005f : 0f; - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return spawnInfo.spawnTileY < Main.rockLayer && NPC.downedMoonlord && tile == mod.TileType("CometiteOreTile") || tile == mod.TileType("HardCometiteOreTile") ? 0.005f : 0f; + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Catalyst"), Main.rand.Next(5,12)); - } - } - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Catalyst"), Main.rand.Next(5, 12)); + } + } + } + } } \ No newline at end of file diff --git a/NPCs/Geerd.cs b/NPCs/Geerd.cs index 8ad0a97a..f1bf9ee6 100644 --- a/NPCs/Geerd.cs +++ b/NPCs/Geerd.cs @@ -6,79 +6,81 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Geerd : ModNPC +namespace Tremor.NPCs { + + public class Geerd : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Geerd"); Main.npcFrameCount[npc.type] = 3; } - - public override void SetDefaults() - { - npc.lifeMax = 300; - npc.damage = 30; - npc.defense = 18; - npc.knockBackResist = 0.3f; - npc.width = 38; - npc.height = 44; - animationType = 141; - npc.aiStyle = 1; - npc.npcSlots = 1f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath17; - npc.value = Item.buyPrice(0, 0, 1, 24); - banner = npc.type; - bannerItem = mod.ItemType("GeerdBanner"); - } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(25) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GreenPuzzleFragment")); - } - } - } + public override void SetDefaults() + { + npc.lifeMax = 300; + npc.damage = 30; + npc.defense = 18; + npc.knockBackResist = 0.3f; + npc.width = 38; + npc.height = 44; + animationType = 141; + npc.aiStyle = 1; + npc.npcSlots = 1f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath17; + npc.value = Item.buyPrice(0, 0, 1, 24); + banner = npc.type; + bannerItem = mod.ItemType("GeerdBanner"); + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(25) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GreenPuzzleFragment")); + } + } + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } public override float SpawnChance(NPCSpawnInfo spawnInfo) { return spawnInfo.spawnTileY < Main.rockLayer && NPC.downedBoss3 && Main.dayTime ? 0.005f : 0f; } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 60; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GeerdGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GrudGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GrudGore2"), 1f); - } - else - { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } -} -}} \ No newline at end of file + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 60; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GeerdGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GrudGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GrudGore2"), 1f); + } + else + { + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + } + } + } + } +} \ No newline at end of file diff --git a/NPCs/Gelateen.cs b/NPCs/Gelateen.cs index 5144e831..d5ac2d66 100644 --- a/NPCs/Gelateen.cs +++ b/NPCs/Gelateen.cs @@ -6,81 +6,83 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Gelateen : ModNPC +namespace Tremor.NPCs { + + public class Gelateen : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Gelateen"); Main.npcFrameCount[npc.type] = 3; } - - public override void SetDefaults() - { - npc.lifeMax = 500; - npc.damage = 20; - npc.defense = 24; - npc.knockBackResist = 0.6f; - npc.width = 90; - npc.height = 62; - animationType = 141; - npc.aiStyle = 1; - npc.npcSlots = 1f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.value = Item.buyPrice(0, 0, 12, 24); - banner = npc.type; - bannerItem = mod.ItemType("GelateenBanner"); - } + public override void SetDefaults() + { + npc.lifeMax = 500; + npc.damage = 20; + npc.defense = 24; + npc.knockBackResist = 0.6f; + npc.width = 90; + npc.height = 62; + animationType = 141; + npc.aiStyle = 1; + npc.npcSlots = 1f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.value = Item.buyPrice(0, 0, 12, 24); + banner = npc.type; + bannerItem = mod.ItemType("GelateenBanner"); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BounceTome")); - } - } - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BounceTome")); + } + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && y > Main.rockLayer ? 0.001f : 0f; - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && y > Main.rockLayer ? 0.001f : 0f; + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GelateenGore1"), 1f); + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GelateenGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GelateenGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GelateenGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GelateenGore3"), 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 1, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); - } -} -}} \ No newline at end of file + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GelateenGore3"), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 1, 2.5f * (float)hitDirection, -2.5f, 0, Color.Green, 0.7f); + } + } + } +} \ No newline at end of file diff --git a/NPCs/GeneralSnowman.cs b/NPCs/GeneralSnowman.cs index 8d86ca49..87e801dd 100644 --- a/NPCs/GeneralSnowman.cs +++ b/NPCs/GeneralSnowman.cs @@ -6,60 +6,62 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class GeneralSnowman : ModNPC +namespace Tremor.NPCs { + + public class GeneralSnowman : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("General Snowman"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 800; - npc.damage = 50; - npc.defense = 22; - npc.knockBackResist = 0.1f; - npc.width = 34; - npc.height = 46; - animationType = 143; - npc.aiStyle = 38; - aiType = 143; - npc.npcSlots = 0.3f; - npc.HitSound = SoundID.NPCHit11; - npc.DeathSound = SoundID.NPCDeath15; - npc.value = Item.buyPrice(0, 0, 8, 7); - banner = npc.type; - bannerItem = mod.ItemType("GeneralSnowmanBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 800; + npc.damage = 50; + npc.defense = 22; + npc.knockBackResist = 0.1f; + npc.width = 34; + npc.height = 46; + animationType = 143; + npc.aiStyle = 38; + aiType = 143; + npc.npcSlots = 0.3f; + npc.HitSound = SoundID.NPCHit11; + npc.DeathSound = SoundID.NPCDeath15; + npc.value = Item.buyPrice(0, 0, 8, 7); + banner = npc.type; + bannerItem = mod.ItemType("GeneralSnowmanBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); - } - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3f); - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2f); - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3f); + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return NPC.AnyNPCs(144) && Main.hardMode && y < Main.worldSurface ? 0.01f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return NPC.AnyNPCs(144) && Main.hardMode && y < Main.worldSurface ? 0.01f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/GhostKnight.cs b/NPCs/GhostKnight.cs index 659830b2..42a9fd40 100644 --- a/NPCs/GhostKnight.cs +++ b/NPCs/GhostKnight.cs @@ -6,74 +6,76 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class GhostKnight : ModNPC +namespace Tremor.NPCs { + + public class GhostKnight : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Ghost Knight"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 500; - npc.damage = 80; - npc.defense = 26; - npc.knockBackResist = 0.6f; - npc.width = 38; - npc.height = 44; - animationType = 82; -npc.noGravity = true; - npc.noTileCollide = true; - npc.aiStyle = 22; - aiType = 82; - npc.npcSlots = 1f; - npc.HitSound = SoundID.NPCHit54; - npc.DeathSound = SoundID.NPCDeath52; - npc.value = Item.buyPrice(0, 0, 8, 0); - banner = npc.type; - bannerItem = mod.ItemType("GhostKnightBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 500; + npc.damage = 80; + npc.defense = 26; + npc.knockBackResist = 0.6f; + npc.width = 38; + npc.height = 44; + animationType = 82; + npc.noGravity = true; + npc.noTileCollide = true; + npc.aiStyle = 22; + aiType = 82; + npc.npcSlots = 1f; + npc.HitSound = SoundID.NPCHit54; + npc.DeathSound = SoundID.NPCDeath52; + npc.value = Item.buyPrice(0, 0, 8, 0); + banner = npc.type; + bannerItem = mod.ItemType("GhostKnightBanner"); + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedPlantBoss && !Main.dayTime && y < Main.worldSurface ? 0.01f : 0f; - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 60; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GhostGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GhostGore2"), 1f); - } - else - { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 54, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 54, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 54, (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } -} -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedPlantBoss && !Main.dayTime && y < Main.worldSurface ? 0.01f : 0f; + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 60; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GhostGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GhostGore2"), 1f); + } + else + { + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 54, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, (float)hitDirection, -1f, 0, default(Color), 0.7f); + } + } + } + } +} \ No newline at end of file diff --git a/NPCs/GhostWarrior.cs b/NPCs/GhostWarrior.cs index f594dcc5..3e2e3e1a 100644 --- a/NPCs/GhostWarrior.cs +++ b/NPCs/GhostWarrior.cs @@ -6,75 +6,77 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class GhostWarrior : ModNPC +namespace Tremor.NPCs { + + public class GhostWarrior : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Ghost Warrior"); Main.npcFrameCount[npc.type] = 15; } - - public override void SetDefaults() - { - npc.lifeMax = 6400; - npc.damage = 16; - npc.defense = 90; - npc.knockBackResist = 0.3f; - npc.width = 36; - npc.alpha = 120; - npc.height = 44; -animationType = 21; - npc.aiStyle = 3; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit2; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 4, 7); - banner = npc.type; - bannerItem = mod.ItemType("GhostWarriorBanner"); - } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GWGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GWGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GWGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); - } -} + public override void SetDefaults() + { + npc.lifeMax = 6400; + npc.damage = 16; + npc.defense = 90; + npc.knockBackResist = 0.3f; + npc.width = 36; + npc.alpha = 120; + npc.height = 44; + animationType = 21; + npc.aiStyle = 3; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit2; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 0, 4, 7); + banner = npc.type; + bannerItem = mod.ItemType("GhostWarriorBanner"); + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GWGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GWGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GWGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); + } + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GoldenClaw")); - }; - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LapisLazuli")); - }; - } - } + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GoldenClaw")); + }; + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LapisLazuli")); + }; + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && TremorWorld.downedTrinity && NPC.downedMoonlord && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.005f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && TremorWorld.downedTrinity && NPC.downedMoonlord && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.005f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/GiantCrab.cs b/NPCs/GiantCrab.cs index 237eba75..d7c8a2b3 100644 --- a/NPCs/GiantCrab.cs +++ b/NPCs/GiantCrab.cs @@ -6,76 +6,78 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class GiantCrab : ModNPC +namespace Tremor.NPCs { + + public class GiantCrab : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Giant Crab"); Main.npcFrameCount[npc.type] = 8; } - - public override void SetDefaults() - { - npc.lifeMax = 300; - npc.damage = 70; - npc.defense = 25; - npc.knockBackResist = 0.3f; - npc.width = 35; - npc.height = 28; - animationType = 67; - npc.aiStyle = 26; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 9, 0); - banner = npc.type; - bannerItem = mod.ItemType("GiantCrabBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 300; + npc.damage = 70; + npc.defense = 25; + npc.knockBackResist = 0.3f; + npc.width = 35; + npc.height = 28; + animationType = 67; + npc.aiStyle = 26; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 0, 9, 0); + banner = npc.type; + bannerItem = mod.ItemType("GiantCrabBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CrabGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CrabGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CrabGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CrabGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CrabGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CrabGore3"), 1f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CrabGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CrabGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CrabGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CrabGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CrabGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CrabGore3"), 1f); + } + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(25) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CrabClaw"), Main.rand.Next(1)); - }; - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(25) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CrabClaw"), Main.rand.Next(1)); + }; + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && (tile == 53 || tile == 112 || tile == 116 || tile == 234) && spawnInfo.water) && y < Main.rockLayer && (x < 250 || x > Main.maxTilesX - 250) && !spawnInfo.playerSafe && Main.hardMode ? 0.01f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && (tile == 53 || tile == 112 || tile == 116 || tile == 234) && spawnInfo.water) && y < Main.rockLayer && (x < 250 || x > Main.maxTilesX - 250) && !spawnInfo.playerSafe && Main.hardMode ? 0.01f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/GiantGastropod.cs b/NPCs/GiantGastropod.cs index a13409c8..d4971be3 100644 --- a/NPCs/GiantGastropod.cs +++ b/NPCs/GiantGastropod.cs @@ -6,91 +6,93 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class GiantGastropod : ModNPC +namespace Tremor.NPCs { + + public class GiantGastropod : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Giant Gastropod"); Main.npcFrameCount[npc.type] = 11; } - - public override void SetDefaults() - { - npc.lifeMax = 3200; - npc.damage = 150; - npc.defense = 70; - npc.knockBackResist = 0.1f; - npc.width = 40; - npc.height = 40; - animationType = 122; - npc.aiStyle = 22; - aiType = 122; - npc.noGravity = true; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit1; - npc.buffImmune[20] = true; - npc.buffImmune[24] = true; - npc.buffImmune[39] = true; - npc.buffImmune[31] = false; - npc.DeathSound = SoundID.NPCDeath7; - npc.value = Item.buyPrice(0, 0, 12, 0); - banner = npc.type; - bannerItem = mod.ItemType("GiantGastropodBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 3200; + npc.damage = 150; + npc.defense = 70; + npc.knockBackResist = 0.1f; + npc.width = 40; + npc.height = 40; + animationType = 122; + npc.aiStyle = 22; + aiType = 122; + npc.noGravity = true; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit1; + npc.buffImmune[20] = true; + npc.buffImmune[24] = true; + npc.buffImmune[39] = true; + npc.buffImmune[31] = false; + npc.DeathSound = SoundID.NPCDeath7; + npc.value = Item.buyPrice(0, 0, 12, 0); + banner = npc.type; + bannerItem = mod.ItemType("GiantGastropodBanner"); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 282, 6); - } - } - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } + + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 282, 6); + } + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Dust.NewDust(npc.position, npc.width, npc.height, 72, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 72, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 72, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GGGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GGGore2"), 1f); - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 72, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 72, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); - } - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Dust.NewDust(npc.position, npc.width, npc.height, 72, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 72, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 72, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GGGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GGGore2"), 1f); + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 72, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 72, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); + } + } + } - public override void AI() - { -if (Main.rand.Next(4) == 0) - { - int num706 = Dust.NewDust(npc.position, npc.width, npc.height, 72, 0f, 0f, 200, npc.color, 1f); - Main.dust[num706].velocity *= 0.3f; - } - } + public override void AI() + { + if (Main.rand.Next(4) == 0) + { + int num706 = Dust.NewDust(npc.position, npc.width, npc.height, 72, 0f, 0f, 200, npc.color, 1f); + Main.dust[num706].velocity *= 0.3f; + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && !Main.dayTime && NPC.downedMoonlord && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneHoly && y < Main.worldSurface ? 0.01f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && !Main.dayTime && NPC.downedMoonlord && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneHoly && y < Main.worldSurface ? 0.01f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/GiantMeteorHead.cs b/NPCs/GiantMeteorHead.cs index fc7c3e71..2a133140 100644 --- a/NPCs/GiantMeteorHead.cs +++ b/NPCs/GiantMeteorHead.cs @@ -13,75 +13,75 @@ public override void SetStaticDefaults() DisplayName.SetDefault("Giant Meteor Head"); Main.npcFrameCount[npc.type] = 2; } - + public override void SetDefaults() { npc.width = 72; npc.height = 62; npc.damage = 44; npc.defense = 13; - npc.noGravity = true; - npc.noTileCollide = true; + npc.noGravity = true; + npc.noTileCollide = true; npc.lifeMax = 260; - npc.npcSlots = 5f; + npc.npcSlots = 5f; npc.HitSound = SoundID.NPCHit3; npc.DeathSound = SoundID.NPCDeath3; - npc.value = Item.buyPrice(0, 0, 3, 12); + npc.value = Item.buyPrice(0, 0, 3, 12); npc.knockBackResist = 0.1f; npc.aiStyle = 5; aiType = 23; animationType = 23; - banner = npc.type; - bannerItem = mod.ItemType("GiantMeteorHeadBanner"); + banner = npc.type; + bannerItem = mod.ItemType("GiantMeteorHeadBanner"); } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MeteorScepter")); - }; - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MeteorScepter")); + }; + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); - } - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); + } + } + } - public override void AI() - { -if (Main.rand.Next(4) == 0) - { - int num706 = Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 1f); - Main.dust[num706].velocity *= 0.3f; - } - } + public override void AI() + { + if (Main.rand.Next(4) == 0) + { + int num706 = Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 1f); + Main.dust[num706].velocity *= 0.3f; + } + } public override float SpawnChance(NPCSpawnInfo spawnInfo) { diff --git a/NPCs/GloomySeer.cs b/NPCs/GloomySeer.cs index ccc36bd4..a8bd7b7d 100644 --- a/NPCs/GloomySeer.cs +++ b/NPCs/GloomySeer.cs @@ -6,91 +6,93 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class GloomySeer : ModNPC +namespace Tremor.NPCs { + + public class GloomySeer : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Gloomy Seer"); Main.npcFrameCount[npc.type] = 5; } - - public override void SetDefaults() - { - npc.lifeMax = 250; - npc.damage = 22; - npc.defense = 10; - npc.knockBackResist = 0.3f; - npc.width = 40; - npc.height = 40; -animationType = 156; - npc.aiStyle = 22; - npc.npcSlots = 15f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath2; - npc.noGravity = true; - npc.value = Item.buyPrice(0, 0, 2, 50); - banner = npc.type; - bannerItem = mod.ItemType("GloomySeerBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 250; + npc.damage = 22; + npc.defense = 10; + npc.knockBackResist = 0.3f; + npc.width = 40; + npc.height = 40; + animationType = 156; + npc.aiStyle = 22; + npc.npcSlots = 15f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath2; + npc.noGravity = true; + npc.value = Item.buyPrice(0, 0, 2, 50); + banner = npc.type; + bannerItem = mod.ItemType("GloomySeerBanner"); + } - public override void AI() - { + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - npc.ai[0] += 1f; - if (npc.ai[0] == 20f || npc.ai[0] == 40f || npc.ai[0] == 60f || npc.ai[0] == 80f) - { - if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) - { - float num630 = 2.2f; - Vector2 vector64 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num631 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector64.X + (float)Main.rand.Next(-100, 101); - float num632 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - vector64.Y + (float)Main.rand.Next(-100, 101); - float num633 = (float)Math.Sqrt((double)(num631 * num631 + num632 * num632)); - num633 = num630 / num633; - num631 *= num633; - num632 *= num633; - int num634 = 21; - int num635 = 83; - int num636 = Projectile.NewProjectile(vector64.X, vector64.Y, num631, num632, num635, num634, 0f, Main.myPlayer, 0f, 0f); - Main.projectile[num636].timeLeft = 3000; - } - } - else if (npc.ai[0] >= (float)(150 + Main.rand.Next(150))) - { - npc.ai[0] = 0f; - } + public override void AI() + { - } + npc.ai[0] += 1f; + if (npc.ai[0] == 20f || npc.ai[0] == 40f || npc.ai[0] == 60f || npc.ai[0] == 80f) + { + if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + { + float num630 = 2.2f; + Vector2 vector64 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num631 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector64.X + (float)Main.rand.Next(-100, 101); + float num632 = Main.player[npc.target].position.Y + (float)Main.player[npc.target].height * 0.5f - vector64.Y + (float)Main.rand.Next(-100, 101); + float num633 = (float)Math.Sqrt((double)(num631 * num631 + num632 * num632)); + num633 = num630 / num633; + num631 *= num633; + num632 *= num633; + int num634 = 21; + int num635 = 83; + int num636 = Projectile.NewProjectile(vector64.X, vector64.Y, num631, num632, num635, num634, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[num636].timeLeft = 3000; + } + } + else if (npc.ai[0] >= (float)(150 + Main.rand.Next(150))) + { + npc.ai[0] = 0f; + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.bloodMoon && y < Main.worldSurface ? 0.001f : 0f; - } + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.bloodMoon && y < Main.worldSurface ? 0.001f : 0f; + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.2f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GSGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GSGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GSGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GSGore3"), 1f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.2f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GSGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GSGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GSGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GSGore3"), 1f); + } + } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/GoblinAssassin.cs b/NPCs/GoblinAssassin.cs index 7cfff59b..216f6114 100644 --- a/NPCs/GoblinAssassin.cs +++ b/NPCs/GoblinAssassin.cs @@ -7,604 +7,604 @@ namespace Tremor.NPCs { - public class GoblinAssassin : ModNPC - { + public class GoblinAssassin : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Goblin Assassin"); Main.npcFrameCount[npc.type] = 3; } - - int CountFrame = 0; - int TimeToAnimation = 4; - public override void SetDefaults() - { - npc.lifeMax = 90; - npc.damage = 21; - npc.defense = 10; - npc.knockBackResist = 0.4f; - npc.width = 46; - npc.height = 44; - npc.aiStyle = -1; - npc.npcSlots = 0.2f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.value = Item.buyPrice(0, 0, 0, 56); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + int CountFrame = 0; + int TimeToAnimation = 4; + public override void SetDefaults() + { + npc.lifeMax = 90; + npc.damage = 21; + npc.defense = 10; + npc.knockBackResist = 0.4f; + npc.width = 46; + npc.height = 44; + npc.aiStyle = -1; + npc.npcSlots = 0.2f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.value = Item.buyPrice(0, 0, 0, 56); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void AI() - { - npc.TargetClosest(true); - npc.spriteDirection = npc.direction; - Player player = Main.player[npc.target]; - DoAI(); - ExpertSetting(); - PlayAnimation(); - } + public override void AI() + { + npc.TargetClosest(true); + npc.spriteDirection = npc.direction; + Player player = Main.player[npc.target]; + DoAI(); + ExpertSetting(); + PlayAnimation(); + } + + public void ExpertSetting() + { + if (Main.expertMode) + { + if (npc.life > npc.lifeMax * 0.5f) + { + npc.defense = 13; + } + if (npc.life < npc.lifeMax * 0.5f && npc.life > npc.lifeMax * 0.3f) + { + npc.defense = 15; + } + if (npc.life < npc.lifeMax * 0.3f) + { + npc.defense = 18; + } + } + } - public void ExpertSetting() - { - if (Main.expertMode) - { - if (npc.life > npc.lifeMax * 0.5f) - { - npc.defense = 13; - } - if (npc.life < npc.lifeMax * 0.5f && npc.life > npc.lifeMax * 0.3f) - { - npc.defense = 15; - } - if (npc.life < npc.lifeMax * 0.3f) - { - npc.defense = 18; - } - } - } + public void PlayAnimation() + { + if (--TimeToAnimation <= 0) + { + if (++CountFrame > 3) + CountFrame = 1; + TimeToAnimation = 4; + npc.frame = GetFrame(CountFrame); + } + } - public void PlayAnimation() - { - if (--TimeToAnimation <= 0) - { - if (++CountFrame > 3) - CountFrame = 1; - TimeToAnimation = 4; - npc.frame = GetFrame(CountFrame); - } - } + bool TimetoShoot = false; + public void DoAI() + { + Vector2 VectorPos = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float FirstPos = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - VectorPos.X; + float SecondPos = Main.player[npc.target].position.Y - VectorPos.Y; + float FinallyPos = (float)Math.Sqrt((double)(FirstPos * FirstPos + SecondPos * SecondPos)); + if (!npc.wet && !Main.player[npc.target].npcTypeNoAggro[npc.type]) + { + if (FinallyPos < 400f && Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + { + TimetoShoot = true; + } + else + TimetoShoot = false; + } + if (TimetoShoot) + { + int Num = 15; + bool Flag = false; + bool Flag2 = true; - bool TimetoShoot = false; - public void DoAI() - { - Vector2 VectorPos = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float FirstPos = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - VectorPos.X; - float SecondPos = Main.player[npc.target].position.Y - VectorPos.Y; - float FinallyPos = (float)Math.Sqrt((double)(FirstPos * FirstPos + SecondPos * SecondPos)); - if (!npc.wet && !Main.player[npc.target].npcTypeNoAggro[npc.type]) - { - if (FinallyPos < 400f && Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) - { - TimetoShoot = true; - } - else - TimetoShoot = false; - } - if (TimetoShoot) - { - int Num = 15; - bool Flag = false; - bool Flag2 = true; + if (npc.velocity.Y == 0f && ((npc.velocity.X > 0f && npc.direction < 0) || (npc.velocity.X < 0f && npc.direction > 0))) + { + Flag = true; + } + if (npc.position.X == npc.oldPosition.X || npc.ai[3] >= (float)Num || Flag) + { + npc.ai[3] += 1f; + } + else + { + if ((double)Math.Abs(npc.velocity.X) > 0.9 && npc.ai[3] > 0f) + { + npc.ai[3] -= 1f; + } + } + if (npc.ai[3] > (float)(Num * 10)) + { + npc.ai[3] = 0f; + } + if (npc.justHit) + { + npc.ai[3] = 0f; + } + if (npc.ai[3] == (float)Num) + { + npc.netUpdate = true; + } - if (npc.velocity.Y == 0f && ((npc.velocity.X > 0f && npc.direction < 0) || (npc.velocity.X < 0f && npc.direction > 0))) - { - Flag = true; - } - if (npc.position.X == npc.oldPosition.X || npc.ai[3] >= (float)Num || Flag) - { - npc.ai[3] += 1f; - } - else - { - if ((double)Math.Abs(npc.velocity.X) > 0.9 && npc.ai[3] > 0f) - { - npc.ai[3] -= 1f; - } - } - if (npc.ai[3] > (float)(Num * 10)) - { - npc.ai[3] = 0f; - } - if (npc.justHit) - { - npc.ai[3] = 0f; - } - if (npc.ai[3] == (float)Num) - { - npc.netUpdate = true; - } + if (npc.ai[3] < (float)Num) + { + npc.TargetClosest(true); + } + else + { + if (npc.velocity.X == 0f) + { + if (npc.velocity.Y == 0f) + { + npc.ai[0] += 1f; + if (npc.ai[0] >= 2f) + { + npc.direction *= -1; + npc.spriteDirection = npc.direction; + npc.ai[0] = 0f; + } + } + } + else + { + npc.ai[0] = 0f; + } + if (npc.direction == 0) + { + npc.direction = 1; + } + } - if (npc.ai[3] < (float)Num) - { - npc.TargetClosest(true); - } - else - { - if (npc.velocity.X == 0f) - { - if (npc.velocity.Y == 0f) - { - npc.ai[0] += 1f; - if (npc.ai[0] >= 2f) - { - npc.direction *= -1; - npc.spriteDirection = npc.direction; - npc.ai[0] = 0f; - } - } - } - else - { - npc.ai[0] = 0f; - } - if (npc.direction == 0) - { - npc.direction = 1; - } - } + if (npc.velocity.X < -5f || npc.velocity.X > 5f) + { + if (npc.velocity.Y == 0f) + { + npc.velocity *= 0.8f; + } + } + else + { + if (npc.velocity.X < 5f && npc.direction == 1) + { + npc.velocity.X = npc.velocity.X + 0.1f; + if (npc.velocity.X > 5f) + { + npc.velocity.X = 5f; + } + } + else + { + if (npc.velocity.X > -5f && npc.direction == -1) + { + npc.velocity.X = npc.velocity.X - 0.1f; + if (npc.velocity.X < -5f) + { + npc.velocity.X = -5f; + } + } + } + } - if (npc.velocity.X < -5f || npc.velocity.X > 5f) - { - if (npc.velocity.Y == 0f) - { - npc.velocity *= 0.8f; - } - } - else - { - if (npc.velocity.X < 5f && npc.direction == 1) - { - npc.velocity.X = npc.velocity.X + 0.1f; - if (npc.velocity.X > 5f) - { - npc.velocity.X = 5f; - } - } - else - { - if (npc.velocity.X > -5f && npc.direction == -1) - { - npc.velocity.X = npc.velocity.X - 0.1f; - if (npc.velocity.X < -5f) - { - npc.velocity.X = -5f; - } - } - } - } + bool Flag3 = false; + if (npc.velocity.Y == 0f) + { + int Num2 = (int)(npc.position.Y + (float)npc.height + 8f) / 16; + int Num3 = (int)npc.position.X / 16; + int Num4 = (int)(npc.position.X + (float)npc.width) / 16; + for (int l = Num3; l <= Num4; l++) + { + if (Main.tile[l, Num2] == null) + { + return; + } + if (Main.tile[l, Num2].active() && Main.tileSolid[(int)Main.tile[l, Num2].type]) + { + Flag3 = true; + break; + } + } + } - bool Flag3 = false; - if (npc.velocity.Y == 0f) - { - int Num2 = (int)(npc.position.Y + (float)npc.height + 8f) / 16; - int Num3 = (int)npc.position.X / 16; - int Num4 = (int)(npc.position.X + (float)npc.width) / 16; - for (int l = Num3; l <= Num4; l++) - { - if (Main.tile[l, Num2] == null) - { - return; - } - if (Main.tile[l, Num2].active() && Main.tileSolid[(int)Main.tile[l, Num2].type]) - { - Flag3 = true; - break; - } - } - } + if (Flag3) + { + int Num5 = (int)((npc.position.X + (float)(npc.width / 2) + (float)((npc.width / 2 + 6) * npc.direction)) / 16f); + int Num6 = (int)((npc.position.Y + (float)npc.height - 15f) / 16f); + if (Main.tile[Num5, Num6] == null) + { + Main.tile[Num5, Num6] = new Tile(); + } + if (Main.tile[Num5, Num6 - 1] == null) + { + Main.tile[Num5, Num6 - 1] = new Tile(); + } + if (Main.tile[Num5, Num6 - 2] == null) + { + Main.tile[Num5, Num6 - 2] = new Tile(); + } + if (Main.tile[Num5, Num6 - 3] == null) + { + Main.tile[Num5, Num6 - 3] = new Tile(); + } + if (Main.tile[Num5, Num6 + 1] == null) + { + Main.tile[Num5, Num6 + 1] = new Tile(); + } + if (Main.tile[Num5 + npc.direction, Num6 - 1] == null) + { + Main.tile[Num5 + npc.direction, Num6 - 1] = new Tile(); + } + if (Main.tile[Num5 + npc.direction, Num6 + 1] == null) + { + Main.tile[Num5 + npc.direction, Num6 + 1] = new Tile(); + } - if (Flag3) - { - int Num5 = (int)((npc.position.X + (float)(npc.width / 2) + (float)((npc.width / 2 + 6) * npc.direction)) / 16f); - int Num6 = (int)((npc.position.Y + (float)npc.height - 15f) / 16f); - if (Main.tile[Num5, Num6] == null) - { - Main.tile[Num5, Num6] = new Tile(); - } - if (Main.tile[Num5, Num6 - 1] == null) - { - Main.tile[Num5, Num6 - 1] = new Tile(); - } - if (Main.tile[Num5, Num6 - 2] == null) - { - Main.tile[Num5, Num6 - 2] = new Tile(); - } - if (Main.tile[Num5, Num6 - 3] == null) - { - Main.tile[Num5, Num6 - 3] = new Tile(); - } - if (Main.tile[Num5, Num6 + 1] == null) - { - Main.tile[Num5, Num6 + 1] = new Tile(); - } - if (Main.tile[Num5 + npc.direction, Num6 - 1] == null) - { - Main.tile[Num5 + npc.direction, Num6 - 1] = new Tile(); - } - if (Main.tile[Num5 + npc.direction, Num6 + 1] == null) - { - Main.tile[Num5 + npc.direction, Num6 + 1] = new Tile(); - } + if (Main.tile[Num5, Num6 - 1].active() && Main.tile[Num5, Num6 - 1].type == 10 && Flag2) + { + npc.ai[2] += 1f; + npc.ai[3] = 0f; + if (npc.ai[2] >= 60f) + { + npc.velocity.X = 0.5f * (float)(-(float)npc.direction); + npc.ai[1] += 1f; + npc.ai[2] = 0f; + bool Flag4 = false; + if (npc.ai[1] >= 10f) + { + Flag4 = true; + npc.ai[1] = 10f; + } + WorldGen.KillTile(Num5, Num6 - 1, true, false, false); + if ((Main.netMode != 1 || !Flag4) && Flag4 && Main.netMode != 1) + { + bool Flag5 = WorldGen.OpenDoor(Num5, Num6, npc.direction); + if (!Flag5) + { + npc.ai[3] = (float)Num; + npc.netUpdate = true; + } + if (Main.netMode == 2 && Flag5) + { + //NetMessage.SendData(19, -1, -1, "", 0, (float)Num5, (float)Num6, (float)npc.direction, 0); + } + } + } + } - if (Main.tile[Num5, Num6 - 1].active() && Main.tile[Num5, Num6 - 1].type == 10 && Flag2) - { - npc.ai[2] += 1f; - npc.ai[3] = 0f; - if (npc.ai[2] >= 60f) - { - npc.velocity.X = 0.5f * (float)(-(float)npc.direction); - npc.ai[1] += 1f; - npc.ai[2] = 0f; - bool Flag4 = false; - if (npc.ai[1] >= 10f) - { - Flag4 = true; - npc.ai[1] = 10f; - } - WorldGen.KillTile(Num5, Num6 - 1, true, false, false); - if ((Main.netMode != 1 || !Flag4) && Flag4 && Main.netMode != 1) - { - bool Flag5 = WorldGen.OpenDoor(Num5, Num6, npc.direction); - if (!Flag5) - { - npc.ai[3] = (float)Num; - npc.netUpdate = true; - } - if (Main.netMode == 2 && Flag5) - { - //NetMessage.SendData(19, -1, -1, "", 0, (float)Num5, (float)Num6, (float)npc.direction, 0); - } - } - } - } + if ((npc.velocity.X < 0f && npc.spriteDirection == -1) || (npc.velocity.X > 0f && npc.spriteDirection == 1)) + { + if (Main.tile[Num5, Num6 - 2].active() && Main.tileSolid[(int)Main.tile[Num5, Num6 - 2].type]) + { + if ((Main.tile[Num5, Num6 - 3].active() && Main.tileSolid[(int)Main.tile[Num5, Num6 - 3].type])) + { + npc.velocity.Y = -8f; + npc.netUpdate = true; + } + else + { + npc.velocity.Y = -7f; + npc.netUpdate = true; + } + } + else + { + if (Main.tile[Num5, Num6 - 1].active() && Main.tileSolid[(int)Main.tile[Num5, Num6 - 1].type]) + { + npc.velocity.Y = -6f; + npc.netUpdate = true; + } + else + { + if (Main.tile[Num5, Num6].active() && Main.tileSolid[(int)Main.tile[Num5, Num6].type]) + { + npc.velocity.Y = -5f; + npc.netUpdate = true; + } + else + { + if (npc.directionY < 0 && (!Main.tile[Num5, Num6 + 1].active() || !Main.tileSolid[(int)Main.tile[Num5, Num6 + 1].type]) && (!Main.tile[Num5 + npc.direction, Num6 + 1].active() || !Main.tileSolid[(int)Main.tile[Num5 + npc.direction, Num6 + 1].type])) + { + npc.velocity.Y = -8f; + npc.velocity.X = npc.velocity.X * 1.5f; + npc.netUpdate = true; + } + else + { + if (Flag2) + { + npc.ai[1] = 0f; + npc.ai[2] = 0f; + } + } + } + } + } + } + } + else + { + if (Flag2) + { + npc.ai[1] = 0f; + npc.ai[2] = 0f; + } + } + } + else + { + int Num = 15; + bool Flag = false; + bool Flag2 = true; - if ((npc.velocity.X < 0f && npc.spriteDirection == -1) || (npc.velocity.X > 0f && npc.spriteDirection == 1)) - { - if (Main.tile[Num5, Num6 - 2].active() && Main.tileSolid[(int)Main.tile[Num5, Num6 - 2].type]) - { - if ((Main.tile[Num5, Num6 - 3].active() && Main.tileSolid[(int)Main.tile[Num5, Num6 - 3].type])) - { - npc.velocity.Y = -8f; - npc.netUpdate = true; - } - else - { - npc.velocity.Y = -7f; - npc.netUpdate = true; - } - } - else - { - if (Main.tile[Num5, Num6 - 1].active() && Main.tileSolid[(int)Main.tile[Num5, Num6 - 1].type]) - { - npc.velocity.Y = -6f; - npc.netUpdate = true; - } - else - { - if (Main.tile[Num5, Num6].active() && Main.tileSolid[(int)Main.tile[Num5, Num6].type]) - { - npc.velocity.Y = -5f; - npc.netUpdate = true; - } - else - { - if (npc.directionY < 0 && (!Main.tile[Num5, Num6 + 1].active() || !Main.tileSolid[(int)Main.tile[Num5, Num6 + 1].type]) && (!Main.tile[Num5 + npc.direction, Num6 + 1].active() || !Main.tileSolid[(int)Main.tile[Num5 + npc.direction, Num6 + 1].type])) - { - npc.velocity.Y = -8f; - npc.velocity.X = npc.velocity.X * 1.5f; - npc.netUpdate = true; - } - else - { - if (Flag2) - { - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - } - } - } - } - } - } - else - { - if (Flag2) - { - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - } - } - else - { - int Num = 15; - bool Flag = false; - bool Flag2 = true; + if (npc.velocity.Y == 0f && ((npc.velocity.X > 0f && npc.direction < 0) || (npc.velocity.X < 0f && npc.direction > 0))) + { + Flag = true; + } + if (npc.position.X == npc.oldPosition.X || npc.ai[3] >= (float)Num || Flag) + { + npc.ai[3] += 1f; + } + else + { + if ((double)Math.Abs(npc.velocity.X) > 0.9 && npc.ai[3] > 0f) + { + npc.ai[3] -= 1f; + } + } + if (npc.ai[3] > (float)(Num * 10)) + { + npc.ai[3] = 0f; + } + if (npc.justHit) + { + npc.ai[3] = 0f; + } + if (npc.ai[3] == (float)Num) + { + npc.netUpdate = true; + } - if (npc.velocity.Y == 0f && ((npc.velocity.X > 0f && npc.direction < 0) || (npc.velocity.X < 0f && npc.direction > 0))) - { - Flag = true; - } - if (npc.position.X == npc.oldPosition.X || npc.ai[3] >= (float)Num || Flag) - { - npc.ai[3] += 1f; - } - else - { - if ((double)Math.Abs(npc.velocity.X) > 0.9 && npc.ai[3] > 0f) - { - npc.ai[3] -= 1f; - } - } - if (npc.ai[3] > (float)(Num * 10)) - { - npc.ai[3] = 0f; - } - if (npc.justHit) - { - npc.ai[3] = 0f; - } - if (npc.ai[3] == (float)Num) - { - npc.netUpdate = true; - } + if (npc.ai[3] < (float)Num) + { + npc.TargetClosest(true); + } + else + { + if (npc.velocity.X == 0f) + { + if (npc.velocity.Y == 0f) + { + npc.ai[0] += 1f; + if (npc.ai[0] >= 2f) + { + npc.direction *= -1; + npc.spriteDirection = npc.direction; + npc.ai[0] = 0f; + } + } + } + else + { + npc.ai[0] = 0f; + } + if (npc.direction == 0) + { + npc.direction = 1; + } + } - if (npc.ai[3] < (float)Num) - { - npc.TargetClosest(true); - } - else - { - if (npc.velocity.X == 0f) - { - if (npc.velocity.Y == 0f) - { - npc.ai[0] += 1f; - if (npc.ai[0] >= 2f) - { - npc.direction *= -1; - npc.spriteDirection = npc.direction; - npc.ai[0] = 0f; - } - } - } - else - { - npc.ai[0] = 0f; - } - if (npc.direction == 0) - { - npc.direction = 1; - } - } + if (npc.velocity.X < -3f || npc.velocity.X > 3f) + { + if (npc.velocity.Y == 0f) + { + npc.velocity *= 0.8f; + } + } + else + { + if (npc.velocity.X < 3f && npc.direction == 1) + { + npc.velocity.X = npc.velocity.X + 0.1f; + if (npc.velocity.X > 3f) + { + npc.velocity.X = 3f; + } + } + else + { + if (npc.velocity.X > -3f && npc.direction == -1) + { + npc.velocity.X = npc.velocity.X - 0.1f; + if (npc.velocity.X < -3f) + { + npc.velocity.X = -3f; + } + } + } + } - if (npc.velocity.X < -3f || npc.velocity.X > 3f) - { - if (npc.velocity.Y == 0f) - { - npc.velocity *= 0.8f; - } - } - else - { - if (npc.velocity.X < 3f && npc.direction == 1) - { - npc.velocity.X = npc.velocity.X + 0.1f; - if (npc.velocity.X > 3f) - { - npc.velocity.X = 3f; - } - } - else - { - if (npc.velocity.X > -3f && npc.direction == -1) - { - npc.velocity.X = npc.velocity.X - 0.1f; - if (npc.velocity.X < -3f) - { - npc.velocity.X = -3f; - } - } - } - } + bool Flag3 = false; + if (npc.velocity.Y == 0f) + { + int Num2 = (int)(npc.position.Y + (float)npc.height + 8f) / 16; + int Num3 = (int)npc.position.X / 16; + int Num4 = (int)(npc.position.X + (float)npc.width) / 16; + for (int l = Num3; l <= Num4; l++) + { + if (Main.tile[l, Num2] == null) + { + return; + } + if (Main.tile[l, Num2].active() && Main.tileSolid[(int)Main.tile[l, Num2].type]) + { + Flag3 = true; + break; + } + } + } - bool Flag3 = false; - if (npc.velocity.Y == 0f) - { - int Num2 = (int)(npc.position.Y + (float)npc.height + 8f) / 16; - int Num3 = (int)npc.position.X / 16; - int Num4 = (int)(npc.position.X + (float)npc.width) / 16; - for (int l = Num3; l <= Num4; l++) - { - if (Main.tile[l, Num2] == null) - { - return; - } - if (Main.tile[l, Num2].active() && Main.tileSolid[(int)Main.tile[l, Num2].type]) - { - Flag3 = true; - break; - } - } - } + if (Flag3) + { + int Num5 = (int)((npc.position.X + (float)(npc.width / 2) + (float)((npc.width / 2 + 6) * npc.direction)) / 16f); + int Num6 = (int)((npc.position.Y + (float)npc.height - 15f) / 16f); + if (Main.tile[Num5, Num6] == null) + { + Main.tile[Num5, Num6] = new Tile(); + } + if (Main.tile[Num5, Num6 - 1] == null) + { + Main.tile[Num5, Num6 - 1] = new Tile(); + } + if (Main.tile[Num5, Num6 - 2] == null) + { + Main.tile[Num5, Num6 - 2] = new Tile(); + } + if (Main.tile[Num5, Num6 - 3] == null) + { + Main.tile[Num5, Num6 - 3] = new Tile(); + } + if (Main.tile[Num5, Num6 + 1] == null) + { + Main.tile[Num5, Num6 + 1] = new Tile(); + } + if (Main.tile[Num5 + npc.direction, Num6 - 1] == null) + { + Main.tile[Num5 + npc.direction, Num6 - 1] = new Tile(); + } + if (Main.tile[Num5 + npc.direction, Num6 + 1] == null) + { + Main.tile[Num5 + npc.direction, Num6 + 1] = new Tile(); + } - if (Flag3) - { - int Num5 = (int)((npc.position.X + (float)(npc.width / 2) + (float)((npc.width / 2 + 6) * npc.direction)) / 16f); - int Num6 = (int)((npc.position.Y + (float)npc.height - 15f) / 16f); - if (Main.tile[Num5, Num6] == null) - { - Main.tile[Num5, Num6] = new Tile(); - } - if (Main.tile[Num5, Num6 - 1] == null) - { - Main.tile[Num5, Num6 - 1] = new Tile(); - } - if (Main.tile[Num5, Num6 - 2] == null) - { - Main.tile[Num5, Num6 - 2] = new Tile(); - } - if (Main.tile[Num5, Num6 - 3] == null) - { - Main.tile[Num5, Num6 - 3] = new Tile(); - } - if (Main.tile[Num5, Num6 + 1] == null) - { - Main.tile[Num5, Num6 + 1] = new Tile(); - } - if (Main.tile[Num5 + npc.direction, Num6 - 1] == null) - { - Main.tile[Num5 + npc.direction, Num6 - 1] = new Tile(); - } - if (Main.tile[Num5 + npc.direction, Num6 + 1] == null) - { - Main.tile[Num5 + npc.direction, Num6 + 1] = new Tile(); - } + if (Main.tile[Num5, Num6 - 1].active() && Main.tile[Num5, Num6 - 1].type == 10 && Flag2) + { + npc.ai[2] += 1f; + npc.ai[3] = 0f; + if (npc.ai[2] >= 60f) + { + npc.velocity.X = 0.5f * (float)(-(float)npc.direction); + npc.ai[1] += 1f; + npc.ai[2] = 0f; + bool Flag4 = false; + if (npc.ai[1] >= 10f) + { + Flag4 = true; + npc.ai[1] = 10f; + } + WorldGen.KillTile(Num5, Num6 - 1, true, false, false); + if ((Main.netMode != 1 || !Flag4) && Flag4 && Main.netMode != 1) + { + bool Flag5 = WorldGen.OpenDoor(Num5, Num6, npc.direction); + if (!Flag5) + { + npc.ai[3] = (float)Num; + npc.netUpdate = true; + } + if (Main.netMode == 2 && Flag5) + { + //NetMessage.SendData(19, -1, -1, "", 0, (float)Num5, (float)Num6, (float)npc.direction, 0); + } + } + } + } - if (Main.tile[Num5, Num6 - 1].active() && Main.tile[Num5, Num6 - 1].type == 10 && Flag2) - { - npc.ai[2] += 1f; - npc.ai[3] = 0f; - if (npc.ai[2] >= 60f) - { - npc.velocity.X = 0.5f * (float)(-(float)npc.direction); - npc.ai[1] += 1f; - npc.ai[2] = 0f; - bool Flag4 = false; - if (npc.ai[1] >= 10f) - { - Flag4 = true; - npc.ai[1] = 10f; - } - WorldGen.KillTile(Num5, Num6 - 1, true, false, false); - if ((Main.netMode != 1 || !Flag4) && Flag4 && Main.netMode != 1) - { - bool Flag5 = WorldGen.OpenDoor(Num5, Num6, npc.direction); - if (!Flag5) - { - npc.ai[3] = (float)Num; - npc.netUpdate = true; - } - if (Main.netMode == 2 && Flag5) - { - //NetMessage.SendData(19, -1, -1, "", 0, (float)Num5, (float)Num6, (float)npc.direction, 0); - } - } - } - } + if ((npc.velocity.X < 0f && npc.spriteDirection == -1) || (npc.velocity.X > 0f && npc.spriteDirection == 1)) + { + if (Main.tile[Num5, Num6 - 2].active() && Main.tileSolid[(int)Main.tile[Num5, Num6 - 2].type]) + { + if ((Main.tile[Num5, Num6 - 3].active() && Main.tileSolid[(int)Main.tile[Num5, Num6 - 3].type])) + { + npc.velocity.Y = -8f; + npc.netUpdate = true; + } + else + { + npc.velocity.Y = -7f; + npc.netUpdate = true; + } + } + else + { + if (Main.tile[Num5, Num6 - 1].active() && Main.tileSolid[(int)Main.tile[Num5, Num6 - 1].type]) + { + npc.velocity.Y = -6f; + npc.netUpdate = true; + } + else + { + if (Main.tile[Num5, Num6].active() && Main.tileSolid[(int)Main.tile[Num5, Num6].type]) + { + npc.velocity.Y = -5f; + npc.netUpdate = true; + } + else + { + if (npc.directionY < 0 && (!Main.tile[Num5, Num6 + 1].active() || !Main.tileSolid[(int)Main.tile[Num5, Num6 + 1].type]) && (!Main.tile[Num5 + npc.direction, Num6 + 1].active() || !Main.tileSolid[(int)Main.tile[Num5 + npc.direction, Num6 + 1].type])) + { + npc.velocity.Y = -8f; + npc.velocity.X = npc.velocity.X * 1.5f; + npc.netUpdate = true; + } + else + { + if (Flag2) + { + npc.ai[1] = 0f; + npc.ai[2] = 0f; + } + } + } + } + } + } + } + else + { + if (Flag2) + { + npc.ai[1] = 0f; + npc.ai[2] = 0f; + } + } + } + } - if ((npc.velocity.X < 0f && npc.spriteDirection == -1) || (npc.velocity.X > 0f && npc.spriteDirection == 1)) - { - if (Main.tile[Num5, Num6 - 2].active() && Main.tileSolid[(int)Main.tile[Num5, Num6 - 2].type]) - { - if ((Main.tile[Num5, Num6 - 3].active() && Main.tileSolid[(int)Main.tile[Num5, Num6 - 3].type])) - { - npc.velocity.Y = -8f; - npc.netUpdate = true; - } - else - { - npc.velocity.Y = -7f; - npc.netUpdate = true; - } - } - else - { - if (Main.tile[Num5, Num6 - 1].active() && Main.tileSolid[(int)Main.tile[Num5, Num6 - 1].type]) - { - npc.velocity.Y = -6f; - npc.netUpdate = true; - } - else - { - if (Main.tile[Num5, Num6].active() && Main.tileSolid[(int)Main.tile[Num5, Num6].type]) - { - npc.velocity.Y = -5f; - npc.netUpdate = true; - } - else - { - if (npc.directionY < 0 && (!Main.tile[Num5, Num6 + 1].active() || !Main.tileSolid[(int)Main.tile[Num5, Num6 + 1].type]) && (!Main.tile[Num5 + npc.direction, Num6 + 1].active() || !Main.tileSolid[(int)Main.tile[Num5 + npc.direction, Num6 + 1].type])) - { - npc.velocity.Y = -8f; - npc.velocity.X = npc.velocity.X * 1.5f; - npc.netUpdate = true; - } - else - { - if (Flag2) - { - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - } - } - } - } - } - } - else - { - if (Flag2) - { - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - } - } - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (NPC.AnyNPCs(26) || NPC.AnyNPCs(27) || NPC.AnyNPCs(28) || NPC.AnyNPCs(29)) && NPC.downedBoss3 && y < Main.worldSurface ? 0.08f : 0f; + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (NPC.AnyNPCs(26) || NPC.AnyNPCs(27) || NPC.AnyNPCs(28) || NPC.AnyNPCs(29)) && NPC.downedBoss3 && y < Main.worldSurface ? 0.08f : 0f; - } - - public override void NPCLoot() - { - if (Main.invasionType == Terraria.ID.InvasionID.GoblinArmy) - { - Main.invasionProgress++; - } - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; + public override void NPCLoot() + { + if (Main.invasionType == Terraria.ID.InvasionID.GoblinArmy) + { + Main.invasionProgress++; + } + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 161, Main.rand.Next(1, 15)); - } + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 161, Main.rand.Next(1, 15)); + } - if(Main.rand.Next(200) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 160); - } - } - } + if (Main.rand.Next(200) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 160); + } + } + } - Rectangle GetFrame(int Num) - { - return new Rectangle(0, npc.frame.Height * (Num - 1), npc.frame.Width, npc.frame.Height); - } - } + Rectangle GetFrame(int Num) + { + return new Rectangle(0, npc.frame.Height * (Num - 1), npc.frame.Width, npc.frame.Height); + } + } } \ No newline at end of file diff --git a/NPCs/GoblinBomber.cs b/NPCs/GoblinBomber.cs index 73327743..6ddad7b3 100644 --- a/NPCs/GoblinBomber.cs +++ b/NPCs/GoblinBomber.cs @@ -8,477 +8,477 @@ namespace Tremor.NPCs { - public class GoblinBomber : ModNPC - { + public class GoblinBomber : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Goblin Bomber"); Main.npcFrameCount[npc.type] = 3; } - - public override void SetDefaults() - { - npc.lifeMax = 45; - npc.damage = 50; - npc.defense = 0; - npc.knockBackResist = 0.3f; - npc.width = 42; - npc.height = 56; - npc.aiStyle = -1; - npc.npcSlots = 15f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.value = Item.buyPrice(0, 0, 1, 21); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 45; + npc.damage = 50; + npc.defense = 0; + npc.knockBackResist = 0.3f; + npc.width = 42; + npc.height = 56; + npc.aiStyle = -1; + npc.npcSlots = 15f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.value = Item.buyPrice(0, 0, 1, 21); + } - int TimeToAnimation = 4; - int Frame = 0; - public override void AI() - { - npc.TargetClosest(true); - npc.spriteDirection = npc.direction; - PlayAnimation(); - DoAI(); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public void PlayAnimation() - { - if (--TimeToAnimation <= 0) - { - if (++Frame > 3) - Frame = 1; - TimeToAnimation = 4; - npc.frame = GetFrame(Frame); - } - } + int TimeToAnimation = 4; + int Frame = 0; + public override void AI() + { + npc.TargetClosest(true); + npc.spriteDirection = npc.direction; + PlayAnimation(); + DoAI(); + } - public void DoAI() - { - int Num = 15; - bool Flag = false; - bool Flag2 = true; + public void PlayAnimation() + { + if (--TimeToAnimation <= 0) + { + if (++Frame > 3) + Frame = 1; + TimeToAnimation = 4; + npc.frame = GetFrame(Frame); + } + } - if (npc.velocity.Y == 0f && ((npc.velocity.X > 0f && npc.direction < 0) || (npc.velocity.X < 0f && npc.direction > 0))) - { - Flag = true; - } - if (npc.position.X == npc.oldPosition.X || npc.ai[3] >= (float)Num || Flag) - { - npc.ai[3] += 1f; - } - else - { - if ((double)Math.Abs(npc.velocity.X) > 0.9 && npc.ai[3] > 0f) - { - npc.ai[3] -= 1f; - } - } - if (npc.ai[3] > (float)(Num * 10)) - { - npc.ai[3] = 0f; - } - if (npc.justHit) - { - npc.ai[3] = 0f; - } - if (npc.ai[3] == (float)Num) - { - npc.netUpdate = true; - } + public void DoAI() + { + int Num = 15; + bool Flag = false; + bool Flag2 = true; - if (npc.ai[3] < (float)Num) - { - npc.TargetClosest(true); - } - else - { - if (npc.velocity.X == 0f) - { - if (npc.velocity.Y == 0f) - { - npc.ai[0] += 1f; - if (npc.ai[0] >= 2f) - { - npc.direction *= -1; - npc.spriteDirection = npc.direction; - npc.ai[0] = 0f; - } - } - } - else - { - npc.ai[0] = 0f; - } - if (npc.direction == 0) - { - npc.direction = 1; - } - } + if (npc.velocity.Y == 0f && ((npc.velocity.X > 0f && npc.direction < 0) || (npc.velocity.X < 0f && npc.direction > 0))) + { + Flag = true; + } + if (npc.position.X == npc.oldPosition.X || npc.ai[3] >= (float)Num || Flag) + { + npc.ai[3] += 1f; + } + else + { + if ((double)Math.Abs(npc.velocity.X) > 0.9 && npc.ai[3] > 0f) + { + npc.ai[3] -= 1f; + } + } + if (npc.ai[3] > (float)(Num * 10)) + { + npc.ai[3] = 0f; + } + if (npc.justHit) + { + npc.ai[3] = 0f; + } + if (npc.ai[3] == (float)Num) + { + npc.netUpdate = true; + } - if (npc.velocity.X < -5f || npc.velocity.X > 5f) - { - if (npc.velocity.Y == 0f) - { - npc.velocity *= 0.8f; - } - } - else - { - if (npc.velocity.X < 5f && npc.direction == 1) - { - npc.velocity.X = npc.velocity.X + 0.1f; - if (npc.velocity.X > 5f) - { - npc.velocity.X = 5f; - } - } - else - { - if (npc.velocity.X > -5f && npc.direction == -1) - { - npc.velocity.X = npc.velocity.X - 0.1f; - if (npc.velocity.X < -5f) - { - npc.velocity.X = -5f; - } - } - } - } + if (npc.ai[3] < (float)Num) + { + npc.TargetClosest(true); + } + else + { + if (npc.velocity.X == 0f) + { + if (npc.velocity.Y == 0f) + { + npc.ai[0] += 1f; + if (npc.ai[0] >= 2f) + { + npc.direction *= -1; + npc.spriteDirection = npc.direction; + npc.ai[0] = 0f; + } + } + } + else + { + npc.ai[0] = 0f; + } + if (npc.direction == 0) + { + npc.direction = 1; + } + } - bool Flag3 = false; - if (npc.velocity.Y == 0f) - { - int Num2 = (int)(npc.position.Y + (float)npc.height + 8f) / 16; - int Num3 = (int)npc.position.X / 16; - int Num4 = (int)(npc.position.X + (float)npc.width) / 16; - for (int l = Num3; l <= Num4; l++) - { - if (Main.tile[l, Num2] == null) - { - return; - } - if (Main.tile[l, Num2].active() && Main.tileSolid[(int)Main.tile[l, Num2].type]) - { - Flag3 = true; - break; - } - } - } + if (npc.velocity.X < -5f || npc.velocity.X > 5f) + { + if (npc.velocity.Y == 0f) + { + npc.velocity *= 0.8f; + } + } + else + { + if (npc.velocity.X < 5f && npc.direction == 1) + { + npc.velocity.X = npc.velocity.X + 0.1f; + if (npc.velocity.X > 5f) + { + npc.velocity.X = 5f; + } + } + else + { + if (npc.velocity.X > -5f && npc.direction == -1) + { + npc.velocity.X = npc.velocity.X - 0.1f; + if (npc.velocity.X < -5f) + { + npc.velocity.X = -5f; + } + } + } + } - if (Flag3) - { - int Num5 = (int)((npc.position.X + (float)(npc.width / 2) + (float)((npc.width / 2 + 6) * npc.direction)) / 16f); - int Num6 = (int)((npc.position.Y + (float)npc.height - 15f) / 16f); - if (Main.tile[Num5, Num6] == null) - { - Main.tile[Num5, Num6] = new Tile(); - } - if (Main.tile[Num5, Num6 - 1] == null) - { - Main.tile[Num5, Num6 - 1] = new Tile(); - } - if (Main.tile[Num5, Num6 - 2] == null) - { - Main.tile[Num5, Num6 - 2] = new Tile(); - } - if (Main.tile[Num5, Num6 - 3] == null) - { - Main.tile[Num5, Num6 - 3] = new Tile(); - } - if (Main.tile[Num5, Num6 + 1] == null) - { - Main.tile[Num5, Num6 + 1] = new Tile(); - } - if (Main.tile[Num5 + npc.direction, Num6 - 1] == null) - { - Main.tile[Num5 + npc.direction, Num6 - 1] = new Tile(); - } - if (Main.tile[Num5 + npc.direction, Num6 + 1] == null) - { - Main.tile[Num5 + npc.direction, Num6 + 1] = new Tile(); - } + bool Flag3 = false; + if (npc.velocity.Y == 0f) + { + int Num2 = (int)(npc.position.Y + (float)npc.height + 8f) / 16; + int Num3 = (int)npc.position.X / 16; + int Num4 = (int)(npc.position.X + (float)npc.width) / 16; + for (int l = Num3; l <= Num4; l++) + { + if (Main.tile[l, Num2] == null) + { + return; + } + if (Main.tile[l, Num2].active() && Main.tileSolid[(int)Main.tile[l, Num2].type]) + { + Flag3 = true; + break; + } + } + } - if (Main.tile[Num5, Num6 - 1].active() && Main.tile[Num5, Num6 - 1].type == 10 && Flag2) - { - npc.ai[2] += 1f; - npc.ai[3] = 0f; - if (npc.ai[2] >= 60f) - { - npc.velocity.X = 0.5f * (float)(-(float)npc.direction); - npc.ai[1] += 1f; - npc.ai[2] = 0f; - bool Flag4 = false; - if (npc.ai[1] >= 10f) - { - Flag4 = true; - npc.ai[1] = 10f; - } - WorldGen.KillTile(Num5, Num6 - 1, true, false, false); - if ((Main.netMode != 1 || !Flag4) && Flag4 && Main.netMode != 1) - { - bool Flag5 = WorldGen.OpenDoor(Num5, Num6, npc.direction); - if (!Flag5) - { - npc.ai[3] = (float)Num; - npc.netUpdate = true; - } - if (Main.netMode == 2 && Flag5) - { - //NetMessage.SendData(19, -1, -1, "", 0, (float)Num5, (float)Num6, (float)npc.direction, 0); - } - } - } - } + if (Flag3) + { + int Num5 = (int)((npc.position.X + (float)(npc.width / 2) + (float)((npc.width / 2 + 6) * npc.direction)) / 16f); + int Num6 = (int)((npc.position.Y + (float)npc.height - 15f) / 16f); + if (Main.tile[Num5, Num6] == null) + { + Main.tile[Num5, Num6] = new Tile(); + } + if (Main.tile[Num5, Num6 - 1] == null) + { + Main.tile[Num5, Num6 - 1] = new Tile(); + } + if (Main.tile[Num5, Num6 - 2] == null) + { + Main.tile[Num5, Num6 - 2] = new Tile(); + } + if (Main.tile[Num5, Num6 - 3] == null) + { + Main.tile[Num5, Num6 - 3] = new Tile(); + } + if (Main.tile[Num5, Num6 + 1] == null) + { + Main.tile[Num5, Num6 + 1] = new Tile(); + } + if (Main.tile[Num5 + npc.direction, Num6 - 1] == null) + { + Main.tile[Num5 + npc.direction, Num6 - 1] = new Tile(); + } + if (Main.tile[Num5 + npc.direction, Num6 + 1] == null) + { + Main.tile[Num5 + npc.direction, Num6 + 1] = new Tile(); + } - if ((npc.velocity.X < 0f && npc.spriteDirection == -1) || (npc.velocity.X > 0f && npc.spriteDirection == 1)) - { - if (Main.tile[Num5, Num6 - 2].active() && Main.tileSolid[(int)Main.tile[Num5, Num6 - 2].type]) - { - if ((Main.tile[Num5, Num6 - 3].active() && Main.tileSolid[(int)Main.tile[Num5, Num6 - 3].type])) - { - npc.velocity.Y = -8f; - npc.netUpdate = true; - } - else - { - npc.velocity.Y = -7f; - npc.netUpdate = true; - } - } - else - { - if (Main.tile[Num5, Num6 - 1].active() && Main.tileSolid[(int)Main.tile[Num5, Num6 - 1].type]) - { - npc.velocity.Y = -6f; - npc.netUpdate = true; - } - else - { - if (Main.tile[Num5, Num6].active() && Main.tileSolid[(int)Main.tile[Num5, Num6].type]) - { - npc.velocity.Y = -5f; - npc.netUpdate = true; - } - else - { - if (npc.directionY < 0 && (!Main.tile[Num5, Num6 + 1].active() || !Main.tileSolid[(int)Main.tile[Num5, Num6 + 1].type]) && (!Main.tile[Num5 + npc.direction, Num6 + 1].active() || !Main.tileSolid[(int)Main.tile[Num5 + npc.direction, Num6 + 1].type])) - { - npc.velocity.Y = -8f; - npc.velocity.X = npc.velocity.X * 1.5f; - npc.netUpdate = true; - } - else - { - if (Flag2) - { - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - } - } - } - } - } - } - else - { - if (Flag2) - { - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - } - } + if (Main.tile[Num5, Num6 - 1].active() && Main.tile[Num5, Num6 - 1].type == 10 && Flag2) + { + npc.ai[2] += 1f; + npc.ai[3] = 0f; + if (npc.ai[2] >= 60f) + { + npc.velocity.X = 0.5f * (float)(-(float)npc.direction); + npc.ai[1] += 1f; + npc.ai[2] = 0f; + bool Flag4 = false; + if (npc.ai[1] >= 10f) + { + Flag4 = true; + npc.ai[1] = 10f; + } + WorldGen.KillTile(Num5, Num6 - 1, true, false, false); + if ((Main.netMode != 1 || !Flag4) && Flag4 && Main.netMode != 1) + { + bool Flag5 = WorldGen.OpenDoor(Num5, Num6, npc.direction); + if (!Flag5) + { + npc.ai[3] = (float)Num; + npc.netUpdate = true; + } + if (Main.netMode == 2 && Flag5) + { + //NetMessage.SendData(19, -1, -1, "", 0, (float)Num5, (float)Num6, (float)npc.direction, 0); + } + } + } + } - public override void OnHitPlayer(Player player, int damage, bool crit) - { - npc.life = -1; - npc.active = false; - npc.checkDead(); - Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 62); - npc.position.X = npc.position.X + (float)(npc.width / 2); - npc.position.Y = npc.position.Y + (float)(npc.height / 2); - npc.width = 80; - npc.height = 80; - npc.position.X = npc.position.X - (float)(npc.width / 2); - npc.position.Y = npc.position.Y - (float)(npc.height / 2); - for (int num628 = 0; num628 < 40; num628++) - { - int num629 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 31, 0f, 0f, 100, default(Color), 2f); - Main.dust[num629].velocity *= 3f; - if (Main.rand.Next(2) == 0) - { - Main.dust[num629].scale = 0.5f; - Main.dust[num629].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } - for (int num630 = 0; num630 < 70; num630++) - { - int num631 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 6, 0f, 0f, 100, default(Color), 3f); - Main.dust[num631].noGravity = true; - Main.dust[num631].velocity *= 5f; - num631 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 6, 0f, 0f, 100, default(Color), 2f); - Main.dust[num631].velocity *= 2f; - } - for (int num632 = 0; num632 < 3; num632++) - { - float scaleFactor10 = 0.33f; - if (num632 == 1) - { - scaleFactor10 = 0.66f; - } - if (num632 == 2) - { - scaleFactor10 = 1f; - } - int num633 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); - Main.gore[num633].velocity *= scaleFactor10; - Gore expr_13E6D_cp_0 = Main.gore[num633]; - expr_13E6D_cp_0.velocity.X = expr_13E6D_cp_0.velocity.X + 1f; - Gore expr_13E8D_cp_0 = Main.gore[num633]; - expr_13E8D_cp_0.velocity.Y = expr_13E8D_cp_0.velocity.Y + 1f; - num633 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 2f); - Main.gore[num633].velocity *= scaleFactor10; - Gore expr_13F30_cp_0 = Main.gore[num633]; - expr_13F30_cp_0.velocity.X = expr_13F30_cp_0.velocity.X - 1f; - Gore expr_13F50_cp_0 = Main.gore[num633]; - expr_13F50_cp_0.velocity.Y = expr_13F50_cp_0.velocity.Y + 1f; - num633 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); - Main.gore[num633].velocity *= scaleFactor10; - Gore expr_13FF3_cp_0 = Main.gore[num633]; - expr_13FF3_cp_0.velocity.X = expr_13FF3_cp_0.velocity.X + 1f; - Gore expr_14013_cp_0 = Main.gore[num633]; - expr_14013_cp_0.velocity.Y = expr_14013_cp_0.velocity.Y - 1f; - num633 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); - Main.gore[num633].velocity *= scaleFactor10; - Gore expr_140B6_cp_0 = Main.gore[num633]; - expr_140B6_cp_0.velocity.X = expr_140B6_cp_0.velocity.X - 1f; - Gore expr_140D6_cp_0 = Main.gore[num633]; - expr_140D6_cp_0.velocity.Y = expr_140D6_cp_0.velocity.Y - 1f; - } - npc.position.X = npc.position.X + (float)(npc.width / 2); - npc.position.Y = npc.position.Y + (float)(npc.height / 2); - npc.width = 10; - npc.height = 10; - npc.position.X = npc.position.X - (float)(npc.width / 2); - npc.position.Y = npc.position.Y - (float)(npc.height / 2); - } + if ((npc.velocity.X < 0f && npc.spriteDirection == -1) || (npc.velocity.X > 0f && npc.spriteDirection == 1)) + { + if (Main.tile[Num5, Num6 - 2].active() && Main.tileSolid[(int)Main.tile[Num5, Num6 - 2].type]) + { + if ((Main.tile[Num5, Num6 - 3].active() && Main.tileSolid[(int)Main.tile[Num5, Num6 - 3].type])) + { + npc.velocity.Y = -8f; + npc.netUpdate = true; + } + else + { + npc.velocity.Y = -7f; + npc.netUpdate = true; + } + } + else + { + if (Main.tile[Num5, Num6 - 1].active() && Main.tileSolid[(int)Main.tile[Num5, Num6 - 1].type]) + { + npc.velocity.Y = -6f; + npc.netUpdate = true; + } + else + { + if (Main.tile[Num5, Num6].active() && Main.tileSolid[(int)Main.tile[Num5, Num6].type]) + { + npc.velocity.Y = -5f; + npc.netUpdate = true; + } + else + { + if (npc.directionY < 0 && (!Main.tile[Num5, Num6 + 1].active() || !Main.tileSolid[(int)Main.tile[Num5, Num6 + 1].type]) && (!Main.tile[Num5 + npc.direction, Num6 + 1].active() || !Main.tileSolid[(int)Main.tile[Num5 + npc.direction, Num6 + 1].type])) + { + npc.velocity.Y = -8f; + npc.velocity.X = npc.velocity.X * 1.5f; + npc.netUpdate = true; + } + else + { + if (Flag2) + { + npc.ai[1] = 0f; + npc.ai[2] = 0f; + } + } + } + } + } + } + } + else + { + if (Flag2) + { + npc.ai[1] = 0f; + npc.ai[2] = 0f; + } + } + } - public override void HitEffect(int hitDirection, double damage) - { - if (npc.life <= 0) - { - Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 62); - npc.position.X = npc.position.X + (float)(npc.width / 2); - npc.position.Y = npc.position.Y + (float)(npc.height / 2); - npc.width = 80; - npc.height = 80; - npc.position.X = npc.position.X - (float)(npc.width / 2); - npc.position.Y = npc.position.Y - (float)(npc.height / 2); - for (int num628 = 0; num628 < 40; num628++) - { - int num629 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 31, 0f, 0f, 100, default(Color), 2f); - Main.dust[num629].velocity *= 3f; - if (Main.rand.Next(2) == 0) - { - Main.dust[num629].scale = 0.5f; - Main.dust[num629].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } - for (int num630 = 0; num630 < 70; num630++) - { - int num631 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 6, 0f, 0f, 100, default(Color), 3f); - Main.dust[num631].noGravity = true; - Main.dust[num631].velocity *= 5f; - num631 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 6, 0f, 0f, 100, default(Color), 2f); - Main.dust[num631].velocity *= 2f; - } - for (int num632 = 0; num632 < 3; num632++) - { - float scaleFactor10 = 0.33f; - if (num632 == 1) - { - scaleFactor10 = 0.66f; - } - if (num632 == 2) - { - scaleFactor10 = 1f; - } - int num633 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); - Main.gore[num633].velocity *= scaleFactor10; - Gore expr_13E6D_cp_0 = Main.gore[num633]; - expr_13E6D_cp_0.velocity.X = expr_13E6D_cp_0.velocity.X + 1f; - Gore expr_13E8D_cp_0 = Main.gore[num633]; - expr_13E8D_cp_0.velocity.Y = expr_13E8D_cp_0.velocity.Y + 1f; - num633 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 2f); - Main.gore[num633].velocity *= scaleFactor10; - Gore expr_13F30_cp_0 = Main.gore[num633]; - expr_13F30_cp_0.velocity.X = expr_13F30_cp_0.velocity.X - 1f; - Gore expr_13F50_cp_0 = Main.gore[num633]; - expr_13F50_cp_0.velocity.Y = expr_13F50_cp_0.velocity.Y + 1f; - num633 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); - Main.gore[num633].velocity *= scaleFactor10; - Gore expr_13FF3_cp_0 = Main.gore[num633]; - expr_13FF3_cp_0.velocity.X = expr_13FF3_cp_0.velocity.X + 1f; - Gore expr_14013_cp_0 = Main.gore[num633]; - expr_14013_cp_0.velocity.Y = expr_14013_cp_0.velocity.Y - 1f; - num633 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); - Main.gore[num633].velocity *= scaleFactor10; - Gore expr_140B6_cp_0 = Main.gore[num633]; - expr_140B6_cp_0.velocity.X = expr_140B6_cp_0.velocity.X - 1f; - Gore expr_140D6_cp_0 = Main.gore[num633]; - expr_140D6_cp_0.velocity.Y = expr_140D6_cp_0.velocity.Y - 1f; - } - npc.position.X = npc.position.X + (float)(npc.width / 2); - npc.position.Y = npc.position.Y + (float)(npc.height / 2); - npc.width = 10; - npc.height = 10; - npc.position.X = npc.position.X - (float)(npc.width / 2); - npc.position.Y = npc.position.Y - (float)(npc.height / 2); - } - } + public override void OnHitPlayer(Player player, int damage, bool crit) + { + npc.life = -1; + npc.active = false; + npc.checkDead(); + Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 62); + npc.position.X = npc.position.X + (float)(npc.width / 2); + npc.position.Y = npc.position.Y + (float)(npc.height / 2); + npc.width = 80; + npc.height = 80; + npc.position.X = npc.position.X - (float)(npc.width / 2); + npc.position.Y = npc.position.Y - (float)(npc.height / 2); + for (int num628 = 0; num628 < 40; num628++) + { + int num629 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 31, 0f, 0f, 100, default(Color), 2f); + Main.dust[num629].velocity *= 3f; + if (Main.rand.Next(2) == 0) + { + Main.dust[num629].scale = 0.5f; + Main.dust[num629].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + } + } + for (int num630 = 0; num630 < 70; num630++) + { + int num631 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 6, 0f, 0f, 100, default(Color), 3f); + Main.dust[num631].noGravity = true; + Main.dust[num631].velocity *= 5f; + num631 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 6, 0f, 0f, 100, default(Color), 2f); + Main.dust[num631].velocity *= 2f; + } + for (int num632 = 0; num632 < 3; num632++) + { + float scaleFactor10 = 0.33f; + if (num632 == 1) + { + scaleFactor10 = 0.66f; + } + if (num632 == 2) + { + scaleFactor10 = 1f; + } + int num633 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num633].velocity *= scaleFactor10; + Gore expr_13E6D_cp_0 = Main.gore[num633]; + expr_13E6D_cp_0.velocity.X = expr_13E6D_cp_0.velocity.X + 1f; + Gore expr_13E8D_cp_0 = Main.gore[num633]; + expr_13E8D_cp_0.velocity.Y = expr_13E8D_cp_0.velocity.Y + 1f; + num633 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 2f); + Main.gore[num633].velocity *= scaleFactor10; + Gore expr_13F30_cp_0 = Main.gore[num633]; + expr_13F30_cp_0.velocity.X = expr_13F30_cp_0.velocity.X - 1f; + Gore expr_13F50_cp_0 = Main.gore[num633]; + expr_13F50_cp_0.velocity.Y = expr_13F50_cp_0.velocity.Y + 1f; + num633 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num633].velocity *= scaleFactor10; + Gore expr_13FF3_cp_0 = Main.gore[num633]; + expr_13FF3_cp_0.velocity.X = expr_13FF3_cp_0.velocity.X + 1f; + Gore expr_14013_cp_0 = Main.gore[num633]; + expr_14013_cp_0.velocity.Y = expr_14013_cp_0.velocity.Y - 1f; + num633 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num633].velocity *= scaleFactor10; + Gore expr_140B6_cp_0 = Main.gore[num633]; + expr_140B6_cp_0.velocity.X = expr_140B6_cp_0.velocity.X - 1f; + Gore expr_140D6_cp_0 = Main.gore[num633]; + expr_140D6_cp_0.velocity.Y = expr_140D6_cp_0.velocity.Y - 1f; + } + npc.position.X = npc.position.X + (float)(npc.width / 2); + npc.position.Y = npc.position.Y + (float)(npc.height / 2); + npc.width = 10; + npc.height = 10; + npc.position.X = npc.position.X - (float)(npc.width / 2); + npc.position.Y = npc.position.Y - (float)(npc.height / 2); + } - public override void NPCLoot() - { - if (Main.invasionType == Terraria.ID.InvasionID.GoblinArmy) - { - Main.invasionProgress++; - } - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 62); + npc.position.X = npc.position.X + (float)(npc.width / 2); + npc.position.Y = npc.position.Y + (float)(npc.height / 2); + npc.width = 80; + npc.height = 80; + npc.position.X = npc.position.X - (float)(npc.width / 2); + npc.position.Y = npc.position.Y - (float)(npc.height / 2); + for (int num628 = 0; num628 < 40; num628++) + { + int num629 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 31, 0f, 0f, 100, default(Color), 2f); + Main.dust[num629].velocity *= 3f; + if (Main.rand.Next(2) == 0) + { + Main.dust[num629].scale = 0.5f; + Main.dust[num629].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + } + } + for (int num630 = 0; num630 < 70; num630++) + { + int num631 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 6, 0f, 0f, 100, default(Color), 3f); + Main.dust[num631].noGravity = true; + Main.dust[num631].velocity *= 5f; + num631 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 6, 0f, 0f, 100, default(Color), 2f); + Main.dust[num631].velocity *= 2f; + } + for (int num632 = 0; num632 < 3; num632++) + { + float scaleFactor10 = 0.33f; + if (num632 == 1) + { + scaleFactor10 = 0.66f; + } + if (num632 == 2) + { + scaleFactor10 = 1f; + } + int num633 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num633].velocity *= scaleFactor10; + Gore expr_13E6D_cp_0 = Main.gore[num633]; + expr_13E6D_cp_0.velocity.X = expr_13E6D_cp_0.velocity.X + 1f; + Gore expr_13E8D_cp_0 = Main.gore[num633]; + expr_13E8D_cp_0.velocity.Y = expr_13E8D_cp_0.velocity.Y + 1f; + num633 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 2f); + Main.gore[num633].velocity *= scaleFactor10; + Gore expr_13F30_cp_0 = Main.gore[num633]; + expr_13F30_cp_0.velocity.X = expr_13F30_cp_0.velocity.X - 1f; + Gore expr_13F50_cp_0 = Main.gore[num633]; + expr_13F50_cp_0.velocity.Y = expr_13F50_cp_0.velocity.Y + 1f; + num633 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num633].velocity *= scaleFactor10; + Gore expr_13FF3_cp_0 = Main.gore[num633]; + expr_13FF3_cp_0.velocity.X = expr_13FF3_cp_0.velocity.X + 1f; + Gore expr_14013_cp_0 = Main.gore[num633]; + expr_14013_cp_0.velocity.Y = expr_14013_cp_0.velocity.Y - 1f; + num633 = Gore.NewGore(new Vector2(npc.position.X + (float)(npc.width / 2) - 24f, npc.position.Y + (float)(npc.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num633].velocity *= scaleFactor10; + Gore expr_140B6_cp_0 = Main.gore[num633]; + expr_140B6_cp_0.velocity.X = expr_140B6_cp_0.velocity.X - 1f; + Gore expr_140D6_cp_0 = Main.gore[num633]; + expr_140D6_cp_0.velocity.Y = expr_140D6_cp_0.velocity.Y - 1f; + } + npc.position.X = npc.position.X + (float)(npc.width / 2); + npc.position.Y = npc.position.Y + (float)(npc.height / 2); + npc.width = 10; + npc.height = 10; + npc.position.X = npc.position.X - (float)(npc.width / 2); + npc.position.Y = npc.position.Y - (float)(npc.height / 2); + } + } + + public override void NPCLoot() + { + if (Main.invasionType == Terraria.ID.InvasionID.GoblinArmy) + { + Main.invasionProgress++; + } + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 161, Main.rand.Next(1, 15)); - } + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 161, Main.rand.Next(1, 15)); + } - if(Main.rand.Next(200) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 160); - } - } - } + if (Main.rand.Next(200) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 160); + } + } + } - Rectangle GetFrame(int Num) - { - return new Rectangle(0, npc.frame.Height * (Num - 1), npc.frame.Width, npc.frame.Height); - } + Rectangle GetFrame(int Num) + { + return new Rectangle(0, npc.frame.Height * (Num - 1), npc.frame.Width, npc.frame.Height); + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (NPC.AnyNPCs(26) || NPC.AnyNPCs(27) || NPC.AnyNPCs(28) || NPC.AnyNPCs(29)) && NPC.downedBoss3 && y < Main.worldSurface ? 0.08f : 0f; - } - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (NPC.AnyNPCs(26) || NPC.AnyNPCs(27) || NPC.AnyNPCs(28) || NPC.AnyNPCs(29)) && NPC.downedBoss3 && y < Main.worldSurface ? 0.08f : 0f; + } + } } \ No newline at end of file diff --git a/NPCs/GoblinStandardBearer.cs b/NPCs/GoblinStandardBearer.cs index e393fb1e..bbed0e07 100644 --- a/NPCs/GoblinStandardBearer.cs +++ b/NPCs/GoblinStandardBearer.cs @@ -8,138 +8,138 @@ namespace Tremor.NPCs { - public class GoblinStandardBearer : ModNPC - { + public class GoblinStandardBearer : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Goblin Standard Bearer"); Main.npcFrameCount[npc.type] = 3; } - - public override void SetDefaults() - { - npc.lifeMax = 75; - npc.damage = 34; - npc.defense = 14; - npc.knockBackResist = 0.1f; - npc.width = 34; - npc.height = 70; - npc.aiStyle = 3; - aiType = 77; - npc.npcSlots = 3f; - npc.noGravity = true; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.value = Item.buyPrice(0, 0, 0, 0); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 75; + npc.damage = 34; + npc.defense = 14; + npc.knockBackResist = 0.1f; + npc.width = 34; + npc.height = 70; + npc.aiStyle = 3; + aiType = 77; + npc.npcSlots = 3f; + npc.noGravity = true; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.value = Item.buyPrice(0, 0, 0, 0); + } - public override void AI() - { - PlayAnimation(); - if (Main.player[npc.target].position.X > npc.position.X) - npc.spriteDirection = 1; - else - npc.spriteDirection = -1; + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - if (npc.direction == -1 && npc.velocity.X > -2f) - { - npc.velocity.X = npc.velocity.X - 0.1f; - if (npc.velocity.X > 2f) - { - npc.velocity.X = npc.velocity.X - 0.1f; - } - else - { - if (npc.velocity.X > 0f) - { - npc.velocity.X = npc.velocity.X + 0.05f; - } - } - if (npc.velocity.X < -2f) - { - npc.velocity.X = -2f; - } - } - else - { - if (npc.direction == 1 && npc.velocity.X < 2f) - { - npc.velocity.X = npc.velocity.X + 0.1f; - if (npc.velocity.X < -2f) - { - npc.velocity.X = npc.velocity.X + 0.1f; - } - else - { - if (npc.velocity.X < 0f) - { - npc.velocity.X = npc.velocity.X - 0.05f; - } - } - if (npc.velocity.X > 2f) - { - npc.velocity.X = 2f; - } - } - } - if (npc.directionY == -1 && (double)npc.velocity.Y > -1.5) - { - npc.velocity.Y = npc.velocity.Y - 0.05f; + public override void AI() + { + PlayAnimation(); + if (Main.player[npc.target].position.X > npc.position.X) + npc.spriteDirection = 1; + else + npc.spriteDirection = -1; - if ((double)npc.velocity.Y < -1.5) - { - npc.velocity.Y = -1.5f; - } - } - else - { - if (npc.directionY == 1 && (double)npc.velocity.Y < 1.5) - { - npc.velocity.Y = npc.velocity.Y + 0.05f; - if ((double)npc.velocity.Y > 1.5) - { - npc.velocity.Y = 1.5f; - } - } - } - } + if (npc.direction == -1 && npc.velocity.X > -2f) + { + npc.velocity.X = npc.velocity.X - 0.1f; + if (npc.velocity.X > 2f) + { + npc.velocity.X = npc.velocity.X - 0.1f; + } + else + { + if (npc.velocity.X > 0f) + { + npc.velocity.X = npc.velocity.X + 0.05f; + } + } + if (npc.velocity.X < -2f) + { + npc.velocity.X = -2f; + } + } + else + { + if (npc.direction == 1 && npc.velocity.X < 2f) + { + npc.velocity.X = npc.velocity.X + 0.1f; + if (npc.velocity.X < -2f) + { + npc.velocity.X = npc.velocity.X + 0.1f; + } + else + { + if (npc.velocity.X < 0f) + { + npc.velocity.X = npc.velocity.X - 0.05f; + } + } + if (npc.velocity.X > 2f) + { + npc.velocity.X = 2f; + } + } + } + if (npc.directionY == -1 && (double)npc.velocity.Y > -1.5) + { + npc.velocity.Y = npc.velocity.Y - 0.05f; - int Frame = 0; - int TimeToAnimation = 6; - public void PlayAnimation() - { - if (--TimeToAnimation <= 0) - { - if (++Frame > 3) - Frame = 1; - TimeToAnimation = 6; - npc.frame = GetFrame(Frame); - } - } + if ((double)npc.velocity.Y < -1.5) + { + npc.velocity.Y = -1.5f; + } + } + else + { + if (npc.directionY == 1 && (double)npc.velocity.Y < 1.5) + { + npc.velocity.Y = npc.velocity.Y + 0.05f; + if ((double)npc.velocity.Y > 1.5) + { + npc.velocity.Y = 1.5f; + } + } + } + } - Rectangle GetFrame(int Num) - { - return new Rectangle(0, npc.frame.Height * (Num - 1), npc.frame.Width, npc.frame.Height); - } + int Frame = 0; + int TimeToAnimation = 6; + public void PlayAnimation() + { + if (--TimeToAnimation <= 0) + { + if (++Frame > 3) + Frame = 1; + TimeToAnimation = 6; + npc.frame = GetFrame(Frame); + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (NPC.AnyNPCs(26) || NPC.AnyNPCs(27) || NPC.AnyNPCs(28) || NPC.AnyNPCs(29)) && NPC.downedBoss3 && y < Main.worldSurface ? 0.3f : 0f; - } + Rectangle GetFrame(int Num) + { + return new Rectangle(0, npc.frame.Height * (Num - 1), npc.frame.Width, npc.frame.Height); + } - public override void NPCLoot() - { - NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("GoblinStandardBearer_Balloon")); - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (NPC.AnyNPCs(26) || NPC.AnyNPCs(27) || NPC.AnyNPCs(28) || NPC.AnyNPCs(29)) && NPC.downedBoss3 && y < Main.worldSurface ? 0.3f : 0f; + } + + public override void NPCLoot() + { + NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("GoblinStandardBearer_Balloon")); + } - } + } } \ No newline at end of file diff --git a/NPCs/GoblinStandardBearer_Balloon.cs b/NPCs/GoblinStandardBearer_Balloon.cs index 6b9c3b3d..9a0fe005 100644 --- a/NPCs/GoblinStandardBearer_Balloon.cs +++ b/NPCs/GoblinStandardBearer_Balloon.cs @@ -8,147 +8,147 @@ namespace Tremor.NPCs { - public class GoblinStandardBearer_Balloon : ModNPC - { + public class GoblinStandardBearer_Balloon : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Goblin Standard Bearer"); Main.npcFrameCount[npc.type] = 3; } - - public override void SetDefaults() - { - npc.lifeMax = 50; - npc.damage = 34; - npc.defense = 14; - npc.knockBackResist = 0.1f; - npc.width = 34; - npc.height = 70; - npc.aiStyle = 3; - aiType = 77; - npc.npcSlots = 3f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.value = Item.buyPrice(0, 0, 1, 64); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 50; + npc.damage = 34; + npc.defense = 14; + npc.knockBackResist = 0.1f; + npc.width = 34; + npc.height = 70; + npc.aiStyle = 3; + aiType = 77; + npc.npcSlots = 3f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.value = Item.buyPrice(0, 0, 1, 64); + } - public override void AI() - { - PlayAnimation(); - if (Main.player[npc.target].position.X > npc.position.X) - npc.spriteDirection = 1; - else - npc.spriteDirection = -1; + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - if (npc.direction == -1 && npc.velocity.X > -2f) - { - npc.velocity.X = npc.velocity.X - 0.1f; - if (npc.velocity.X > 2f) - { - npc.velocity.X = npc.velocity.X - 0.1f; - } - else - { - if (npc.velocity.X > 0f) - { - npc.velocity.X = npc.velocity.X + 0.05f; - } - } - if (npc.velocity.X < -2f) - { - npc.velocity.X = -2f; - } - } - else - { - if (npc.direction == 1 && npc.velocity.X < 2f) - { - npc.velocity.X = npc.velocity.X + 0.1f; - if (npc.velocity.X < -2f) - { - npc.velocity.X = npc.velocity.X + 0.1f; - } - else - { - if (npc.velocity.X < 0f) - { - npc.velocity.X = npc.velocity.X - 0.05f; - } - } - if (npc.velocity.X > 2f) - { - npc.velocity.X = 2f; - } - } - } - if (npc.directionY == -1 && (double)npc.velocity.Y > -1.5) - { - npc.velocity.Y = npc.velocity.Y - 0.05f; + public override void AI() + { + PlayAnimation(); + if (Main.player[npc.target].position.X > npc.position.X) + npc.spriteDirection = 1; + else + npc.spriteDirection = -1; - if ((double)npc.velocity.Y < -1.5) - { - npc.velocity.Y = -1.5f; - } - } - else - { - if (npc.directionY == 1 && (double)npc.velocity.Y < 1.5) - { - npc.velocity.Y = npc.velocity.Y + 0.05f; - if ((double)npc.velocity.Y > 1.5) - { - npc.velocity.Y = 1.5f; - } - } - } - } + if (npc.direction == -1 && npc.velocity.X > -2f) + { + npc.velocity.X = npc.velocity.X - 0.1f; + if (npc.velocity.X > 2f) + { + npc.velocity.X = npc.velocity.X - 0.1f; + } + else + { + if (npc.velocity.X > 0f) + { + npc.velocity.X = npc.velocity.X + 0.05f; + } + } + if (npc.velocity.X < -2f) + { + npc.velocity.X = -2f; + } + } + else + { + if (npc.direction == 1 && npc.velocity.X < 2f) + { + npc.velocity.X = npc.velocity.X + 0.1f; + if (npc.velocity.X < -2f) + { + npc.velocity.X = npc.velocity.X + 0.1f; + } + else + { + if (npc.velocity.X < 0f) + { + npc.velocity.X = npc.velocity.X - 0.05f; + } + } + if (npc.velocity.X > 2f) + { + npc.velocity.X = 2f; + } + } + } + if (npc.directionY == -1 && (double)npc.velocity.Y > -1.5) + { + npc.velocity.Y = npc.velocity.Y - 0.05f; - int Frame = 0; - int TimeToAnimation = 6; - public void PlayAnimation() - { - if (--TimeToAnimation <= 0) - { - if (++Frame > 3) - Frame = 1; - TimeToAnimation = 6; - npc.frame = GetFrame(Frame); - } - } + if ((double)npc.velocity.Y < -1.5) + { + npc.velocity.Y = -1.5f; + } + } + else + { + if (npc.directionY == 1 && (double)npc.velocity.Y < 1.5) + { + npc.velocity.Y = npc.velocity.Y + 0.05f; + if ((double)npc.velocity.Y > 1.5) + { + npc.velocity.Y = 1.5f; + } + } + } + } - Rectangle GetFrame(int Num) - { - return new Rectangle(0, npc.frame.Height * (Num - 1), npc.frame.Width, npc.frame.Height); - } + int Frame = 0; + int TimeToAnimation = 6; + public void PlayAnimation() + { + if (--TimeToAnimation <= 0) + { + if (++Frame > 3) + Frame = 1; + TimeToAnimation = 6; + npc.frame = GetFrame(Frame); + } + } + + Rectangle GetFrame(int Num) + { + return new Rectangle(0, npc.frame.Height * (Num - 1), npc.frame.Width, npc.frame.Height); + } - public override void NPCLoot() - { - if (Main.invasionType == Terraria.ID.InvasionID.GoblinArmy) - { - Main.invasionProgress++; - } - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; + public override void NPCLoot() + { + if (Main.invasionType == Terraria.ID.InvasionID.GoblinArmy) + { + Main.invasionProgress++; + } + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 161, Main.rand.Next(1, 15)); - } + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 161, Main.rand.Next(1, 15)); + } - if(Main.rand.Next(200) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 160); - } - } - } - } + if (Main.rand.Next(200) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 160); + } + } + } + } } \ No newline at end of file diff --git a/NPCs/GogLordGog.cs b/NPCs/GogLordGog.cs index 406583f3..cd8de071 100644 --- a/NPCs/GogLordGog.cs +++ b/NPCs/GogLordGog.cs @@ -9,64 +9,64 @@ namespace Tremor.NPCs { - public class GogLordGog : ModNPC - { + public class GogLordGog : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Brass Gear"); } - - public override void SetDefaults() - { - npc.lifeMax = 1; - npc.damage = 100; - npc.defense = 0; - npc.knockBackResist = 1f; - npc.width = 42; - npc.height = 46; - npc.aiStyle = -1; - npc.noGravity = true; - npc.noTileCollide = true; - npc.dontTakeDamage = true; - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath10; - npc.value = Item.buyPrice(0, 1, 0, 0); - } - int timer = 0; - public override void AI() - { - float Num1 = (float)Main.mouseTextColor / 200f - 0.35f; - Num1 *= 0.5f; - npc.scale = Num1 + 0.95f; - timer++; - npc.velocity.X = 0f; - npc.velocity.Y = 0f; + public override void SetDefaults() + { + npc.lifeMax = 1; + npc.damage = 100; + npc.defense = 0; + npc.knockBackResist = 1f; + npc.width = 42; + npc.height = 46; + npc.aiStyle = -1; + npc.noGravity = true; + npc.noTileCollide = true; + npc.dontTakeDamage = true; + npc.HitSound = SoundID.NPCHit4; + npc.DeathSound = SoundID.NPCDeath10; + npc.value = Item.buyPrice(0, 1, 0, 0); + } - if (timer >= 200) - { - npc.alpha++; - npc.alpha++; - } + int timer = 0; + public override void AI() + { + float Num1 = (float)Main.mouseTextColor / 200f - 0.35f; + Num1 *= 0.5f; + npc.scale = Num1 + 0.95f; + timer++; + npc.velocity.X = 0f; + npc.velocity.Y = 0f; - if (npc.alpha >= 255) - { - npc.life = -1; - npc.active = false; - npc.checkDead(); - } - } + if (timer >= 200) + { + npc.alpha++; + npc.alpha++; + } - public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) - { - Texture2D drawTexture = Main.npcTexture[npc.type]; - Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); - Vector2 drawPos = new Vector2( - npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, - npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); - SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); - return false; - } - } + if (npc.alpha >= 255) + { + npc.life = -1; + npc.active = false; + npc.checkDead(); + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) + { + Texture2D drawTexture = Main.npcTexture[npc.type]; + Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); + Vector2 drawPos = new Vector2( + npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, + npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); + SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); + return false; + } + } } \ No newline at end of file diff --git a/NPCs/GoplitArcher.cs b/NPCs/GoplitArcher.cs index ca779e46..bc9ec33e 100644 --- a/NPCs/GoplitArcher.cs +++ b/NPCs/GoplitArcher.cs @@ -13,7 +13,7 @@ public override void SetStaticDefaults() DisplayName.SetDefault("Hoplite Archer"); Main.npcFrameCount[npc.type] = 20; } - + public override void SetDefaults() { npc.width = 24; @@ -23,60 +23,60 @@ public override void SetDefaults() npc.lifeMax = 95; npc.HitSound = SoundID.NPCHit2; npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 3, 7); + npc.value = Item.buyPrice(0, 0, 3, 7); npc.knockBackResist = 0.2f; npc.aiStyle = 3; aiType = 111; animationType = 110; - npc.buffImmune[20] = true; - npc.buffImmune[31] = false; - npc.buffImmune[24] = true; - banner = npc.type; - bannerItem = mod.ItemType("GoplitArcherBanner"); + npc.buffImmune[20] = true; + npc.buffImmune[31] = false; + npc.buffImmune[24] = true; + banner = npc.type; + bannerItem = mod.ItemType("GoplitArcherBanner"); } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 31, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GoplitAGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GoplitAGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GoplitAGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GoplitAGore3"), 1f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 31, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GoplitAGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GoplitAGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GoplitAGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GoplitAGore3"), 1f); + } + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StoneofLife")); - }; - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StoneofLife")); + }; + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - Tile tile = Main.tile[spawnInfo.spawnTileX, spawnInfo.spawnTileY]; - return (Tremor.NoZoneAllowWater(spawnInfo)) && (tile.type == 367) && y > Main.rockLayer ? 0.01f : 0f; - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + Tile tile = Main.tile[spawnInfo.spawnTileX, spawnInfo.spawnTileY]; + return (Tremor.NoZoneAllowWater(spawnInfo)) && (tile.type == 367) && y > Main.rockLayer ? 0.01f : 0f; + } } } diff --git a/NPCs/GoplitOfficer.cs b/NPCs/GoplitOfficer.cs index 311192f2..1988b821 100644 --- a/NPCs/GoplitOfficer.cs +++ b/NPCs/GoplitOfficer.cs @@ -6,62 +6,64 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class GoplitOfficer : ModNPC +namespace Tremor.NPCs { + + public class GoplitOfficer : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Hoplite Officer"); Main.npcFrameCount[npc.type] = 16; } - - public override void SetDefaults() - { - npc.lifeMax = 300; - npc.damage = 30; - npc.defense = 10; - npc.knockBackResist = 0.1f; - npc.width = 46; - npc.height = 42; - animationType = 86; - npc.aiStyle = 26; - npc.npcSlots = 0.3f; - npc.HitSound = SoundID.NPCHit2; - npc.DeathSound = SoundID.NPCDeath5; - npc.value = Item.buyPrice(0, 0, 2, 0); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 300; + npc.damage = 30; + npc.defense = 10; + npc.knockBackResist = 0.1f; + npc.width = 46; + npc.height = 42; + animationType = 86; + npc.aiStyle = 26; + npc.npcSlots = 0.3f; + npc.HitSound = SoundID.NPCHit2; + npc.DeathSound = SoundID.NPCDeath5; + npc.value = Item.buyPrice(0, 0, 2, 0); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SHGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SHGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SHGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SHGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SHGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SHGore2"), 1f); - NPC.NewNPC((int)npc.position.X - 22, (int)npc.position.Y + 55, 481); - } -} - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - Tile tile = Main.tile[spawnInfo.spawnTileX, spawnInfo.spawnTileY]; - return (Tremor.NoZoneAllowWater(spawnInfo)) && (tile.type == 367) && y > Main.rockLayer ? 0.001f : 0f; - } - -}} \ No newline at end of file + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SHGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SHGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SHGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SHGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SHGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SHGore2"), 1f); + NPC.NewNPC((int)npc.position.X - 22, (int)npc.position.Y + 55, 481); + } + } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + Tile tile = Main.tile[spawnInfo.spawnTileX, spawnInfo.spawnTileY]; + return (Tremor.NoZoneAllowWater(spawnInfo)) && (tile.type == 367) && y > Main.rockLayer ? 0.001f : 0f; + } + + } +} \ No newline at end of file diff --git a/NPCs/GraniteBeetle.cs b/NPCs/GraniteBeetle.cs index 0ce7041a..873454f2 100644 --- a/NPCs/GraniteBeetle.cs +++ b/NPCs/GraniteBeetle.cs @@ -13,77 +13,77 @@ public override void SetStaticDefaults() DisplayName.SetDefault("Granite Beetle"); Main.npcFrameCount[npc.type] = 6; } - + public override void SetDefaults() { - npc.width = 38; - npc.height = 44; + npc.width = 38; + npc.height = 44; npc.damage = 16; npc.defense = 22; npc.lifeMax = 65; npc.HitSound = SoundID.NPCHit41; npc.DeathSound = SoundID.NPCDeath44; - npc.value = Item.buyPrice(0, 0, 2, 7); + npc.value = Item.buyPrice(0, 0, 2, 7); npc.knockBackResist = 0.4f; npc.aiStyle = 3; - aiType = 258; - //npc.noGravity = false; + aiType = 258; + //npc.noGravity = false; animationType = 258; - npc.buffImmune[20] = true; - npc.buffImmune[31] = false; - npc.buffImmune[24] = true; - banner = npc.type; - bannerItem = mod.ItemType("GraniteBeetleBanner"); + npc.buffImmune[20] = true; + npc.buffImmune[31] = false; + npc.buffImmune[24] = true; + banner = npc.type; + bannerItem = mod.ItemType("GraniteBeetleBanner"); } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 3086, Main.rand.Next(10)); - }; - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StoneofLife")); - }; - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 3086, Main.rand.Next(10)); + }; + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StoneofLife")); + }; + } + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 31, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GBeetleGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GBeetleGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GBeetleGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GBeetleGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GBeetleGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GBeetleGore3"), 1f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 31, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GBeetleGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GBeetleGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GBeetleGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GBeetleGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GBeetleGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GBeetleGore3"), 1f); + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - Tile tile = Main.tile[spawnInfo.spawnTileX, spawnInfo.spawnTileY]; - return (Tremor.NoZoneAllowWater(spawnInfo)) && (tile.type == 368) && y > Main.rockLayer ? 0.01f : 0f; - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + Tile tile = Main.tile[spawnInfo.spawnTileX, spawnInfo.spawnTileY]; + return (Tremor.NoZoneAllowWater(spawnInfo)) && (tile.type == 368) && y > Main.rockLayer ? 0.01f : 0f; + } } } diff --git a/NPCs/GraniteBowman.cs b/NPCs/GraniteBowman.cs index 9249d07a..f4aba5d3 100644 --- a/NPCs/GraniteBowman.cs +++ b/NPCs/GraniteBowman.cs @@ -13,7 +13,7 @@ public override void SetStaticDefaults() DisplayName.SetDefault("Granite Bowman"); Main.npcFrameCount[npc.type] = 20; } - + public override void SetDefaults() { npc.width = 24; @@ -23,64 +23,64 @@ public override void SetDefaults() npc.lifeMax = 95; npc.HitSound = SoundID.NPCHit41; npc.DeathSound = SoundID.NPCDeath44; - npc.value = Item.buyPrice(0, 0, 3, 7); + npc.value = Item.buyPrice(0, 0, 3, 7); npc.knockBackResist = 0.2f; npc.aiStyle = 3; aiType = 111; animationType = 110; - npc.buffImmune[20] = true; - npc.buffImmune[31] = false; - npc.buffImmune[24] = true; - banner = npc.type; - bannerItem = mod.ItemType("GraniteBowmanBanner"); + npc.buffImmune[20] = true; + npc.buffImmune[31] = false; + npc.buffImmune[24] = true; + banner = npc.type; + bannerItem = mod.ItemType("GraniteBowmanBanner"); } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 3086, Main.rand.Next(10)); - }; - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StoneofLife")); - }; - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 3086, Main.rand.Next(10)); + }; + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StoneofLife")); + }; + } + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 31, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GBGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GBGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GBGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GBGore3"), 1f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 31, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GBGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GBGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GBGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GBGore3"), 1f); + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - Tile tile = Main.tile[spawnInfo.spawnTileX, spawnInfo.spawnTileY]; - return (Tremor.NoZoneAllowWater(spawnInfo)) && (tile.type == 368) && y > Main.rockLayer ? 0.01f : 0f; - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + Tile tile = Main.tile[spawnInfo.spawnTileX, spawnInfo.spawnTileY]; + return (Tremor.NoZoneAllowWater(spawnInfo)) && (tile.type == 368) && y > Main.rockLayer ? 0.01f : 0f; + } } } diff --git a/NPCs/GrayRaven.cs b/NPCs/GrayRaven.cs index e0532f26..ae5cbad8 100644 --- a/NPCs/GrayRaven.cs +++ b/NPCs/GrayRaven.cs @@ -5,75 +5,77 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class GrayRaven : ModNPC +namespace Tremor.NPCs { + + public class GrayRaven : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Gray Raven"); Main.npcFrameCount[npc.type] = 5; } - - public override void SetDefaults() - { - npc.width = 36; - npc.height = 26; - npc.aiStyle = 17; - npc.damage = 22; - npc.defense = 5; - npc.lifeMax = 58; - npc.HitSound = SoundID.NPCHit1; - npc.knockBackResist = 0.85f; - npc.DeathSound = SoundID.NPCDeath1; - npc.value = 50f; - animationType = 301; - bannerItem = mod.ItemType("GrayRavenBanner"); - } + + public override void SetDefaults() + { + npc.width = 36; + npc.height = 26; + npc.aiStyle = 17; + npc.damage = 22; + npc.defense = 5; + npc.lifeMax = 58; + npc.HitSound = SoundID.NPCHit1; + npc.knockBackResist = 0.85f; + npc.DeathSound = SoundID.NPCDeath1; + npc.value = 50f; + animationType = 301; + bannerItem = mod.ItemType("GrayRavenBanner"); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("RavenFeather"), Main.rand.Next(1,3)); - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("RavenFeather"), Main.rand.Next(1, 3)); + } - } - } + } + } - public override void OnHitPlayer(Player player, int damage, bool crit) - { - { - player.AddBuff(30, 60, true); - } - } + public override void OnHitPlayer(Player player, int damage, bool crit) + { + { + player.AddBuff(30, 60, true); + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GrayRavenGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GrayRavenGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GrayRavenGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GrayRavenGore3"), 1f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GrayRavenGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GrayRavenGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GrayRavenGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GrayRavenGore3"), 1f); + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && y > Main.rockLayer ? 0.01f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && y > Main.rockLayer ? 0.01f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/GreatFungusBug.cs b/NPCs/GreatFungusBug.cs index 59e29623..db604955 100644 --- a/NPCs/GreatFungusBug.cs +++ b/NPCs/GreatFungusBug.cs @@ -6,63 +6,65 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class GreatFungusBug : ModNPC +namespace Tremor.NPCs { + + public class GreatFungusBug : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Great Fungus Bug"); Main.npcFrameCount[npc.type] = 3; } - - public override void SetDefaults() - { - npc.lifeMax = 50; - npc.damage = 25; - npc.defense = 10; - npc.knockBackResist = 0.2f; - npc.width = 33; - npc.height = 33; - animationType = 34; - npc.noGravity = true; - npc.noTileCollide = true; - npc.aiStyle = 14; - aiType = 34; - npc.npcSlots = 5f; - npc.HitSound = SoundID.NPCHit35; - npc.DeathSound = SoundID.NPCDeath57; - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 50; + npc.damage = 25; + npc.defense = 10; + npc.knockBackResist = 0.2f; + npc.width = 33; + npc.height = 33; + animationType = 34; + npc.noGravity = true; + npc.noTileCollide = true; + npc.aiStyle = 14; + aiType = 34; + npc.npcSlots = 5f; + npc.HitSound = SoundID.NPCHit35; + npc.DeathSound = SoundID.NPCDeath57; + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FungalBugGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FungalBugGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FungalBugGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FungalBugGore3"), 1f); - for(int k = 0; k < 60; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 67, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 67, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - } - else - { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 67, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - } -} -}} \ No newline at end of file + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FungalBugGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FungalBugGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FungalBugGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FungalBugGore3"), 1f); + for (int k = 0; k < 60; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 67, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 67, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + } + else + { + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 67, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + } + } + } +} \ No newline at end of file diff --git a/NPCs/Grood.cs b/NPCs/Grood.cs index e8540914..e7b3cf56 100644 --- a/NPCs/Grood.cs +++ b/NPCs/Grood.cs @@ -6,85 +6,87 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Grood : ModNPC +namespace Tremor.NPCs { + + public class Grood : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Grood"); Main.npcFrameCount[npc.type] = 3; } - - public override void SetDefaults() - { - npc.lifeMax = 1000; - npc.damage = 70; - npc.defense = 28; - npc.knockBackResist = 0.3f; - npc.width = 38; - npc.height = 44; - animationType = 141; - npc.aiStyle = 41; - npc.npcSlots = 1f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath17; - npc.value = Item.buyPrice(0, 0, 5, 24); - banner = npc.type; - bannerItem = mod.ItemType("GroodBanner"); - } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(23) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("YellowPuzzleFragment")); - } - if(Main.rand.Next(30) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GiantRedFeather")); - } - } - } + public override void SetDefaults() + { + npc.lifeMax = 1000; + npc.damage = 70; + npc.defense = 28; + npc.knockBackResist = 0.3f; + npc.width = 38; + npc.height = 44; + animationType = 141; + npc.aiStyle = 41; + npc.npcSlots = 1f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath17; + npc.value = Item.buyPrice(0, 0, 5, 24); + banner = npc.type; + bannerItem = mod.ItemType("GroodBanner"); + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(23) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("YellowPuzzleFragment")); + } + if (Main.rand.Next(30) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GiantRedFeather")); + } + } + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } public override float SpawnChance(NPCSpawnInfo spawnInfo) { return spawnInfo.spawnTileY < Main.rockLayer && Main.hardMode && Main.dayTime ? 0.001f : 0f; } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 60; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GroodGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GroodGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GroodGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GroodGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GroodGore3"), 1f); - } - else - { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } -} -}} \ No newline at end of file + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 60; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GroodGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GroodGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GroodGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GroodGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GroodGore3"), 1f); + } + else + { + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + } + } + } + } +} \ No newline at end of file diff --git a/NPCs/Gurd.cs b/NPCs/Gurd.cs index 4767d600..4260b9e8 100644 --- a/NPCs/Gurd.cs +++ b/NPCs/Gurd.cs @@ -6,79 +6,81 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Gurd : ModNPC +namespace Tremor.NPCs { + + public class Gurd : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Gurd"); Main.npcFrameCount[npc.type] = 3; } - - public override void SetDefaults() - { - npc.lifeMax = 100; - npc.damage = 20; - npc.defense = 14; - npc.knockBackResist = 0.3f; - npc.width = 38; - npc.height = 44; - animationType = 141; - npc.aiStyle = 1; - npc.npcSlots = 1f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath17; - npc.value = Item.buyPrice(0, 0, 1, 24); - banner = npc.type; - bannerItem = mod.ItemType("GurdBanner"); - } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(27) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("RedPuzzleFragment")); - } - } - } + public override void SetDefaults() + { + npc.lifeMax = 100; + npc.damage = 20; + npc.defense = 14; + npc.knockBackResist = 0.3f; + npc.width = 38; + npc.height = 44; + animationType = 141; + npc.aiStyle = 1; + npc.npcSlots = 1f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath17; + npc.value = Item.buyPrice(0, 0, 1, 24); + banner = npc.type; + bannerItem = mod.ItemType("GurdBanner"); + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(27) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("RedPuzzleFragment")); + } + } + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } public override float SpawnChance(NPCSpawnInfo spawnInfo) { return spawnInfo.spawnTileY < Main.rockLayer && NPC.downedBoss1 && Main.dayTime ? 0.005f : 0f; } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 60; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GrudGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GrudGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GrudGore2"), 1f); - } - else - { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } -} -}} \ No newline at end of file + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 60; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GrudGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GrudGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/GrudGore2"), 1f); + } + else + { + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + } + } + } + } +} \ No newline at end of file diff --git a/NPCs/HallowSlimer.cs b/NPCs/HallowSlimer.cs index 2e7f2d36..ad6c4f06 100644 --- a/NPCs/HallowSlimer.cs +++ b/NPCs/HallowSlimer.cs @@ -6,41 +6,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class HallowSlimer : ModNPC +namespace Tremor.NPCs { + + public class HallowSlimer : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Hallow Slimer"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 200; - npc.damage = 25; - npc.defense = 20; - npc.knockBackResist = 0.5f; - npc.width = 40; - npc.height = 40; -animationType = 121; - npc.aiStyle = 14; -npc.noGravity = true; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath6; - npc.value = Item.buyPrice(0, 0, 5, 0); - banner = npc.type; - bannerItem = mod.ItemType("HallowSlimerBanner"); + + public override void SetDefaults() + { + npc.lifeMax = 200; + npc.damage = 25; + npc.defense = 20; + npc.knockBackResist = 0.5f; + npc.width = 40; + npc.height = 40; + animationType = 121; + npc.aiStyle = 14; + npc.noGravity = true; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath6; + npc.value = Item.buyPrice(0, 0, 5, 0); + banner = npc.type; + bannerItem = mod.ItemType("HallowSlimerBanner"); NPCID.Sets.TrailCacheLength[npc.type] = 5; - } + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) @@ -48,13 +49,13 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) Vector2 drawOrigin = new Vector2(Main.npcTexture[npc.type].Width, Main.npcTexture[npc.type].Height * 0.8f); for (int k = 0; k < npc.oldPos.Length; k++) { - SpriteEffects effect = SpriteEffects.None; - if (npc.direction ==1) {effect = SpriteEffects.FlipHorizontally;} - if (npc.direction ==-1) {effect = SpriteEffects.None;} + SpriteEffects effect = SpriteEffects.None; + if (npc.direction == 1) { effect = SpriteEffects.FlipHorizontally; } + if (npc.direction == -1) { effect = SpriteEffects.None; } Vector2 drawPos = npc.oldPos[k] - Main.screenPosition; Color color = npc.GetAlpha(lightColor) * ((float)(npc.oldPos.Length - k) / (float)npc.oldPos.Length); - Rectangle frame = new Rectangle(0, 0, 90, 42); -frame.Y += 164 * (k / 60); + Rectangle frame = new Rectangle(0, 0, 90, 42); + frame.Y += 164 * (k / 60); spriteBatch.Draw(Main.npcTexture[npc.type], drawPos, frame, color, 0, Vector2.Zero, npc.scale, effect, 1f); @@ -62,34 +63,35 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) return true; } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { -NPC.NewNPC((int)npc.position.X, (int)npc.position.Y - 48, 138); - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + NPC.NewNPC((int)npc.position.X, (int)npc.position.Y - 48, 138); + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + } + } - public override void AI() - { - for (int num72 = npc.oldPos.Length - 1; num72 > 0; num72--) - { - npc.oldPos[num72] = npc.oldPos[num72 - 1]; - Lighting.AddLight((int)npc.position.X / 16, (int)npc.position.Y / 16, 0.3f, 0f, 0.2f); - } - npc.oldPos[0] = npc.position; + public override void AI() + { + for (int num72 = npc.oldPos.Length - 1; num72 > 0; num72--) + { + npc.oldPos[num72] = npc.oldPos[num72 - 1]; + Lighting.AddLight((int)npc.position.X / 16, (int)npc.position.Y / 16, 0.3f, 0f, 0.2f); + } + npc.oldPos[0] = npc.position; - } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneHoly && y < Main.worldSurface ? 0.01f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneHoly && y < Main.worldSurface ? 0.01f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/Hallower.cs b/NPCs/Hallower.cs index 60233254..f72adf08 100644 --- a/NPCs/Hallower.cs +++ b/NPCs/Hallower.cs @@ -6,93 +6,95 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Hallower : ModNPC +namespace Tremor.NPCs { + + public class Hallower : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Hallower"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 5000; - npc.damage = 150; - npc.defense = 70; - npc.knockBackResist = 0.1f; - npc.width = 40; - npc.height = 40; - animationType = 121; - npc.aiStyle = 14; - aiType = 75; - npc.noGravity = true; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit5; - npc.buffImmune[20] = true; - npc.buffImmune[24] = true; - npc.buffImmune[39] = true; - npc.buffImmune[31] = false; - npc.DeathSound = SoundID.NPCDeath7; - npc.value = Item.buyPrice(0, 0, 5, 0); - banner = npc.type; - bannerItem = mod.ItemType("HallowerBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 5000; + npc.damage = 150; + npc.defense = 70; + npc.knockBackResist = 0.1f; + npc.width = 40; + npc.height = 40; + animationType = 121; + npc.aiStyle = 14; + aiType = 75; + npc.noGravity = true; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit5; + npc.buffImmune[20] = true; + npc.buffImmune[24] = true; + npc.buffImmune[39] = true; + npc.buffImmune[31] = false; + npc.DeathSound = SoundID.NPCDeath7; + npc.value = Item.buyPrice(0, 0, 5, 0); + banner = npc.type; + bannerItem = mod.ItemType("HallowerBanner"); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 501, 5); - } - } - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } + + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 501, 5); + } + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + } + } - public override void AI() - { -if (Main.rand.Next(6) == 0) - { - int num706 = Dust.NewDust(npc.position, npc.width, npc.height, 55, 0f, 0f, 200, npc.color, 1f); - Main.dust[num706].velocity *= 0.3f; - } -if (Main.rand.Next(40) == 0) - { - Main.PlaySound(27, (int)npc.position.X, (int)npc.position.Y, 1); - } - } + public override void AI() + { + if (Main.rand.Next(6) == 0) + { + int num706 = Dust.NewDust(npc.position, npc.width, npc.height, 55, 0f, 0f, 200, npc.color, 1f); + Main.dust[num706].velocity *= 0.3f; + } + if (Main.rand.Next(40) == 0) + { + Main.PlaySound(27, (int)npc.position.X, (int)npc.position.Y, 1); + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && NPC.downedMoonlord && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneHoly && y < Main.worldSurface ? 0.01f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && NPC.downedMoonlord && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneHoly && y < Main.worldSurface ? 0.01f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/HappySoul.cs b/NPCs/HappySoul.cs index 95b5a42f..d0d9cc21 100644 --- a/NPCs/HappySoul.cs +++ b/NPCs/HappySoul.cs @@ -7,60 +7,62 @@ using Terraria.ModLoader; -namespace Tremor.NPCs { - [AutoloadBossHead] - -public class HappySoul : ModNPC +namespace Tremor.NPCs { + [AutoloadBossHead] + + public class HappySoul : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Soul of Happiness"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 750; - npc.damage = 26; - npc.defense = 5; - npc.knockBackResist = 1f; - npc.width = 60; - npc.height = 85; - animationType = 288; - npc.aiStyle = 17; - npc.npcSlots = 15f; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit31; - npc.noGravity = true; - npc.DeathSound = SoundID.NPCDeath6; - npc.value = Item.buyPrice(0, 2, 0, 9); - } - public override void AI() - { + + public override void SetDefaults() + { + npc.lifeMax = 750; + npc.damage = 26; + npc.defense = 5; + npc.knockBackResist = 1f; + npc.width = 60; + npc.height = 85; + animationType = 288; + npc.aiStyle = 17; + npc.npcSlots = 15f; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit31; + npc.noGravity = true; + npc.DeathSound = SoundID.NPCDeath6; + npc.value = Item.buyPrice(0, 2, 0, 9); + } + public override void AI() + { npc.position += npc.velocity * 2f; -if (Main.rand.Next(6) == 0) - { - int num706 = Dust.NewDust(npc.position, npc.width , npc.height, 62, 0f, 0f, 200, npc.color, 1f); - Main.dust[num706].velocity *= 0.3f; - } - } + if (Main.rand.Next(6) == 0) + { + int num706 = Dust.NewDust(npc.position, npc.width, npc.height, 62, 0f, 0f, 200, npc.color, 1f); + Main.dust[num706].velocity *= 0.3f; + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Dust.NewDust(npc.position, npc.width, npc.height, 62, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 62, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 62, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 62, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 62, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 62, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 62, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); - Dust.NewDust(npc.position, npc.width, npc.height, 62, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 62, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); - } - } -} -}} \ No newline at end of file + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Dust.NewDust(npc.position, npc.width, npc.height, 62, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 62, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 62, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 62, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 62, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 62, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 62, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); + Dust.NewDust(npc.position, npc.width, npc.height, 62, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 62, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); + } + } + } + } +} \ No newline at end of file diff --git a/NPCs/HarpyWarrior.cs b/NPCs/HarpyWarrior.cs index b75b828c..f62331a8 100644 --- a/NPCs/HarpyWarrior.cs +++ b/NPCs/HarpyWarrior.cs @@ -6,62 +6,64 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class HarpyWarrior : ModNPC +namespace Tremor.NPCs { + + public class HarpyWarrior : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Harpy Warrior"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 300; - npc.damage = 90; - npc.defense = 17; - npc.knockBackResist = 0.3f; - npc.width = 80; - npc.height = 60; - animationType = 48; - npc.aiStyle = 14; - aiType = 48; - npc.npcSlots = 1f; - npc.HitSound = SoundID.NPCHit1; - npc.noGravity = true; - npc.DeathSound = SoundID.NPCDeath4; - npc.value = Item.buyPrice(0, 0, 8, 9); - banner = npc.type; - bannerItem = mod.ItemType("HarpyWarriorBanner"); - } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HarpyGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HarpyGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HarpyGore2"), 1f); - } -} + public override void SetDefaults() + { + npc.lifeMax = 300; + npc.damage = 90; + npc.defense = 17; + npc.knockBackResist = 0.3f; + npc.width = 80; + npc.height = 60; + animationType = 48; + npc.aiStyle = 14; + aiType = 48; + npc.npcSlots = 1f; + npc.HitSound = SoundID.NPCHit1; + npc.noGravity = true; + npc.DeathSound = SoundID.NPCDeath4; + npc.value = Item.buyPrice(0, 0, 8, 9); + banner = npc.type; + bannerItem = mod.ItemType("HarpyWarriorBanner"); + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HarpyGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HarpyGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HarpyGore2"), 1f); + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return Tremor.NoZoneAllowWater(spawnInfo) && Main.hardMode && spawnInfo.sky ? 0.02f : 0; - } -}} \ No newline at end of file + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return Tremor.NoZoneAllowWater(spawnInfo) && Main.hardMode && spawnInfo.sky ? 0.02f : 0; + } + } +} \ No newline at end of file diff --git a/NPCs/HeadlessZombie.cs b/NPCs/HeadlessZombie.cs index e6584632..cdc3e7d6 100644 --- a/NPCs/HeadlessZombie.cs +++ b/NPCs/HeadlessZombie.cs @@ -6,73 +6,75 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class HeadlessZombie : ModNPC +namespace Tremor.NPCs { + + public class HeadlessZombie : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Headless Zombie"); Main.npcFrameCount[npc.type] = 3; } - - public override void SetDefaults() - { - npc.lifeMax = 30; - npc.damage = 20; - npc.defense = 5; - npc.knockBackResist = 0.3f; - npc.width = 35; - npc.height = 28; - animationType = 3; - npc.aiStyle = 26; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 2, 0); - banner = npc.type; - bannerItem = mod.ItemType("HeadlessZombieBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 30; + npc.damage = 20; + npc.defense = 5; + npc.knockBackResist = 0.3f; + npc.width = 35; + npc.height = 28; + animationType = 3; + npc.aiStyle = 26; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 0, 2, 0); + banner = npc.type; + bannerItem = mod.ItemType("HeadlessZombieBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore2"), 1f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore2"), 1f); + } + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("UntreatedFlesh")); - }; - } - } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && y < Main.worldSurface ? 0.01f : 0f; - } -}} \ No newline at end of file + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("UntreatedFlesh")); + }; + } + } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && y < Main.worldSurface ? 0.01f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/HeaterOfWorldsBody.cs b/NPCs/HeaterOfWorldsBody.cs index d3f06a46..f7e43797 100644 --- a/NPCs/HeaterOfWorldsBody.cs +++ b/NPCs/HeaterOfWorldsBody.cs @@ -7,50 +7,50 @@ namespace Tremor.NPCs { - public class HeaterOfWorldsBody : ModNPC - { + public class HeaterOfWorldsBody : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Heater of Worlds"); } - - const int ShootRate = 160; // — áâ®â  ¢ëáâ५  - const int ShootDamage = 10; // “à®­ ®â « §¥à . - const float ShootKN = 1.0f; // Žâ¡à á뢠­¨¥ - const int ShootType = 326; // ’¨¯ ¯à®¤¦¥ªâ ©«  ª®â®àë¬ ¡ã¤¥â ¯à®¨§¢¥¤ñ­ ¢ëáâ५. - const float ShootSpeed = 4; // â®, ï â ª ¯®­¨¬ î, ¢«¨ï¥â ­  ¤ «ì­®áâì ¢ëáâ५  - int TimeToShoot = ShootRate; // ‚à¥¬ï ¤® ¢ëáâ५ . + const int ShootRate = 160; // — áâ®â  ¢ëáâ५  + const int ShootDamage = 10; // “à®­ ®â « §¥à . + const float ShootKN = 1.0f; // Žâ¡à á뢠­¨¥ + const int ShootType = 326; // ’¨¯ ¯à®¤¦¥ªâ ©«  ª®â®àë¬ ¡ã¤¥â ¯à®¨§¢¥¤ñ­ ¢ëáâ५. + const float ShootSpeed = 4; // â®, ï â ª ¯®­¨¬ î, ¢«¨ï¥â ­  ¤ «ì­®áâì ¢ëáâ५  + + int TimeToShoot = ShootRate; // ‚à¥¬ï ¤® ¢ëáâ५ . - public override void SetDefaults() - { - npc.lifeMax = 6500; - npc.damage = 39; - npc.defense = 40; - npc.width = 26; - npc.height = 48; - npc.noTileCollide = true; - npc.behindTiles = true; - npc.friendly = false; - npc.noGravity = true; - npc.aiStyle = 6; - npc.dontTakeDamage = true; - npc.dontCountMe = true; - npc.lavaImmune = true; - npc.buffImmune[24] = true; - npc.buffImmune[67] = true; - npc.npcSlots = 5f; - music = 17; - npc.HitSound = SoundID.NPCHit7; - npc.DeathSound = SoundID.NPCDeath10; - } + public override void SetDefaults() + { + npc.lifeMax = 6500; + npc.damage = 39; + npc.defense = 40; + npc.width = 26; + npc.height = 48; + npc.noTileCollide = true; + npc.behindTiles = true; + npc.friendly = false; + npc.noGravity = true; + npc.aiStyle = 6; + npc.dontTakeDamage = true; + npc.dontCountMe = true; + npc.lavaImmune = true; + npc.buffImmune[24] = true; + npc.buffImmune[67] = true; + npc.npcSlots = 5f; + music = 17; + npc.HitSound = SoundID.NPCHit7; + npc.DeathSound = SoundID.NPCDeath10; + } public override void OnHitPlayer(Player player, int damage, bool crit) { if (Main.expertMode || Main.rand.Next(1) == 0) { - player.AddBuff(24, 180, true); + player.AddBuff(24, 180, true); } } @@ -60,61 +60,61 @@ public override void ScaleExpertStats(int numPlayers, float bossLifeScale) npc.damage = (int)(npc.damage * 0.6f); } - void Shoot() - { - TimeToShoot = ShootRate; // “áâ ­ ¢«¨¢ ¥¬ ªã«¤ ã­ ¢ëáâ५ã - Vector2 velocity = VelocityFPTP(npc.Center, Main.player[npc.target].Center, ShootSpeed); // ’ãâ ¬ë ¯®«ã稬 ­ã¦­ãî velocity (¯®ïá­¥­¨¥  à£ã¬¥­â®¢ ­¨¦¥) - // 1  à£ã¬¥­â - ¯®§¨æ¨ï ¨§ ª®â®à®© ¡ã¤¥â ¢ë«¥â âì ¢ëáâ५ - // 2  à£ã¬¥­â - ¯®§¨æ¨ï ¢ ª®â®àãî ®­ ¤®«¦¥­ ¯®«¥â¥âì - // 3  à£ã¬¥­â - ᪮à®áâì ¢ëáâ५  - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, velocity.X, velocity.Y, ShootType, ShootDamage, ShootKN); - } + void Shoot() + { + TimeToShoot = ShootRate; // “áâ ­ ¢«¨¢ ¥¬ ªã«¤ ã­ ¢ëáâ५ã + Vector2 velocity = VelocityFPTP(npc.Center, Main.player[npc.target].Center, ShootSpeed); // ’ãâ ¬ë ¯®«ã稬 ­ã¦­ãî velocity (¯®ïá­¥­¨¥  à£ã¬¥­â®¢ ­¨¦¥) + // 1  à£ã¬¥­â - ¯®§¨æ¨ï ¨§ ª®â®à®© ¡ã¤¥â ¢ë«¥â âì ¢ëáâ५ + // 2  à£ã¬¥­â - ¯®§¨æ¨ï ¢ ª®â®àãî ®­ ¤®«¦¥­ ¯®«¥â¥âì + // 3  à£ã¬¥­â - ᪮à®áâì ¢ëáâ५  + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, velocity.X, velocity.Y, ShootType, ShootDamage, ShootKN); + } - Vector2 VelocityFPTP(Vector2 pos1, Vector2 pos2, float speed) - { - Vector2 move = pos2 - pos1; - return move * (speed / (float)System.Math.Sqrt(move.X * move.X + move.Y * move.Y)); - } + Vector2 VelocityFPTP(Vector2 pos1, Vector2 pos2, float speed) + { + Vector2 move = pos2 - pos1; + return move * (speed / (float)System.Math.Sqrt(move.X * move.X + move.Y * move.Y)); + } - public override void AI() - { + public override void AI() + { - if (--TimeToShoot <= 0 && npc.target != -1) Shoot(); // ‚ í⮩ áâப¥ ¨§ ¯¥à¥¬¥­­®© TimeToShot ®â­¨¬ ¥âáï 1, ¨ ¥á«¨ TimeToShot < ¨«¨ = 0, â® ¢ë§ë¢ ¥âáï ¬¥â®¤ Shoot() - if (Main.rand.Next(3) == 0) - { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 1f); - } + if (--TimeToShoot <= 0 && npc.target != -1) Shoot(); // ‚ í⮩ áâப¥ ¨§ ¯¥à¥¬¥­­®© TimeToShot ®â­¨¬ ¥âáï 1, ¨ ¥á«¨ TimeToShot < ¨«¨ = 0, â® ¢ë§ë¢ ¥âáï ¬¥â®¤ Shoot() + if (Main.rand.Next(3) == 0) + { + Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 1f); + } - if (!Main.npc[(int)npc.ai[1]].active) - { - npc.life = 0; - npc.HitEffect(0, 10.0); - NPCLoot(); - npc.active = false; - } - } - public override bool CheckActive() - { - return false; - } - public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) - { - return false; - } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Texture2D drawTexture = Main.npcTexture[npc.type]; - Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); + if (!Main.npc[(int)npc.ai[1]].active) + { + npc.life = 0; + npc.HitEffect(0, 10.0); + NPCLoot(); + npc.active = false; + } + } + public override bool CheckActive() + { + return false; + } + public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) + { + return false; + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D drawTexture = Main.npcTexture[npc.type]; + Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); - Vector2 drawPos = new Vector2( - npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, - npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); + Vector2 drawPos = new Vector2( + npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, + npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); - SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); + SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); - return false; - } - } + return false; + } + } } \ No newline at end of file diff --git a/NPCs/HeaterOfWorldsHead.cs b/NPCs/HeaterOfWorldsHead.cs index b9f2f7a9..d22d635a 100644 --- a/NPCs/HeaterOfWorldsHead.cs +++ b/NPCs/HeaterOfWorldsHead.cs @@ -8,61 +8,61 @@ namespace Tremor.NPCs { [AutoloadBossHead] - public class HeaterOfWorldsHead : ModNPC - { + public class HeaterOfWorldsHead : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Heater of Worlds"); } - - bool TailSpawned = false; - - public static int ShootRate = 20; - const int ShootDamage = 58; - const float ShootKN = 1.0f; - const int ShootType = 100; - const float ShootSpeed = 10; - const int ShootCount = 5; - const int spread = 2; - const float spreadMult = 0.045f; - - const int ShootSound = 62; - const int ShootSoundStyle = 1; - - int TimeToShoot = ShootRate; - public override void SetDefaults() - { - npc.lifeMax = 6500; - npc.damage = 39; - npc.defense = 40; - npc.knockBackResist = 0f; - npc.width = 74; - npc.height = 82; - npc.aiStyle = 6; - npc.npcSlots = 1f; - npc.noTileCollide = true; - npc.behindTiles = true; - npc.friendly = false; - npc.noGravity = true; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.dontTakeDamage = false; - npc.dontCountMe = true; - npc.lavaImmune = true; - npc.buffImmune[24] = true; - npc.buffImmune[67] = true; - npc.npcSlots = 5f; - music = 17; - npc.HitSound = SoundID.NPCHit7; - npc.DeathSound = SoundID.NPCDeath10; - bossBag = mod.ItemType("HeaterOfWorldsBag"); - } + + bool TailSpawned = false; + + public static int ShootRate = 20; + const int ShootDamage = 58; + const float ShootKN = 1.0f; + const int ShootType = 100; + const float ShootSpeed = 10; + const int ShootCount = 5; + const int spread = 2; + const float spreadMult = 0.045f; + + const int ShootSound = 62; + const int ShootSoundStyle = 1; + + int TimeToShoot = ShootRate; + public override void SetDefaults() + { + npc.lifeMax = 6500; + npc.damage = 39; + npc.defense = 40; + npc.knockBackResist = 0f; + npc.width = 74; + npc.height = 82; + npc.aiStyle = 6; + npc.npcSlots = 1f; + npc.noTileCollide = true; + npc.behindTiles = true; + npc.friendly = false; + npc.noGravity = true; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.dontTakeDamage = false; + npc.dontCountMe = true; + npc.lavaImmune = true; + npc.buffImmune[24] = true; + npc.buffImmune[67] = true; + npc.npcSlots = 5f; + music = 17; + npc.HitSound = SoundID.NPCHit7; + npc.DeathSound = SoundID.NPCDeath10; + bossBag = mod.ItemType("HeaterOfWorldsBag"); + } public override void OnHitPlayer(Player player, int damage, bool crit) { if (Main.expertMode || Main.rand.Next(1) == 0) { - player.AddBuff(24, 180, true); + player.AddBuff(24, 180, true); } } @@ -73,123 +73,123 @@ public override void ScaleExpertStats(int numPlayers, float bossLifeScale) } - public override void AI() - { - - if(!Main.expertMode && Main.rand.Next(490) == 0) - { - NPC.NewNPC((int)npc.Center.X - 70, (int)npc.Center.Y, mod.NPCType("MagmaLeechHead")); - } - - if(Main.expertMode && Main.rand.Next(430) == 0) - { - NPC.NewNPC((int)npc.Center.X - 70, (int)npc.Center.Y, mod.NPCType("MagmaLeechHead")); - } - - npc.position += npc.velocity * (2 - 1); - - if (!TailSpawned) - { - int Previous = npc.whoAmI; - for (int num36 = 0; num36 < 25; num36++) - { - int lol = 0; - if (num36 >= 0 && num36 < 24) - { - lol = NPC.NewNPC((int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.width / 2), mod.NPCType("HeaterOfWorldsBody"), npc.whoAmI); - } - else - { - lol = NPC.NewNPC((int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.width / 2), mod.NPCType("HeaterOfWorldsTail"), npc.whoAmI); - } - Main.npc[lol].realLife = npc.whoAmI; - Main.npc[lol].ai[2] = (float)npc.whoAmI; - Main.npc[lol].ai[1] = (float)Previous; - Main.npc[Previous].ai[0] = (float)lol; - //NetMessage.SendData(23, -1, -1, "", lol, 0f, 0f, 0f, 0); - Previous = lol; - } - TailSpawned = true; - } - - if ((int)(Main.time % 180) == 0) - { - Vector2 vector = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height / 2)); - float birdRotation = (float)Math.Atan2(vector.Y - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), vector.X - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); - npc.velocity.X = (float)(Math.Cos(birdRotation) * 7) * -1; - npc.velocity.Y = (float)(Math.Sin(birdRotation) * 7) * -1; - npc.netUpdate = true; - } - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Texture2D drawTexture = Main.npcTexture[npc.type]; - Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); - - Vector2 drawPos = new Vector2( - npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, - npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); - - SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); - - return false; - } - - public override void NPCLoot() - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - for (int x = centerX - halfLength; x <= centerX + halfLength; x++) + public override void AI() + { + + if (!Main.expertMode && Main.rand.Next(490) == 0) + { + NPC.NewNPC((int)npc.Center.X - 70, (int)npc.Center.Y, mod.NPCType("MagmaLeechHead")); + } + + if (Main.expertMode && Main.rand.Next(430) == 0) + { + NPC.NewNPC((int)npc.Center.X - 70, (int)npc.Center.Y, mod.NPCType("MagmaLeechHead")); + } + + npc.position += npc.velocity * (2 - 1); + + if (!TailSpawned) + { + int Previous = npc.whoAmI; + for (int num36 = 0; num36 < 25; num36++) + { + int lol = 0; + if (num36 >= 0 && num36 < 24) + { + lol = NPC.NewNPC((int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.width / 2), mod.NPCType("HeaterOfWorldsBody"), npc.whoAmI); + } + else + { + lol = NPC.NewNPC((int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.width / 2), mod.NPCType("HeaterOfWorldsTail"), npc.whoAmI); + } + Main.npc[lol].realLife = npc.whoAmI; + Main.npc[lol].ai[2] = (float)npc.whoAmI; + Main.npc[lol].ai[1] = (float)Previous; + Main.npc[Previous].ai[0] = (float)lol; + //NetMessage.SendData(23, -1, -1, "", lol, 0f, 0f, 0f, 0); + Previous = lol; + } + TailSpawned = true; + } + + if ((int)(Main.time % 180) == 0) + { + Vector2 vector = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height / 2)); + float birdRotation = (float)Math.Atan2(vector.Y - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), vector.X - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); + npc.velocity.X = (float)(Math.Cos(birdRotation) * 7) * -1; + npc.velocity.Y = (float)(Math.Sin(birdRotation) * 7) * -1; + npc.netUpdate = true; + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D drawTexture = Main.npcTexture[npc.type]; + Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); + + Vector2 drawPos = new Vector2( + npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, + npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); + + SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); + + return false; + } + + public override void NPCLoot() + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + for (int x = centerX - halfLength; x <= centerX + halfLength; x++) + { + for (int y = centerY - halfLength; y <= centerY + halfLength; y++) { - for (int y = centerY - halfLength; y <= centerY + halfLength; y++) + if ((x == centerX - halfLength || x == centerX + halfLength || y == centerY - halfLength || y == centerY + halfLength) && !Main.tile[x, y].active()) + { + Main.tile[x, y].type = TileID.ObsidianBrick; + Main.tile[x, y].active(true); + } + Main.tile[x, y].lava(false); + Main.tile[x, y].liquid = 0; + if (Main.netMode == 2) { - if ((x == centerX - halfLength || x == centerX + halfLength || y == centerY - halfLength || y == centerY + halfLength) && !Main.tile[x, y].active()) - { - Main.tile[x, y].type = TileID.ObsidianBrick; - Main.tile[x, y].active(true); - } - Main.tile[x, y].lava(false); - Main.tile[x, y].liquid = 0; - if (Main.netMode == 2) - { - NetMessage.SendTileSquare(-1, x, y, 1); - } - else - { - WorldGen.SquareTileFrame(x, y, true); - } + NetMessage.SendTileSquare(-1, x, y, 1); + } + else + { + WorldGen.SquareTileFrame(x, y, true); } } - if(Main.expertMode) - { - npc.DropBossBags(); - } - - if(!Main.expertMode && Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MoltenParts")); - } - if(Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HeaterOfWorldsTrophy")); - } - if(!Main.expertMode && Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 188, Main.rand.Next(6,18)); - } - if(!Main.expertMode && Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 189, Main.rand.Next(6,18)); - } - if(!Main.expertMode && Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HeaterOfWorldsMask")); - } - TremorWorld.downedHeaterofWorlds = true; - } - - } + } + if (Main.expertMode) + { + npc.DropBossBags(); + } + + if (!Main.expertMode && Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MoltenParts")); + } + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HeaterOfWorldsTrophy")); + } + if (!Main.expertMode && Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 188, Main.rand.Next(6, 18)); + } + if (!Main.expertMode && Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 189, Main.rand.Next(6, 18)); + } + if (!Main.expertMode && Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HeaterOfWorldsMask")); + } + TremorWorld.downedHeaterofWorlds = true; + } + + } } \ No newline at end of file diff --git a/NPCs/HeaterOfWorldsTail.cs b/NPCs/HeaterOfWorldsTail.cs index 394c84b1..1769fa19 100644 --- a/NPCs/HeaterOfWorldsTail.cs +++ b/NPCs/HeaterOfWorldsTail.cs @@ -7,41 +7,41 @@ namespace Tremor.NPCs { - public class HeaterOfWorldsTail : ModNPC - { + public class HeaterOfWorldsTail : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Heater of Worlds"); } - - public override void SetDefaults() - { - npc.lifeMax = 6500; - npc.damage = 39; - npc.defense = 40; - npc.width = 30; - npc.height = 62; - npc.noTileCollide = true; - npc.behindTiles = true; - npc.friendly = false; - npc.noGravity = true; - npc.aiStyle = 6; - npc.dontCountMe = true; - npc.lavaImmune = true; - npc.buffImmune[24] = true; - npc.buffImmune[67] = true; - npc.npcSlots = 5f; - music = 17; - npc.dontTakeDamage = true; - npc.HitSound = SoundID.NPCHit7; - npc.DeathSound = SoundID.NPCDeath10; - } + + public override void SetDefaults() + { + npc.lifeMax = 6500; + npc.damage = 39; + npc.defense = 40; + npc.width = 30; + npc.height = 62; + npc.noTileCollide = true; + npc.behindTiles = true; + npc.friendly = false; + npc.noGravity = true; + npc.aiStyle = 6; + npc.dontCountMe = true; + npc.lavaImmune = true; + npc.buffImmune[24] = true; + npc.buffImmune[67] = true; + npc.npcSlots = 5f; + music = 17; + npc.dontTakeDamage = true; + npc.HitSound = SoundID.NPCHit7; + npc.DeathSound = SoundID.NPCDeath10; + } public override void OnHitPlayer(Player player, int damage, bool crit) { if (Main.expertMode || Main.rand.Next(1) == 0) { - player.AddBuff(24, 180, true); + player.AddBuff(24, 180, true); } } @@ -51,32 +51,32 @@ public override void ScaleExpertStats(int numPlayers, float bossLifeScale) npc.damage = (int)(npc.damage * 0.6f); } - public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) - { - return false; - } - public override void AI() - { - if (!Main.npc[(int)npc.ai[1]].active) - { - npc.life = 0; - npc.HitEffect(0, 10.0); - npc.active = false; - } - } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Texture2D drawTexture = Main.npcTexture[npc.type]; - Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); + public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) + { + return false; + } + public override void AI() + { + if (!Main.npc[(int)npc.ai[1]].active) + { + npc.life = 0; + npc.HitEffect(0, 10.0); + npc.active = false; + } + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D drawTexture = Main.npcTexture[npc.type]; + Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); - Vector2 drawPos = new Vector2( - npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, - npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); + Vector2 drawPos = new Vector2( + npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, + npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); - SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); + SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); - return false; - } - } + return false; + } + } } \ No newline at end of file diff --git a/NPCs/HeavyZombie.cs b/NPCs/HeavyZombie.cs index a48a19c9..c6bb2691 100644 --- a/NPCs/HeavyZombie.cs +++ b/NPCs/HeavyZombie.cs @@ -6,89 +6,91 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class HeavyZombie : ModNPC +namespace Tremor.NPCs { + + public class HeavyZombie : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Heavy Zombie"); Main.npcFrameCount[npc.type] = 3; } - - public override void SetDefaults() - { - npc.lifeMax = 300; - npc.damage = 80; - npc.defense = 30; - npc.knockBackResist = 0.03f; - npc.width = 34; - npc.height = 40; - animationType = 3; - npc.aiStyle = 3; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 11, 0); - banner = npc.type; - bannerItem = mod.ItemType("HeavyZombieBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 300; + npc.damage = 80; + npc.defense = 30; + npc.knockBackResist = 0.03f; + npc.width = 34; + npc.height = 40; + animationType = 3; + npc.aiStyle = 3; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 0, 11, 0); + banner = npc.type; + bannerItem = mod.ItemType("HeavyZombieBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HeavyGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HeavyGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HeavyGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HeavyGore3"), 1f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HeavyGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HeavyGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HeavyGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HeavyGore3"), 1f); + } + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("UntreatedFlesh")); - } - if(Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 22, Main.rand.Next(2,4)); - } - if(Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 21, Main.rand.Next(2,4)); - } - if(Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 704, Main.rand.Next(2,4)); - } - if(Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 705, Main.rand.Next(2,4)); - } - } - } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.03f : 0f; - } -}} \ No newline at end of file + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("UntreatedFlesh")); + } + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 22, Main.rand.Next(2, 4)); + } + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 21, Main.rand.Next(2, 4)); + } + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 704, Main.rand.Next(2, 4)); + } + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 705, Main.rand.Next(2, 4)); + } + } + } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.03f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/Hellgron.cs b/NPCs/Hellgron.cs index 1d9ac4e0..ce6e3e28 100644 --- a/NPCs/Hellgron.cs +++ b/NPCs/Hellgron.cs @@ -6,79 +6,81 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Hellgron : ModNPC +namespace Tremor.NPCs { + + public class Hellgron : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Hellgron"); Main.npcFrameCount[npc.type] = 14; } - - public override void SetDefaults() - { - npc.lifeMax = 200; - npc.damage = 26; - npc.defense = 16; - npc.knockBackResist = 0.7f; - npc.width = 44; - npc.height = 36; - animationType = 180; - npc.aiStyle = 2; - aiType = 180; - npc.npcSlots = 0.8f; - npc.noTileCollide = true; - npc.buffImmune[20] = true; - npc.buffImmune[24] = true; - npc.buffImmune[39] = true; - npc.buffImmune[31] = false; - npc.HitSound = SoundID.NPCHit27; - npc.DeathSound = SoundID.NPCDeath30; - npc.value = Item.buyPrice(0, 0, 25, 0); - banner = npc.type; - bannerItem = mod.ItemType("HellgronBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } - public override void AI() - { -if (Main.rand.Next(4) == 0) - { - int num706 = Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 2f); - Main.dust[num706].velocity *= 0.3f; - } - } + public override void SetDefaults() + { + npc.lifeMax = 200; + npc.damage = 26; + npc.defense = 16; + npc.knockBackResist = 0.7f; + npc.width = 44; + npc.height = 36; + animationType = 180; + npc.aiStyle = 2; + aiType = 180; + npc.npcSlots = 0.8f; + npc.noTileCollide = true; + npc.buffImmune[20] = true; + npc.buffImmune[24] = true; + npc.buffImmune[39] = true; + npc.buffImmune[31] = false; + npc.HitSound = SoundID.NPCHit27; + npc.DeathSound = SoundID.NPCDeath30; + npc.value = Item.buyPrice(0, 0, 25, 0); + banner = npc.type; + bannerItem = mod.ItemType("HellgronBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } + public override void AI() + { + if (Main.rand.Next(4) == 0) + { + int num706 = Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 2f); + Main.dust[num706].velocity *= 0.3f; + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HellgronGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HellgronGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HellgronGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HellgronGore3"), 1f); - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.6f); - } - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HellgronGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HellgronGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HellgronGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HellgronGore3"), 1f); + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.6f); + } + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.spawnTileY > Main.maxTilesY - 200 ? 0.03f : 0; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.spawnTileY > Main.maxTilesY - 200 ? 0.03f : 0; + } + } +} \ No newline at end of file diff --git a/NPCs/Hellhound.cs b/NPCs/Hellhound.cs index 9a8e74d2..bd20abc7 100644 --- a/NPCs/Hellhound.cs +++ b/NPCs/Hellhound.cs @@ -5,162 +5,164 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Hellhound : ModNPC +namespace Tremor.NPCs { + + public class Hellhound : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Hellhound"); Main.npcFrameCount[npc.type] = 12; } - - public override void SetDefaults() - { - npc.lifeMax = 10000; - npc.damage = 160; - npc.defense = 70; - npc.knockBackResist = 0.2f; - npc.width = 50; - npc.height = 44; - animationType = 423; - npc.aiStyle = 26; - npc.npcSlots = 0.5f; - npc.lavaImmune = true; - npc.buffImmune[24] = true; - npc.buffImmune[67] = true; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath21; - npc.value = Item.buyPrice(0, 0, 40, 0); - banner = npc.type; - bannerItem = mod.ItemType("HellhoundBanner"); - } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 60; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HellhoundGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HellhoundGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HellhoundGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HellhoundGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HellhoundGore3"), 1f); - } - else - { + public override void SetDefaults() + { + npc.lifeMax = 10000; + npc.damage = 160; + npc.defense = 70; + npc.knockBackResist = 0.2f; + npc.width = 50; + npc.height = 44; + animationType = 423; + npc.aiStyle = 26; + npc.npcSlots = 0.5f; + npc.lavaImmune = true; + npc.buffImmune[24] = true; + npc.buffImmune[67] = true; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath21; + npc.value = Item.buyPrice(0, 0, 40, 0); + banner = npc.type; + bannerItem = mod.ItemType("HellhoundBanner"); + } - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 6, (float)hitDirection, -2f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 60; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HellhoundGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HellhoundGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HellhoundGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HellhoundGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HellhoundGore3"), 1f); + } + else + { - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FireFragment"), Main.rand.Next(2,4)); - }; - if(Main.rand.Next(25) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FlamesofDespair")); - }; - } - } + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 6, (float)hitDirection, -2f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, (float)hitDirection, -1f, 0, default(Color), 0.7f); + } + } + } - public override void AI() - { + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FireFragment"), Main.rand.Next(2, 4)); + }; + if (Main.rand.Next(25) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FlamesofDespair")); + }; + } + } + + public override void AI() + { -if (Main.rand.Next(4) == 0) - { - int num706 = Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 1f); - Main.dust[num706].velocity *= 0.3f; - } - Vector2 vector72 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num738 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector72.X; - float num739 = Main.player[npc.target].position.Y - vector72.Y; - float num740 = (float)Math.Sqrt((double)(num738 * num738 + num739 * num739)); + if (Main.rand.Next(4) == 0) + { + int num706 = Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 1f); + Main.dust[num706].velocity *= 0.3f; + } + Vector2 vector72 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num738 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector72.X; + float num739 = Main.player[npc.target].position.Y - vector72.Y; + float num740 = (float)Math.Sqrt((double)(num738 * num738 + num739 * num739)); - if (npc.ai[2] == 1f) - { - npc.ai[1] += 1f; - npc.velocity.X = npc.velocity.X * 0.7f; - if (npc.ai[1] < 30f) - { - Vector2 vector73 = npc.Center + Vector2.UnitX * (float)npc.spriteDirection * -20f; - Dust dust11 = Main.dust[Dust.NewDust(vector73, 0, 0, 6, 0f, 0f, 0, default(Color), 1f)]; - Vector2 vector74 = Vector2.UnitY.RotatedByRandom(6.2831854820251465); - dust11.position = vector73 + vector74 * 20f; - dust11.velocity = -vector74 * 2f; - dust11.scale = 0.5f + vector74.X * (float)(-(float)npc.spriteDirection); - dust11.fadeIn = 1f; - dust11.noGravity = true; - } - else if (npc.ai[1] == 30f) - { - for (int num743 = 0; num743 < 20; num743++) - { - Vector2 vector75 = npc.Center + Vector2.UnitX * (float)npc.spriteDirection * -20f; - Dust dust12 = Main.dust[Dust.NewDust(vector75, 0, 0, 6, 0f, 0f, 0, default(Color), 1f)]; - Vector2 vector76 = Vector2.UnitY.RotatedByRandom(6.2831854820251465); - dust12.position = vector75 + vector76 * 4f; - dust12.velocity = vector76 * 4f + Vector2.UnitX * Main.rand.NextFloat() * (float)npc.spriteDirection * -5f; - dust12.scale = 0.5f + vector76.X * (float)(-(float)npc.spriteDirection); - dust12.fadeIn = 1f; - dust12.noGravity = true; - } - } - if (npc.velocity.X > -0.5f && npc.velocity.X < 0.5f) - { - npc.velocity.X = 0f; - } - if (npc.ai[1] == 30f && Main.netMode != 1) - { - int num744 = Main.expertMode ? 35 : 50; - Projectile.NewProjectile(npc.Center.X + (float)(npc.spriteDirection * -20), npc.Center.Y, (float)(npc.spriteDirection * -7), 0f, 467, num744, 0f, Main.myPlayer, (float)npc.target, 0f); - } - if (npc.ai[1] >= 60f) - { - npc.ai[1] = (float)(-(float)Main.rand.Next(320, 601)); - npc.ai[2] = 0f; - } - } - else - { - npc.ai[1] += 1f; - if (npc.ai[1] >= 180f && num740 < 500f && npc.velocity.Y == 0f) - { - npc.ai[1] = 0f; - npc.ai[2] = 1f; - npc.netUpdate = true; - } - else if (npc.velocity.Y == 0f && num740 < 100f && Math.Abs(npc.velocity.X) > 3f && ((npc.Center.X < Main.player[npc.target].Center.X && npc.velocity.X > 0f) || (npc.Center.X > Main.player[npc.target].Center.X && npc.velocity.X < 0f))) - { - npc.velocity.Y = npc.velocity.Y - 4f; - } - } - } + if (npc.ai[2] == 1f) + { + npc.ai[1] += 1f; + npc.velocity.X = npc.velocity.X * 0.7f; + if (npc.ai[1] < 30f) + { + Vector2 vector73 = npc.Center + Vector2.UnitX * (float)npc.spriteDirection * -20f; + Dust dust11 = Main.dust[Dust.NewDust(vector73, 0, 0, 6, 0f, 0f, 0, default(Color), 1f)]; + Vector2 vector74 = Vector2.UnitY.RotatedByRandom(6.2831854820251465); + dust11.position = vector73 + vector74 * 20f; + dust11.velocity = -vector74 * 2f; + dust11.scale = 0.5f + vector74.X * (float)(-(float)npc.spriteDirection); + dust11.fadeIn = 1f; + dust11.noGravity = true; + } + else if (npc.ai[1] == 30f) + { + for (int num743 = 0; num743 < 20; num743++) + { + Vector2 vector75 = npc.Center + Vector2.UnitX * (float)npc.spriteDirection * -20f; + Dust dust12 = Main.dust[Dust.NewDust(vector75, 0, 0, 6, 0f, 0f, 0, default(Color), 1f)]; + Vector2 vector76 = Vector2.UnitY.RotatedByRandom(6.2831854820251465); + dust12.position = vector75 + vector76 * 4f; + dust12.velocity = vector76 * 4f + Vector2.UnitX * Main.rand.NextFloat() * (float)npc.spriteDirection * -5f; + dust12.scale = 0.5f + vector76.X * (float)(-(float)npc.spriteDirection); + dust12.fadeIn = 1f; + dust12.noGravity = true; + } + } + if (npc.velocity.X > -0.5f && npc.velocity.X < 0.5f) + { + npc.velocity.X = 0f; + } + if (npc.ai[1] == 30f && Main.netMode != 1) + { + int num744 = Main.expertMode ? 35 : 50; + Projectile.NewProjectile(npc.Center.X + (float)(npc.spriteDirection * -20), npc.Center.Y, (float)(npc.spriteDirection * -7), 0f, 467, num744, 0f, Main.myPlayer, (float)npc.target, 0f); + } + if (npc.ai[1] >= 60f) + { + npc.ai[1] = (float)(-(float)Main.rand.Next(320, 601)); + npc.ai[2] = 0f; + } + } + else + { + npc.ai[1] += 1f; + if (npc.ai[1] >= 180f && num740 < 500f && npc.velocity.Y == 0f) + { + npc.ai[1] = 0f; + npc.ai[2] = 1f; + npc.netUpdate = true; + } + else if (npc.velocity.Y == 0f && num740 < 100f && Math.Abs(npc.velocity.X) > 3f && ((npc.Center.X < Main.player[npc.target].Center.X && npc.velocity.X > 0f) || (npc.Center.X > Main.player[npc.target].Center.X && npc.velocity.X < 0f))) + { + npc.velocity.Y = npc.velocity.Y - 4f; + } + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && spawnInfo.spawnTileY > Main.maxTilesY - 200 ? 0.002f : 0f; - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && spawnInfo.spawnTileY > Main.maxTilesY - 200 ? 0.002f : 0f; + } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/HiveHeadZombie.cs b/NPCs/HiveHeadZombie.cs index d3be9259..87a84cae 100644 --- a/NPCs/HiveHeadZombie.cs +++ b/NPCs/HiveHeadZombie.cs @@ -6,62 +6,64 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class HiveHeadZombie : ModNPC +namespace Tremor.NPCs { + + public class HiveHeadZombie : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Hivehead Zombie"); Main.npcFrameCount[npc.type] = 3; } - - public override void SetDefaults() - { - npc.lifeMax = 125; - npc.damage = 25; - npc.defense = 15; - npc.knockBackResist = 0.3f; - npc.width = 34; - npc.height = 40; - animationType = 3; - npc.aiStyle = 3; - npc.npcSlots = 1f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 3, 0); - banner = npc.type; - bannerItem = mod.ItemType("HiveHeadZombieBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 125; + npc.damage = 25; + npc.defense = 15; + npc.knockBackResist = 0.3f; + npc.width = 34; + npc.height = 40; + animationType = 3; + npc.aiStyle = 3; + npc.npcSlots = 1f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 0, 3, 0); + banner = npc.type; + bannerItem = mod.ItemType("HiveHeadZombieBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore2"), 1f); -NPC.NewNPC((int)npc.position.X - 22, (int)npc.position.Y + 55, 210); -NPC.NewNPC((int)npc.position.X + 37, (int)npc.position.Y, 210); -NPC.NewNPC((int)npc.position.X, (int)npc.position.Y - 48, 210); - } -} - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedQueenBee && !Main.dayTime && y < Main.worldSurface ? 0.01f : 0f; - } -}} \ No newline at end of file + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore2"), 1f); + NPC.NewNPC((int)npc.position.X - 22, (int)npc.position.Y + 55, 210); + NPC.NewNPC((int)npc.position.X + 37, (int)npc.position.Y, 210); + NPC.NewNPC((int)npc.position.X, (int)npc.position.Y - 48, 210); + } + } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedQueenBee && !Main.dayTime && y < Main.worldSurface ? 0.01f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/IceBlazer.cs b/NPCs/IceBlazer.cs index a06d15f1..01415f2f 100644 --- a/NPCs/IceBlazer.cs +++ b/NPCs/IceBlazer.cs @@ -6,90 +6,92 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class IceBlazer : ModNPC +namespace Tremor.NPCs { + + public class IceBlazer : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Ice Blazer"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 2000; - npc.damage = 112; - npc.defense = 30; - npc.knockBackResist = 0.6f; - npc.width = 45; - npc.height = 75; - animationType = 169; -npc.noGravity = true; - npc.noTileCollide = true; - npc.aiStyle = 22; - aiType = 169; - npc.npcSlots = 5f; - npc.HitSound = SoundID.NPCHit5; - npc.DeathSound = SoundID.NPCDeath7; - npc.value = Item.buyPrice(0, 0, 5, 0); - banner = npc.type; - bannerItem = mod.ItemType("IceBlazerBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 2000; + npc.damage = 112; + npc.defense = 30; + npc.knockBackResist = 0.6f; + npc.width = 45; + npc.height = 75; + animationType = 169; + npc.noGravity = true; + npc.noTileCollide = true; + npc.aiStyle = 22; + aiType = 169; + npc.npcSlots = 5f; + npc.HitSound = SoundID.NPCHit5; + npc.DeathSound = SoundID.NPCDeath7; + npc.value = Item.buyPrice(0, 0, 5, 0); + banner = npc.type; + bannerItem = mod.ItemType("IceBlazerBanner"); + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && spawnInfo.player.ZoneSnow && y < Main.worldSurface ? 0.004f : 0f; - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FrostCore")); - }; - if(NPC.downedMoonlord && Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); - } - } - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && spawnInfo.player.ZoneSnow && y < Main.worldSurface ? 0.004f : 0f; + } + + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FrostCore")); + }; + if (NPC.downedMoonlord && Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); + } + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 60; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 92, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 92, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 92, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 92, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - } - else - { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 92, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - } -} -}} \ No newline at end of file + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 60; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 92, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 92, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 92, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 92, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + } + else + { + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 92, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + } + } + } +} \ No newline at end of file diff --git a/NPCs/IceMotherSlime.cs b/NPCs/IceMotherSlime.cs index f8b1e523..7073232b 100644 --- a/NPCs/IceMotherSlime.cs +++ b/NPCs/IceMotherSlime.cs @@ -6,73 +6,75 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class IceMotherSlime : ModNPC +namespace Tremor.NPCs { + + public class IceMotherSlime : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Ice Mother Slime"); Main.npcFrameCount[npc.type] = 2; } - - public override void SetDefaults() - { - npc.lifeMax = 120; - npc.damage = 22; - npc.defense = 4; - npc.knockBackResist = 0.6f; - npc.width = 32; - npc.height = 22; - animationType = 1; - npc.aiStyle = 1; - aiType = 141; - npc.npcSlots = 0.1f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.value = Item.buyPrice(0, 0, 6, 50); - banner = npc.type; - bannerItem = mod.ItemType("IceMotherSlimeBanner"); - } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); -NPC.NewNPC((int)npc.position.X, (int)npc.position.Y - 48, 147); -NPC.NewNPC((int)npc.position.X, (int)npc.position.Y - 48, 147); -NPC.NewNPC((int)npc.position.X, (int)npc.position.Y - 48, 147); - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); - } - } -} + public override void SetDefaults() + { + npc.lifeMax = 120; + npc.damage = 22; + npc.defense = 4; + npc.knockBackResist = 0.6f; + npc.width = 32; + npc.height = 22; + animationType = 1; + npc.aiStyle = 1; + aiType = 141; + npc.npcSlots = 0.1f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.value = Item.buyPrice(0, 0, 6, 50); + banner = npc.type; + bannerItem = mod.ItemType("IceMotherSlimeBanner"); + } - public override void AI() - { -if (Main.rand.Next(10) == 0) - { - int num706 = Dust.NewDust(npc.position, npc.width, npc.height, 80, 0f, 0f, 200, npc.color, 1f); - Main.dust[num706].velocity *= 0.3f; - } - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + NPC.NewNPC((int)npc.position.X, (int)npc.position.Y - 48, 147); + NPC.NewNPC((int)npc.position.X, (int)npc.position.Y - 48, 147); + NPC.NewNPC((int)npc.position.X, (int)npc.position.Y - 48, 147); + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); + } + } + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void AI() + { + if (Main.rand.Next(10) == 0) + { + int num706 = Dust.NewDust(npc.position, npc.width, npc.height, 80, 0f, 0f, 200, npc.color, 1f); + Main.dust[num706].velocity *= 0.3f; + } + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && Main.cloudAlpha > 0f && y < Main.worldSurface && spawnInfo.player.ZoneSnow ? 0.01f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && Main.cloudAlpha > 0f && y < Main.worldSurface && spawnInfo.player.ZoneSnow ? 0.01f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/IndifferenceSoul.cs b/NPCs/IndifferenceSoul.cs index cbc21b8a..bf2d6680 100644 --- a/NPCs/IndifferenceSoul.cs +++ b/NPCs/IndifferenceSoul.cs @@ -7,66 +7,68 @@ using Terraria.ModLoader; -namespace Tremor.NPCs { - [AutoloadBossHead] - -public class IndifferenceSoul : ModNPC +namespace Tremor.NPCs { + [AutoloadBossHead] + + public class IndifferenceSoul : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Soul of Indifference"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 750; - npc.damage = 26; - npc.defense = 5; - npc.knockBackResist = 1f; - npc.width = 60; - npc.height = 85; - animationType = 288; - npc.aiStyle = 17; - npc.npcSlots = 15f; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit31; - npc.noGravity = true; - npc.DeathSound = SoundID.NPCDeath6; - npc.value = Item.buyPrice(0, 4, 0, 9); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } - public override void AI() - { + public override void SetDefaults() + { + npc.lifeMax = 750; + npc.damage = 26; + npc.defense = 5; + npc.knockBackResist = 1f; + npc.width = 60; + npc.height = 85; + animationType = 288; + npc.aiStyle = 17; + npc.npcSlots = 15f; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit31; + npc.noGravity = true; + npc.DeathSound = SoundID.NPCDeath6; + npc.value = Item.buyPrice(0, 4, 0, 9); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } + public override void AI() + { npc.position += npc.velocity * 2f; -if (Main.rand.Next(6) == 0) - { - int num706 = Dust.NewDust(npc.position, npc.width , npc.height, 60, 0f, 0f, 200, npc.color, 1f); - Main.dust[num706].velocity *= 0.3f; - } - } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Dust.NewDust(npc.position, npc.width, npc.height, 60, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 60, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 60, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 60, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 60, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 60, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 60, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); - Dust.NewDust(npc.position, npc.width, npc.height, 60, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 60, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); - } - } -} + if (Main.rand.Next(6) == 0) + { + int num706 = Dust.NewDust(npc.position, npc.width, npc.height, 60, 0f, 0f, 200, npc.color, 1f); + Main.dust[num706].velocity *= 0.3f; + } + } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Dust.NewDust(npc.position, npc.width, npc.height, 60, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 60, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 60, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 60, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 60, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 60, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 60, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); + Dust.NewDust(npc.position, npc.width, npc.height, 60, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 60, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); + } + } + } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/InfectedZombie.cs b/NPCs/InfectedZombie.cs index 0636be7a..db67b6d3 100644 --- a/NPCs/InfectedZombie.cs +++ b/NPCs/InfectedZombie.cs @@ -6,45 +6,47 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class InfectedZombie : ModNPC +namespace Tremor.NPCs { + + public class InfectedZombie : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Infected Zombie"); Main.npcFrameCount[npc.type] = 3; } - - public override void SetDefaults() - { - npc.lifeMax = 95; - npc.damage = 25; - Main.npcFrameCount[npc.type] = 3; - npc.defense = 14; - npc.knockBackResist = 0.3f; - npc.width = 34; - npc.height = 46; -animationType = 3; - npc.aiStyle = 3; - npc.npcSlots = 1f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 15, 9); - bannerItem = mod.ItemType("InfectedZombieBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 95; + npc.damage = 25; + Main.npcFrameCount[npc.type] = 3; + npc.defense = 14; + npc.knockBackResist = 0.3f; + npc.width = 34; + npc.height = 46; + animationType = 3; + npc.aiStyle = 3; + npc.npcSlots = 1f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 0, 15, 9); + bannerItem = mod.ItemType("InfectedZombieBanner"); + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && NPC.downedBoss2 && spawnInfo.player.ZoneCrimson && y < Main.worldSurface ? 0.02f : 0; - } -}} \ No newline at end of file + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && NPC.downedBoss2 && spawnInfo.player.ZoneCrimson && y < Main.worldSurface ? 0.02f : 0; + } + } +} \ No newline at end of file diff --git a/NPCs/IronGiant.cs b/NPCs/IronGiant.cs index 9c521cc4..051e3ca9 100644 --- a/NPCs/IronGiant.cs +++ b/NPCs/IronGiant.cs @@ -13,7 +13,7 @@ public override void SetStaticDefaults() DisplayName.SetDefault("Iron Giant"); Main.npcFrameCount[npc.type] = 10; } - + public override void SetDefaults() { npc.width = 40; @@ -23,69 +23,69 @@ public override void SetDefaults() npc.lifeMax = 800; npc.HitSound = SoundID.NPCHit4; npc.DeathSound = SoundID.NPCDeath6; - npc.value = Item.buyPrice(0, 0, 28, 7); + npc.value = Item.buyPrice(0, 0, 28, 7); npc.knockBackResist = 0.3f; npc.aiStyle = 3; aiType = 343; animationType = 343; - npc.buffImmune[20] = true; - npc.buffImmune[31] = false; - npc.buffImmune[24] = true; - banner = npc.type; - bannerItem = mod.ItemType("IronGiantBanner"); + npc.buffImmune[20] = true; + npc.buffImmune[31] = false; + npc.buffImmune[24] = true; + banner = npc.type; + bannerItem = mod.ItemType("IronGiantBanner"); } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(8) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ElectricSpear")); - }; - if(Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 18); - }; - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(8) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ElectricSpear")); + }; + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 18); + }; + } + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 31, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, 99, 1f); - Gore.NewGore(npc.position, npc.velocity, 99, 1f); - Gore.NewGore(npc.position, npc.velocity, 99, 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IGGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IGGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IGGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IGGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IGGore4"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IGGore4"), 1f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 31, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IGGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IGGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IGGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IGGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IGGore4"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/IGGore4"), 1f); + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && y > Main.rockLayer ? 0.001f : 0f; - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && y > Main.rockLayer ? 0.001f : 0f; + } } } diff --git a/NPCs/JungleMimic.cs b/NPCs/JungleMimic.cs index 7d687314..55ab7359 100644 --- a/NPCs/JungleMimic.cs +++ b/NPCs/JungleMimic.cs @@ -6,49 +6,49 @@ namespace Tremor.NPCs { - public class JungleMimic : ModNPC - { + public class JungleMimic : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Jungle Mimic"); Main.npcFrameCount[npc.type] = 14; } - - public override void SetDefaults() - { - npc.lifeMax = 3500; - npc.damage = 90; - npc.defense = 34; - npc.knockBackResist = 0f; - npc.width = 48; - npc.height = 40; - npc.aiStyle = 87; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath6; - npc.value = Item.buyPrice(0, 3, 0, 0); - animationType = NPCID.BigMimicHallow; - } - public override void NPCLoot() - { -if (Main.netMode != 1) -{ -int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; -int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; -int halfLength = npc.width / 2 / 16 + 1; -Helper.DropItem(new Rectangle((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height), new Drop(mod.ItemType("SporeBlade"), 1, 1), new Drop(mod.ItemType("TechnologyofDionysus"), 1, 2), new Drop(mod.ItemType("LivingWoodThreepeater"), 1, 2), new Drop(mod.ItemType("UnfathomableFlower"), 1, 1), new Drop(0, 0, 0)); -Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 500, Main.rand.Next(10)); -Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 499, Main.rand.Next(10)); -} -} + public override void SetDefaults() + { + npc.lifeMax = 3500; + npc.damage = 90; + npc.defense = 34; + npc.knockBackResist = 0f; + npc.width = 48; + npc.height = 40; + npc.aiStyle = 87; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit4; + npc.DeathSound = SoundID.NPCDeath6; + npc.value = Item.buyPrice(0, 3, 0, 0); + animationType = NPCID.BigMimicHallow; + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && spawnInfo.player.ZoneJungle && y > Main.rockLayer ? 0.003f : 0f; - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + Helper.DropItem(new Rectangle((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height), new Drop(mod.ItemType("SporeBlade"), 1, 1), new Drop(mod.ItemType("TechnologyofDionysus"), 1, 2), new Drop(mod.ItemType("LivingWoodThreepeater"), 1, 2), new Drop(mod.ItemType("UnfathomableFlower"), 1, 1), new Drop(0, 0, 0)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 500, Main.rand.Next(10)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 499, Main.rand.Next(10)); + } + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && spawnInfo.player.ZoneJungle && y > Main.rockLayer ? 0.003f : 0f; + } + } } \ No newline at end of file diff --git a/NPCs/JungleSpirit.cs b/NPCs/JungleSpirit.cs index 6415169a..f0d2ced1 100644 --- a/NPCs/JungleSpirit.cs +++ b/NPCs/JungleSpirit.cs @@ -10,64 +10,64 @@ namespace Tremor.NPCs { - public class JungleSpirit : ModNPC - { + public class JungleSpirit : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Jungle Spirit"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 140; - npc.damage = 15; - npc.defense = 14; - npc.knockBackResist = 0.3f; - npc.width = 34; - npc.height = 48; - animationType = 316; - npc.aiStyle = 22; - npc.npcSlots = 0.4f; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit44; - npc.noGravity = true; - npc.DeathSound = SoundID.NPCDeath58; - npc.value = Item.buyPrice(0, 0, 4, 15); - banner = npc.type; - bannerItem = mod.ItemType("JungleSpiritBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 140; + npc.damage = 15; + npc.defense = 14; + npc.knockBackResist = 0.3f; + npc.width = 34; + npc.height = 48; + animationType = 316; + npc.aiStyle = 22; + npc.npcSlots = 0.4f; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit44; + npc.noGravity = true; + npc.DeathSound = SoundID.NPCDeath58; + npc.value = Item.buyPrice(0, 0, 4, 15); + banner = npc.type; + bannerItem = mod.ItemType("JungleSpiritBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if (npc.life <= 0) - { - for (int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/JungleSpiritGore"), 1f); + } - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/JungleSpiritGore"), 1f); - } + } - } - - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneJungle && y > Main.rockLayer ? 0.005f : 0f; - } - } - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneJungle && y > Main.rockLayer ? 0.005f : 0f; + } + } +} diff --git a/NPCs/Knight.cs b/NPCs/Knight.cs index a51a5098..fa1b70b0 100644 --- a/NPCs/Knight.cs +++ b/NPCs/Knight.cs @@ -6,10 +6,11 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { -[AutoloadHead] -public class Knight : ModNPC +namespace Tremor.NPCs { + [AutoloadHead] + public class Knight : ModNPC + { public override string Texture { get @@ -17,14 +18,14 @@ public override string Texture return "Tremor/NPCs/Knight"; } } - + public override string[] AltTextures { get { - return new string[] { "Tremor/NPCs/Knight"}; + return new string[] { "Tremor/NPCs/Knight" }; } - } + } public override bool Autoload(ref string name) { @@ -44,165 +45,166 @@ public override void SetStaticDefaults() NPCID.Sets.AttackAverageChance[npc.type] = 30; } - public override void SetDefaults() - { - npc.townNPC = true; - npc.friendly = true; - npc.width = 30; - npc.height = 44; - npc.aiStyle = 7; - npc.damage = 10; - npc.defense = 15; - npc.lifeMax = 250; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.knockBackResist = 0.5f; - animationType = NPCID.GoblinTinkerer; - } - - - public override bool CanTownNPCSpawn(int numTownNPCs, int money) - { - return true; - } - - - public override string TownNPCName() - { - switch(WorldGen.genRand.Next(5)) - { - case 0: - return "Wheatly"; - case 1: - return "Daniel"; - case 2: - return "Crox"; - case 3: - return "Geralt"; - case 4: - return "Roland"; - case 5: - return "Rishel"; - default: - return "Hodor"; - } - } - - public override string GetChat() - { - switch(Main.rand.Next(6)) - { - case 0: - return "Well met, brave adventurer."; - case 1: - return "A balanced weapon can mean the difference between victory and defeat."; - case 2: - return "I am not overly fond of the bovine hordes. Best to leave them alone really."; - case 3: - return "Do you have a weapon? Needs about 20% more coolness!"; - case 4: - return "Hail and good morrow my Liege!"; - case 5: - return "I was in a strange castle one day. There were mechanical things saying EXTERMINATE. Were they your minions?"; - default: - return "Have you ever met a knight whose name is Sir Uncle Slime? He is best friend of mine."; - } - } - - public override void SetChatButtons(ref string button, ref string button2) - { - button = Lang.inter[28].Value; - } - - public override void OnChatButtonClicked(bool firstButton, ref bool shop) - { - if(firstButton) - { - shop = true; - } - } - - public override void SetupShop(Chest shop, ref int nextSlot) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("ThrowingAxe")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("RustySword")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("RipperKnife")); - nextSlot++; - if(NPC.downedBoss1) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("TombRaider")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("SpikeShield")); - nextSlot++; - } - if(NPC.downedBoss2) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("TwilightHorns")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("ToxicRazorknife")); - nextSlot++; - } - if(NPC.downedBoss3) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("NecromancerClaymore")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("Shovel")); - nextSlot++; - } - if(Main.hardMode) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("GoldenThrowingAxe")); - nextSlot++; - } - if(NPC.downedMechBossAny) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("PrizmaticSword")); - nextSlot++; - } - if(Main.hardMode && Main.bloodMoon) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("Oppressor")); - nextSlot++; - } - } - - public override void TownNPCAttackStrength(ref int damage, ref float knockback) - { - damage = 25; - knockback = 4f; - } - - public override void TownNPCAttackCooldown(ref int cooldown, ref int randExtraCooldown) - { - cooldown = 10; - randExtraCooldown = 10; - } - - public override void TownNPCAttackProj(ref int projType, ref int attackDelay) - { - projType = mod.ProjectileType("ThrowingAxe"); - attackDelay = 4; - } - - public override void TownNPCAttackProjSpeed(ref float multiplier, ref float gravityCorrection, ref float randomOffset) - { - multiplier = 12f; - randomOffset = 2f; - } - - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/KnightGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/KnightGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/KnightGore3"), 1f); - } -} -}} \ No newline at end of file + public override void SetDefaults() + { + npc.townNPC = true; + npc.friendly = true; + npc.width = 30; + npc.height = 44; + npc.aiStyle = 7; + npc.damage = 10; + npc.defense = 15; + npc.lifeMax = 250; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.knockBackResist = 0.5f; + animationType = NPCID.GoblinTinkerer; + } + + + public override bool CanTownNPCSpawn(int numTownNPCs, int money) + { + return true; + } + + + public override string TownNPCName() + { + switch (WorldGen.genRand.Next(5)) + { + case 0: + return "Wheatly"; + case 1: + return "Daniel"; + case 2: + return "Crox"; + case 3: + return "Geralt"; + case 4: + return "Roland"; + case 5: + return "Rishel"; + default: + return "Hodor"; + } + } + + public override string GetChat() + { + switch (Main.rand.Next(6)) + { + case 0: + return "Well met, brave adventurer."; + case 1: + return "A balanced weapon can mean the difference between victory and defeat."; + case 2: + return "I am not overly fond of the bovine hordes. Best to leave them alone really."; + case 3: + return "Do you have a weapon? Needs about 20% more coolness!"; + case 4: + return "Hail and good morrow my Liege!"; + case 5: + return "I was in a strange castle one day. There were mechanical things saying EXTERMINATE. Were they your minions?"; + default: + return "Have you ever met a knight whose name is Sir Uncle Slime? He is best friend of mine."; + } + } + + public override void SetChatButtons(ref string button, ref string button2) + { + button = Lang.inter[28].Value; + } + + public override void OnChatButtonClicked(bool firstButton, ref bool shop) + { + if (firstButton) + { + shop = true; + } + } + + public override void SetupShop(Chest shop, ref int nextSlot) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("ThrowingAxe")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("RustySword")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("RipperKnife")); + nextSlot++; + if (NPC.downedBoss1) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("TombRaider")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("SpikeShield")); + nextSlot++; + } + if (NPC.downedBoss2) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("TwilightHorns")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("ToxicRazorknife")); + nextSlot++; + } + if (NPC.downedBoss3) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("NecromancerClaymore")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("Shovel")); + nextSlot++; + } + if (Main.hardMode) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("GoldenThrowingAxe")); + nextSlot++; + } + if (NPC.downedMechBossAny) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("PrizmaticSword")); + nextSlot++; + } + if (Main.hardMode && Main.bloodMoon) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("Oppressor")); + nextSlot++; + } + } + + public override void TownNPCAttackStrength(ref int damage, ref float knockback) + { + damage = 25; + knockback = 4f; + } + + public override void TownNPCAttackCooldown(ref int cooldown, ref int randExtraCooldown) + { + cooldown = 10; + randExtraCooldown = 10; + } + + public override void TownNPCAttackProj(ref int projType, ref int attackDelay) + { + projType = mod.ProjectileType("ThrowingAxe"); + attackDelay = 4; + } + + public override void TownNPCAttackProjSpeed(ref float multiplier, ref float gravityCorrection, ref float randomOffset) + { + multiplier = 12f; + randomOffset = 2f; + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/KnightGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/KnightGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/KnightGore3"), 1f); + } + } + } +} \ No newline at end of file diff --git a/NPCs/KnightZombie.cs b/NPCs/KnightZombie.cs index 7e113d16..9e670a89 100644 --- a/NPCs/KnightZombie.cs +++ b/NPCs/KnightZombie.cs @@ -6,72 +6,74 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class KnightZombie : ModNPC +namespace Tremor.NPCs { + + public class KnightZombie : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Knight Zombie"); Main.npcFrameCount[npc.type] = 3; } - - public override void SetDefaults() - { - npc.lifeMax = 160; - npc.damage = 20; - npc.defense = 7; - npc.knockBackResist = 0.3f; - npc.width = 34; - npc.height = 46; -animationType = 3; - npc.aiStyle = 3; - npc.npcSlots = 1f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 4, 7); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 160; + npc.damage = 20; + npc.defense = 7; + npc.knockBackResist = 0.3f; + npc.width = 34; + npc.height = 46; + animationType = 3; + npc.aiStyle = 3; + npc.npcSlots = 1f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 0, 4, 7); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/KnightZombieGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore2"), 1f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/KnightZombieGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore2"), 1f); + } + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(25) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("KnightHelmet")); - }; - } - } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && y < Main.worldSurface ? 0.1f : 0f; - } -}} \ No newline at end of file + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(25) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("KnightHelmet")); + }; + } + } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && y < Main.worldSurface ? 0.1f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/KnightZombieSword.cs b/NPCs/KnightZombieSword.cs index 554fc29a..d7e2537b 100644 --- a/NPCs/KnightZombieSword.cs +++ b/NPCs/KnightZombieSword.cs @@ -13,7 +13,7 @@ public override void SetStaticDefaults() DisplayName.SetDefault("Knight Zombie"); Main.npcFrameCount[npc.type] = 7; } - + public override void SetDefaults() { npc.width = 30; @@ -23,68 +23,68 @@ public override void SetDefaults() npc.lifeMax = 140; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 4, 7); + npc.value = Item.buyPrice(0, 0, 4, 7); npc.knockBackResist = 0.5f; npc.aiStyle = 3; aiType = 434; - npc.npcSlots = 0.5f; + npc.npcSlots = 0.5f; animationType = 434; } -public override void AI() - { -if (npc.frame.Y <= 204) -{ -npc.width = 30; -} -if (npc.frame.Y > 204) -{ -npc.width = 70; -} - } + public override void AI() + { + if (npc.frame.Y <= 204) + { + npc.width = 30; + } + if (npc.frame.Y > 204) + { + npc.width = 70; + } + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } public override float SpawnChance(NPCSpawnInfo spawnInfo) { return spawnInfo.spawnTileY < Main.rockLayer && !Main.dayTime ? 0.01f : 0f; } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/KnightZombieGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore2"), 1f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/KnightZombieGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore2"), 1f); + } + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(25) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("KnightHelmet")); - }; - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(25) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("KnightHelmet")); + }; + } + } } } diff --git a/NPCs/LadyMoon.cs b/NPCs/LadyMoon.cs index 32cfd8fe..d06d3edb 100644 --- a/NPCs/LadyMoon.cs +++ b/NPCs/LadyMoon.cs @@ -6,10 +6,11 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { -[AutoloadHead] -public class LadyMoon : ModNPC +namespace Tremor.NPCs { + [AutoloadHead] + public class LadyMoon : ModNPC + { public override string Texture { get @@ -17,12 +18,12 @@ public override string Texture return "Tremor/NPCs/LadyMoon"; } } - + public override string[] AltTextures { get { - return new string[] { "Tremor/NPCs/LadyMoon"}; + return new string[] { "Tremor/NPCs/LadyMoon" }; } } @@ -44,151 +45,152 @@ public override void SetStaticDefaults() NPCID.Sets.AttackAverageChance[npc.type] = 30; } - public override void SetDefaults() - { - npc.townNPC = true; - npc.friendly = true; - npc.width = 30; - npc.height = 48; - npc.aiStyle = 7; - npc.damage = 20; - npc.defense = 15; - npc.lifeMax = 250; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.knockBackResist = 0.5f; - animationType = NPCID.Dryad; - } + public override void SetDefaults() + { + npc.townNPC = true; + npc.friendly = true; + npc.width = 30; + npc.height = 48; + npc.aiStyle = 7; + npc.damage = 20; + npc.defense = 15; + npc.lifeMax = 250; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.knockBackResist = 0.5f; + animationType = NPCID.Dryad; + } public override bool CanTownNPCSpawn(int numTownNPCs, int money) { - if(NPC.downedMoonlord) - { - return true; - } + if (NPC.downedMoonlord) + { + return true; + } return false; } - public override string TownNPCName() - { - switch(WorldGen.genRand.Next(4)) - { - case 0: - return "Atria"; - case 1: - return "Mintaka"; - case 2: - return "Nashira"; - case 3: - return "Rana"; - case 4: - return "Talita"; - case 5: - return "Zosma"; - default: - return "Pleyona"; - } - } - - public override string GetChat() - { - switch(Main.rand.Next(6)) - { - case 0: - return "There are so many beautiful things in this world! What can be more beautiful than a big shining star? Maybe only an exploding big shining star!"; - case 1: - return "I hope this world don't have crazy kings who wanna kill you? Aren't you one of them!?"; - case 2: - return "I have heard about an space station called Death Star that can destroy any planet or star! Can you show me this station? "; - case 3: - return "I believe I can fly! I believe I can touch the sk-... Sorry, I forgot that I'm not alone here!"; - case 4: - return "How are you going to call a man that watches an exploding star? A STARk man!"; - default: - return "Planets are burning, stars are exploding, but my prices for my spacy things are not changing! "; - } - } - - public override void SetChatButtons(ref string button, ref string button2) - { - button = Lang.inter[28].Value; - } - - public override void OnChatButtonClicked(bool firstButton, ref bool shop) - { - if(firstButton) - { - shop = true; - } - } - - public override void SetupShop(Chest shop, ref int nextSlot) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("DimensionalTopHat")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("ExtraterrestrialRubies")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("UnchargedBand")); - nextSlot++; - if(!Main.dayTime) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("ManaBooster")); - nextSlot++; - } - if(Main.dayTime) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("HealthBooster")); - nextSlot++; - } - if(Main.bloodMoon) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("ChainedRocket")); - nextSlot++; - } - if(Main.eclipse) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("Infusion")); - nextSlot++; - } - } - - public override void TownNPCAttackStrength(ref int damage, ref float knockback) - { - damage = 165 ; - knockback = 4f; - } - - public override void TownNPCAttackCooldown(ref int cooldown, ref int randExtraCooldown) - { - cooldown = 10; - randExtraCooldown = 10; - } - - public override void TownNPCAttackProj(ref int projType, ref int attackDelay) - { - projType = 12; - attackDelay = 4; - } - - public override void TownNPCAttackProjSpeed(ref float multiplier, ref float gravityCorrection, ref float randomOffset) - { - multiplier = 12f; - randomOffset = 2f; - } - - - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FarmerGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FarmerGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FarmerGore3"), 1f); - } -} -}} \ No newline at end of file + public override string TownNPCName() + { + switch (WorldGen.genRand.Next(4)) + { + case 0: + return "Atria"; + case 1: + return "Mintaka"; + case 2: + return "Nashira"; + case 3: + return "Rana"; + case 4: + return "Talita"; + case 5: + return "Zosma"; + default: + return "Pleyona"; + } + } + + public override string GetChat() + { + switch (Main.rand.Next(6)) + { + case 0: + return "There are so many beautiful things in this world! What can be more beautiful than a big shining star? Maybe only an exploding big shining star!"; + case 1: + return "I hope this world don't have crazy kings who wanna kill you? Aren't you one of them!?"; + case 2: + return "I have heard about an space station called Death Star that can destroy any planet or star! Can you show me this station? "; + case 3: + return "I believe I can fly! I believe I can touch the sk-... Sorry, I forgot that I'm not alone here!"; + case 4: + return "How are you going to call a man that watches an exploding star? A STARk man!"; + default: + return "Planets are burning, stars are exploding, but my prices for my spacy things are not changing! "; + } + } + + public override void SetChatButtons(ref string button, ref string button2) + { + button = Lang.inter[28].Value; + } + + public override void OnChatButtonClicked(bool firstButton, ref bool shop) + { + if (firstButton) + { + shop = true; + } + } + + public override void SetupShop(Chest shop, ref int nextSlot) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("DimensionalTopHat")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("ExtraterrestrialRubies")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("UnchargedBand")); + nextSlot++; + if (!Main.dayTime) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("ManaBooster")); + nextSlot++; + } + if (Main.dayTime) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("HealthBooster")); + nextSlot++; + } + if (Main.bloodMoon) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("ChainedRocket")); + nextSlot++; + } + if (Main.eclipse) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("Infusion")); + nextSlot++; + } + } + + public override void TownNPCAttackStrength(ref int damage, ref float knockback) + { + damage = 165; + knockback = 4f; + } + + public override void TownNPCAttackCooldown(ref int cooldown, ref int randExtraCooldown) + { + cooldown = 10; + randExtraCooldown = 10; + } + + public override void TownNPCAttackProj(ref int projType, ref int attackDelay) + { + projType = 12; + attackDelay = 4; + } + + public override void TownNPCAttackProjSpeed(ref float multiplier, ref float gravityCorrection, ref float randomOffset) + { + multiplier = 12f; + randomOffset = 2f; + } + + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FarmerGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FarmerGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/FarmerGore3"), 1f); + } + } + } +} \ No newline at end of file diff --git a/NPCs/Leprechaun.cs b/NPCs/Leprechaun.cs index 377b1798..f3bf64e4 100644 --- a/NPCs/Leprechaun.cs +++ b/NPCs/Leprechaun.cs @@ -6,56 +6,56 @@ namespace Tremor.NPCs { - public class Leprechaun : ModNPC - { + public class Leprechaun : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Leprechaun"); Main.npcFrameCount[npc.type] = 14; } - - public override void SetDefaults() - { - npc.lifeMax = 500; - npc.damage = 15; - npc.defense = 14; - npc.knockBackResist = 0f; - npc.width = 28; - npc.height = 46; - npc.aiStyle = 87; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath6; - npc.value = Item.buyPrice(0, 3, 0, 0); - animationType = NPCID.BigMimicHallow; - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 500; + npc.damage = 15; + npc.defense = 14; + npc.knockBackResist = 0f; + npc.width = 28; + npc.height = 46; + npc.aiStyle = 87; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath6; + npc.value = Item.buyPrice(0, 3, 0, 0); + animationType = NPCID.BigMimicHallow; + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 31, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, 220, 1f); - Gore.NewGore(npc.position, npc.velocity, 221, 1f); - Gore.NewGore(npc.position, npc.velocity, 222, 1f); - } -} + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && y > Main.rockLayer ? 0.0007f : 0f; - } - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 31, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, 220, 1f); + Gore.NewGore(npc.position, npc.velocity, 221, 1f); + Gore.NewGore(npc.position, npc.velocity, 222, 1f); + } + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && y > Main.rockLayer ? 0.0007f : 0f; + } + } } \ No newline at end of file diff --git a/NPCs/LihzahrdWarrior.cs b/NPCs/LihzahrdWarrior.cs index cb3f1afd..7b2f4819 100644 --- a/NPCs/LihzahrdWarrior.cs +++ b/NPCs/LihzahrdWarrior.cs @@ -5,76 +5,78 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class LihzahrdWarrior : ModNPC +namespace Tremor.NPCs { + + public class LihzahrdWarrior : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Lihzahrd Warrior"); Main.npcFrameCount[npc.type] = 16; } - - public override void SetDefaults() - { - npc.lifeMax = 1600; - npc.damage = 160; - npc.defense = 82; - npc.knockBackResist = 0.05f; - npc.width = 32; - npc.height = 50; - animationType = 198; - npc.aiStyle = 3; - aiType = 529; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 8, 0); - banner = npc.type; - bannerItem = mod.ItemType("LihzahrdWarriorBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 1600; + npc.damage = 160; + npc.defense = 82; + npc.knockBackResist = 0.05f; + npc.width = 32; + npc.height = 50; + animationType = 198; + npc.aiStyle = 3; + aiType = 529; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit4; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 0, 8, 0); + banner = npc.type; + bannerItem = mod.ItemType("LihzahrdWarriorBanner"); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(6) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 2766); - } - } - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/LWGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/LWGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/LWGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/LWGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/LWGore3"), 1f); - } -} + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(6) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 2766); + } + } + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/LWGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/LWGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/LWGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/LWGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/LWGore3"), 1f); + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return Main.hardMode && (tile == 226) && NPC.downedMoonlord && y > Main.rockLayer ? 0.01f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return Main.hardMode && (tile == 226) && NPC.downedMoonlord && y > Main.rockLayer ? 0.01f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/LittleMushroomBug.cs b/NPCs/LittleMushroomBug.cs index f285e53f..798a58d8 100644 --- a/NPCs/LittleMushroomBug.cs +++ b/NPCs/LittleMushroomBug.cs @@ -6,59 +6,61 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class LittleMushroomBug : ModNPC +namespace Tremor.NPCs { + + public class LittleMushroomBug : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Little Mushroom Bug"); Main.npcFrameCount[npc.type] = 2; } - - public override void SetDefaults() - { - npc.lifeMax = 30; - npc.damage = 28; - npc.defense = 10; - npc.knockBackResist = 0.2f; - npc.width = 28; - npc.height = 26; - animationType = 2; - npc.noGravity = true; - npc.noTileCollide = true; - npc.aiStyle = 14; - aiType = 49; - npc.npcSlots = 5f; - npc.HitSound = SoundID.NPCHit35; - npc.DeathSound = SoundID.NPCDeath57; - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 30; + npc.damage = 28; + npc.defense = 10; + npc.knockBackResist = 0.2f; + npc.width = 28; + npc.height = 26; + animationType = 2; + npc.noGravity = true; + npc.noTileCollide = true; + npc.aiStyle = 14; + aiType = 49; + npc.npcSlots = 5f; + npc.HitSound = SoundID.NPCHit35; + npc.DeathSound = SoundID.NPCDeath57; + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 60; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 67, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 67, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - } - else - { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 67, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - } -} -}} \ No newline at end of file + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 60; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 67, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 67, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + } + else + { + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 67, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + } + } + } +} \ No newline at end of file diff --git a/NPCs/Lizard.cs b/NPCs/Lizard.cs index 54a0a45c..4f4834a4 100644 --- a/NPCs/Lizard.cs +++ b/NPCs/Lizard.cs @@ -6,44 +6,46 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Lizard : ModNPC +namespace Tremor.NPCs { + + public class Lizard : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Lizard"); Main.npcFrameCount[npc.type] = 6; } - - public override void SetDefaults() - { - npc.lifeMax = 30; - npc.damage = 18; - npc.defense = 9; - npc.knockBackResist = 0.6f; - npc.width = 42; - npc.height = 22; -animationType = 102; - npc.aiStyle = 26; - npc.npcSlots = 15f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.value = Item.buyPrice(0, 0, 0, 0); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 30; + npc.damage = 18; + npc.defense = 9; + npc.knockBackResist = 0.6f; + npc.width = 42; + npc.height = 22; + animationType = 102; + npc.aiStyle = 26; + npc.npcSlots = 15f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.value = Item.buyPrice(0, 0, 0, 0); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } -public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/LizardGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/LizardGore2"), 1f); - } - } -}} \ No newline at end of file + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/LizardGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/LizardGore2"), 1f); + } + } + } +} \ No newline at end of file diff --git a/NPCs/Luminion.cs b/NPCs/Luminion.cs index 3e6988f0..78a0d737 100644 --- a/NPCs/Luminion.cs +++ b/NPCs/Luminion.cs @@ -6,84 +6,86 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Luminion : ModNPC +namespace Tremor.NPCs { + + public class Luminion : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Luminion"); Main.npcFrameCount[npc.type] = 15; } - - public override void SetDefaults() - { - npc.lifeMax = 2000; - npc.damage = 120; - npc.defense = 100; - npc.knockBackResist = 0.0f; - npc.width = 46; - npc.height = 32; - aiType = 417; - animationType = 417; - npc.aiStyle = 39; - npc.npcSlots = 2f; - npc.HitSound = SoundID.NPCHit7; - npc.DeathSound = SoundID.NPCDeath5; - npc.value = Item.buyPrice(0, 0, 6, 9); - banner = npc.type; - bannerItem = mod.ItemType("LuminionBanner"); - } + + public override void SetDefaults() + { + npc.lifeMax = 2000; + npc.damage = 120; + npc.defense = 100; + npc.knockBackResist = 0.0f; + npc.width = 46; + npc.height = 32; + aiType = 417; + animationType = 417; + npc.aiStyle = 39; + npc.npcSlots = 2f; + npc.HitSound = SoundID.NPCHit7; + npc.DeathSound = SoundID.NPCDeath5; + npc.value = Item.buyPrice(0, 0, 6, 9); + banner = npc.type; + bannerItem = mod.ItemType("LuminionBanner"); + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Squorb"), Main.rand.Next(1,2)); - } - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 3467, Main.rand.Next(3,8)); - } - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LunarRoot"), Main.rand.Next(2,4)); - } - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Squorb"), Main.rand.Next(1, 2)); + } + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 3467, Main.rand.Next(3, 8)); + } + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LunarRoot"), Main.rand.Next(2, 4)); + } + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/LuminionGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/LuminionGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/LuminionGore2"), 1f); + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/LuminionGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/LuminionGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/LuminionGore2"), 1f); - } -} + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return Main.hardMode && NPC.downedMoonlord && !spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.01f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return Main.hardMode && NPC.downedMoonlord && !spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.01f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/MagiumFlyer.cs b/NPCs/MagiumFlyer.cs index f86db044..7bf332b8 100644 --- a/NPCs/MagiumFlyer.cs +++ b/NPCs/MagiumFlyer.cs @@ -6,64 +6,66 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class MagiumFlyer : ModNPC +namespace Tremor.NPCs { + + public class MagiumFlyer : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Magium Flyer"); Main.npcFrameCount[npc.type] = 4; } - - const int SpeedMulti = 3; // Œ­®¦¨â¥«ì ᪮à®á⨠- public override void SetDefaults() - { - npc.lifeMax = 100; - npc.damage = 30; - npc.defense = 20; - npc.knockBackResist = 0.0f; - npc.width = 34; - npc.height = 48; - animationType = 93; - npc.aiStyle = 14; - npc.npcSlots = 1f; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit1; - npc.noGravity = true; - npc.DeathSound = SoundID.NPCDeath4; - npc.value = Item.buyPrice(0, 0, 6, 9); - banner = npc.type; - bannerItem = mod.ItemType("MagiumFlayerBanner"); - } + const int SpeedMulti = 3; // Œ­®¦¨â¥«ì ᪮à®á⨠+ + public override void SetDefaults() + { + npc.lifeMax = 100; + npc.damage = 30; + npc.defense = 20; + npc.knockBackResist = 0.0f; + npc.width = 34; + npc.height = 48; + animationType = 93; + npc.aiStyle = 14; + npc.npcSlots = 1f; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit1; + npc.noGravity = true; + npc.DeathSound = SoundID.NPCDeath4; + npc.value = Item.buyPrice(0, 0, 6, 9); + banner = npc.type; + bannerItem = mod.ItemType("MagiumFlayerBanner"); + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 60; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - } - else - { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 59, (float)hitDirection, -2f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, (float)hitDirection, -2f, 0, default(Color), 0.7f); - } - } - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 60; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + } + else + { + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 59, (float)hitDirection, -2f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, (float)hitDirection, -2f, 0, default(Color), 0.7f); + } + } + } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/MagiumKeeper.cs b/NPCs/MagiumKeeper.cs index f5863ff9..d1476aef 100644 --- a/NPCs/MagiumKeeper.cs +++ b/NPCs/MagiumKeeper.cs @@ -13,7 +13,7 @@ public override void SetStaticDefaults() DisplayName.SetDefault("Magium Keeper"); Main.npcFrameCount[npc.type] = 20; } - + public override void SetDefaults() { npc.width = 40; @@ -23,299 +23,299 @@ public override void SetDefaults() npc.lifeMax = 3000; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath42; - npc.value = Item.buyPrice(0, 12, 12, 7); + npc.value = Item.buyPrice(0, 12, 12, 7); npc.knockBackResist = 0.5f; - npc.aiStyle = 3; - aiType = 482; + npc.aiStyle = 3; + aiType = 482; animationType = 471; - banner = npc.type; - bannerItem = mod.ItemType("MagiumKeeperBanner"); + banner = npc.type; + bannerItem = mod.ItemType("MagiumKeeperBanner"); } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void AI() - { - if (npc.ai[3] < 0f) + public override void AI() + { + if (npc.ai[3] < 0f) + { + npc.knockBackResist = 0f; + npc.defense = (int)((double)npc.defDefense * 1.1); + npc.noGravity = true; + npc.noTileCollide = true; + if (npc.velocity.X < 0f) + { + npc.direction = -1; + } + else if (npc.velocity.X > 0f) + { + npc.direction = 1; + } + npc.rotation = npc.velocity.X * 0.1f; + if (Main.netMode != 1) + { + npc.localAI[3] += 1f; + if (npc.localAI[3] > (float)Main.rand.Next(20, 180)) { - npc.knockBackResist = 0f; - npc.defense = (int)((double)npc.defDefense * 1.1); - npc.noGravity = true; - npc.noTileCollide = true; - if (npc.velocity.X < 0f) - { - npc.direction = -1; - } - else if (npc.velocity.X > 0f) + npc.localAI[3] = 0f; + Vector2 value3 = npc.position; + value3 += npc.velocity; + NPC.NewNPC((int)value3.X, (int)value3.Y, mod.NPCType("MagiumSword"), 0, 0f, 0f, 0f, 0f, 255); + } + } + } + else + { + npc.localAI[3] = 0f; + npc.knockBackResist = 0.35f * Main.knockBackMultiplier; + npc.rotation *= 0.9f; + npc.defense = npc.defDefense; + npc.noGravity = false; + npc.noTileCollide = false; + } + if (npc.ai[3] == 1f) + { + npc.knockBackResist = 0f; + npc.defense += 10; + } + if (npc.ai[3] == -1f) + { + npc.TargetClosest(true); + float num46 = 8f; + float num47 = 40f; + Vector2 value4 = Main.player[npc.target].Center - npc.position; + float num48 = value4.Length(); + num46 += num48 / 200f; + value4.Normalize(); + value4 *= num46; + npc.velocity = (npc.velocity * (num47 - 1f) + value4) / num47; + if (num48 < 500f && !Collision.SolidCollision(npc.position, npc.width, npc.height)) + { + npc.ai[3] = 0f; + npc.ai[2] = 0f; + } + return; + } + if (npc.ai[3] == -2f) + { + npc.velocity.Y = npc.velocity.Y - 0.2f; + if (npc.velocity.Y < -10f) + { + npc.velocity.Y = -10f; + } + if (Main.player[npc.target].Center.Y - npc.position.Y > 200f) + { + npc.TargetClosest(true); + npc.ai[3] = -3f; + if (Main.player[npc.target].Center.X > npc.position.X) + { + npc.ai[2] = 1f; + } + else + { + npc.ai[2] = -1f; + } + } + npc.velocity.X = npc.velocity.X * 0.99f; + return; + } + if (npc.ai[3] == -3f) + { + if (npc.direction == 0) + { + npc.TargetClosest(true); + } + if (npc.ai[2] == 0f) + { + npc.ai[2] = (float)npc.direction; + } + npc.velocity.Y = npc.velocity.Y * 0.9f; + npc.velocity.X = npc.velocity.X + npc.ai[2] * 0.3f; + if (npc.velocity.X > 10f) + { + npc.velocity.X = 10f; + } + if (npc.velocity.X < -10f) + { + npc.velocity.X = -10f; + } + float num49 = Main.player[npc.target].Center.X - npc.position.X; + if ((npc.ai[2] < 0f && num49 > 300f) || (npc.ai[2] > 0f && num49 < -300f)) + { + npc.ai[3] = -4f; + npc.ai[2] = 0f; + return; + } + return; + } + else + { + if (npc.ai[3] == -4f) + { + npc.ai[2] += 1f; + npc.velocity.Y = npc.velocity.Y + 0.1f; + if (npc.velocity.Length() > 4f) + { + npc.velocity *= 0.9f; + } + int num50 = (int)npc.position.X / 16; + int num51 = (int)(npc.position.Y + (float)npc.height + 12f) / 16; + bool flag4 = false; + for (int num52 = num50 - 1; num52 <= num50 + 1; num52++) + { + if (Main.tile[num52, num51] == null) { - npc.direction = 1; + Main.tile[num50, num51] = new Tile(); } - npc.rotation = npc.velocity.X * 0.1f; - if (Main.netMode != 1) + if (Main.tile[num52, num51].active() && Main.tileSolid[(int)Main.tile[num52, num51].type]) { - npc.localAI[3] += 1f; - if (npc.localAI[3] > (float)Main.rand.Next(20, 180)) - { - npc.localAI[3] = 0f; - Vector2 value3 = npc.position; - value3 += npc.velocity; - NPC.NewNPC((int)value3.X, (int)value3.Y, mod.NPCType("MagiumSword"), 0, 0f, 0f, 0f, 0f, 255); - } + flag4 = true; } } - else + if (flag4 && !Collision.SolidCollision(npc.position, npc.width, npc.height)) { - npc.localAI[3] = 0f; - npc.knockBackResist = 0.35f * Main.knockBackMultiplier; - npc.rotation *= 0.9f; - npc.defense = npc.defDefense; - npc.noGravity = false; - npc.noTileCollide = false; + npc.ai[3] = 0f; + npc.ai[2] = 0f; } - if (npc.ai[3] == 1f) + else if (npc.ai[2] > 300f || npc.position.Y > Main.player[npc.target].Center.Y + 200f) { - npc.knockBackResist = 0f; - npc.defense += 10; + npc.ai[3] = -1f; + npc.ai[2] = 0f; } - if (npc.ai[3] == -1f) + } + else + { + if (npc.ai[3] == 1f) { - npc.TargetClosest(true); - float num46 = 8f; - float num47 = 40f; - Vector2 value4 = Main.player[npc.target].Center - npc.position; - float num48 = value4.Length(); - num46 += num48 / 200f; - value4.Normalize(); - value4 *= num46; - npc.velocity = (npc.velocity * (num47 - 1f) + value4) / num47; - if (num48 < 500f && !Collision.SolidCollision(npc.position, npc.width, npc.height)) + Vector2 center3 = npc.position; + center3.Y -= 70f; + npc.velocity.X = npc.velocity.X * 0.8f; + npc.ai[2] += 1f; + if (npc.ai[2] == 60f) { - npc.ai[3] = 0f; - npc.ai[2] = 0f; + if (Main.netMode != 1) + { + NPC.NewNPC((int)center3.X, (int)center3.Y + 18, mod.NPCType("MagiumFlyer"), 0, 0f, 0f, 0f, 0f, 255); + } } - return; - } - if (npc.ai[3] == -2f) - { - npc.velocity.Y = npc.velocity.Y - 0.2f; - if (npc.velocity.Y < -10f) + else if (npc.ai[2] >= 90f) { - npc.velocity.Y = -10f; + npc.ai[3] = -2f; + npc.ai[2] = 0f; } - if (Main.player[npc.target].Center.Y - npc.position.Y > 200f) + for (int num53 = 0; num53 < 2; num53++) { - npc.TargetClosest(true); - npc.ai[3] = -3f; - if (Main.player[npc.target].Center.X > npc.position.X) - { - npc.ai[2] = 1f; - } - else + Vector2 vector11 = center3; + Vector2 value5 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value5.Normalize(); + value5 *= (float)Main.rand.Next(0, 100) * 0.1f; + vector11 += value5; + value5.Normalize(); + value5 *= (float)Main.rand.Next(50, 90) * 0.1f; + int num54 = Dust.NewDust(vector11, 1, 1, 59, 0f, 0f, 0, default(Color), 3f); + Main.dust[num54].velocity = -value5 * 0.3f; + Main.dust[num54].alpha = 100; + if (Main.rand.Next(2) == 0) { - npc.ai[2] = -1f; + Main.dust[num54].noGravity = true; + Main.dust[num54].scale += 0.3f; } } - npc.velocity.X = npc.velocity.X * 0.99f; return; } - if (npc.ai[3] == -3f) + npc.ai[2] += 1f; + int num55 = 10; + if (npc.velocity.Y == 0f && NPC.CountNPCS(472) < num55) { - if (npc.direction == 0) - { - npc.TargetClosest(true); - } - if (npc.ai[2] == 0f) - { - npc.ai[2] = (float)npc.direction; - } - npc.velocity.Y = npc.velocity.Y * 0.9f; - npc.velocity.X = npc.velocity.X + npc.ai[2] * 0.3f; - if (npc.velocity.X > 10f) - { - npc.velocity.X = 10f; - } - if (npc.velocity.X < -10f) + if (npc.ai[2] >= 180f) { - npc.velocity.X = -10f; - } - float num49 = Main.player[npc.target].Center.X - npc.position.X; - if ((npc.ai[2] < 0f && num49 > 300f) || (npc.ai[2] > 0f && num49 < -300f)) - { - npc.ai[3] = -4f; npc.ai[2] = 0f; - return; + npc.ai[3] = 1f; } - return; } else { - if (npc.ai[3] == -4f) + if (NPC.CountNPCS(472) >= num55) { npc.ai[2] += 1f; - npc.velocity.Y = npc.velocity.Y + 0.1f; - if (npc.velocity.Length() > 4f) - { - npc.velocity *= 0.9f; - } - int num50 = (int)npc.position.X / 16; - int num51 = (int)(npc.position.Y + (float)npc.height + 12f) / 16; - bool flag4 = false; - for (int num52 = num50 - 1; num52 <= num50 + 1; num52++) - { - if (Main.tile[num52, num51] == null) - { - Main.tile[num50, num51] = new Tile(); - } - if (Main.tile[num52, num51].active() && Main.tileSolid[(int)Main.tile[num52, num51].type]) - { - flag4 = true; - } - } - if (flag4 && !Collision.SolidCollision(npc.position, npc.width, npc.height)) - { - npc.ai[3] = 0f; - npc.ai[2] = 0f; - } - else if (npc.ai[2] > 300f || npc.position.Y > Main.player[npc.target].Center.Y + 200f) - { - npc.ai[3] = -1f; - npc.ai[2] = 0f; - } } - else + if (npc.ai[2] >= 360f) { - if (npc.ai[3] == 1f) - { - Vector2 center3 = npc.position; - center3.Y -= 70f; - npc.velocity.X = npc.velocity.X * 0.8f; - npc.ai[2] += 1f; - if (npc.ai[2] == 60f) - { - if (Main.netMode != 1) - { - NPC.NewNPC((int)center3.X, (int)center3.Y + 18, mod.NPCType("MagiumFlyer"), 0, 0f, 0f, 0f, 0f, 255); - } - } - else if (npc.ai[2] >= 90f) - { - npc.ai[3] = -2f; - npc.ai[2] = 0f; - } - for (int num53 = 0; num53 < 2; num53++) - { - Vector2 vector11 = center3; - Vector2 value5 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - value5.Normalize(); - value5 *= (float)Main.rand.Next(0, 100) * 0.1f; - vector11 += value5; - value5.Normalize(); - value5 *= (float)Main.rand.Next(50, 90) * 0.1f; - int num54 = Dust.NewDust(vector11, 1, 1, 59, 0f, 0f, 0, default(Color), 3f); - Main.dust[num54].velocity = -value5 * 0.3f; - Main.dust[num54].alpha = 100; - if (Main.rand.Next(2) == 0) - { - Main.dust[num54].noGravity = true; - Main.dust[num54].scale += 0.3f; - } - } - return; - } - npc.ai[2] += 1f; - int num55 = 10; - if (npc.velocity.Y == 0f && NPC.CountNPCS(472) < num55) - { - if (npc.ai[2] >= 180f) - { - npc.ai[2] = 0f; - npc.ai[3] = 1f; - } - } - else - { - if (NPC.CountNPCS(472) >= num55) - { - npc.ai[2] += 1f; - } - if (npc.ai[2] >= 360f) - { - npc.ai[2] = 0f; - npc.ai[3] = -2f; - npc.velocity.Y = npc.velocity.Y - 3f; - } - } - if (npc.target >= 0 && !Main.player[npc.target].dead && (Main.player[npc.target].Center - npc.position).Length() > 800f) - { - npc.ai[3] = -1f; - npc.ai[2] = 0f; - } - } - if (Main.player[npc.target].dead) - { - npc.TargetClosest(true); - if (Main.player[npc.target].dead && npc.timeLeft > 1) - { - npc.timeLeft = 1; - } + npc.ai[2] = 0f; + npc.ai[3] = -2f; + npc.velocity.Y = npc.velocity.Y - 3f; } } - } + if (npc.target >= 0 && !Main.player[npc.target].dead && (Main.player[npc.target].Center - npc.position).Length() > 800f) + { + npc.ai[3] = -1f; + npc.ai[2] = 0f; + } + } + if (Main.player[npc.target].dead) + { + npc.TargetClosest(true); + if (Main.player[npc.target].dead && npc.timeLeft > 1) + { + npc.timeLeft = 1; + } + } + } + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagiumShard"), Main.rand.Next(5,12)); - }; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("RuneBar"), Main.rand.Next(6,16)); - }; - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagiumShard"), Main.rand.Next(5, 12)); + }; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("RuneBar"), Main.rand.Next(6, 16)); + }; + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MagiumGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MagiumGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MagiumGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MagiumGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MagiumGore3"), 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MagiumGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MagiumGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MagiumGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MagiumGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MagiumGore3"), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && y > Main.rockLayer ? 0.0003f : 0f; - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && y > Main.rockLayer ? 0.0003f : 0f; + } } } diff --git a/NPCs/MagiumSword.cs b/NPCs/MagiumSword.cs index f0d6e4bd..b3c20eda 100644 --- a/NPCs/MagiumSword.cs +++ b/NPCs/MagiumSword.cs @@ -7,61 +7,63 @@ using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class MagiumSword : ModNPC +namespace Tremor.NPCs { + + public class MagiumSword : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Magium Sword"); Main.npcFrameCount[npc.type] = 6; } - - public override void SetDefaults() - { - npc.lifeMax = 30; - npc.damage = 30; - Main.npcFrameCount[npc.type] = 6; - npc.defense = 24; - npc.knockBackResist = 0f; - npc.width = 34; - npc.height = 34; - animationType = 84; - npc.aiStyle = 23; - npc.noGravity = true; - npc.npcSlots = 15f; - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath6; - npc.value = Item.buyPrice(0, 0, 0, 0); - } + + public override void SetDefaults() + { + npc.lifeMax = 30; + npc.damage = 30; + Main.npcFrameCount[npc.type] = 6; + npc.defense = 24; + npc.knockBackResist = 0f; + npc.width = 34; + npc.height = 34; + animationType = 84; + npc.aiStyle = 23; + npc.noGravity = true; + npc.npcSlots = 15f; + npc.HitSound = SoundID.NPCHit4; + npc.DeathSound = SoundID.NPCDeath6; + npc.value = Item.buyPrice(0, 0, 0, 0); + } - public override void AI() - { -if (Main.rand.Next(6) == 0) - { - int num706 = Dust.NewDust(npc.position, npc.width, npc.height, 59, 0f, 0f, 200, npc.color, 2f); - Main.dust[num706].velocity *= 0.3f; - } - } + public override void AI() + { + if (Main.rand.Next(6) == 0) + { + int num706 = Dust.NewDust(npc.position, npc.width, npc.height, 59, 0f, 0f, 200, npc.color, 2f); + Main.dust[num706].velocity *= 0.3f; + } + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + } + } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/MagmaLeechBody.cs b/NPCs/MagmaLeechBody.cs index ebe4a9f4..9a39366a 100644 --- a/NPCs/MagmaLeechBody.cs +++ b/NPCs/MagmaLeechBody.cs @@ -7,77 +7,77 @@ namespace Tremor.NPCs { - public class MagmaLeechBody : ModNPC - { + public class MagmaLeechBody : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Magma Leech"); } - public override void SetDefaults() - { - npc.lifeMax = 250; - npc.damage = 15; - npc.defense = 10; - npc.width = 26; - npc.height = 48; - npc.noTileCollide = true; - npc.behindTiles = true; - npc.friendly = false; - npc.noGravity = true; - npc.aiStyle = 6; - npc.HitSound = SoundID.NPCHit2; - npc.buffImmune[24] = true; - npc.buffImmune[67] = true; - npc.lavaImmune = true; - } - + public override void SetDefaults() + { + npc.lifeMax = 250; + npc.damage = 15; + npc.defense = 10; + npc.width = 26; + npc.height = 48; + npc.noTileCollide = true; + npc.behindTiles = true; + npc.friendly = false; + npc.noGravity = true; + npc.aiStyle = 6; + npc.HitSound = SoundID.NPCHit2; + npc.buffImmune[24] = true; + npc.buffImmune[67] = true; + npc.lavaImmune = true; + } + public override void OnHitPlayer(Player player, int damage, bool crit) { if (Main.rand.Next(1) == 0) { - player.AddBuff(24, 180, true); + player.AddBuff(24, 180, true); } } - - public override void AI() - { - - if (Main.rand.Next(3) == 0) - { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 1f); - } - - if (!Main.npc[(int)npc.ai[1]].active) - { - npc.life = 0; - npc.HitEffect(0, 10.0); - NPCLoot(); - npc.active = false; - } - } - public override bool CheckActive() - { - return false; - } - public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) - { - return false; - } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Texture2D drawTexture = Main.npcTexture[npc.type]; - Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); - Vector2 drawPos = new Vector2( - npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, - npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); + public override void AI() + { + + if (Main.rand.Next(3) == 0) + { + Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 1f); + } + + if (!Main.npc[(int)npc.ai[1]].active) + { + npc.life = 0; + npc.HitEffect(0, 10.0); + NPCLoot(); + npc.active = false; + } + } + public override bool CheckActive() + { + return false; + } + public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) + { + return false; + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D drawTexture = Main.npcTexture[npc.type]; + Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); - SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); + Vector2 drawPos = new Vector2( + npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, + npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); - return false; - } - } + SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); + + return false; + } + } } \ No newline at end of file diff --git a/NPCs/MagmaLeechHead.cs b/NPCs/MagmaLeechHead.cs index aab90865..0a3ab73a 100644 --- a/NPCs/MagmaLeechHead.cs +++ b/NPCs/MagmaLeechHead.cs @@ -7,117 +7,117 @@ namespace Tremor.NPCs { - public class MagmaLeechHead : ModNPC - { + public class MagmaLeechHead : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Magma Leech"); } - bool TailSpawned = false; - - public static int ShootRate = 20; - const int ShootDamage = 58; - const float ShootKN = 1.0f; - const int ShootType = 100; - const float ShootSpeed = 10; - const int ShootCount = 5; - const int spread = 2; - const float spreadMult = 0.045f; - - const int ShootSound = 62; - const int ShootSoundStyle = 1; - - int TimeToShoot = ShootRate; - public override void SetDefaults() - { - npc.lifeMax = 250; - npc.damage = 15; - npc.defense = 10; - npc.knockBackResist = 0f; - npc.width = 74; - npc.height = 82; - npc.aiStyle = 6; - npc.npcSlots = 1f; - npc.noTileCollide = true; - npc.behindTiles = true; - npc.friendly = false; - npc.dontTakeDamage = false; - npc.noGravity = true; - npc.HitSound = SoundID.NPCHit2; - npc.DeathSound = SoundID.NPCDeath6; - npc.buffImmune[24] = true; - npc.buffImmune[67] = true; - npc.lavaImmune = true; - } - + bool TailSpawned = false; + + public static int ShootRate = 20; + const int ShootDamage = 58; + const float ShootKN = 1.0f; + const int ShootType = 100; + const float ShootSpeed = 10; + const int ShootCount = 5; + const int spread = 2; + const float spreadMult = 0.045f; + + const int ShootSound = 62; + const int ShootSoundStyle = 1; + + int TimeToShoot = ShootRate; + public override void SetDefaults() + { + npc.lifeMax = 250; + npc.damage = 15; + npc.defense = 10; + npc.knockBackResist = 0f; + npc.width = 74; + npc.height = 82; + npc.aiStyle = 6; + npc.npcSlots = 1f; + npc.noTileCollide = true; + npc.behindTiles = true; + npc.friendly = false; + npc.dontTakeDamage = false; + npc.noGravity = true; + npc.HitSound = SoundID.NPCHit2; + npc.DeathSound = SoundID.NPCDeath6; + npc.buffImmune[24] = true; + npc.buffImmune[67] = true; + npc.lavaImmune = true; + } + public override void OnHitPlayer(Player player, int damage, bool crit) { if (Main.rand.Next(1) == 0) { - player.AddBuff(24, 180, true); + player.AddBuff(24, 180, true); } - } + } - public override void AI() - { - - if (Main.rand.Next(3) == 0) - { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 1f); + public override void AI() + { + + if (Main.rand.Next(3) == 0) + { + Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 1f); + } + + npc.position += npc.velocity * (2 - 1); + + if (!TailSpawned) + { + int Previous = npc.whoAmI; + for (int num36 = 0; num36 < 14; num36++) + { + int lol = 0; + if (num36 >= 0 && num36 < 13) + { + lol = NPC.NewNPC((int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.width / 2), mod.NPCType("MagmaLeechBody"), npc.whoAmI); + } + else + { + lol = NPC.NewNPC((int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.width / 2), mod.NPCType("MagmaLeechTail"), npc.whoAmI); + } + Main.npc[lol].realLife = npc.whoAmI; + Main.npc[lol].ai[2] = (float)npc.whoAmI; + Main.npc[lol].ai[1] = (float)Previous; + Main.npc[Previous].ai[0] = (float)lol; + //NetMessage.SendData(23, -1, -1, "", lol, 0f, 0f, 0f, 0); + Previous = lol; + } + TailSpawned = true; + } + + if ((int)(Main.time % 180) == 0) + { + Vector2 vector = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height / 2)); + float birdRotation = (float)Math.Atan2(vector.Y - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), vector.X - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); + npc.velocity.X = (float)(Math.Cos(birdRotation) * 7) * -1; + npc.velocity.Y = (float)(Math.Sin(birdRotation) * 7) * -1; + npc.netUpdate = true; + } + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D drawTexture = Main.npcTexture[npc.type]; + Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); + + Vector2 drawPos = new Vector2( + npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, + npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); + + SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); + + return false; + } } - - npc.position += npc.velocity * (2 - 1); - - if (!TailSpawned) - { - int Previous = npc.whoAmI; - for (int num36 = 0; num36 < 14; num36++) - { - int lol = 0; - if (num36 >= 0 && num36 < 13) - { - lol = NPC.NewNPC((int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.width / 2), mod.NPCType("MagmaLeechBody"), npc.whoAmI); - } - else - { - lol = NPC.NewNPC((int)npc.position.X + (npc.width / 2), (int)npc.position.Y + (npc.width / 2), mod.NPCType("MagmaLeechTail"), npc.whoAmI); - } - Main.npc[lol].realLife = npc.whoAmI; - Main.npc[lol].ai[2] = (float)npc.whoAmI; - Main.npc[lol].ai[1] = (float)Previous; - Main.npc[Previous].ai[0] = (float)lol; - //NetMessage.SendData(23, -1, -1, "", lol, 0f, 0f, 0f, 0); - Previous = lol; - } - TailSpawned = true; - } - - if ((int)(Main.time % 180) == 0) - { - Vector2 vector = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height / 2)); - float birdRotation = (float)Math.Atan2(vector.Y - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), vector.X - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); - npc.velocity.X = (float)(Math.Cos(birdRotation) * 7) * -1; - npc.velocity.Y = (float)(Math.Sin(birdRotation) * 7) * -1; - npc.netUpdate = true; - } - } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Texture2D drawTexture = Main.npcTexture[npc.type]; - Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); - - Vector2 drawPos = new Vector2( - npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, - npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); - - SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); - - return false; - } - } } \ No newline at end of file diff --git a/NPCs/MagmaLeechTail.cs b/NPCs/MagmaLeechTail.cs index 2e2c4500..191ca148 100644 --- a/NPCs/MagmaLeechTail.cs +++ b/NPCs/MagmaLeechTail.cs @@ -7,73 +7,73 @@ namespace Tremor.NPCs { - public class MagmaLeechTail : ModNPC - { + public class MagmaLeechTail : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Magma Leech"); } - - public override void SetDefaults() - { - npc.lifeMax = 250; - npc.damage = 15; - npc.defense = 10; - npc.width = 30; - npc.height = 62; - npc.noTileCollide = true; - npc.behindTiles = true; - npc.friendly = false; - npc.noGravity = true; - npc.aiStyle = 6; - npc.HitSound = SoundID.NPCHit2; - npc.buffImmune[24] = true; - npc.buffImmune[67] = true; - npc.lavaImmune = true; - } + + public override void SetDefaults() + { + npc.lifeMax = 250; + npc.damage = 15; + npc.defense = 10; + npc.width = 30; + npc.height = 62; + npc.noTileCollide = true; + npc.behindTiles = true; + npc.friendly = false; + npc.noGravity = true; + npc.aiStyle = 6; + npc.HitSound = SoundID.NPCHit2; + npc.buffImmune[24] = true; + npc.buffImmune[67] = true; + npc.lavaImmune = true; + } public override void OnHitPlayer(Player player, int damage, bool crit) { if (Main.rand.Next(1) == 0) { - player.AddBuff(24, 180, true); + player.AddBuff(24, 180, true); } } - - public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) - { - return false; - } - public override void AI() - { - - if (Main.rand.Next(3) == 0) - { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 1f); - } - - if (!Main.npc[(int)npc.ai[1]].active) - { - npc.life = 0; - npc.HitEffect(0, 10.0); - npc.active = false; - } - } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Texture2D drawTexture = Main.npcTexture[npc.type]; - Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); - Vector2 drawPos = new Vector2( - npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, - npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); + public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) + { + return false; + } + public override void AI() + { + + if (Main.rand.Next(3) == 0) + { + Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 1f); + } - SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); + if (!Main.npc[(int)npc.ai[1]].active) + { + npc.life = 0; + npc.HitEffect(0, 10.0); + npc.active = false; + } + } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D drawTexture = Main.npcTexture[npc.type]; + Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); + + Vector2 drawPos = new Vector2( + npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, + npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); - return false; - } - } + SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); + + return false; + } + } } \ No newline at end of file diff --git a/NPCs/Magus.cs b/NPCs/Magus.cs index 06729674..245fedc7 100644 --- a/NPCs/Magus.cs +++ b/NPCs/Magus.cs @@ -8,115 +8,115 @@ namespace Tremor.NPCs { - public class Magus : ModNPC - { + public class Magus : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Magus"); Main.npcFrameCount[npc.type] = 3; } - - public override void SetDefaults() - { - npc.lifeMax = 290; - npc.damage = 65; - npc.defense = 18; - npc.knockBackResist = 0.3f; - npc.width = 42; - npc.height = 56; - animationType = 29; - npc.aiStyle = 0; - npc.npcSlots = 15f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.value = Item.buyPrice(0, 0, 1, 21); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 290; + npc.damage = 65; + npc.defense = 18; + npc.knockBackResist = 0.3f; + npc.width = 42; + npc.height = 56; + animationType = 29; + npc.aiStyle = 0; + npc.npcSlots = 15f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.value = Item.buyPrice(0, 0, 1, 21); + } - int timer = 0; - int TimeToAnimation = 50; - int Frame = 0; - public override void AI() - { - if ((int)(Main.time % 180) == 0) - { - PlayAnimation(); - DoAI(); - Teleport(); - } - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public void PlayAnimation() - { - if (--TimeToAnimation <= 0) - { - if (++Frame > 3) - Frame = 1; - TimeToAnimation = 50; - npc.frame = GetFrame(Frame); - } - } + int timer = 0; + int TimeToAnimation = 50; + int Frame = 0; + public override void AI() + { + if ((int)(Main.time % 180) == 0) + { + PlayAnimation(); + DoAI(); + Teleport(); + } + } - Rectangle GetFrame(int Num) - { - return new Rectangle(0, npc.frame.Height * (Num - 1), npc.frame.Width, npc.frame.Height); - } + public void PlayAnimation() + { + if (--TimeToAnimation <= 0) + { + if (++Frame > 3) + Frame = 1; + TimeToAnimation = 50; + npc.frame = GetFrame(Frame); + } + } - public void Teleport() - { - for (int Num = 0; Num < 10; Num++) - { - int dust = Dust.NewDust(new Vector2((float)npc.position.X, (float)npc.position.Y), npc.width, npc.height, 68, npc.velocity.X + Main.rand.Next(-10, 10), npc.velocity.Y + Main.rand.Next(-10, 10), 5, npc.color, 2.6f); - Main.dust[dust].noGravity = true; - } - npc.position.X = (Main.player[npc.target].position.X - 500) + Main.rand.Next(1000); - npc.position.Y = (Main.player[npc.target].position.Y - 500) + Main.rand.Next(1000); - } + Rectangle GetFrame(int Num) + { + return new Rectangle(0, npc.frame.Height * (Num - 1), npc.frame.Width, npc.frame.Height); + } - public void DoAI() - { - float SpeedX = Main.LocalPlayer.Center.X - npc.Center.X; - float SpeedY = Main.LocalPlayer.Center.Y - npc.Center.Y; - float Length = (float)Math.Sqrt(SpeedX * SpeedX + SpeedY * SpeedY); - float Speed = 8; - float Num = Speed / Length; - SpeedX = SpeedX * Num; - SpeedY = SpeedY * Num; - int Proj = Projectile.NewProjectile(npc.Center.X - 10f, npc.Center.Y, SpeedX, SpeedY, mod.ProjectileType("MagusBall"), 14, 1f, Main.myPlayer); - Main.projectile[Proj].timeLeft = 300; - Main.projectile[Proj].netUpdate = true; - } + public void Teleport() + { + for (int Num = 0; Num < 10; Num++) + { + int dust = Dust.NewDust(new Vector2((float)npc.position.X, (float)npc.position.Y), npc.width, npc.height, 68, npc.velocity.X + Main.rand.Next(-10, 10), npc.velocity.Y + Main.rand.Next(-10, 10), 5, npc.color, 2.6f); + Main.dust[dust].noGravity = true; + } + npc.position.X = (Main.player[npc.target].position.X - 500) + Main.rand.Next(1000); + npc.position.Y = (Main.player[npc.target].position.Y - 500) + Main.rand.Next(1000); + } - public override void NPCLoot() - { - if (Main.invasionType == Terraria.ID.InvasionID.GoblinArmy) - { - Main.invasionProgress++; - } - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; + public void DoAI() + { + float SpeedX = Main.LocalPlayer.Center.X - npc.Center.X; + float SpeedY = Main.LocalPlayer.Center.Y - npc.Center.Y; + float Length = (float)Math.Sqrt(SpeedX * SpeedX + SpeedY * SpeedY); + float Speed = 8; + float Num = Speed / Length; + SpeedX = SpeedX * Num; + SpeedY = SpeedY * Num; + int Proj = Projectile.NewProjectile(npc.Center.X - 10f, npc.Center.Y, SpeedX, SpeedY, mod.ProjectileType("MagusBall"), 14, 1f, Main.myPlayer); + Main.projectile[Proj].timeLeft = 300; + Main.projectile[Proj].netUpdate = true; + } - if(Main.rand.Next(50) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagusTome")); - } - } - } + public override void NPCLoot() + { + if (Main.invasionType == Terraria.ID.InvasionID.GoblinArmy) + { + Main.invasionProgress++; + } + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (NPC.AnyNPCs(26) || NPC.AnyNPCs(27) || NPC.AnyNPCs(28) || NPC.AnyNPCs(29)) && Main.hardMode && y < Main.worldSurface ? 0.08f : 0f; - } - } + if (Main.rand.Next(50) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MagusTome")); + } + } + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (NPC.AnyNPCs(26) || NPC.AnyNPCs(27) || NPC.AnyNPCs(28) || NPC.AnyNPCs(29)) && Main.hardMode && y < Main.worldSurface ? 0.08f : 0f; + } + } } \ No newline at end of file diff --git a/NPCs/MechanicalFirefly.cs b/NPCs/MechanicalFirefly.cs index 34c71e79..4ab511a2 100644 --- a/NPCs/MechanicalFirefly.cs +++ b/NPCs/MechanicalFirefly.cs @@ -6,63 +6,65 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class MechanicalFirefly : ModNPC +namespace Tremor.NPCs { + + public class MechanicalFirefly : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Mechanical Firefly"); Main.npcFrameCount[npc.type] = 9; } - - public override void SetDefaults() - { - npc.lifeMax = 3000; - npc.damage = 115; - npc.defense = 46; - npc.knockBackResist = 0.1f; - npc.width = 58; - npc.height = 36; - animationType = 509; - npc.aiStyle = 44; - npc.noGravity = true; - aiType = 509; - npc.npcSlots = 0.4f; - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath6; - npc.value = Item.buyPrice(0, 0, 40, 7); - banner = npc.type; - bannerItem = mod.ItemType("MechanicalFireflyBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 3000; + npc.damage = 115; + npc.defense = 46; + npc.knockBackResist = 0.1f; + npc.width = 58; + npc.height = 36; + animationType = 509; + npc.aiStyle = 44; + npc.noGravity = true; + aiType = 509; + npc.npcSlots = 0.4f; + npc.HitSound = SoundID.NPCHit4; + npc.DeathSound = SoundID.NPCDeath6; + npc.value = Item.buyPrice(0, 0, 40, 7); + banner = npc.type; + bannerItem = mod.ItemType("MechanicalFireflyBanner"); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, 61, 1f); - Gore.NewGore(npc.position, npc.velocity, 61, 1f); - Gore.NewGore(npc.position, npc.velocity, 62, 1f); - Gore.NewGore(npc.position, npc.velocity, 62, 1f); - Gore.NewGore(npc.position, npc.velocity, 63, 1f); - } -} + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && Main.bloodMoon && y < Main.worldSurface ? 0.007f : 0f; - } -}} \ No newline at end of file + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, 61, 1f); + Gore.NewGore(npc.position, npc.velocity, 61, 1f); + Gore.NewGore(npc.position, npc.velocity, 62, 1f); + Gore.NewGore(npc.position, npc.velocity, 62, 1f); + Gore.NewGore(npc.position, npc.velocity, 63, 1f); + } + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && Main.bloodMoon && y < Main.worldSurface ? 0.007f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/MeteoriteGolem.cs b/NPCs/MeteoriteGolem.cs index 39eb7c9a..529ad1cd 100644 --- a/NPCs/MeteoriteGolem.cs +++ b/NPCs/MeteoriteGolem.cs @@ -6,88 +6,90 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class MeteoriteGolem : ModNPC +namespace Tremor.NPCs { + + public class MeteoriteGolem : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Meteorite Golem"); Main.npcFrameCount[npc.type] = 20; } - - public override void SetDefaults() - { - npc.lifeMax = 300; - npc.damage = 30; - npc.defense = 12; - npc.knockBackResist = 0.1f; - npc.width = 40; - npc.height = 40; - animationType = 482; - npc.aiStyle = 3; - aiType = 482; - npc.npcSlots = 0.8f; - npc.HitSound = SoundID.NPCHit41; - npc.buffImmune[20] = true; - npc.buffImmune[24] = true; - npc.buffImmune[39] = true; - npc.buffImmune[31] = false; - npc.DeathSound = SoundID.NPCDeath44; - npc.value = Item.buyPrice(0, 0, 5, 0); - banner = npc.type; - bannerItem = mod.ItemType("MeteoriteGolemBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 300; + npc.damage = 30; + npc.defense = 12; + npc.knockBackResist = 0.1f; + npc.width = 40; + npc.height = 40; + animationType = 482; + npc.aiStyle = 3; + aiType = 482; + npc.npcSlots = 0.8f; + npc.HitSound = SoundID.NPCHit41; + npc.buffImmune[20] = true; + npc.buffImmune[24] = true; + npc.buffImmune[39] = true; + npc.buffImmune[31] = false; + npc.DeathSound = SoundID.NPCDeath44; + npc.value = Item.buyPrice(0, 0, 5, 0); + banner = npc.type; + bannerItem = mod.ItemType("MeteoriteGolemBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 116, 3); - } - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FireFragment"), 3); - } - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 116, 3); + } + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FireFragment"), 3); + } + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MGGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MGGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MGGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MGGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MGGore2"), 1f); - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); - } - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MGGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MGGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MGGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MGGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MGGore2"), 1f); + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); + } + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneMeteor ? 0.005f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneMeteor ? 0.005f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/MightyNimbus.cs b/NPCs/MightyNimbus.cs index fe2a6eb3..738e70c4 100644 --- a/NPCs/MightyNimbus.cs +++ b/NPCs/MightyNimbus.cs @@ -6,86 +6,88 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class MightyNimbus : ModNPC +namespace Tremor.NPCs { + + public class MightyNimbus : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Mighty Nimbus"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 4000; - npc.damage = 160; - npc.defense = 70; - npc.knockBackResist = 0.1f; - npc.width = 70; - npc.height = 50; - animationType = 250; - npc.aiStyle = 49; - aiType = 250; - npc.noGravity = true; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit30; - npc.buffImmune[20] = true; - npc.buffImmune[24] = true; - npc.buffImmune[39] = true; - npc.buffImmune[31] = false; - npc.DeathSound = SoundID.NPCDeath33; - npc.value = Item.buyPrice(0, 0, 7, 0); - banner = npc.type; - bannerItem = mod.ItemType("MightyNimbusBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 4000; + npc.damage = 160; + npc.defense = 70; + npc.knockBackResist = 0.1f; + npc.width = 70; + npc.height = 50; + animationType = 250; + npc.aiStyle = 49; + aiType = 250; + npc.noGravity = true; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit30; + npc.buffImmune[20] = true; + npc.buffImmune[24] = true; + npc.buffImmune[39] = true; + npc.buffImmune[31] = false; + npc.DeathSound = SoundID.NPCDeath33; + npc.value = Item.buyPrice(0, 0, 7, 0); + banner = npc.type; + bannerItem = mod.ItemType("MightyNimbusBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Gore.NewGore(npc.position, npc.velocity, 99, 1f); - Gore.NewGore(npc.position, npc.velocity, 99, 2f); - Gore.NewGore(npc.position, npc.velocity, 99, 1f); - Gore.NewGore(npc.position, npc.velocity, 99, 2f); - Gore.NewGore(npc.position, npc.velocity, 99, 1f); - Gore.NewGore(npc.position, npc.velocity, 99, 3f); - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 76, 0f, 0f, 200, npc.color, 1f); - } - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + Gore.NewGore(npc.position, npc.velocity, 99, 2f); + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + Gore.NewGore(npc.position, npc.velocity, 99, 2f); + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + Gore.NewGore(npc.position, npc.velocity, 99, 3f); + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 76, 0f, 0f, 200, npc.color, 1f); + } + } + } - public override void AI() - { - if(Main.rand.Next(1000) == 0) - { - NPC.NewNPC((int)npc.position.X - 50, (int)npc.position.Y, 250); - NPC.NewNPC((int)npc.position.X + 50, (int)npc.position.Y, 250); - } - if(Main.rand.Next(700) == 0) + public override void AI() + { + if (Main.rand.Next(1000) == 0) + { + NPC.NewNPC((int)npc.position.X - 50, (int)npc.position.Y, 250); + NPC.NewNPC((int)npc.position.X + 50, (int)npc.position.Y, 250); + } + if (Main.rand.Next(700) == 0) { Main.PlaySound(29, (int)npc.position.X, (int)npc.position.Y, Main.rand.Next(41, 44)); return; } - } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && NPC.downedMoonlord && Tremor.NoZoneAllowWater(spawnInfo)) && Main.raining && y < Main.worldSurface ? 0.01f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && NPC.downedMoonlord && Tremor.NoZoneAllowWater(spawnInfo)) && Main.raining && y < Main.worldSurface ? 0.01f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/Minotaur.cs b/NPCs/Minotaur.cs index 7d41ba40..8dc2a4f1 100644 --- a/NPCs/Minotaur.cs +++ b/NPCs/Minotaur.cs @@ -7,72 +7,72 @@ using Terraria.ModLoader; namespace Tremor.NPCs { - public class Minotaur : ModNPC - { + public class Minotaur : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Minotaur"); Main.npcFrameCount[npc.type] = 14; } - - public override void SetDefaults() - { - npc.lifeMax = 1000; - npc.damage = 20; - npc.defense = 14; - npc.knockBackResist = 0f; - npc.width = 48; - npc.height = 40; - npc.aiStyle = 87; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath42; - npc.value = Item.buyPrice(0, 3, 0, 0); - animationType = NPCID.BigMimicHallow; - banner = npc.type; - bannerItem = mod.ItemType("MinotaurBanner"); - } + public override void SetDefaults() + { + npc.lifeMax = 1000; + npc.damage = 20; + npc.defense = 14; + npc.knockBackResist = 0f; + npc.width = 48; + npc.height = 40; + npc.aiStyle = 87; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath42; + npc.value = Item.buyPrice(0, 3, 0, 0); + animationType = NPCID.BigMimicHallow; + banner = npc.type; + bannerItem = mod.ItemType("MinotaurBanner"); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MinotaurHorn")); - }; - if(Main.rand.Next(6) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("NecroShield")); - }; - } - } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MinotaurGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MinotaurGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MinotaurGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MinotaurGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MinotaurGore3"), 1f); - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MinotaurHorn")); + }; + if (Main.rand.Next(6) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("NecroShield")); + }; + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.005f : 0f; - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MinotaurGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MinotaurGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MinotaurGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MinotaurGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MinotaurGore3"), 1f); + } + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.005f : 0f; + } + } } \ No newline at end of file diff --git a/NPCs/Motherboard.cs b/NPCs/Motherboard.cs index 4e3f6b75..02f755e0 100644 --- a/NPCs/Motherboard.cs +++ b/NPCs/Motherboard.cs @@ -9,441 +9,441 @@ namespace Tremor.NPCs { [AutoloadBossHead] - public class Motherboard : ModNPC - { - #region "КонÑтанты" - const int stateOne_FollowPlayerTime = 120; // Ð’Ñ€ÐµÐ¼Ñ ÑÐ»ÐµÐ´Ð¾Ð²Ð°Ð½Ð¸Ñ Ð·Ð° игроком в первой Ñтадии - const int stateOne_DisappearingTime = 30; // Ð’Ñ€ÐµÐ¼Ñ Ð¸ÑÑ‡ÐµÐ·Ð½Ð¾Ð²ÐµÐ½Ð¸Ñ Ð² первой Ñтадии - const int stateOne_AppearingTime = 30; // Ð’Ñ€ÐµÐ¼Ñ Ð¿Ð¾ÑÐ²Ð»ÐµÐ½Ð¸Ñ Ð² первой Ñтадии - const int stateSecond_FollowPlayerTime = 90; // Ð’Ñ€ÐµÐ¼Ñ ÑÐ»ÐµÐ´Ð¾Ð²Ð°Ð½Ð¸Ñ Ð·Ð° игроком в второй Ñтадии - const int stateSecond_DisappearingTime = 30; // Ð’Ñ€ÐµÐ¼Ñ Ð¸ÑÑ‡ÐµÐ·Ð½Ð¾Ð²ÐµÐ½Ð¸Ñ Ð² второй Ñтадии - const int stateSecond_AppearingTime = 30; // Ð’Ñ€ÐµÐ¼Ñ Ð¿Ð¾ÑÐ²Ð»ÐµÐ½Ð¸Ñ Ð² второй Ñтадии - const int maxDrones = 20; // МакÑ. кол-во дронов - const int DronSpawnAreaX = 300; // Размер площади, в которой может заÑпавнитÑÑ Ð´Ñ€Ð¾Ð½, по X - const int DronSpawnAreaY = 300; // Размер площади, в которой может заÑпавнитÑÑ Ð´Ñ€Ð¾Ð½, по Y - const int StartDronCount = 8; // Ðачальное кол-во дронов - const int ShootRate = 150; // СкороÑÑ‚ÑŒ Ñтрельбы (60ед. == 1Ñек.) - const int LaserDamage = 40; // Урон от лазера - const float LaserKB = 1; // ÐžÑ‚Ð±Ñ€Ð¾Ñ Ð¾Ñ‚ лазера - const int LaserYOffset = 95; // Смещение точки Ñпавна лазера по Y ( + значени Ñто вниз, - значение Ñто вверх) - const int TimeToLaserRate = 3; // СкороÑÑ‚ÑŒ выÑтрелов лазером от дрона до дрона - const int LaserType = ProjectileID.ShadowBeamHostile; // Тип выÑтрела по игроку - const int AnimationRate = 6; // СкороÑÑ‚ÑŒ Ñмены кадров - const int SecondShootCount = 3; - const float SecondShootSpeed = 15f; - const int SecondShootDamage = 30; - const float SecondShootKN = 1.0f; - const int SecondShootRate = 60; - const int SecondShootSpread = 65; - const float SecondShootSpreadMult = 0.05f; - #endregion + public class Motherboard : ModNPC + { + #region "КонÑтанты" + const int stateOne_FollowPlayerTime = 120; // Ð’Ñ€ÐµÐ¼Ñ ÑÐ»ÐµÐ´Ð¾Ð²Ð°Ð½Ð¸Ñ Ð·Ð° игроком в первой Ñтадии + const int stateOne_DisappearingTime = 30; // Ð’Ñ€ÐµÐ¼Ñ Ð¸ÑÑ‡ÐµÐ·Ð½Ð¾Ð²ÐµÐ½Ð¸Ñ Ð² первой Ñтадии + const int stateOne_AppearingTime = 30; // Ð’Ñ€ÐµÐ¼Ñ Ð¿Ð¾ÑÐ²Ð»ÐµÐ½Ð¸Ñ Ð² первой Ñтадии + const int stateSecond_FollowPlayerTime = 90; // Ð’Ñ€ÐµÐ¼Ñ ÑÐ»ÐµÐ´Ð¾Ð²Ð°Ð½Ð¸Ñ Ð·Ð° игроком в второй Ñтадии + const int stateSecond_DisappearingTime = 30; // Ð’Ñ€ÐµÐ¼Ñ Ð¸ÑÑ‡ÐµÐ·Ð½Ð¾Ð²ÐµÐ½Ð¸Ñ Ð² второй Ñтадии + const int stateSecond_AppearingTime = 30; // Ð’Ñ€ÐµÐ¼Ñ Ð¿Ð¾ÑÐ²Ð»ÐµÐ½Ð¸Ñ Ð² второй Ñтадии + const int maxDrones = 20; // МакÑ. кол-во дронов + const int DronSpawnAreaX = 300; // Размер площади, в которой может заÑпавнитÑÑ Ð´Ñ€Ð¾Ð½, по X + const int DronSpawnAreaY = 300; // Размер площади, в которой может заÑпавнитÑÑ Ð´Ñ€Ð¾Ð½, по Y + const int StartDronCount = 8; // Ðачальное кол-во дронов + const int ShootRate = 150; // СкороÑÑ‚ÑŒ Ñтрельбы (60ед. == 1Ñек.) + const int LaserDamage = 40; // Урон от лазера + const float LaserKB = 1; // ÐžÑ‚Ð±Ñ€Ð¾Ñ Ð¾Ñ‚ лазера + const int LaserYOffset = 95; // Смещение точки Ñпавна лазера по Y ( + значени Ñто вниз, - значение Ñто вверх) + const int TimeToLaserRate = 3; // СкороÑÑ‚ÑŒ выÑтрелов лазером от дрона до дрона + const int LaserType = ProjectileID.ShadowBeamHostile; // Тип выÑтрела по игроку + const int AnimationRate = 6; // СкороÑÑ‚ÑŒ Ñмены кадров + const int SecondShootCount = 3; + const float SecondShootSpeed = 15f; + const int SecondShootDamage = 30; + const float SecondShootKN = 1.0f; + const int SecondShootRate = 60; + const int SecondShootSpread = 65; + const float SecondShootSpreadMult = 0.05f; + #endregion - #region "Переменные" - bool FirstAI = true; // Первый ли раз вызван метод AI - bool FirstState = true; // ÐŸÐµÑ€Ð²Ð°Ñ Ð»Ð¸ ÑÑ‚Ð°Ð´Ð¸Ñ - List SignalDrones = new List(); // ID Ñигнальных дронов - int LastSignalDron = -1; // ПоÑледний дрон принимающий лазер - int stateTime = stateOne_AppearingTime + stateOne_DisappearingTime + stateOne_FollowPlayerTime; // Ð’Ñ€ÐµÐ¼Ñ Ñтадии - bool ShootNow = false; // ПроиÑходит ли ÑÐµÐ¹Ñ‡Ð°Ñ Ñтрелба - int TimeToNextDrone = 1; // Ð’Ñ€ÐµÐ¼Ñ Ð´Ð¾ Ñпавна Ñледующего дрона - int TimeToShoot = 60; // Ð’Ñ€ÐµÐ¼Ñ Ð´Ð¾ Ñледующего выÑтрела - int TimeToLaser = 3; // Ð’Ñ€ÐµÐ¼Ñ Ð´Ð¾ выÑтрела лазера от дрона до дрона - int CurrentFrame = 0; // Содержит текущий кадр анимации - int TimeToAnimation = 6; // Ð’Ñ€ÐµÐ¼Ñ Ð´Ð¾ Ñмены кадра - List Clampers = new List(); // СпиÑок кламперов - int SecondShootTime = 60; - int ai = 0; + #region "Переменные" + bool FirstAI = true; // Первый ли раз вызван метод AI + bool FirstState = true; // ÐŸÐµÑ€Ð²Ð°Ñ Ð»Ð¸ ÑÑ‚Ð°Ð´Ð¸Ñ + List SignalDrones = new List(); // ID Ñигнальных дронов + int LastSignalDron = -1; // ПоÑледний дрон принимающий лазер + int stateTime = stateOne_AppearingTime + stateOne_DisappearingTime + stateOne_FollowPlayerTime; // Ð’Ñ€ÐµÐ¼Ñ Ñтадии + bool ShootNow = false; // ПроиÑходит ли ÑÐµÐ¹Ñ‡Ð°Ñ Ñтрелба + int TimeToNextDrone = 1; // Ð’Ñ€ÐµÐ¼Ñ Ð´Ð¾ Ñпавна Ñледующего дрона + int TimeToShoot = 60; // Ð’Ñ€ÐµÐ¼Ñ Ð´Ð¾ Ñледующего выÑтрела + int TimeToLaser = 3; // Ð’Ñ€ÐµÐ¼Ñ Ð´Ð¾ выÑтрела лазера от дрона до дрона + int CurrentFrame = 0; // Содержит текущий кадр анимации + int TimeToAnimation = 6; // Ð’Ñ€ÐµÐ¼Ñ Ð´Ð¾ Ñмены кадра + List Clampers = new List(); // СпиÑок кламперов + int SecondShootTime = 60; + int ai = 0; - int getStateTime { get { return getAppearingTimeNow + getDisappearingTimeNow + getFollowPlayerTimeNow; } } //----- - // Получить Ð²Ñ€ÐµÐ¼Ñ Ñ‚Ñ€ÐµÐ±ÑƒÐµÐ¼Ð¾Ðµ на полный цикл Ñмены ÑоÑтоÑний - int getTimeToNextDrone { get { return (Main.rand.Next(3, 6) * 60); } } // Получить Ð²Ñ€ÐµÐ¼Ñ Ð´Ð¾ Ñледующего дрона + int getStateTime { get { return getAppearingTimeNow + getDisappearingTimeNow + getFollowPlayerTimeNow; } } //----- + // Получить Ð²Ñ€ÐµÐ¼Ñ Ñ‚Ñ€ÐµÐ±ÑƒÐµÐ¼Ð¾Ðµ на полный цикл Ñмены ÑоÑтоÑний + int getTimeToNextDrone { get { return (Main.rand.Next(3, 6) * 60); } } // Получить Ð²Ñ€ÐµÐ¼Ñ Ð´Ð¾ Ñледующего дрона + + //----- Методы Ð¿Ð¾Ð»ÑƒÑ‡ÐµÐ½Ð¸Ñ Ð²Ñ€ÐµÐ¼ÐµÐ½Ð¸ на ÑоÑтоÑÐ½Ð¸Ñ Ð² данный момент + int getFollowPlayerTimeNow { get { return (FirstState) ? stateOne_FollowPlayerTime : stateSecond_FollowPlayerTime; } } + int getDisappearingTimeNow { get { return (FirstState) ? stateOne_DisappearingTime : stateSecond_DisappearingTime; } } + int getAppearingTimeNow { get { return (FirstState) ? stateOne_AppearingTime : stateSecond_AppearingTime; } } + //----- + #endregion - //----- Методы Ð¿Ð¾Ð»ÑƒÑ‡ÐµÐ½Ð¸Ñ Ð²Ñ€ÐµÐ¼ÐµÐ½Ð¸ на ÑоÑтоÑÐ½Ð¸Ñ Ð² данный момент - int getFollowPlayerTimeNow { get { return (FirstState) ? stateOne_FollowPlayerTime : stateSecond_FollowPlayerTime; } } - int getDisappearingTimeNow { get { return (FirstState) ? stateOne_DisappearingTime : stateSecond_DisappearingTime; } } - int getAppearingTimeNow { get { return (FirstState) ? stateOne_AppearingTime : stateSecond_AppearingTime; } } - //----- - #endregion - public override void SetStaticDefaults() { DisplayName.SetDefault("Motherboard"); Main.npcFrameCount[npc.type] = 6; } - - public override void SetDefaults() - { - npc.dontTakeDamage = true; - npc.noTileCollide = true; - npc.noGravity = true; - npc.lifeMax = 45000; - npc.damage = 30; - npc.knockBackResist = 0f; - npc.defense = 70; - npc.width = 170; - npc.height = 160; - npc.aiStyle = 2; - npc.boss = true; - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath10; - music = 13; - bossBag = mod.ItemType("MotherboardBag"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 0.625f * bossLifeScale); - npc.damage = (int)(npc.damage * 0.6f); - } + public override void SetDefaults() + { + npc.dontTakeDamage = true; + npc.noTileCollide = true; + npc.noGravity = true; + npc.lifeMax = 45000; + npc.damage = 30; + npc.knockBackResist = 0f; + npc.defense = 70; + npc.width = 170; + npc.height = 160; + npc.aiStyle = 2; + npc.boss = true; + npc.HitSound = SoundID.NPCHit4; + npc.DeathSound = SoundID.NPCDeath10; + music = 13; + bossBag = mod.ItemType("MotherboardBag"); + } - void Teleport() - { - npc.aiStyle = 2; - npc.position += npc.velocity * 2; - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 0.625f * bossLifeScale); + npc.damage = (int)(npc.damage * 0.6f); + } - public override void AI() - { - Animation(); - if (Helper.GetNearestPlayer(npc.position, true) == -1 || Main.dayTime) - { - npc.aiStyle = 11; - npc.damage = 1000; - npc.ai[0] = 2; - } - if (npc.aiStyle == 11) - { - npc.rotation = 0; - return; - } - if (FirstAI) - { - FirstAI = false; - for (int i = 0; i < ((StartDronCount <= 0) ? 1 : StartDronCount); i++) - { - Vector2 SpawnPosition = Helper.RandomPointInArea(new Vector2(npc.Center.X - DronSpawnAreaX / 2, npc.Center.Y - DronSpawnAreaY / 2), new Vector2(npc.Center.X + DronSpawnAreaX / 2, npc.Center.Y + DronSpawnAreaY / 2)); - SignalDrones.Add(NPC.NewNPC((int)SpawnPosition.X, (int)SpawnPosition.Y, mod.NPCType("SignalDron"), 0, 0, 0, 0, npc.whoAmI)); - } - } - ChangeAI(); - if (FirstState) - { - Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[npc.type]] = mod.GetTexture("NPCs/Motherboard_Head_Boss"); - Drones(); - npc.dontTakeDamage = true; - } - else - { - Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[npc.type]] = mod.GetTexture("NPCs/Motherboard_Head_Boss2"); - Teleport(); - if (ai == 1) - { - npc.TargetClosest(true); - Vector2 vector142 = new Vector2(npc.Center.X, npc.Center.Y); - float num1243 = Main.player[npc.target].Center.X - vector142.X; - float num1244 = Main.player[npc.target].Center.Y - vector142.Y; - float num1245 = (float)Math.Sqrt((double)(num1243 * num1243 + num1244 * num1244)); - if (npc.ai[1] == 0f) - { - if (Main.netMode != 1) - { - npc.localAI[1] += 1f; - if (npc.localAI[1] >= (float)(120 + Main.rand.Next(200))) - { - npc.localAI[1] = 0f; - npc.TargetClosest(true); - int num1249 = 0; - int num1250; - int num1251; - while (true) - { - num1249++; - num1250 = (int)Main.player[npc.target].Center.X / 16; - num1251 = (int)Main.player[npc.target].Center.Y / 16; - num1250 += Main.rand.Next(-50, 51); - num1251 += Main.rand.Next(-50, 51); - if (!WorldGen.SolidTile(num1250, num1251) && Collision.CanHit(new Vector2((float)(num1250 * 16), (float)(num1251 * 16)), 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) - { - break; - } - if (num1249 > 100) - { - return; - } - } - npc.ai[1] = 1f; - npc.ai[2] = (float)num1250; - npc.ai[3] = (float)num1251; - npc.netUpdate = true; - return; - } - } - } - else if (npc.ai[1] == 1f) - { - npc.alpha += 3; - if (npc.alpha >= 255) - { - npc.alpha = 255; - npc.position.X = npc.ai[2] * 16f - (float)(npc.width / 2); - npc.position.Y = npc.ai[3] * 16f - (float)(npc.height / 2); - npc.ai[1] = 2f; - return; - } - } - else if (npc.ai[1] == 2f) - { - npc.alpha -= 3; - if (npc.alpha <= 0) - { - npc.alpha = 0; - npc.ai[1] = 0f; - return; - } - } - } - CheckClampers(); - SecondShoot(); - npc.dontTakeDamage = false; - return; - } - ChangeStady(); - } + void Teleport() + { + npc.aiStyle = 2; + npc.position += npc.velocity * 2; + } - void Animation() - { - if (--TimeToAnimation <= 0) - { + public override void AI() + { + Animation(); + if (Helper.GetNearestPlayer(npc.position, true) == -1 || Main.dayTime) + { + npc.aiStyle = 11; + npc.damage = 1000; + npc.ai[0] = 2; + } + if (npc.aiStyle == 11) + { + npc.rotation = 0; + return; + } + if (FirstAI) + { + FirstAI = false; + for (int i = 0; i < ((StartDronCount <= 0) ? 1 : StartDronCount); i++) + { + Vector2 SpawnPosition = Helper.RandomPointInArea(new Vector2(npc.Center.X - DronSpawnAreaX / 2, npc.Center.Y - DronSpawnAreaY / 2), new Vector2(npc.Center.X + DronSpawnAreaX / 2, npc.Center.Y + DronSpawnAreaY / 2)); + SignalDrones.Add(NPC.NewNPC((int)SpawnPosition.X, (int)SpawnPosition.Y, mod.NPCType("SignalDron"), 0, 0, 0, 0, npc.whoAmI)); + } + } + ChangeAI(); + if (FirstState) + { + Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[npc.type]] = mod.GetTexture("NPCs/Motherboard_Head_Boss"); + Drones(); + npc.dontTakeDamage = true; + } + else + { + Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[npc.type]] = mod.GetTexture("NPCs/Motherboard_Head_Boss2"); + Teleport(); + if (ai == 1) + { + npc.TargetClosest(true); + Vector2 vector142 = new Vector2(npc.Center.X, npc.Center.Y); + float num1243 = Main.player[npc.target].Center.X - vector142.X; + float num1244 = Main.player[npc.target].Center.Y - vector142.Y; + float num1245 = (float)Math.Sqrt((double)(num1243 * num1243 + num1244 * num1244)); + if (npc.ai[1] == 0f) + { + if (Main.netMode != 1) + { + npc.localAI[1] += 1f; + if (npc.localAI[1] >= (float)(120 + Main.rand.Next(200))) + { + npc.localAI[1] = 0f; + npc.TargetClosest(true); + int num1249 = 0; + int num1250; + int num1251; + while (true) + { + num1249++; + num1250 = (int)Main.player[npc.target].Center.X / 16; + num1251 = (int)Main.player[npc.target].Center.Y / 16; + num1250 += Main.rand.Next(-50, 51); + num1251 += Main.rand.Next(-50, 51); + if (!WorldGen.SolidTile(num1250, num1251) && Collision.CanHit(new Vector2((float)(num1250 * 16), (float)(num1251 * 16)), 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + { + break; + } + if (num1249 > 100) + { + return; + } + } + npc.ai[1] = 1f; + npc.ai[2] = (float)num1250; + npc.ai[3] = (float)num1251; + npc.netUpdate = true; + return; + } + } + } + else if (npc.ai[1] == 1f) + { + npc.alpha += 3; + if (npc.alpha >= 255) + { + npc.alpha = 255; + npc.position.X = npc.ai[2] * 16f - (float)(npc.width / 2); + npc.position.Y = npc.ai[3] * 16f - (float)(npc.height / 2); + npc.ai[1] = 2f; + return; + } + } + else if (npc.ai[1] == 2f) + { + npc.alpha -= 3; + if (npc.alpha <= 0) + { + npc.alpha = 0; + npc.ai[1] = 0f; + return; + } + } + } + CheckClampers(); + SecondShoot(); + npc.dontTakeDamage = false; + return; + } + ChangeStady(); + } - if (++CurrentFrame > 3) - CurrentFrame = 1; - TimeToAnimation = AnimationRate; - npc.frame = GetFrame(CurrentFrame + ((FirstState) ? 0 : 3)); - } - } + void Animation() + { + if (--TimeToAnimation <= 0) + { + + if (++CurrentFrame > 3) + CurrentFrame = 1; + TimeToAnimation = AnimationRate; + npc.frame = GetFrame(CurrentFrame + ((FirstState) ? 0 : 3)); + } + } - Rectangle GetFrame(int Number) - { - return new Rectangle(0, npc.frame.Height * (Number - 1), npc.frame.Width, npc.frame.Height); - } + Rectangle GetFrame(int Number) + { + return new Rectangle(0, npc.frame.Height * (Number - 1), npc.frame.Width, npc.frame.Height); + } - public override void HitEffect(int hitDirection, double damage) - { - if (npc.life <= 0) - { - for (int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MotherboardGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MotherboardGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MotherboardGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MotherboardGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MotherboardGore4"), 1f); - } - } - void SecondShoot() - { - for (int i = (int)npc.position.X - 8; i < (npc.position.X + 8 + npc.width); i += 8) - for (int l = (int)npc.Center.Y + 90; l < (npc.Center.Y + 106); l += 8) - if (WorldGen.SolidTile(i / 16, l / 16)) - return; - if (--SecondShootTime <= 0) - { - SecondShootTime = SecondShootRate; - Projectile.NewProjectile(npc.Center.X, npc.Center.Y + 95, 0, 0, mod.ProjectileType("projMotherboardSuperLaser"), SecondShootDamage, SecondShootKN, 0, npc.whoAmI, 0); - Projectile.NewProjectile(npc.Center.X, npc.Center.Y + 95, 0, 0, mod.ProjectileType("projMotherboardSuperLaser"), SecondShootDamage, SecondShootKN, 0, npc.whoAmI, 1); - } - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MotherboardGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MotherboardGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MotherboardGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MotherboardGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/MotherboardGore4"), 1f); + } + } + void SecondShoot() + { + for (int i = (int)npc.position.X - 8; i < (npc.position.X + 8 + npc.width); i += 8) + for (int l = (int)npc.Center.Y + 90; l < (npc.Center.Y + 106); l += 8) + if (WorldGen.SolidTile(i / 16, l / 16)) + return; + if (--SecondShootTime <= 0) + { + SecondShootTime = SecondShootRate; + Projectile.NewProjectile(npc.Center.X, npc.Center.Y + 95, 0, 0, mod.ProjectileType("projMotherboardSuperLaser"), SecondShootDamage, SecondShootKN, 0, npc.whoAmI, 0); + Projectile.NewProjectile(npc.Center.X, npc.Center.Y + 95, 0, 0, mod.ProjectileType("projMotherboardSuperLaser"), SecondShootDamage, SecondShootKN, 0, npc.whoAmI, 1); + } + } - void ChangeStady() // Попытка Ñмены Ñтадии - { - CheckDrones(); // УдалÑем лишних дронов (мёртвых) - if (SignalDrones.Count <= 0) // ЕÑли живих дронов нет - { - FirstState = false; // Выключаем первую Ñтадию - Clampers = new List { - NPC.NewNPC((int)npc.Center.X - 15, (int)npc.Center.Y + 25, mod.NPCType("Clamper"), 0, 0, 0, 0, npc.whoAmI), - NPC.NewNPC((int)npc.Center.X - 10, (int)npc.Center.Y + 25, mod.NPCType("Clamper"), 0, 0, 0, 0, npc.whoAmI), - NPC.NewNPC((int)npc.Center.X + 10, (int)npc.Center.Y + 25, mod.NPCType("Clamper"), 0, 0, 0, 0, npc.whoAmI), - NPC.NewNPC((int)npc.Center.X + 15, (int)npc.Center.Y + 25, mod.NPCType("Clamper"), 0, 0, 0, 0, npc.whoAmI)}; - Main.npc[Clampers[0]].localAI[1] = 1; - Main.npc[Clampers[1]].localAI[1] = 2; - Main.npc[Clampers[2]].localAI[1] = 3; - Main.npc[Clampers[3]].localAI[1] = 4; - } - } + void ChangeStady() // Попытка Ñмены Ñтадии + { + CheckDrones(); // УдалÑем лишних дронов (мёртвых) + if (SignalDrones.Count <= 0) // ЕÑли живих дронов нет + { + FirstState = false; // Выключаем первую Ñтадию + Clampers = new List { + NPC.NewNPC((int)npc.Center.X - 15, (int)npc.Center.Y + 25, mod.NPCType("Clamper"), 0, 0, 0, 0, npc.whoAmI), + NPC.NewNPC((int)npc.Center.X - 10, (int)npc.Center.Y + 25, mod.NPCType("Clamper"), 0, 0, 0, 0, npc.whoAmI), + NPC.NewNPC((int)npc.Center.X + 10, (int)npc.Center.Y + 25, mod.NPCType("Clamper"), 0, 0, 0, 0, npc.whoAmI), + NPC.NewNPC((int)npc.Center.X + 15, (int)npc.Center.Y + 25, mod.NPCType("Clamper"), 0, 0, 0, 0, npc.whoAmI)}; + Main.npc[Clampers[0]].localAI[1] = 1; + Main.npc[Clampers[1]].localAI[1] = 2; + Main.npc[Clampers[2]].localAI[1] = 3; + Main.npc[Clampers[3]].localAI[1] = 4; + } + } - int AppearTime = 0; - void ChangeAI() // СменÑет ÑоÑтоÑние (преÑледование/иÑчезновение/поÑвление) - { - if (FirstState) - { - --stateTime; // Уменьшаем Ð²Ñ€ÐµÐ¼Ñ ÑоÑтоÑний - if (stateTime <= 0) // ЕÑли Ð²Ñ€ÐµÐ¼Ñ ÑоÑтоÑÐ½Ð¸Ñ Ð¼ÐµÐ½ÑŒÑˆÐµ или равно 0, то обновлÑем переменную - stateTime = getStateTime; // Обновление - for (int i = 0; i < Clampers.Count; i++) - Main.npc[Clampers[i]].ai[2] = 1; - if (stateTime <= getAppearingTimeNow) // ЕÑли у Ð½Ð°Ñ ÑÑ‚Ð°Ð´Ð¸Ñ Ð¿Ð¾ÑÐ²Ð»ÐµÐ½Ð¸Ñ - { - npc.ai[0] = -3; // То поÑвлÑемÑÑ - return; // Завершаем метод - } - if (stateTime <= getAppearingTimeNow + getDisappearingTimeNow) // ЕÑли у Ð½Ð°Ñ ÑÑ‚Ð°Ð´Ð¸Ñ Ð¸ÑÑ‡ÐµÐ·Ð½Ð¾Ð²ÐµÐ½Ð¸Ñ - { - npc.ai[0] = -2; // ИÑчезаем - return; // Завершаем метод - } - } - // Сюда процеÑÑор дойдёт только в том Ñлучаи, еÑли ÑÐµÐ¹Ñ‡Ð°Ñ ÑÑ‚Ð°Ð´Ð¸Ñ ÑÐ»ÐµÐ´Ð¾Ð²Ð°Ð½Ð¸Ñ Ð·Ð° игроком, по Ñтому... - if (npc.ai[0] == -2) - AppearTime = getAppearingTimeNow; - if (--AppearTime > 0) - { - npc.ai[0] = -3; - return; - } - npc.ai[0] = -1; // Следуем за игроком - } + int AppearTime = 0; + void ChangeAI() // СменÑет ÑоÑтоÑние (преÑледование/иÑчезновение/поÑвление) + { + if (FirstState) + { + --stateTime; // Уменьшаем Ð²Ñ€ÐµÐ¼Ñ ÑоÑтоÑний + if (stateTime <= 0) // ЕÑли Ð²Ñ€ÐµÐ¼Ñ ÑоÑтоÑÐ½Ð¸Ñ Ð¼ÐµÐ½ÑŒÑˆÐµ или равно 0, то обновлÑем переменную + stateTime = getStateTime; // Обновление + for (int i = 0; i < Clampers.Count; i++) + Main.npc[Clampers[i]].ai[2] = 1; + if (stateTime <= getAppearingTimeNow) // ЕÑли у Ð½Ð°Ñ ÑÑ‚Ð°Ð´Ð¸Ñ Ð¿Ð¾ÑÐ²Ð»ÐµÐ½Ð¸Ñ + { + npc.ai[0] = -3; // То поÑвлÑемÑÑ + return; // Завершаем метод + } + if (stateTime <= getAppearingTimeNow + getDisappearingTimeNow) // ЕÑли у Ð½Ð°Ñ ÑÑ‚Ð°Ð´Ð¸Ñ Ð¸ÑÑ‡ÐµÐ·Ð½Ð¾Ð²ÐµÐ½Ð¸Ñ + { + npc.ai[0] = -2; // ИÑчезаем + return; // Завершаем метод + } + } + // Сюда процеÑÑор дойдёт только в том Ñлучаи, еÑли ÑÐµÐ¹Ñ‡Ð°Ñ ÑÑ‚Ð°Ð´Ð¸Ñ ÑÐ»ÐµÐ´Ð¾Ð²Ð°Ð½Ð¸Ñ Ð·Ð° игроком, по Ñтому... + if (npc.ai[0] == -2) + AppearTime = getAppearingTimeNow; + if (--AppearTime > 0) + { + npc.ai[0] = -3; + return; + } + npc.ai[0] = -1; // Следуем за игроком + } - void CheckClampers() - { - for (int index = 0; index < Clampers.Count; index++) // Проходим по каждому Ñлементу маÑÑива Ñ id кламперов - if (!Main.npc[Clampers[index]].active || Main.npc[Clampers[index]].type != mod.NPCType("Clamper")) // ЕÑли... - // NPC Ñ Ñ‚ÐµÐºÑƒÑ‰Ð¸Ð¼ ID из маÑÑива кламперов, не ÑвлÑетÑÑ ÐºÐ»Ð°Ð¼Ð¿ÐµÑ€Ð¾Ð¼, или мёртв, то... - { - Clampers.RemoveAt(index); // УдалÑем из ÑпиÑка кламперов ID данного NPC - --index; // Уменьшаем Ð¸Ð½Ð´ÐµÐºÑ Ð½Ð° 1, чтобы не переÑкочить через одно значение в маÑÑиве ID кламперов - } - foreach (int ID in Clampers) - { - int id = Projectile.NewProjectile(npc.Center.X, npc.Center.Y + LaserYOffset, 0, 0, mod.ProjectileType("projClamperLaser"), LaserDamage, LaserKB, 0, npc.whoAmI, ID); - Main.projectile[id].localAI[1] = stateTime; - } - } + void CheckClampers() + { + for (int index = 0; index < Clampers.Count; index++) // Проходим по каждому Ñлементу маÑÑива Ñ id кламперов + if (!Main.npc[Clampers[index]].active || Main.npc[Clampers[index]].type != mod.NPCType("Clamper")) // ЕÑли... + // NPC Ñ Ñ‚ÐµÐºÑƒÑ‰Ð¸Ð¼ ID из маÑÑива кламперов, не ÑвлÑетÑÑ ÐºÐ»Ð°Ð¼Ð¿ÐµÑ€Ð¾Ð¼, или мёртв, то... + { + Clampers.RemoveAt(index); // УдалÑем из ÑпиÑка кламперов ID данного NPC + --index; // Уменьшаем Ð¸Ð½Ð´ÐµÐºÑ Ð½Ð° 1, чтобы не переÑкочить через одно значение в маÑÑиве ID кламперов + } + foreach (int ID in Clampers) + { + int id = Projectile.NewProjectile(npc.Center.X, npc.Center.Y + LaserYOffset, 0, 0, mod.ProjectileType("projClamperLaser"), LaserDamage, LaserKB, 0, npc.whoAmI, ID); + Main.projectile[id].localAI[1] = stateTime; + } + } - void Drones() // Работает Ñ Ð´Ñ€Ð¾Ð½Ð°Ð¼Ð¸ (только в первой Ñтадии) - { - CheckDrones(); // УдалÑет из ÑпиÑка вÑех мёртвых дронов - SpawnDrones(); // Спавнит дронов - ShootDrones(); // Работа Ñ Ð»Ð°Ð·ÐµÑ€Ð°Ð¼Ð¸ - } + void Drones() // Работает Ñ Ð´Ñ€Ð¾Ð½Ð°Ð¼Ð¸ (только в первой Ñтадии) + { + CheckDrones(); // УдалÑет из ÑпиÑка вÑех мёртвых дронов + SpawnDrones(); // Спавнит дронов + ShootDrones(); // Работа Ñ Ð»Ð°Ð·ÐµÑ€Ð°Ð¼Ð¸ + } - void CheckDrones() // УдалÑет из ÑпиÑка вÑех мёртвых дронов - { - for (int index = 0; index < SignalDrones.Count; index++) // Проходим по каждому Ñлементу маÑÑива Ñ id дронов - if (!Main.npc[SignalDrones[index]].active || Main.npc[SignalDrones[index]].type != mod.NPCType("SignalDron")) // ЕÑли... - // NPC Ñ Ñ‚ÐµÐºÑƒÑ‰Ð¸Ð¼ ID из маÑÑива дронов, не ÑвлÑетÑÑ Ð´Ñ€Ð¾Ð½Ð¾Ð¼, или мёртв, то... - { - SignalDrones.RemoveAt(index); // УдалÑем из ÑпиÑка дронов ID данного NPC - --index; // Уменьшаем Ð¸Ð½Ð´ÐµÐºÑ Ð½Ð° 1, чтобы не переÑкочить через одно значение в маÑÑиве ID дронов - } - } + void CheckDrones() // УдалÑет из ÑпиÑка вÑех мёртвых дронов + { + for (int index = 0; index < SignalDrones.Count; index++) // Проходим по каждому Ñлементу маÑÑива Ñ id дронов + if (!Main.npc[SignalDrones[index]].active || Main.npc[SignalDrones[index]].type != mod.NPCType("SignalDron")) // ЕÑли... + // NPC Ñ Ñ‚ÐµÐºÑƒÑ‰Ð¸Ð¼ ID из маÑÑива дронов, не ÑвлÑетÑÑ Ð´Ñ€Ð¾Ð½Ð¾Ð¼, или мёртв, то... + { + SignalDrones.RemoveAt(index); // УдалÑем из ÑпиÑка дронов ID данного NPC + --index; // Уменьшаем Ð¸Ð½Ð´ÐµÐºÑ Ð½Ð° 1, чтобы не переÑкочить через одно значение в маÑÑиве ID дронов + } + } - void SpawnDrones() // ЕÑли пришло времÑ, Ñпавнит дрона - { - if (SignalDrones.Count >= maxDrones) // ЕÑли текущее кол-во дронов равно или привышает лимит дронов, то... - return; // Завершаем метод - if (--TimeToNextDrone <= 0) // Уменьшаем Ð²Ñ€ÐµÐ¼Ñ Ð´Ð¾ Ñпавна Ñледующего дрона. ЕÑли Ð²Ñ€ÐµÐ¼Ñ Ð´Ð¾ Ñледующего дрона меньше или равно 0, то... - { - TimeToNextDrone = getTimeToNextDrone; // УÑтанавливаем новое Ð²Ñ€ÐµÐ¼Ñ Ð´Ð»Ñ Ñпавна дронов - Vector2 SpawnPosition = Helper.RandomPointInArea(new Vector2(npc.Center.X - DronSpawnAreaX / 2, npc.Center.Y - DronSpawnAreaY / 2), new Vector2(npc.Center.X + DronSpawnAreaX / 2, npc.Center.Y + DronSpawnAreaY / 2)); - // С помощью хелпера определÑем Ñлучайную позицию вокруг боÑÑа и запиÑываем в переменную 01 - SignalDrones.Add(NPC.NewNPC((int)SpawnPosition.X, (int)SpawnPosition.Y + LaserYOffset, mod.NPCType("SignalDron"), 0, 0, 0, 0, npc.whoAmI)); - // Спавним дрона Ñ ÐºÐ¾Ð¾Ñ€Ð´Ð¸Ð½Ð°Ñ‚Ð°Ð¼Ð¸ из переменной 01 и Ñ ID данного боÑÑа в ai[3] - } - } + void SpawnDrones() // ЕÑли пришло времÑ, Ñпавнит дрона + { + if (SignalDrones.Count >= maxDrones) // ЕÑли текущее кол-во дронов равно или привышает лимит дронов, то... + return; // Завершаем метод + if (--TimeToNextDrone <= 0) // Уменьшаем Ð²Ñ€ÐµÐ¼Ñ Ð´Ð¾ Ñпавна Ñледующего дрона. ЕÑли Ð²Ñ€ÐµÐ¼Ñ Ð´Ð¾ Ñледующего дрона меньше или равно 0, то... + { + TimeToNextDrone = getTimeToNextDrone; // УÑтанавливаем новое Ð²Ñ€ÐµÐ¼Ñ Ð´Ð»Ñ Ñпавна дронов + Vector2 SpawnPosition = Helper.RandomPointInArea(new Vector2(npc.Center.X - DronSpawnAreaX / 2, npc.Center.Y - DronSpawnAreaY / 2), new Vector2(npc.Center.X + DronSpawnAreaX / 2, npc.Center.Y + DronSpawnAreaY / 2)); + // С помощью хелпера определÑем Ñлучайную позицию вокруг боÑÑа и запиÑываем в переменную 01 + SignalDrones.Add(NPC.NewNPC((int)SpawnPosition.X, (int)SpawnPosition.Y + LaserYOffset, mod.NPCType("SignalDron"), 0, 0, 0, 0, npc.whoAmI)); + // Спавним дрона Ñ ÐºÐ¾Ð¾Ñ€Ð´Ð¸Ð½Ð°Ñ‚Ð°Ð¼Ð¸ из переменной 01 и Ñ ID данного боÑÑа в ai[3] + } + } - void ShootDrones() // ЕÑли пришло времÑ, начинает Ñтрельбу - { - if (SignalDrones.Count <= 0) // ЕÑли нету дронов, то... - return; // Завершаем метод - if (--TimeToShoot <= 0 || ShootNow) // ЕÑли ÑÐµÐ¹Ñ‡Ð°Ñ Ð¸Ð´Ñ‘Ñ‚ Ñтрельба, или наÑтало её Ð²Ñ€ÐµÐ¼Ñ (тут же Ñто Ð²Ñ€ÐµÐ¼Ñ Ð¸Ð·Ð¼ÐµÐ½Ñем), то - { - if (LastSignalDron == -1 && npc.ai[0] != -1) - return; - TimeToShoot = ShootRate; // УÑтанавливаем новое Ð²Ñ€ÐµÐ¼Ñ Ð²Ñ‹Ñтрела - ShootNow = true; // Ð¡ÐµÐ¹Ñ‡Ð°Ñ ÑтрелÑем - if (--TimeToLaser <= 0) // ЕÑли Ð²Ñ€ÐµÐ¼Ñ ÑтрелÑÑ‚ÑŒ лазером от дрона до дрона - { - TimeToLaser = TimeToLaserRate; // УÑтанавливаем новое Ð²Ñ€ÐµÐ¼Ñ - if (LastSignalDron == -1) // ЕÑли нет поÑледнего ÑтрелÑвшего дрона, то... - { - LastSignalDron = 0; // Берём первого дрона из маÑÑива - Main.projectile[Projectile.NewProjectile(npc.Center.X, npc.Center.Y, 0, 0, mod.ProjectileType("projMotherboardLaser"), LaserDamage, LaserKB, 0, npc.whoAmI, SignalDrones[LastSignalDron])].localAI[1] = 1; - // СтрелÑем в него из боÑÑа - return; // Выход из метода - } - ++LastSignalDron; // Берём Ñледующего дрона - if (LastSignalDron < SignalDrones.Count) // Проверка на выход за пределы маÑÑива - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, 0, 0, mod.ProjectileType("projMotherboardLaser"), LaserDamage, LaserKB, 0, SignalDrones[LastSignalDron - 1], SignalDrones[LastSignalDron]); - // Спавним лазер - if (LastSignalDron + 1 >= SignalDrones.Count) // ЕÑли Ñто замыкающий дрон, то... - { - Vector2 vel = Helper.VelocityToPoint(Main.npc[SignalDrones[SignalDrones.Count - 1]].Center, Main.player[npc.target].Center, 15f); - for (int i = 0; i < SecondShootCount; i++) - { - Vector2 velocity = Helper.VelocityToPoint(Main.npc[SignalDrones[SignalDrones.Count - 1]].Center, Main.player[npc.target].Center, SecondShootSpeed); - velocity.X = velocity.X + (float)Main.rand.Next(-SecondShootSpread, SecondShootSpread + 1) * SecondShootSpreadMult; - velocity.Y = velocity.Y + (float)Main.rand.Next(-SecondShootSpread, SecondShootSpread + 1) * SecondShootSpreadMult; - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, velocity.X, velocity.Y, LaserType, SecondShootDamage, SecondShootKN); - } - LastSignalDron = -1; - ShootNow = false; - // СтрелÑем в игрока другим лазером, уÑтанавливаем поÑледнего дрона на -1 и завершаем цикл Ñтрельбы - } - } - } - } + void ShootDrones() // ЕÑли пришло времÑ, начинает Ñтрельбу + { + if (SignalDrones.Count <= 0) // ЕÑли нету дронов, то... + return; // Завершаем метод + if (--TimeToShoot <= 0 || ShootNow) // ЕÑли ÑÐµÐ¹Ñ‡Ð°Ñ Ð¸Ð´Ñ‘Ñ‚ Ñтрельба, или наÑтало её Ð²Ñ€ÐµÐ¼Ñ (тут же Ñто Ð²Ñ€ÐµÐ¼Ñ Ð¸Ð·Ð¼ÐµÐ½Ñем), то + { + if (LastSignalDron == -1 && npc.ai[0] != -1) + return; + TimeToShoot = ShootRate; // УÑтанавливаем новое Ð²Ñ€ÐµÐ¼Ñ Ð²Ñ‹Ñтрела + ShootNow = true; // Ð¡ÐµÐ¹Ñ‡Ð°Ñ ÑтрелÑем + if (--TimeToLaser <= 0) // ЕÑли Ð²Ñ€ÐµÐ¼Ñ ÑтрелÑÑ‚ÑŒ лазером от дрона до дрона + { + TimeToLaser = TimeToLaserRate; // УÑтанавливаем новое Ð²Ñ€ÐµÐ¼Ñ + if (LastSignalDron == -1) // ЕÑли нет поÑледнего ÑтрелÑвшего дрона, то... + { + LastSignalDron = 0; // Берём первого дрона из маÑÑива + Main.projectile[Projectile.NewProjectile(npc.Center.X, npc.Center.Y, 0, 0, mod.ProjectileType("projMotherboardLaser"), LaserDamage, LaserKB, 0, npc.whoAmI, SignalDrones[LastSignalDron])].localAI[1] = 1; + // СтрелÑем в него из боÑÑа + return; // Выход из метода + } + ++LastSignalDron; // Берём Ñледующего дрона + if (LastSignalDron < SignalDrones.Count) // Проверка на выход за пределы маÑÑива + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, 0, 0, mod.ProjectileType("projMotherboardLaser"), LaserDamage, LaserKB, 0, SignalDrones[LastSignalDron - 1], SignalDrones[LastSignalDron]); + // Спавним лазер + if (LastSignalDron + 1 >= SignalDrones.Count) // ЕÑли Ñто замыкающий дрон, то... + { + Vector2 vel = Helper.VelocityToPoint(Main.npc[SignalDrones[SignalDrones.Count - 1]].Center, Main.player[npc.target].Center, 15f); + for (int i = 0; i < SecondShootCount; i++) + { + Vector2 velocity = Helper.VelocityToPoint(Main.npc[SignalDrones[SignalDrones.Count - 1]].Center, Main.player[npc.target].Center, SecondShootSpeed); + velocity.X = velocity.X + (float)Main.rand.Next(-SecondShootSpread, SecondShootSpread + 1) * SecondShootSpreadMult; + velocity.Y = velocity.Y + (float)Main.rand.Next(-SecondShootSpread, SecondShootSpread + 1) * SecondShootSpreadMult; + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, velocity.X, velocity.Y, LaserType, SecondShootDamage, SecondShootKN); + } + LastSignalDron = -1; + ShootNow = false; + // СтрелÑем в игрока другим лазером, уÑтанавливаем поÑледнего дрона на -1 и завершаем цикл Ñтрельбы + } + } + } + } - public override void NPCLoot() - { - NPC.downedMechBossAny = true; - NPC.downedMechBoss1 = true; + public override void NPCLoot() + { + NPC.downedMechBossAny = true; + NPC.downedMechBoss1 = true; TremorWorld.downedMotherboard = true; - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; - if (Main.expertMode) - { - npc.DropBossBags(); - } - if (!Main.expertMode && Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SoulofMind"), Main.rand.Next(20, 40)); - } - if (!Main.expertMode && Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 499, Main.rand.Next(5, 15)); - } - if (!Main.expertMode && Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 1225, Main.rand.Next(15, 35)); - } - if (!Main.expertMode && Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MotherboardMask")); - } - if (Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MotherboardTrophy")); - } - if (Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BenderLegs")); - } - if (NPC.downedMoonlord && Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CarbonSteel"), Main.rand.Next(6, 12)); - } - if (NPC.downedMechBossAny && Main.rand.Next(10) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, mod.ItemType("FlaskCore")); - } - } - } - } + if (Main.expertMode) + { + npc.DropBossBags(); + } + if (!Main.expertMode && Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SoulofMind"), Main.rand.Next(20, 40)); + } + if (!Main.expertMode && Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 499, Main.rand.Next(5, 15)); + } + if (!Main.expertMode && Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 1225, Main.rand.Next(15, 35)); + } + if (!Main.expertMode && Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MotherboardMask")); + } + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MotherboardTrophy")); + } + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BenderLegs")); + } + if (NPC.downedMoonlord && Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CarbonSteel"), Main.rand.Next(6, 12)); + } + if (NPC.downedMechBossAny && Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FlaskCore")); + } + } + } + } } \ No newline at end of file diff --git a/NPCs/Mothership.cs b/NPCs/Mothership.cs index 81f99ee0..82cc02d9 100644 --- a/NPCs/Mothership.cs +++ b/NPCs/Mothership.cs @@ -10,179 +10,179 @@ namespace Tremor.NPCs { [AutoloadBossHead] - public class Mothership : ModNPC - { + public class Mothership : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Mothership"); Main.npcFrameCount[npc.type] = 8; } - - - private float timeToNextFrame = 0; - public int frame = 0; - - public override void SetDefaults() - { - npc.aiStyle = -1; - npc.lifeMax = 45000; - npc.damage = 125; - npc.defense = 55 * 0; - npc.knockBackResist = 0f; - npc.width = 162; - npc.height = 122; - npc.value = Item.buyPrice(0, 0, 0, 0); - npc.npcSlots = 1; - npc.boss = true; - npc.lavaImmune = true; - npc.noGravity = true; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath6; - music = MusicID.Boss2; - } - - public float timeToShoot = 2; - private float vel = 2.5f; - private float lifeTime = 0; - private bool Rage = false; - - - - public Vector2 bossCenter - { - get {return npc.Center;} - set {npc.position = value - new Vector2(npc.width / 2, npc.height / 2);} - } - - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 0.625f * bossLifeScale); - npc.damage = (int)(npc.damage * 0.6f); - } - - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CKMotherGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CKMotherGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CKMotherGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CKMotherGore3"), 1f); - } -} - - - public override void AI() - { -bool allDead = false; -for(int i = 0; i < Main.player.Length; i++) -{ - if(Main.player[i].dead) allDead = true; -} - - if (Main.dayTime || allDead) - { - if (npc.velocity.X > 0f) - { - npc.velocity.X = npc.velocity.X + 0.75f; - } - else - { - npc.velocity.X = npc.velocity.X - 0.75f; - } - npc.velocity.Y = npc.velocity.Y - 0.1f; - npc.rotation = npc.velocity.X * 0.05f; - } - - lifeTime += 0.016f; - Player player = Main.player[npc.target]; - Vector2 targetPos = player.Center - new Vector2(0, 250) + new Vector2((float)Math.Sin(lifeTime) * 200, (float)Math.Cos(lifeTime) * 50); - bossCenter = Vector2.Lerp(bossCenter, targetPos, 0.01f); - Lighting.AddLight(bossCenter, 0.3f, 0.3f, 1f); - if (npc.life0) - { - timeToNextFrame -= 0.016f; - } - else - { - timeToNextFrame = 0.1f; - if (frame<3) - { - frame++; - } - else - { - frame = 0; - } - if (Rage) - { - frame += 4; - } - } - if (timeToShoot>0) - { - timeToShoot -= 0.016f; - } - else - { - Shoot(player); - } - } - - private void Shoot (Player player) - { - if (!Rage) - { - float angle = Main.rand.Next(0, (int)Math.PI * 200) / 100f; - Vector2 vel = new Vector2((float)Math.Cos(angle), (float)Math.Sin(angle)) * 3 * Main.rand.Next(5); - Projectile.NewProjectile(bossCenter.X, bossCenter.Y+15, vel.X+15, vel.Y, mod.ProjectileType("PurplePulsePro"), 30, 5f); - Projectile.NewProjectile(bossCenter.X, bossCenter.Y, vel.X, vel.Y, mod.ProjectileType("PurplePulsePro"), 30, 5f); - Projectile.NewProjectile(bossCenter.X, bossCenter.Y-15, vel.X-15, vel.Y, mod.ProjectileType("PurplePulsePro"), 30, 5f); - Projectile.NewProjectile(bossCenter.X, bossCenter.Y+30, vel.X+30, vel.Y, mod.ProjectileType("PurplePulsePro"), 30, 5f); - Projectile.NewProjectile(bossCenter.X, bossCenter.Y-30, vel.X-30, vel.Y, mod.ProjectileType("PurplePulsePro"), 30, 5f); - timeToShoot = 1; - } - else - { - float angle = (float)Math.Atan2(player.Center.Y-bossCenter.Y, player.Center.X - bossCenter.X); - Vector2 vel = new Vector2((float)Math.Cos(angle), (float)Math.Sin(angle)) * 5; - Projectile.NewProjectile(bossCenter.X, bossCenter.Y, vel.X, vel.Y, 465, 25, 5f); - timeToShoot = 8; - } - } - - public override bool PreNPCLoot() - { - Player player = Main.player[npc.target]; - NPC.NewNPC((int)bossCenter.X, (int)bossCenter.Y, mod.NPCType("CyberKing"), 0, 0, 0, 0, 0, npc.target); - Main.PlaySound(15, (int)player.position.X, (int)player.position.Y, 0); - return false; - } - - private float clamp (float value, float min, float max) - { - if (valuemax) - { - return max; - } - else - { - return value; - } - } - - public override void FindFrame(int frameHeight) - { - npc.frame.Y = frameHeight * frame + 2; - } - } + + + private float timeToNextFrame = 0; + public int frame = 0; + + public override void SetDefaults() + { + npc.aiStyle = -1; + npc.lifeMax = 45000; + npc.damage = 125; + npc.defense = 55 * 0; + npc.knockBackResist = 0f; + npc.width = 162; + npc.height = 122; + npc.value = Item.buyPrice(0, 0, 0, 0); + npc.npcSlots = 1; + npc.boss = true; + npc.lavaImmune = true; + npc.noGravity = true; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit4; + npc.DeathSound = SoundID.NPCDeath6; + music = MusicID.Boss2; + } + + public float timeToShoot = 2; + private float vel = 2.5f; + private float lifeTime = 0; + private bool Rage = false; + + + + public Vector2 bossCenter + { + get { return npc.Center; } + set { npc.position = value - new Vector2(npc.width / 2, npc.height / 2); } + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 0.625f * bossLifeScale); + npc.damage = (int)(npc.damage * 0.6f); + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CKMotherGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CKMotherGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CKMotherGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CKMotherGore3"), 1f); + } + } + + + public override void AI() + { + bool allDead = false; + for (int i = 0; i < Main.player.Length; i++) + { + if (Main.player[i].dead) allDead = true; + } + + if (Main.dayTime || allDead) + { + if (npc.velocity.X > 0f) + { + npc.velocity.X = npc.velocity.X + 0.75f; + } + else + { + npc.velocity.X = npc.velocity.X - 0.75f; + } + npc.velocity.Y = npc.velocity.Y - 0.1f; + npc.rotation = npc.velocity.X * 0.05f; + } + + lifeTime += 0.016f; + Player player = Main.player[npc.target]; + Vector2 targetPos = player.Center - new Vector2(0, 250) + new Vector2((float)Math.Sin(lifeTime) * 200, (float)Math.Cos(lifeTime) * 50); + bossCenter = Vector2.Lerp(bossCenter, targetPos, 0.01f); + Lighting.AddLight(bossCenter, 0.3f, 0.3f, 1f); + if (npc.life < npc.lifeMax / 2) + { + Rage = true; + } + if (timeToNextFrame > 0) + { + timeToNextFrame -= 0.016f; + } + else + { + timeToNextFrame = 0.1f; + if (frame < 3) + { + frame++; + } + else + { + frame = 0; + } + if (Rage) + { + frame += 4; + } + } + if (timeToShoot > 0) + { + timeToShoot -= 0.016f; + } + else + { + Shoot(player); + } + } + + private void Shoot(Player player) + { + if (!Rage) + { + float angle = Main.rand.Next(0, (int)Math.PI * 200) / 100f; + Vector2 vel = new Vector2((float)Math.Cos(angle), (float)Math.Sin(angle)) * 3 * Main.rand.Next(5); + Projectile.NewProjectile(bossCenter.X, bossCenter.Y + 15, vel.X + 15, vel.Y, mod.ProjectileType("PurplePulsePro"), 30, 5f); + Projectile.NewProjectile(bossCenter.X, bossCenter.Y, vel.X, vel.Y, mod.ProjectileType("PurplePulsePro"), 30, 5f); + Projectile.NewProjectile(bossCenter.X, bossCenter.Y - 15, vel.X - 15, vel.Y, mod.ProjectileType("PurplePulsePro"), 30, 5f); + Projectile.NewProjectile(bossCenter.X, bossCenter.Y + 30, vel.X + 30, vel.Y, mod.ProjectileType("PurplePulsePro"), 30, 5f); + Projectile.NewProjectile(bossCenter.X, bossCenter.Y - 30, vel.X - 30, vel.Y, mod.ProjectileType("PurplePulsePro"), 30, 5f); + timeToShoot = 1; + } + else + { + float angle = (float)Math.Atan2(player.Center.Y - bossCenter.Y, player.Center.X - bossCenter.X); + Vector2 vel = new Vector2((float)Math.Cos(angle), (float)Math.Sin(angle)) * 5; + Projectile.NewProjectile(bossCenter.X, bossCenter.Y, vel.X, vel.Y, 465, 25, 5f); + timeToShoot = 8; + } + } + + public override bool PreNPCLoot() + { + Player player = Main.player[npc.target]; + NPC.NewNPC((int)bossCenter.X, (int)bossCenter.Y, mod.NPCType("CyberKing"), 0, 0, 0, 0, 0, npc.target); + Main.PlaySound(15, (int)player.position.X, (int)player.position.Y, 0); + return false; + } + + private float clamp(float value, float min, float max) + { + if (value < min) + { + return min; + } + else if (value > max) + { + return max; + } + else + { + return value; + } + } + + public override void FindFrame(int frameHeight) + { + npc.frame.Y = frameHeight * frame + 2; + } + } } \ No newline at end of file diff --git a/NPCs/MushroomCreature.cs b/NPCs/MushroomCreature.cs index 27eb5484..3d19f385 100644 --- a/NPCs/MushroomCreature.cs +++ b/NPCs/MushroomCreature.cs @@ -6,66 +6,68 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class MushroomCreature : ModNPC +namespace Tremor.NPCs { + + public class MushroomCreature : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Mushroom Creature"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 80; - npc.damage = 22; - npc.defense = 5; - npc.knockBackResist = 0.3f; - npc.width = 38; - npc.height = 50; - animationType = 75; - npc.aiStyle = 3; - npc.npcSlots = 1f; - npc.HitSound = SoundID.NPCHit40; - npc.DeathSound = SoundID.NPCDeath24; - npc.value = Item.buyPrice(0, 0, 3, 20); - banner = npc.type; - aiType = 21; - bannerItem = mod.ItemType("MushroomCreatureBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 80; + npc.damage = 22; + npc.defense = 5; + npc.knockBackResist = 0.3f; + npc.width = 38; + npc.height = 50; + animationType = 75; + npc.aiStyle = 3; + npc.npcSlots = 1f; + npc.HitSound = SoundID.NPCHit40; + npc.DeathSound = SoundID.NPCDeath24; + npc.value = Item.buyPrice(0, 0, 3, 20); + banner = npc.type; + aiType = 21; + bannerItem = mod.ItemType("MushroomCreatureBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void AI() - { + public override void AI() + { -if (Main.rand.Next(1000) == 0) - { - Main.PlaySound(22, (int)npc.position.X, (int)npc.position.Y, 1); - } - } + if (Main.rand.Next(1000) == 0) + { + Main.PlaySound(22, (int)npc.position.X, (int)npc.position.Y, 1); + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - //Gore.NewGore(npc.position, npc.velocity, mod.GoreType("Orc1Gore1"), 1f); - } -} - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && (tile == 70)) && y < Main.rockLayer ? 0.03f : 0f; - } -}} \ No newline at end of file + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + //Gore.NewGore(npc.position, npc.velocity, mod.GoreType("Orc1Gore1"), 1f); + } + } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && (tile == 70)) && y < Main.rockLayer ? 0.03f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/Naga.cs b/NPCs/Naga.cs index d7b38d84..182a7743 100644 --- a/NPCs/Naga.cs +++ b/NPCs/Naga.cs @@ -5,62 +5,64 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Naga : ModNPC +namespace Tremor.NPCs { + + public class Naga : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Naga"); Main.npcFrameCount[npc.type] = 3; } - - public override void SetDefaults() - { - npc.lifeMax = 2000; - npc.damage = 130; - npc.defense = 30; - npc.knockBackResist = 1f; - npc.width = 46; - npc.height = 44; - animationType = 3; - npc.aiStyle = 26; - npc.npcSlots = 1f; - //npc.soundHit = 7; - //npc.soundKilled = 10; - npc.value = Item.buyPrice(0, 5, 3, 2); - } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/NagaGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/NagaGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/NagaGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/NagaGore3"), 1f); - } - else - { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 59, (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } - } + public override void SetDefaults() + { + npc.lifeMax = 2000; + npc.damage = 130; + npc.defense = 30; + npc.knockBackResist = 1f; + npc.width = 46; + npc.height = 44; + animationType = 3; + npc.aiStyle = 26; + npc.npcSlots = 1f; + //npc.soundHit = 7; + //npc.soundKilled = 10; + npc.value = Item.buyPrice(0, 5, 3, 2); + } - public override void OnHitPlayer(Player player, int damage, bool crit) - { - player.AddBuff(70, 300, true); - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/NagaGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/NagaGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/NagaGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/NagaGore3"), 1f); + } + else + { + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 59, (float)hitDirection, -1f, 0, default(Color), 0.7f); + } + } + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } -}} \ No newline at end of file + public override void OnHitPlayer(Player player, int damage, bool crit) + { + player.AddBuff(70, 300, true); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } + } +} \ No newline at end of file diff --git a/NPCs/NightTerror.cs b/NPCs/NightTerror.cs index bf309a86..3baff3c4 100644 --- a/NPCs/NightTerror.cs +++ b/NPCs/NightTerror.cs @@ -6,92 +6,94 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class NightTerror : ModNPC +namespace Tremor.NPCs { + + public class NightTerror : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Night Terror"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 10000; - npc.damage = 122; - npc.defense = 30; - npc.knockBackResist = 0.6f; - npc.width = 75; - npc.height = 95; - animationType = 82; -npc.noGravity = true; - npc.noTileCollide = true; - npc.aiStyle = 22; - aiType = 82; - npc.npcSlots = 5f; - npc.HitSound = SoundID.NPCHit54; - npc.DeathSound = SoundID.NPCDeath52; - npc.value = Item.buyPrice(0, 0, 8, 0); - banner = npc.type; - bannerItem = mod.ItemType("NightTerrorBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 10000; + npc.damage = 122; + npc.defense = 30; + npc.knockBackResist = 0.6f; + npc.width = 75; + npc.height = 95; + animationType = 82; + npc.noGravity = true; + npc.noTileCollide = true; + npc.aiStyle = 22; + aiType = 82; + npc.npcSlots = 5f; + npc.HitSound = SoundID.NPCHit54; + npc.DeathSound = SoundID.NPCDeath52; + npc.value = Item.buyPrice(0, 0, 8, 0); + banner = npc.type; + bannerItem = mod.ItemType("NightTerrorBanner"); + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && Main.bloodMoon && y < Main.worldSurface ? 0.004f : 0f; - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(40) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AxeofExecutioner")); - } - } - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && Main.bloodMoon && y < Main.worldSurface ? 0.004f : 0f; + } + + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(40) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("AxeofExecutioner")); + } + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 60; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, 99, 1f); - Gore.NewGore(npc.position, npc.velocity, 99, 1f); - Gore.NewGore(npc.position, npc.velocity, 99, 1f); - Gore.NewGore(npc.position, npc.velocity, 99, 1f); - Gore.NewGore(npc.position, npc.velocity, 99, 1f); - Gore.NewGore(npc.position, npc.velocity, 99, 1f); - } - else - { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Gore.NewGore(npc.position, npc.velocity, 99, 1f); - } - } -} -}} \ No newline at end of file + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 60; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + } + else + { + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + } + } + } + } +} \ No newline at end of file diff --git a/NPCs/NightWalker.cs b/NPCs/NightWalker.cs index 193b060d..5fe019b2 100644 --- a/NPCs/NightWalker.cs +++ b/NPCs/NightWalker.cs @@ -6,81 +6,83 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class NightWalker : ModNPC +namespace Tremor.NPCs { + + public class NightWalker : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Night Walker"); Main.npcFrameCount[npc.type] = 3; } - - public override void SetDefaults() - { - npc.lifeMax = 3000; - npc.damage = 120; - npc.defense = 30; - npc.knockBackResist = 0.3f; - npc.width = 38; - npc.height = 44; - animationType = 141; - npc.aiStyle = 41; - npc.npcSlots = 1f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath17; - npc.value = Item.buyPrice(0, 0, 5, 24); - banner = npc.type; - bannerItem = mod.ItemType("NightWalkerBanner"); - } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(23) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PurplePuzzleFragment")); - } - } - } + public override void SetDefaults() + { + npc.lifeMax = 3000; + npc.damage = 120; + npc.defense = 30; + npc.knockBackResist = 0.3f; + npc.width = 38; + npc.height = 44; + animationType = 141; + npc.aiStyle = 41; + npc.npcSlots = 1f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath17; + npc.value = Item.buyPrice(0, 0, 5, 24); + banner = npc.type; + bannerItem = mod.ItemType("NightWalkerBanner"); + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(23) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PurplePuzzleFragment")); + } + } + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } public override float SpawnChance(NPCSpawnInfo spawnInfo) { return spawnInfo.spawnTileY < Main.rockLayer && NPC.downedMechBossAny && !Main.dayTime ? 0.0005f : 0f; } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 60; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/NWGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/NWGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/NWGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/NWGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/NWGore3"), 1f); - } - else - { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } -} -}} \ No newline at end of file + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 60; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/NWGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/NWGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/NWGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/NWGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/NWGore3"), 1f); + } + else + { + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + } + } + } + } +} \ No newline at end of file diff --git a/NPCs/NorthWind.cs b/NPCs/NorthWind.cs index 1f055656..20c86c44 100644 --- a/NPCs/NorthWind.cs +++ b/NPCs/NorthWind.cs @@ -7,85 +7,87 @@ using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class NorthWind : ModNPC +namespace Tremor.NPCs { + + public class NorthWind : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("North Wind"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 80; - npc.damage = 15; - npc.defense = 8; - npc.knockBackResist = 0.7f; - npc.width = 24; - npc.height = 44; - animationType = 82; - npc.aiStyle = 22; - npc.npcSlots = 0.4f; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit1; - npc.alpha = 100; - npc.noGravity = true; - npc.DeathSound = SoundID.NPCDeath6; - npc.value = Item.buyPrice(0, 0, 7, 15); - banner = npc.type; - bannerItem = mod.ItemType("NorthWindBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 80; + npc.damage = 15; + npc.defense = 8; + npc.knockBackResist = 0.7f; + npc.width = 24; + npc.height = 44; + animationType = 82; + npc.aiStyle = 22; + npc.npcSlots = 0.4f; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit1; + npc.alpha = 100; + npc.noGravity = true; + npc.DeathSound = SoundID.NPCDeath6; + npc.value = Item.buyPrice(0, 0, 7, 15); + banner = npc.type; + bannerItem = mod.ItemType("NorthWindBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FrostCore")); - }; - if(NPC.downedMoonlord && Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); - } - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FrostCore")); + }; + if (NPC.downedMoonlord && Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); + } + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + } - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - } -} + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && Main.cloudAlpha > 0f && y < Main.worldSurface && spawnInfo.player.ZoneSnow ? 0.06f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && Main.cloudAlpha > 0f && y < Main.worldSurface && spawnInfo.player.ZoneSnow ? 0.06f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/Observer.cs b/NPCs/Observer.cs index 2847b496..9668d8d7 100644 --- a/NPCs/Observer.cs +++ b/NPCs/Observer.cs @@ -6,125 +6,127 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Observer : ModNPC +namespace Tremor.NPCs { + + public class Observer : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Observer"); Main.npcFrameCount[npc.type] = 4; } - - const int ShootRate = 250; // ×àñòîòà âûñòðåëà - const int ShootDamage = 20; // Óðîí îò ëàçåðà. - const float ShootKN = 1.0f; // Îòáðàñûâàíèå - const int ShootType = 100; // Òèï ïðîäæåêòàéëà êîòîðûì áóäåò ïðîèçâåä¸í âûñòðåë. - const float ShootSpeed = 4; // Ýòî, ÿ òàê ïîíèìàþ, âëèÿåò íà äàëüíîñòü âûñòðåëà - int TimeToShoot = ShootRate; // Âðåìÿ äî âûñòðåëà. + const int ShootRate = 250; // ×àñòîòà âûñòðåëà + const int ShootDamage = 20; // Óðîí îò ëàçåðà. + const float ShootKN = 1.0f; // Îòáðàñûâàíèå + const int ShootType = 100; // Òèï ïðîäæåêòàéëà êîòîðûì áóäåò ïðîèçâåä¸í âûñòðåë. + const float ShootSpeed = 4; // Ýòî, ÿ òàê ïîíèìàþ, âëèÿåò íà äàëüíîñòü âûñòðåëà - public override void SetDefaults() - { - npc.lifeMax = 2500; - npc.damage = 80; - npc.defense = 32; - npc.knockBackResist = 0f; - npc.width = 130; - npc.height = 130; - animationType = 82; - npc.aiStyle = 22; - npc.npcSlots = 0.5f; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit31; - npc.noGravity = true; - npc.DeathSound = SoundID.NPCDeath6; - npc.value = Item.buyPrice(0, 0, 55, 9); - banner = npc.type; - bannerItem = mod.ItemType("ObserverBanner"); - } + int TimeToShoot = ShootRate; // Âðåìÿ äî âûñòðåëà. - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 2500; + npc.damage = 80; + npc.defense = 32; + npc.knockBackResist = 0f; + npc.width = 130; + npc.height = 130; + animationType = 82; + npc.aiStyle = 22; + npc.npcSlots = 0.5f; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit31; + npc.noGravity = true; + npc.DeathSound = SoundID.NPCDeath6; + npc.value = Item.buyPrice(0, 0, 55, 9); + banner = npc.type; + bannerItem = mod.ItemType("ObserverBanner"); + } - public override void AI() - { - // Âñÿêàÿ äè÷ü - if (--TimeToShoot <= 0 && npc.target != -1) Shoot(); //  ýòîé ñòðîêå èç ïåðåìåííîé TimeToShot îòíèìàåòñÿ 1, è åñëè TimeToShot < èëè = 0, òî âûçûâàåòñÿ ìåòîä Shoot() - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } + public override void AI() + { + // Âñÿêàÿ äè÷ü + if (--TimeToShoot <= 0 && npc.target != -1) Shoot(); //  ýòîé ñòðîêå èç ïåðåìåííîé TimeToShot îòíèìàåòñÿ 1, è åñëè TimeToShot < èëè = 0, òî âûçûâàåòñÿ ìåòîä Shoot() + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && Main.bloodMoon && y < Main.worldSurface ? 0.006f : 0f; - } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ObserverGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ObserverGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ObserverGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ObserverGore4"), 1f); - } - else - { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } - } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(15) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Spearaxe")); - } - if(Main.rand.Next(15) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ScarredReaper")); - }; - } - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && Main.bloodMoon && y < Main.worldSurface ? 0.006f : 0f; + } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ObserverGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ObserverGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ObserverGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ObserverGore4"), 1f); + } + else + { + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + } + } + } + + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(15) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Spearaxe")); + } + if (Main.rand.Next(15) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ScarredReaper")); + }; + } + } - void Shoot() - { - TimeToShoot = ShootRate; // Óñòàíàâëèâàåì êóëäàóí âûñòðåëó - Vector2 velocity = VelocityFPTP(npc.Center, Main.player[npc.target].Center, ShootSpeed); // Òóò ìû ïîëó÷èì íóæíóþ velocity (ïîÿñíåíèå àðãóìåíòîâ íèæå) - // 1 àðãóìåíò - ïîçèöèÿ èç êîòîðîé áóäåò âûëåòàòü âûñòðåë - // 2 àðãóìåíò - ïîçèöèÿ â êîòîðóþ îí äîëæåí ïîëåòåòü - // 3 àðãóìåíò - ñêîðîñòü âûñòðåëà - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, velocity.X, velocity.Y, ShootType, ShootDamage, ShootKN); - } + void Shoot() + { + TimeToShoot = ShootRate; // Óñòàíàâëèâàåì êóëäàóí âûñòðåëó + Vector2 velocity = VelocityFPTP(npc.Center, Main.player[npc.target].Center, ShootSpeed); // Òóò ìû ïîëó÷èì íóæíóþ velocity (ïîÿñíåíèå àðãóìåíòîâ íèæå) + // 1 àðãóìåíò - ïîçèöèÿ èç êîòîðîé áóäåò âûëåòàòü âûñòðåë + // 2 àðãóìåíò - ïîçèöèÿ â êîòîðóþ îí äîëæåí ïîëåòåòü + // 3 àðãóìåíò - ñêîðîñòü âûñòðåëà + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, velocity.X, velocity.Y, ShootType, ShootDamage, ShootKN); + } - Vector2 VelocityFPTP(Vector2 pos1, Vector2 pos2, float speed) - { - Vector2 move = pos2 - pos1; - return move * (speed / (float)System.Math.Sqrt(move.X * move.X + move.Y * move.Y)); - } -}} \ No newline at end of file + Vector2 VelocityFPTP(Vector2 pos1, Vector2 pos2, float speed) + { + Vector2 move = pos2 - pos1; + return move * (speed / (float)System.Math.Sqrt(move.X * move.X + move.Y * move.Y)); + } + } +} \ No newline at end of file diff --git a/NPCs/OceanMimic.cs b/NPCs/OceanMimic.cs index e22b40ae..9ea0fd77 100644 --- a/NPCs/OceanMimic.cs +++ b/NPCs/OceanMimic.cs @@ -6,49 +6,49 @@ namespace Tremor.NPCs { - public class OceanMimic : ModNPC - { + public class OceanMimic : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Ocean Mimic"); Main.npcFrameCount[npc.type] = 14; } - - public override void SetDefaults() - { - npc.lifeMax = 3500; - npc.damage = 90; - npc.defense = 34; - npc.knockBackResist = 0f; - npc.width = 48; - npc.height = 40; - npc.aiStyle = 87; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath6; - npc.value = Item.buyPrice(0, 3, 0, 0); - animationType = NPCID.BigMimicHallow; - } - public override void NPCLoot() - { -if (Main.netMode != 1) -{ -int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; -int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; -int halfLength = npc.width / 2 / 16 + 1; -Helper.DropItem(new Rectangle((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height), new Drop(mod.ItemType("TheTide"), 1, 1), new Drop(mod.ItemType("TrueTrident"), 1, 1), new Drop(mod.ItemType("SharkRage"), 1, 1), new Drop(mod.ItemType("OceanAmulet"), 1, 1), new Drop(mod.ItemType("SquidTentacle"), 1, 1)); -Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 500, Main.rand.Next(10)); -Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 499, Main.rand.Next(10)); -} -} + public override void SetDefaults() + { + npc.lifeMax = 3500; + npc.damage = 90; + npc.defense = 34; + npc.knockBackResist = 0f; + npc.width = 48; + npc.height = 40; + npc.aiStyle = 87; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit4; + npc.DeathSound = SoundID.NPCDeath6; + npc.value = Item.buyPrice(0, 3, 0, 0); + animationType = NPCID.BigMimicHallow; + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && (tile == 53 || tile == 112 || tile == 116 || tile == 234) && Tremor.NoZoneAllowWater(spawnInfo) && spawnInfo.water) && Main.hardMode && y < Main.rockLayer && (x < 250 || x > Main.maxTilesX - 250) && !spawnInfo.playerSafe ? 0.01f : 0f; - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + Helper.DropItem(new Rectangle((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height), new Drop(mod.ItemType("TheTide"), 1, 1), new Drop(mod.ItemType("TrueTrident"), 1, 1), new Drop(mod.ItemType("SharkRage"), 1, 1), new Drop(mod.ItemType("OceanAmulet"), 1, 1), new Drop(mod.ItemType("SquidTentacle"), 1, 1)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 500, Main.rand.Next(10)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 499, Main.rand.Next(10)); + } + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && (tile == 53 || tile == 112 || tile == 116 || tile == 234) && Tremor.NoZoneAllowWater(spawnInfo) && spawnInfo.water) && Main.hardMode && y < Main.rockLayer && (x < 250 || x > Main.maxTilesX - 250) && !spawnInfo.playerSafe ? 0.01f : 0f; + } + } } \ No newline at end of file diff --git a/NPCs/OmegaWolf.cs b/NPCs/OmegaWolf.cs index 07fba927..bdb57b4f 100644 --- a/NPCs/OmegaWolf.cs +++ b/NPCs/OmegaWolf.cs @@ -6,70 +6,72 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class OmegaWolf : ModNPC +namespace Tremor.NPCs { + + public class OmegaWolf : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Omega Wolf"); Main.npcFrameCount[npc.type] = 9; } - - public override void SetDefaults() - { - npc.lifeMax = 28; - npc.damage = 16; - npc.defense = 5; - npc.knockBackResist = 0.6f; - npc.width = 62; - npc.height = 32; - animationType = 155; - npc.aiStyle = 26; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit6; - npc.DeathSound = SoundID.NPCDeath5; - npc.value = Item.buyPrice(0, 0, 5, 0); - } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("WolfPelt")); - } - if(Main.rand.Next(25) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FurHat")); - }; - } - } + public override void SetDefaults() + { + npc.lifeMax = 28; + npc.damage = 16; + npc.defense = 5; + npc.knockBackResist = 0.6f; + npc.width = 62; + npc.height = 32; + animationType = 155; + npc.aiStyle = 26; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit6; + npc.DeathSound = SoundID.NPCDeath5; + npc.value = Item.buyPrice(0, 0, 5, 0); + } + + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("WolfPelt")); + } + if (Main.rand.Next(25) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FurHat")); + }; + } + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OmegaWolfGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OmegaWolfGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WolfGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WolfGore1"), 1f); + } + } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneSnow && y < Main.worldSurface ? 0.02f : 0f; + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OmegaWolfGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OmegaWolfGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WolfGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WolfGore1"), 1f); - } -} - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneSnow && y < Main.worldSurface ? 0.02f : 0f; - } - -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/Orc.cs b/NPCs/Orc.cs index ccc93887..eeed8bc9 100644 --- a/NPCs/Orc.cs +++ b/NPCs/Orc.cs @@ -6,81 +6,83 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Orc : ModNPC +namespace Tremor.NPCs { + + public class Orc : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Orc"); Main.npcFrameCount[npc.type] = 20; } - - public override void SetDefaults() - { - npc.lifeMax = 80; - npc.damage = 22; - npc.defense = 5; - npc.knockBackResist = 0.3f; - npc.width = 48; - aiType = 77; - npc.height = 54; -animationType = 482; - npc.aiStyle = 3; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath40; - npc.value = Item.buyPrice(0, 0, 6, 7); - banner = npc.type; - bannerItem = mod.ItemType("OrcBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 80; + npc.damage = 22; + npc.defense = 5; + npc.knockBackResist = 0.3f; + npc.width = 48; + aiType = 77; + npc.height = 54; + animationType = 482; + npc.aiStyle = 3; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath40; + npc.value = Item.buyPrice(0, 0, 6, 7); + banner = npc.type; + bannerItem = mod.ItemType("OrcBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Orc1Gore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Orc1Gore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Orc1Gore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Orc1Gore2"), 1f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Orc1Gore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Orc1Gore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Orc1Gore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Orc1Gore2"), 1f); + } + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OrcishShield")); - } - if(Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OrcishKnife")); - } - } - } + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OrcishShield")); + } + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OrcishKnife")); + } + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedBoss1 && y < Main.worldSurface ? 0.1f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedBoss1 && y < Main.worldSurface ? 0.1f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/OrcChampion.cs b/NPCs/OrcChampion.cs index c50e1471..e1db7d0e 100644 --- a/NPCs/OrcChampion.cs +++ b/NPCs/OrcChampion.cs @@ -6,71 +6,73 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class OrcChampion : ModNPC +namespace Tremor.NPCs { + + public class OrcChampion : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Orc Champion"); Main.npcFrameCount[npc.type] = 20; } - - public override void SetDefaults() - { - npc.lifeMax = 500; - npc.damage = 25; - npc.defense = 32; - npc.knockBackResist = 0.1f; - npc.width = 40; - npc.height = 40; - animationType = 482; - npc.aiStyle = 3; - aiType = 482; - npc.npcSlots = 0.8f; - npc.HitSound = SoundID.NPCHit1; - npc.buffImmune[20] = true; - npc.buffImmune[24] = true; - npc.buffImmune[39] = true; - npc.buffImmune[31] = false; - npc.DeathSound = SoundID.NPCDeath27; - npc.value = Item.buyPrice(0, 0, 25, 0); - banner = npc.type; - bannerItem = mod.ItemType("OrcChampionBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 500; + npc.damage = 25; + npc.defense = 32; + npc.knockBackResist = 0.1f; + npc.width = 40; + npc.height = 40; + animationType = 482; + npc.aiStyle = 3; + aiType = 482; + npc.npcSlots = 0.8f; + npc.HitSound = SoundID.NPCHit1; + npc.buffImmune[20] = true; + npc.buffImmune[24] = true; + npc.buffImmune[39] = true; + npc.buffImmune[31] = false; + npc.DeathSound = SoundID.NPCDeath27; + npc.value = Item.buyPrice(0, 0, 25, 0); + banner = npc.type; + bannerItem = mod.ItemType("OrcChampionBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OCGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OCGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OCGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OCGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OCGore4"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OCGore4"), 1f); - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); - } - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OCGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OCGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OCGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OCGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OCGore4"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OCGore4"), 1f); + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); + } + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.005f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.005f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/OrcSkeleton.cs b/NPCs/OrcSkeleton.cs index cb777d66..171aac70 100644 --- a/NPCs/OrcSkeleton.cs +++ b/NPCs/OrcSkeleton.cs @@ -7,63 +7,65 @@ using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class OrcSkeleton : ModNPC +namespace Tremor.NPCs { + + public class OrcSkeleton : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Orc Skeleton"); Main.npcFrameCount[npc.type] = 20; } - - public override void SetDefaults() - { - aiType = 77; - npc.lifeMax = 150; - npc.damage = 30; - npc.defense = 10; - npc.knockBackResist = 0.3f; - npc.width = 36; - npc.height = 44; - animationType = 482; - npc.aiStyle = 3; - npc.npcSlots = 0.6f; - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath6; - npc.value = Item.buyPrice(0, 0, 6, 9); - banner = npc.type; - bannerItem = mod.ItemType("OrcSkeletonBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + aiType = 77; + npc.lifeMax = 150; + npc.damage = 30; + npc.defense = 10; + npc.knockBackResist = 0.3f; + npc.width = 36; + npc.height = 44; + animationType = 482; + npc.aiStyle = 3; + npc.npcSlots = 0.6f; + npc.HitSound = SoundID.NPCHit4; + npc.DeathSound = SoundID.NPCDeath6; + npc.value = Item.buyPrice(0, 0, 6, 9); + banner = npc.type; + bannerItem = mod.ItemType("OrcSkeletonBanner"); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OrcSkeletonGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OrcSkeletonGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OrcSkeletonGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OrcSkeletonGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OrcSkeletonGore3"), 1f); - } -} + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedBoss1 && y > Main.rockLayer ? 0.01f : 0f; - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OrcSkeletonGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OrcSkeletonGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OrcSkeletonGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OrcSkeletonGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OrcSkeletonGore3"), 1f); + } + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedBoss1 && y > Main.rockLayer ? 0.01f : 0f; + } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/OrcWarrior.cs b/NPCs/OrcWarrior.cs index 20ad7b7c..bcf846f5 100644 --- a/NPCs/OrcWarrior.cs +++ b/NPCs/OrcWarrior.cs @@ -6,88 +6,90 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class OrcWarrior : ModNPC +namespace Tremor.NPCs { + + public class OrcWarrior : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Orc Warrior"); Main.npcFrameCount[npc.type] = 20; } - - public override void SetDefaults() - { - npc.lifeMax = 175; - npc.damage = 30; - npc.defense = 10; - npc.knockBackResist = 0.3f; - npc.width = 48; - npc.height = 54; -animationType = 482; - npc.aiStyle = 3; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath40; - npc.value = Item.buyPrice(0, 0, 6, 7); - banner = npc.type; - bannerItem = mod.ItemType("OrcWarriorBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 175; + npc.damage = 30; + npc.defense = 10; + npc.knockBackResist = 0.3f; + npc.width = 48; + npc.height = 54; + animationType = 482; + npc.aiStyle = 3; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath40; + npc.value = Item.buyPrice(0, 0, 6, 7); + banner = npc.type; + bannerItem = mod.ItemType("OrcWarriorBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OrcWarriorGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OrcWarriorGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OrcWarriorGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OrcWarriorGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OrcWarriorGore4"), 1f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OrcWarriorGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OrcWarriorGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OrcWarriorGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OrcWarriorGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/OrcWarriorGore4"), 1f); + } + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(30) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OrcishHelmet")); - } - if(Main.rand.Next(30) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OrcishBreastplate")); - } - if(Main.rand.Next(30) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OrcishGreaves")); - } - if(Main.rand.Next(30) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OrcishBroadsword")); - } - } - } + if (Main.rand.Next(30) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OrcishHelmet")); + } + if (Main.rand.Next(30) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OrcishBreastplate")); + } + if (Main.rand.Next(30) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OrcishGreaves")); + } + if (Main.rand.Next(30) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OrcishBroadsword")); + } + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedBoss1 && !Main.dayTime && y < Main.worldSurface ? 0.1f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedBoss1 && !Main.dayTime && y < Main.worldSurface ? 0.1f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/PGiantSlime.cs b/NPCs/PGiantSlime.cs index 46d93ca9..ff71258e 100644 --- a/NPCs/PGiantSlime.cs +++ b/NPCs/PGiantSlime.cs @@ -7,74 +7,76 @@ using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class PGiantSlime : ModNPC +namespace Tremor.NPCs { + + public class PGiantSlime : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Purple Slime"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 700; - npc.damage = 100; - npc.defense = 30; - npc.knockBackResist = 0.3f; - npc.width = 70; - npc.alpha = 175; - npc.color = new Color(200, 0, 255, 150); - npc.height = 46; - animationType = 244; - npc.aiStyle = 1; - aiType = 138; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath23; - npc.value = Item.buyPrice(0, 0, 12, 15); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 700; + npc.damage = 100; + npc.defense = 30; + npc.knockBackResist = 0.3f; + npc.width = 70; + npc.alpha = 175; + npc.color = new Color(200, 0, 255, 150); + npc.height = 46; + animationType = 244; + npc.aiStyle = 1; + aiType = 138; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath23; + npc.value = Item.buyPrice(0, 0, 12, 15); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Purple, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Purple, 0.7f); - } - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Purple, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Purple, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Purple, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 1, 2.5f * (float)hitDirection, -2.5f, 0, Color.Purple, 0.7f); - } -} + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Purple, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Purple, 0.7f); + } + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Purple, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Purple, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Purple, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 1, 2.5f * (float)hitDirection, -2.5f, 0, Color.Purple, 0.7f); + } + } public override float SpawnChance(NPCSpawnInfo spawnInfo) { return spawnInfo.spawnTileY < Main.rockLayer && Main.hardMode && Tremor.NoInvasion(spawnInfo) && NPC.downedMoonlord && Main.dayTime ? 0.02f : 0f; } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 23); - }; - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 23); + }; + } + } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/Parasprite.cs b/NPCs/Parasprite.cs index e39e086d..9c7adc37 100644 --- a/NPCs/Parasprite.cs +++ b/NPCs/Parasprite.cs @@ -7,63 +7,65 @@ using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Parasprite : ModNPC +namespace Tremor.NPCs { + + public class Parasprite : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Parasprite"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 30; - npc.damage = 7; - npc.defense = 2; - npc.knockBackResist = 0.3f; - npc.width = 34; - npc.height = 48; - animationType = 75; - npc.aiStyle = 14; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit35; - npc.noGravity = true; - npc.DeathSound = SoundID.NPCDeath57; - banner = npc.type; - bannerItem = mod.ItemType("ParaspriteBanner"); - } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ParaspriteGore"), 1f); - } - else - { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 59, (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 30; + npc.damage = 7; + npc.defense = 2; + npc.knockBackResist = 0.3f; + npc.width = 34; + npc.height = 48; + animationType = 75; + npc.aiStyle = 14; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit35; + npc.noGravity = true; + npc.DeathSound = SoundID.NPCDeath57; + banner = npc.type; + bannerItem = mod.ItemType("ParaspriteBanner"); + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ParaspriteGore"), 1f); + } + else + { + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 59, (float)hitDirection, -1f, 0, default(Color), 0.7f); + } + } + } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && y > Main.rockLayer ? 0.01f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && y > Main.rockLayer ? 0.01f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/Peepers.cs b/NPCs/Peepers.cs index 9bbd7bdf..2008fe35 100644 --- a/NPCs/Peepers.cs +++ b/NPCs/Peepers.cs @@ -6,120 +6,122 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Peepers : ModNPC +namespace Tremor.NPCs { + + public class Peepers : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Peepers"); Main.npcFrameCount[npc.type] = 4; } - - const int ShootRate = 100; // ×àñòîòà âûñòðåëà - const int ShootDamage = 10; // Óðîí îò ëàçåðà. - const float ShootKN = 1.0f; // Îòáðàñûâàíèå - const int ShootType = 100; // Òèï ïðîäæåêòàéëà êîòîðûì áóäåò ïðîèçâåä¸í âûñòðåë. - const float ShootSpeed = 4; // Ýòî, ÿ òàê ïîíèìàþ, âëèÿåò íà äàëüíîñòü âûñòðåëà - int TimeToShoot = ShootRate; // Âðåìÿ äî âûñòðåëà. + const int ShootRate = 100; // ×àñòîòà âûñòðåëà + const int ShootDamage = 10; // Óðîí îò ëàçåðà. + const float ShootKN = 1.0f; // Îòáðàñûâàíèå + const int ShootType = 100; // Òèï ïðîäæåêòàéëà êîòîðûì áóäåò ïðîèçâåä¸í âûñòðåë. + const float ShootSpeed = 4; // Ýòî, ÿ òàê ïîíèìàþ, âëèÿåò íà äàëüíîñòü âûñòðåëà - public override void SetDefaults() - { - npc.lifeMax = 250; - npc.damage = 30; - npc.defense = 23; - npc.knockBackResist = 0f; - npc.width = 136; - npc.height = 175; - animationType = 82; - npc.aiStyle = 22; - npc.npcSlots = 0.5f; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit1; - npc.noGravity = true; - npc.DeathSound = SoundID.NPCDeath6; - npc.value = Item.buyPrice(0, 0, 8, 9); - banner = npc.type; - bannerItem = mod.ItemType("PeepersBanner"); - } + int TimeToShoot = ShootRate; // Âðåìÿ äî âûñòðåëà. - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 250; + npc.damage = 30; + npc.defense = 23; + npc.knockBackResist = 0f; + npc.width = 136; + npc.height = 175; + animationType = 82; + npc.aiStyle = 22; + npc.npcSlots = 0.5f; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit1; + npc.noGravity = true; + npc.DeathSound = SoundID.NPCDeath6; + npc.value = Item.buyPrice(0, 0, 8, 9); + banner = npc.type; + bannerItem = mod.ItemType("PeepersBanner"); + } - public override void AI() - { - // Âñÿêàÿ äè÷ü - if (--TimeToShoot <= 0 && npc.target != -1) Shoot(); //  ýòîé ñòðîêå èç ïåðåìåííîé TimeToShot îòíèìàåòñÿ 1, è åñëè TimeToShot < èëè = 0, òî âûçûâàåòñÿ ìåòîä Shoot() - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } + public override void AI() + { + // Âñÿêàÿ äè÷ü + if (--TimeToShoot <= 0 && npc.target != -1) Shoot(); //  ýòîé ñòðîêå èç ïåðåìåííîé TimeToShot îòíèìàåòñÿ 1, è åñëè TimeToShot < èëè = 0, òî âûçûâàåòñÿ ìåòîä Shoot() + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.01f : 0f; - } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PeepersGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PeepersGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PeepersGore3"), 1f); - } - else - { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } - } - void Shoot() - { - TimeToShoot = ShootRate; // Óñòàíàâëèâàåì êóëäàóí âûñòðåëó - Vector2 velocity = VelocityFPTP(npc.Center, Main.player[npc.target].Center, ShootSpeed); // Òóò ìû ïîëó÷èì íóæíóþ velocity (ïîÿñíåíèå àðãóìåíòîâ íèæå) - // 1 àðãóìåíò - ïîçèöèÿ èç êîòîðîé áóäåò âûëåòàòü âûñòðåë - // 2 àðãóìåíò - ïîçèöèÿ â êîòîðóþ îí äîëæåí ïîëåòåòü - // 3 àðãóìåíò - ñêîðîñòü âûñòðåëà - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, velocity.X, velocity.Y, ShootType, ShootDamage, ShootKN); - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.01f : 0f; + } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PeepersGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PeepersGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PeepersGore3"), 1f); + } + else + { + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + } + } + } + + void Shoot() + { + TimeToShoot = ShootRate; // Óñòàíàâëèâàåì êóëäàóí âûñòðåëó + Vector2 velocity = VelocityFPTP(npc.Center, Main.player[npc.target].Center, ShootSpeed); // Òóò ìû ïîëó÷èì íóæíóþ velocity (ïîÿñíåíèå àðãóìåíòîâ íèæå) + // 1 àðãóìåíò - ïîçèöèÿ èç êîòîðîé áóäåò âûëåòàòü âûñòðåë + // 2 àðãóìåíò - ïîçèöèÿ â êîòîðóþ îí äîëæåí ïîëåòåòü + // 3 àðãóìåíò - ñêîðîñòü âûñòðåëà + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, velocity.X, velocity.Y, ShootType, ShootDamage, ShootKN); + } - Vector2 VelocityFPTP(Vector2 pos1, Vector2 pos2, float speed) - { - Vector2 move = pos2 - pos1; - return move * (speed / (float)System.Math.Sqrt(move.X * move.X + move.Y * move.Y)); - } + Vector2 VelocityFPTP(Vector2 pos1, Vector2 pos2, float speed) + { + Vector2 move = pos2 - pos1; + return move * (speed / (float)System.Math.Sqrt(move.X * move.X + move.Y * move.Y)); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SharpenedTooth")); - }; - } - } -}} \ No newline at end of file + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SharpenedTooth")); + }; + } + } + } +} \ No newline at end of file diff --git a/NPCs/Phabor.cs b/NPCs/Phabor.cs index 6c05b256..2b54d42b 100644 --- a/NPCs/Phabor.cs +++ b/NPCs/Phabor.cs @@ -6,123 +6,125 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Phabor : ModNPC +namespace Tremor.NPCs { + + public class Phabor : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Phabor"); Main.npcFrameCount[npc.type] = 4; } - - const int ShootRate = 500; // ×àñòîòà âûñòðåëà - const int ShootDamage = 20; // Óðîí îò ëàçåðà. - const float ShootKN = 1.0f; // Îòáðàñûâàíèå - const int ShootType = 468; // Òèï ïðîäæåêòàéëà êîòîðûì áóäåò ïðîèçâåä¸í âûñòðåë. - const float ShootSpeed = 4; // Ýòî, ÿ òàê ïîíèìàþ, âëèÿåò íà äàëüíîñòü âûñòðåëà - int TimeToShoot = ShootRate; // Âðåìÿ äî âûñòðåëà. + const int ShootRate = 500; // ×àñòîòà âûñòðåëà + const int ShootDamage = 20; // Óðîí îò ëàçåðà. + const float ShootKN = 1.0f; // Îòáðàñûâàíèå + const int ShootType = 468; // Òèï ïðîäæåêòàéëà êîòîðûì áóäåò ïðîèçâåä¸í âûñòðåë. + const float ShootSpeed = 4; // Ýòî, ÿ òàê ïîíèìàþ, âëèÿåò íà äàëüíîñòü âûñòðåëà - public override void SetDefaults() - { - npc.lifeMax = 420; - npc.damage = 30; - npc.defense = 12; - npc.knockBackResist = 0f; - npc.width = 75; - npc.height = 75; - animationType = 82; - npc.aiStyle = 22; - npc.npcSlots = 0.5f; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit31; - npc.noGravity = true; - npc.DeathSound = SoundID.NPCDeath6; - npc.value = Item.buyPrice(0, 0, 55, 9); - banner = npc.type; - bannerItem = mod.ItemType("PhaborBanner"); - } + int TimeToShoot = ShootRate; // Âðåìÿ äî âûñòðåëà. - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 420; + npc.damage = 30; + npc.defense = 12; + npc.knockBackResist = 0f; + npc.width = 75; + npc.height = 75; + animationType = 82; + npc.aiStyle = 22; + npc.npcSlots = 0.5f; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit31; + npc.noGravity = true; + npc.DeathSound = SoundID.NPCDeath6; + npc.value = Item.buyPrice(0, 0, 55, 9); + banner = npc.type; + bannerItem = mod.ItemType("PhaborBanner"); + } - public override void AI() - { - // Âñÿêàÿ äè÷ü - if (--TimeToShoot <= 0 && npc.target != -1) Shoot(); //  ýòîé ñòðîêå èç ïåðåìåííîé TimeToShot îòíèìàåòñÿ 1, è åñëè TimeToShot < èëè = 0, òî âûçûâàåòñÿ ìåòîä Shoot() - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } + public override void AI() + { + // Âñÿêàÿ äè÷ü + if (--TimeToShoot <= 0 && npc.target != -1) Shoot(); //  ýòîé ñòðîêå èç ïåðåìåííîé TimeToShot îòíèìàåòñÿ 1, è åñëè TimeToShot < èëè = 0, òî âûçûâàåòñÿ ìåòîä Shoot() + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Gloomstone"), Main.rand.Next(6,15)); - } - } - } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && Main.bloodMoon && y < Main.worldSurface ? 0.06f : 0f; - } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PhaborGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PhaborGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PhaborGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PhaborGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PhaborGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PhaborGore3"), 1f); - } - else - { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Gloomstone"), Main.rand.Next(6, 15)); + } + } + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && Main.bloodMoon && y < Main.worldSurface ? 0.06f : 0f; + } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PhaborGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PhaborGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PhaborGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PhaborGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PhaborGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PhaborGore3"), 1f); + } + else + { + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + } + } + } - void Shoot() - { - TimeToShoot = ShootRate; // Óñòàíàâëèâàåì êóëäàóí âûñòðåëó - Vector2 velocity = VelocityFPTP(npc.Center, Main.player[npc.target].Center, ShootSpeed); // Òóò ìû ïîëó÷èì íóæíóþ velocity (ïîÿñíåíèå àðãóìåíòîâ íèæå) - // 1 àðãóìåíò - ïîçèöèÿ èç êîòîðîé áóäåò âûëåòàòü âûñòðåë - // 2 àðãóìåíò - ïîçèöèÿ â êîòîðóþ îí äîëæåí ïîëåòåòü - // 3 àðãóìåíò - ñêîðîñòü âûñòðåëà - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, velocity.X, velocity.Y, ShootType, ShootDamage, ShootKN); - } + void Shoot() + { + TimeToShoot = ShootRate; // Óñòàíàâëèâàåì êóëäàóí âûñòðåëó + Vector2 velocity = VelocityFPTP(npc.Center, Main.player[npc.target].Center, ShootSpeed); // Òóò ìû ïîëó÷èì íóæíóþ velocity (ïîÿñíåíèå àðãóìåíòîâ íèæå) + // 1 àðãóìåíò - ïîçèöèÿ èç êîòîðîé áóäåò âûëåòàòü âûñòðåë + // 2 àðãóìåíò - ïîçèöèÿ â êîòîðóþ îí äîëæåí ïîëåòåòü + // 3 àðãóìåíò - ñêîðîñòü âûñòðåëà + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, velocity.X, velocity.Y, ShootType, ShootDamage, ShootKN); + } - Vector2 VelocityFPTP(Vector2 pos1, Vector2 pos2, float speed) - { - Vector2 move = pos2 - pos1; - return move * (speed / (float)System.Math.Sqrt(move.X * move.X + move.Y * move.Y)); - } -}} \ No newline at end of file + Vector2 VelocityFPTP(Vector2 pos1, Vector2 pos2, float speed) + { + Vector2 move = pos2 - pos1; + return move * (speed / (float)System.Math.Sqrt(move.X * move.X + move.Y * move.Y)); + } + } +} \ No newline at end of file diff --git a/NPCs/Phantom.cs b/NPCs/Phantom.cs index d4d9b2af..15e340c6 100644 --- a/NPCs/Phantom.cs +++ b/NPCs/Phantom.cs @@ -6,87 +6,89 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Phantom : ModNPC +namespace Tremor.NPCs { + + public class Phantom : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Phantom"); Main.npcFrameCount[npc.type] = 4; } - - const int SpeedMulti = 3; // Œ­®¦¨â¥«ì ᪮à®á⨠- public override void SetDefaults() - { - npc.lifeMax = 60; - npc.damage = 24; - npc.defense = 16; - npc.knockBackResist = 0.3f; - npc.width = 42; - npc.height = 82; -animationType = 82; - npc.aiStyle = 22; - npc.npcSlots = 0.5f; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit52; -npc.noGravity = true; - npc.DeathSound = SoundID.NPCDeath6; - npc.value = Item.buyPrice(0, 0, 4, 9); - banner = npc.type; - bannerItem = mod.ItemType("PhantomBanner"); - } + const int SpeedMulti = 3; // Œ­®¦¨â¥«ì ᪮à®á⨠+ + public override void SetDefaults() + { + npc.lifeMax = 60; + npc.damage = 24; + npc.defense = 16; + npc.knockBackResist = 0.3f; + npc.width = 42; + npc.height = 82; + animationType = 82; + npc.aiStyle = 22; + npc.npcSlots = 0.5f; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit52; + npc.noGravity = true; + npc.DeathSound = SoundID.NPCDeath6; + npc.value = Item.buyPrice(0, 0, 4, 9); + banner = npc.type; + bannerItem = mod.ItemType("PhantomBanner"); + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 60; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - } - else - { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 27, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 60; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + } + else + { + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 27, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, (float)hitDirection, -1f, 0, default(Color), 0.7f); + } + } + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PhantomSoul")); - }; - if(Main.rand.Next(48) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GloomTome")); - }; - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PhantomSoul")); + }; + if (Main.rand.Next(48) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("GloomTome")); + }; + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.bloodMoon && y < Main.worldSurface ? 0.03f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && Main.bloodMoon && y < Main.worldSurface ? 0.03f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/PharaohCaster.cs b/NPCs/PharaohCaster.cs index 80021112..9bb5439f 100644 --- a/NPCs/PharaohCaster.cs +++ b/NPCs/PharaohCaster.cs @@ -13,7 +13,7 @@ public override void SetStaticDefaults() DisplayName.SetDefault("Pharaoh Caster"); Main.npcFrameCount[npc.type] = 3; } - + public override void SetDefaults() { npc.width = 40; @@ -23,45 +23,45 @@ public override void SetDefaults() npc.lifeMax = 210; npc.HitSound = SoundID.NPCHit2; npc.DeathSound = SoundID.NPCDeath6; - npc.value = Item.buyPrice(0, 1, 5, 7); + npc.value = Item.buyPrice(0, 1, 5, 7); npc.knockBackResist = 0.5f; npc.aiStyle = 8; aiType = 32; animationType = 32; - banner = npc.type; - bannerItem = mod.ItemType("PharaohCasterBanner"); + banner = npc.type; + bannerItem = mod.ItemType("PharaohCasterBanner"); } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && NPC.downedBoss1 && Main.dayTime && y < Main.worldSurface ? 0.01f : 0f; - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && NPC.downedBoss1 && Main.dayTime && y < Main.worldSurface ? 0.01f : 0f; + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PharaonGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PharaonGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PharaonGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PharaonGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PharaonGore3"), 1f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PharaonGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PharaonGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PharaonGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PharaonGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PharaonGore3"), 1f); + } + } } } diff --git a/NPCs/Phobos.cs b/NPCs/Phobos.cs index d048d120..f1c3f766 100644 --- a/NPCs/Phobos.cs +++ b/NPCs/Phobos.cs @@ -6,111 +6,113 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Phobos : ModNPC +namespace Tremor.NPCs { + + public class Phobos : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Phobos"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 10000; - npc.damage = 180; - npc.defense = 100; - npc.knockBackResist = 0.0f; - npc.width = 145; - npc.height = 145; - animationType = 82; - npc.noGravity = true; - npc.noTileCollide = true; - npc.aiStyle = 22; - aiType = 226; - npc.npcSlots = 5f; - npc.HitSound = SoundID.NPCHit54; - npc.DeathSound = SoundID.NPCDeath52; - npc.value = Item.buyPrice(0, 10, 15, 12); - banner = npc.type; - bannerItem = mod.ItemType("PhobosBanner"); - } - public override void AI() - { -if (Main.rand.Next(6) == 0) - { - Dust.NewDust(npc.position, npc.width, npc.height, 27, 0f, 0f, 200, npc.color, 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 70, 0f, 0f, 200, npc.color, 1f); - } - } + public override void SetDefaults() + { + npc.lifeMax = 10000; + npc.damage = 180; + npc.defense = 100; + npc.knockBackResist = 0.0f; + npc.width = 145; + npc.height = 145; + animationType = 82; + npc.noGravity = true; + npc.noTileCollide = true; + npc.aiStyle = 22; + aiType = 226; + npc.npcSlots = 5f; + npc.HitSound = SoundID.NPCHit54; + npc.DeathSound = SoundID.NPCDeath52; + npc.value = Item.buyPrice(0, 10, 15, 12); + banner = npc.type; + bannerItem = mod.ItemType("PhobosBanner"); + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void AI() + { + if (Main.rand.Next(6) == 0) + { + Dust.NewDust(npc.position, npc.width, npc.height, 27, 0f, 0f, 200, npc.color, 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 70, 0f, 0f, 200, npc.color, 1f); + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.05f : 0f; - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EyeofOblivion")); - } - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CarbonSteel"), Main.rand.Next(2,15)); - } - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ToothofAbraxas"), Main.rand.Next(2,16)); - } - } - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.05f : 0f; + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 60; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 70, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - } - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - } - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 70, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3.7f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PhobosGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PhobosGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PhobosGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PhobosGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PhobosGore3"), 1f); - } - else - { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - } - } -} -}} \ No newline at end of file + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EyeofOblivion")); + } + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CarbonSteel"), Main.rand.Next(2, 15)); + } + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ToothofAbraxas"), Main.rand.Next(2, 16)); + } + } + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 60; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 70, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + } + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + } + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 70, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3.7f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PhobosGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PhobosGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PhobosGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PhobosGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PhobosGore3"), 1f); + } + else + { + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + } + } + } + } +} \ No newline at end of file diff --git a/NPCs/PixieQueen.cs b/NPCs/PixieQueen.cs index 6a64a4ce..d7be3371 100644 --- a/NPCs/PixieQueen.cs +++ b/NPCs/PixieQueen.cs @@ -7,794 +7,796 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - [AutoloadBossHead] -public class PixieQueen : ModNPC +namespace Tremor.NPCs { - #region "КонÑтанты" - const int AnimationRate = 8; // ЧаÑтота Ñмены кадров (То, Ñколько кадров не будет ÑменÑÑ‚ÑÑ ÐºÐ°Ð´Ñ€) - const int FrameCount = 4; // Кол-во кадров + [AutoloadBossHead] + public class PixieQueen : ModNPC + { + #region "КонÑтанты" + const int AnimationRate = 8; // ЧаÑтота Ñмены кадров (То, Ñколько кадров не будет ÑменÑÑ‚ÑÑ ÐºÐ°Ð´Ñ€) + const int FrameCount = 4; // Кол-во кадров + + const int ShootRate = 70; // ЧаÑтота выÑтрела. Будет производить 60/ShootRate выÑтрелов в Ñекунду + const int ShootDamage = 15; // Урон от выÑтрела + int ShootType = 100; // Тип выÑтрела (задаётÑÑ Ð² SetDefaults()) + const float ShootKnockback = 1; // ОтбраÑование от выÑтрела + const float ShootSpeed = 10; // СкороÑÑ‚ÑŒ выÑтрела - const int ShootRate = 70; // ЧаÑтота выÑтрела. Будет производить 60/ShootRate выÑтрелов в Ñекунду - const int ShootDamage = 15; // Урон от выÑтрела - int ShootType = 100; // Тип выÑтрела (задаётÑÑ Ð² SetDefaults()) - const float ShootKnockback = 1; // ОтбраÑование от выÑтрела - const float ShootSpeed = 10; // СкороÑÑ‚ÑŒ выÑтрела + const float DistortPercent = 0.15f; // Процент деформации Ñтатов (неточноÑти) (1.0 == 100%) - const float DistortPercent = 0.15f; // Процент деформации Ñтатов (неточноÑти) (1.0 == 100%) + const int MinionsID = 61; // ID вуртулек + const int MinionsCount = 4; // Кол-во вуртулек которых заÑпавнит - const int MinionsID = 61; // ID вуртулек - const int MinionsCount = 4; // Кол-во вуртулек которых заÑпавнит + const int StateTime_Flying = 600; // Сколько будет летать в воздухе до призыва миньонов + const int StateTime_Minions = 120; // Сколько времени будет Ñпавнить вуртулек - const int StateTime_Flying = 600; // Сколько будет летать в воздухе до призыва миньонов - const int StateTime_Minions = 120; // Сколько времени будет Ñпавнить вуртулек + const int FlyingAI = 2; + const int MinionsAI = 0; - const int FlyingAI = 2; - const int MinionsAI = 0; + const float MinionsState_XDeaccelerationPower = 0.05f; // СкороÑÑ‚ÑŒ Ð·Ð°Ð¼ÐµÐ´Ð»ÐµÐ½Ð¸Ñ Ð¿Ð¾ X + const float MinionsState_YMaxSpeed = 2.80f; // МакÑ. ÑкороÑÑ‚ÑŒ взлёта во Ð²Ñ€ÐµÐ¼Ñ Ñпавна миньонов + const float MinionsStete_YSpeedStep = 0.02f; // СкороÑÑ‚ÑŒ ÑƒÐ²ÐµÐ»Ð¸Ñ‡ÐµÐ½Ð¸Ñ ÑкороÑти по Y во Ð²Ñ€ÐµÐ¼Ñ Ñпавна миньонов - const float MinionsState_XDeaccelerationPower = 0.05f; // СкороÑÑ‚ÑŒ Ð·Ð°Ð¼ÐµÐ´Ð»ÐµÐ½Ð¸Ñ Ð¿Ð¾ X - const float MinionsState_YMaxSpeed = 2.80f; // МакÑ. ÑкороÑÑ‚ÑŒ взлёта во Ð²Ñ€ÐµÐ¼Ñ Ñпавна миньонов - const float MinionsStete_YSpeedStep = 0.02f; // СкороÑÑ‚ÑŒ ÑƒÐ²ÐµÐ»Ð¸Ñ‡ÐµÐ½Ð¸Ñ ÑкороÑти по Y во Ð²Ñ€ÐµÐ¼Ñ Ñпавна миньонов + const int States = 2; + #endregion + #region "Переменные" + int TimeToAnimation = AnimationRate; + int Frame = 0; + bool Shoots = true; + int TimeToShoot = ShootRate; + int State = 0; + int TimeToState = StateTime_Flying; + bool runAway = false; + #endregion + + int timer = 0; + int timer2 = 0; + int timer3 = 0; + int timer4 = 0; + bool SpawnMinion = false; + public static bool phase2 = false; + public static bool phase3 = false; - const int States = 2; - #endregion - #region "Переменные" - int TimeToAnimation = AnimationRate; - int Frame = 0; - bool Shoots = true; - int TimeToShoot = ShootRate; - int State = 0; - int TimeToState = StateTime_Flying; - bool runAway = false; - #endregion - int timer = 0; - int timer2 = 0; - int timer3 = 0; - int timer4 = 0; - bool SpawnMinion = false; - public static bool phase2 = false; - public static bool phase3 = false; - - public override void SetStaticDefaults() { DisplayName.SetDefault("Pixie Queen"); Main.npcFrameCount[npc.type] = 8; } - - - public override void SetDefaults() - { - npc.aiStyle = 63; - npc.lifeMax = 25000; - npc.damage = 80; - npc.defense = 35; - npc.knockBackResist = 0f; - //animationType = 75; - npc.width = 122; - npc.height = 122; - npc.value = Item.buyPrice(0, 10, 0, 0); - npc.npcSlots = 15f; - npc.boss = true; - npc.lavaImmune = true; - npc.noGravity = true; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit5; - npc.DeathSound = SoundID.NPCDeath7; - npc.buffImmune[24] = true; - music = 12; - bossBag = mod.ItemType("PixieQueenBag"); - } - - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 0.625f * bossLifeScale); - npc.damage = (int)(npc.damage * 0.6f); - } - public override void AI() - { - npc.TargetClosest(true); - npc.spriteDirection = npc.direction; - Player player = Main.player[npc.target]; - if (!player.active || player.dead) - { - npc.TargetClosest(false); - npc.velocity.Y = 50; - timer = 0; - timer2 = 0; - timer3 = 0; - timer4 = 0; - } - timer++; - if (timer <= 1000) - { - timer2++; - } - if (timer <= 1000) - { - timer3++; - } - if (timer >= 1000) - { - timer4++; - } - if (timer == 1500) + + public override void SetDefaults() { - timer = 0; + npc.aiStyle = 63; + npc.lifeMax = 25000; + npc.damage = 80; + npc.defense = 35; + npc.knockBackResist = 0f; + //animationType = 75; + npc.width = 122; + npc.height = 122; + npc.value = Item.buyPrice(0, 10, 0, 0); + npc.npcSlots = 15f; + npc.boss = true; + npc.lavaImmune = true; + npc.noGravity = true; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit5; + npc.DeathSound = SoundID.NPCDeath7; + npc.buffImmune[24] = true; + music = 12; + bossBag = mod.ItemType("PixieQueenBag"); } - if (timer >= 200 && timer <= 650) + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { - Shoot(); - npc.position += npc.velocity * 1.2f; + npc.lifeMax = (int)(npc.lifeMax * 0.625f * bossLifeScale); + npc.damage = (int)(npc.damage * 0.6f); } - if (timer >= 650 && timer <= 1000) + + public override void AI() { - Shoot(); - int currentLifeP2 = (int)(npc.lifeMax * (2 / 3)); - int currentLifeP3 = (int)(npc.lifeMax * (1 / 3)); - if (npc.life <= currentLifeP2) + npc.TargetClosest(true); + npc.spriteDirection = npc.direction; + Player player = Main.player[npc.target]; + if (!player.active || player.dead) { - phase2 = true; + npc.TargetClosest(false); + npc.velocity.Y = 50; + timer = 0; + timer2 = 0; + timer3 = 0; + timer4 = 0; } - if (npc.life <= currentLifeP3) + timer++; + if (timer <= 1000) { - phase3 = true; + timer2++; } - if (Main.rand.Next(300) == 0) + if (timer <= 1000) { - Main.PlaySound(29, (int)npc.position.X, (int)npc.position.Y, 35); + timer3++; } - //Player player = Main.player[npc.target]; - bool playerWet = player.wet; - //Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0f, 0.25f, 0.15f); - int num1038 = 0; - for (int num1039 = 0; num1039 < 255; num1039++) + if (timer >= 1000) { - if (Main.player[num1039].active && !Main.player[num1039].dead && (npc.Center - Main.player[num1039].Center).Length() < 1000f) - { - num1038++; - } + timer4++; } - if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active) + if (timer == 1500) { - npc.TargetClosest(true); + timer = 0; } - if (Main.player[npc.target].dead) + if (timer >= 200 && timer <= 650) { - npc.TargetClosest(false); - npc.velocity.Y = npc.velocity.Y + 1f; - if ((double)npc.position.Y > Main.worldSurface * 16.0) + Shoot(); + npc.position += npc.velocity * 1.2f; + } + if (timer >= 650 && timer <= 1000) + { + Shoot(); + int currentLifeP2 = (int)(npc.lifeMax * (2 / 3)); + int currentLifeP3 = (int)(npc.lifeMax * (1 / 3)); + if (npc.life <= currentLifeP2) { - npc.velocity.Y = npc.velocity.Y + 1f; + phase2 = true; } - if ((double)npc.position.Y > Main.rockLayer * 16.0) + if (npc.life <= currentLifeP3) { - for (int num957 = 0; num957 < 200; num957++) - { - if (Main.npc[num957].aiStyle == npc.aiStyle) - { - Main.npc[num957].active = false; - } - } + phase3 = true; } - } - else if (npc.ai[0] == -1f) - { - if (Main.netMode != 1) + if (Main.rand.Next(300) == 0) { - float num1041 = npc.ai[1]; - int num1042; - do - { - num1042 = Main.rand.Next(3); - if (num1042 == 1) - { - num1042 = 2; - } - else if (num1042 == 2) - { - num1042 = 3; - } - } - while ((float)num1042 == num1041); - npc.ai[0] = (float)num1042; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - return; + Main.PlaySound(29, (int)npc.position.X, (int)npc.position.Y, 35); } - } - else if (npc.ai[0] == 0f) - { - int num1043 = 2; //2 not a prob - if (npc.life < npc.lifeMax / 2) + //Player player = Main.player[npc.target]; + bool playerWet = player.wet; + //Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0f, 0.25f, 0.15f); + int num1038 = 0; + for (int num1039 = 0; num1039 < 255; num1039++) { - num1043++; + if (Main.player[num1039].active && !Main.player[num1039].dead && (npc.Center - Main.player[num1039].Center).Length() < 1000f) + { + num1038++; + } } - if (npc.life < npc.lifeMax / 3) + if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active) { - num1043++; + npc.TargetClosest(true); } - if (npc.life < npc.lifeMax / 5) + if (Main.player[npc.target].dead) { - num1043++; + npc.TargetClosest(false); + npc.velocity.Y = npc.velocity.Y + 1f; + if ((double)npc.position.Y > Main.worldSurface * 16.0) + { + npc.velocity.Y = npc.velocity.Y + 1f; + } + if ((double)npc.position.Y > Main.rockLayer * 16.0) + { + for (int num957 = 0; num957 < 200; num957++) + { + if (Main.npc[num957].aiStyle == npc.aiStyle) + { + Main.npc[num957].active = false; + } + } + } } - if (npc.ai[1] > (float)(2 * num1043) && npc.ai[1] % 2f == 0f) + else if (npc.ai[0] == -1f) { - npc.ai[0] = -1f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.netUpdate = true; - return; + if (Main.netMode != 1) + { + float num1041 = npc.ai[1]; + int num1042; + do + { + num1042 = Main.rand.Next(3); + if (num1042 == 1) + { + num1042 = 2; + } + else if (num1042 == 2) + { + num1042 = 3; + } + } + while ((float)num1042 == num1041); + npc.ai[0] = (float)num1042; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + return; + } } - if (npc.ai[1] % 2f == 0f) + else if (npc.ai[0] == 0f) { - npc.TargetClosest(true); - if (Math.Abs(npc.position.Y + (float)(npc.height / 2) - (Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2))) < 20f) + int num1043 = 2; //2 not a prob + if (npc.life < npc.lifeMax / 2) + { + num1043++; + } + if (npc.life < npc.lifeMax / 3) + { + num1043++; + } + if (npc.life < npc.lifeMax / 5) + { + num1043++; + } + if (npc.ai[1] > (float)(2 * num1043) && npc.ai[1] % 2f == 0f) { - npc.localAI[0] = 1f; - npc.ai[1] += 1f; + npc.ai[0] = -1f; + npc.ai[1] = 0f; npc.ai[2] = 0f; - float num1044 = 16f; //16 + npc.netUpdate = true; + return; + } + if (npc.ai[1] % 2f == 0f) + { + npc.TargetClosest(true); + if (Math.Abs(npc.position.Y + (float)(npc.height / 2) - (Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2))) < 20f) + { + npc.localAI[0] = 1f; + npc.ai[1] += 1f; + npc.ai[2] = 0f; + float num1044 = 16f; //16 + if ((double)npc.life < (double)npc.lifeMax * 0.75) + { + num1044 += 2f; //2 not a prob + } + if ((double)npc.life < (double)npc.lifeMax * 0.5) + { + num1044 += 2f; //2 not a prob + } + if ((double)npc.life < (double)npc.lifeMax * 0.25) + { + num1044 += 2f; //2 not a prob + } + if ((double)npc.life < (double)npc.lifeMax * 0.1) + { + num1044 += 2f; //2 not a prob + } + Vector2 vector117 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num1045 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector117.X; + float num1046 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector117.Y; + float num1047 = (float)Math.Sqrt((double)(num1045 * num1045 + num1046 * num1046)); + num1047 = num1044 / num1047; + npc.velocity.X = num1045 * num1047; + npc.velocity.Y = num1046 * num1047; + npc.spriteDirection = npc.direction; + Main.PlaySound(29, (int)npc.position.X, (int)npc.position.Y, 34); + return; + } + npc.localAI[0] = 0f; + float num1048 = 12f; //12 not a prob + float num1049 = 0.15f; //0.15 not a prob if ((double)npc.life < (double)npc.lifeMax * 0.75) { - num1044 += 2f; //2 not a prob + num1048 += 1f; //1 not a prob + num1049 += 0.05f; //0.05 not a prob } if ((double)npc.life < (double)npc.lifeMax * 0.5) { - num1044 += 2f; //2 not a prob + num1048 += 1f; //1 not a prob + num1049 += 0.05f; //0.05 not a prob } if ((double)npc.life < (double)npc.lifeMax * 0.25) { - num1044 += 2f; //2 not a prob + num1048 += 2f; //2 not a prob + num1049 += 0.05f; //0.05 not a prob } if ((double)npc.life < (double)npc.lifeMax * 0.1) { - num1044 += 2f; //2 not a prob + num1048 += 2f; //2 not a prob + num1049 += 0.1f; //0.1 not a prob + } + if (npc.position.Y + (float)(npc.height / 2) < Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2)) + { + npc.velocity.Y = npc.velocity.Y + num1049; + } + else + { + npc.velocity.Y = npc.velocity.Y - num1049; + } + if (npc.velocity.Y < -12f) + { + npc.velocity.Y = -num1048; + } + if (npc.velocity.Y > 12f) + { + npc.velocity.Y = num1048; + } + if (Math.Abs(npc.position.X + (float)(npc.width / 2) - (Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2))) > 600f) + { + npc.velocity.X = npc.velocity.X + 0.15f * (float)npc.direction; + } + else if (Math.Abs(npc.position.X + (float)(npc.width / 2) - (Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2))) < 300f) + { + npc.velocity.X = npc.velocity.X - 0.15f * (float)npc.direction; + } + else + { + npc.velocity.X = npc.velocity.X * 0.8f; + } + if (npc.velocity.X < -16f) + { + npc.velocity.X = -16f; + } + if (npc.velocity.X > 16f) + { + npc.velocity.X = 16f; } - Vector2 vector117 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num1045 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector117.X; - float num1046 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector117.Y; - float num1047 = (float)Math.Sqrt((double)(num1045 * num1045 + num1046 * num1046)); - num1047 = num1044 / num1047; - npc.velocity.X = num1045 * num1047; - npc.velocity.Y = num1046 * num1047; npc.spriteDirection = npc.direction; - Main.PlaySound(29, (int)npc.position.X, (int)npc.position.Y, 34); return; } - npc.localAI[0] = 0f; - float num1048 = 12f; //12 not a prob - float num1049 = 0.15f; //0.15 not a prob - if ((double)npc.life < (double)npc.lifeMax * 0.75) - { - num1048 += 1f; //1 not a prob - num1049 += 0.05f; //0.05 not a prob - } - if ((double)npc.life < (double)npc.lifeMax * 0.5) - { - num1048 += 1f; //1 not a prob - num1049 += 0.05f; //0.05 not a prob - } - if ((double)npc.life < (double)npc.lifeMax * 0.25) - { - num1048 += 2f; //2 not a prob - num1049 += 0.05f; //0.05 not a prob - } - if ((double)npc.life < (double)npc.lifeMax * 0.1) - { - num1048 += 2f; //2 not a prob - num1049 += 0.1f; //0.1 not a prob - } - if (npc.position.Y + (float)(npc.height / 2) < Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2)) - { - npc.velocity.Y = npc.velocity.Y + num1049; - } - else - { - npc.velocity.Y = npc.velocity.Y - num1049; - } - if (npc.velocity.Y < -12f) - { - npc.velocity.Y = -num1048; - } - if (npc.velocity.Y > 12f) - { - npc.velocity.Y = num1048; - } - if (Math.Abs(npc.position.X + (float)(npc.width / 2) - (Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2))) > 600f) - { - npc.velocity.X = npc.velocity.X + 0.15f * (float)npc.direction; - } - else if (Math.Abs(npc.position.X + (float)(npc.width / 2) - (Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2))) < 300f) - { - npc.velocity.X = npc.velocity.X - 0.15f * (float)npc.direction; - } - else - { - npc.velocity.X = npc.velocity.X * 0.8f; - } - if (npc.velocity.X < -16f) - { - npc.velocity.X = -16f; - } - if (npc.velocity.X > 16f) - { - npc.velocity.X = 16f; - } - npc.spriteDirection = npc.direction; - return; - } - else - { - if (npc.velocity.X < 0f) - { - npc.direction = -1; - } - else - { - npc.direction = 1; - } - npc.spriteDirection = npc.direction; - int num1050 = 600; //600 not a prob - if (!playerWet) - { - num1050 = 350; - } else { - num1050 = 600; - if ((double)npc.life < (double)npc.lifeMax * 0.1) + if (npc.velocity.X < 0f) { - num1050 = 800; //300 not a prob + npc.direction = -1; } - else if ((double)npc.life < (double)npc.lifeMax * 0.25) + else { - num1050 = 750; //450 not a prob + npc.direction = 1; } - else if ((double)npc.life < (double)npc.lifeMax * 0.5) + npc.spriteDirection = npc.direction; + int num1050 = 600; //600 not a prob + if (!playerWet) { - num1050 = 700; //500 not a prob + num1050 = 350; } - else if ((double)npc.life < (double)npc.lifeMax * 0.75) + else { - num1050 = 650; //550 not a prob + num1050 = 600; + if ((double)npc.life < (double)npc.lifeMax * 0.1) + { + num1050 = 800; //300 not a prob + } + else if ((double)npc.life < (double)npc.lifeMax * 0.25) + { + num1050 = 750; //450 not a prob + } + else if ((double)npc.life < (double)npc.lifeMax * 0.5) + { + num1050 = 700; //500 not a prob + } + else if ((double)npc.life < (double)npc.lifeMax * 0.75) + { + num1050 = 650; //550 not a prob + } + } + int num1051 = 1; + if (npc.position.X + (float)(npc.width / 2) < Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2)) + { + num1051 = -1; + } + if (npc.direction == num1051 && Math.Abs(npc.position.X + (float)(npc.width / 2) - (Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2))) > (float)num1050) + { + npc.ai[2] = 1f; + } + if (npc.ai[2] != 1f) + { + npc.localAI[0] = 1f; + return; + } + npc.TargetClosest(true); + npc.spriteDirection = npc.direction; + npc.localAI[0] = 0f; + npc.velocity *= 0.9f; + float num1052 = 0.1f; //0.1 + if (npc.life < npc.lifeMax / 2) + { + npc.velocity *= 0.9f; + num1052 += 0.05f; //0.05 + } + if (npc.life < npc.lifeMax / 3) + { + npc.velocity *= 0.9f; + num1052 += 0.05f; //0.05 + } + if (npc.life < npc.lifeMax / 5) + { + npc.velocity *= 0.9f; + num1052 += 0.05f; //0.05 + } + if (Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y) < num1052) + { + npc.ai[2] = 0f; + npc.ai[1] += 1f; + return; } } - int num1051 = 1; - if (npc.position.X + (float)(npc.width / 2) < Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2)) - { - num1051 = -1; - } - if (npc.direction == num1051 && Math.Abs(npc.position.X + (float)(npc.width / 2) - (Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2))) > (float)num1050) - { - npc.ai[2] = 1f; - } - if (npc.ai[2] != 1f) - { - npc.localAI[0] = 1f; - return; - } + } + else if (npc.ai[0] == 2f) + { npc.TargetClosest(true); npc.spriteDirection = npc.direction; - npc.localAI[0] = 0f; - npc.velocity *= 0.9f; - float num1052 = 0.1f; //0.1 - if (npc.life < npc.lifeMax / 2) + float num1053 = 12f; //12 found one! dictates speed during bee spawn + float num1054 = 0.1f; //0.1 found one! dictates speed during bee spawn + Vector2 vector118 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num1055 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector118.X; + float num1056 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - 200f - vector118.Y; + float num1057 = (float)Math.Sqrt((double)(num1055 * num1055 + num1056 * num1056)); + if (num1057 < 800f) + { + npc.ai[0] = 1f; + npc.ai[1] = 0f; + npc.netUpdate = true; + return; + } + num1057 = num1053 / num1057; + if (npc.velocity.X < num1055) { - npc.velocity *= 0.9f; - num1052 += 0.05f; //0.05 + npc.velocity.X = npc.velocity.X + num1054; + if (npc.velocity.X < 0f && num1055 > 0f) + { + npc.velocity.X = npc.velocity.X + num1054; + } } - if (npc.life < npc.lifeMax / 3) + else if (npc.velocity.X > num1055) { - npc.velocity *= 0.9f; - num1052 += 0.05f; //0.05 + npc.velocity.X = npc.velocity.X - num1054; + if (npc.velocity.X > 0f && num1055 < 0f) + { + npc.velocity.X = npc.velocity.X - num1054; + } } - if (npc.life < npc.lifeMax / 5) + if (npc.velocity.Y < num1056) { - npc.velocity *= 0.9f; - num1052 += 0.05f; //0.05 + npc.velocity.Y = npc.velocity.Y + num1054; + if (npc.velocity.Y < 0f && num1056 > 0f) + { + npc.velocity.Y = npc.velocity.Y + num1054; + return; + } } - if (Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y) < num1052) + else if (npc.velocity.Y > num1056) { - npc.ai[2] = 0f; - npc.ai[1] += 1f; - return; + npc.velocity.Y = npc.velocity.Y - num1054; + if (npc.velocity.Y > 0f && num1056 < 0f) + { + npc.velocity.Y = npc.velocity.Y - num1054; + return; + } } } - } - else if (npc.ai[0] == 2f) - { - npc.TargetClosest(true); - npc.spriteDirection = npc.direction; - float num1053 = 12f; //12 found one! dictates speed during bee spawn - float num1054 = 0.1f; //0.1 found one! dictates speed during bee spawn - Vector2 vector118 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num1055 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector118.X; - float num1056 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - 200f - vector118.Y; - float num1057 = (float)Math.Sqrt((double)(num1055 * num1055 + num1056 * num1056)); - if (num1057 < 800f) - { - npc.ai[0] = 1f; - npc.ai[1] = 0f; - npc.netUpdate = true; - return; - } - num1057 = num1053 / num1057; - if (npc.velocity.X < num1055) + else if (npc.ai[0] == 1f) { - npc.velocity.X = npc.velocity.X + num1054; - if (npc.velocity.X < 0f && num1055 > 0f) + npc.localAI[0] = 0f; + npc.TargetClosest(true); + Vector2 vector119 = new Vector2(npc.position.X + (float)(npc.width / 2) + (float)(Main.rand.Next(20) * npc.direction), npc.position.Y + (float)npc.height * 0.8f); + Vector2 vector120 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num1058 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector120.X; + float num1059 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector120.Y; + float num1060 = (float)Math.Sqrt((double)(num1058 * num1058 + num1059 * num1059)); + npc.ai[1] += 1f; + npc.ai[1] += (float)(num1038 / 2); + if ((double)npc.life < (double)npc.lifeMax * 0.75) { - npc.velocity.X = npc.velocity.X + num1054; + npc.ai[1] += 0.25f; //0.25 not a prob } - } - else if (npc.velocity.X > num1055) - { - npc.velocity.X = npc.velocity.X - num1054; - if (npc.velocity.X > 0f && num1055 < 0f) + if ((double)npc.life < (double)npc.lifeMax * 0.5) { - npc.velocity.X = npc.velocity.X - num1054; + npc.ai[1] += 0.25f; //0.25 not a prob } - } - if (npc.velocity.Y < num1056) - { - npc.velocity.Y = npc.velocity.Y + num1054; - if (npc.velocity.Y < 0f && num1056 > 0f) + if ((double)npc.life < (double)npc.lifeMax * 0.25) { - npc.velocity.Y = npc.velocity.Y + num1054; - return; + npc.ai[1] += 0.25f; //0.25 not a prob } - } - else if (npc.velocity.Y > num1056) - { - npc.velocity.Y = npc.velocity.Y - num1054; - if (npc.velocity.Y > 0f && num1056 < 0f) + if ((double)npc.life < (double)npc.lifeMax * 0.1) { - npc.velocity.Y = npc.velocity.Y - num1054; - return; + npc.ai[1] += 0.25f; //0.25 not a prob } - } - } - else if (npc.ai[0] == 1f) - { - npc.localAI[0] = 0f; - npc.TargetClosest(true); - Vector2 vector119 = new Vector2(npc.position.X + (float)(npc.width / 2) + (float)(Main.rand.Next(20) * npc.direction), npc.position.Y + (float)npc.height * 0.8f); - Vector2 vector120 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num1058 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector120.X; - float num1059 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector120.Y; - float num1060 = (float)Math.Sqrt((double)(num1058 * num1058 + num1059 * num1059)); - npc.ai[1] += 1f; - npc.ai[1] += (float)(num1038 / 2); - if ((double)npc.life < (double)npc.lifeMax * 0.75) - { - npc.ai[1] += 0.25f; //0.25 not a prob - } - if ((double)npc.life < (double)npc.lifeMax * 0.5) - { - npc.ai[1] += 0.25f; //0.25 not a prob - } - if ((double)npc.life < (double)npc.lifeMax * 0.25) - { - npc.ai[1] += 0.25f; //0.25 not a prob - } - if ((double)npc.life < (double)npc.lifeMax * 0.1) - { - npc.ai[1] += 0.25f; //0.25 not a prob - } - bool flag103 = false; - if (npc.ai[1] > 40f) //changed from 40 not a prob - { - npc.ai[1] = 0f; - npc.ai[2] += 1f; - flag103 = true; - } - if (Collision.CanHit(vector119, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height) && flag103) - { - Main.PlaySound(3, (int)npc.position.X, (int)npc.position.Y, 25); - if (Main.netMode != 1) + bool flag103 = false; + if (npc.ai[1] > 40f) //changed from 40 not a prob { - int num1061; - if (Main.rand.Next(4) == 0) - { - num1061 = mod.NPCType("AquaticAberration"); //Aquatic entity spawns - } - else + npc.ai[1] = 0f; + npc.ai[2] += 1f; + flag103 = true; + } + if (Collision.CanHit(vector119, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height) && flag103) + { + Main.PlaySound(3, (int)npc.position.X, (int)npc.position.Y, 25); + if (Main.netMode != 1) { - num1061 = mod.NPCType("Parasea"); + int num1061; + if (Main.rand.Next(4) == 0) + { + num1061 = mod.NPCType("AquaticAberration"); //Aquatic entity spawns + } + else + { + num1061 = mod.NPCType("Parasea"); + } + int num1062 = NPC.NewNPC((int)vector119.X, (int)vector119.Y, num1061, 0, 0f, 0f, 0f, 0f, 255); + Main.npc[num1062].velocity.X = (float)Main.rand.Next(-200, 201) * 0.01f; + Main.npc[num1062].velocity.Y = (float)Main.rand.Next(-200, 201) * 0.01f; + Main.npc[num1062].localAI[0] = 60f; + Main.npc[num1062].netUpdate = true; } - int num1062 = NPC.NewNPC((int)vector119.X, (int)vector119.Y, num1061, 0, 0f, 0f, 0f, 0f, 255); - Main.npc[num1062].velocity.X = (float)Main.rand.Next(-200, 201) * 0.01f; - Main.npc[num1062].velocity.Y = (float)Main.rand.Next(-200, 201) * 0.01f; - Main.npc[num1062].localAI[0] = 60f; - Main.npc[num1062].netUpdate = true; } - } - if (num1060 > 400f || !Collision.CanHit(new Vector2(vector119.X, vector119.Y - 30f), 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) - { - float num1063 = 14f; //changed from 14 not a prob - float num1064 = 0.1f; //changed from 0.1 not a prob - vector120 = vector119; - num1058 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector120.X; - num1059 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector120.Y; - num1060 = (float)Math.Sqrt((double)(num1058 * num1058 + num1059 * num1059)); - num1060 = num1063 / num1060; - if (npc.velocity.X < num1058) + if (num1060 > 400f || !Collision.CanHit(new Vector2(vector119.X, vector119.Y - 30f), 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { - npc.velocity.X = npc.velocity.X + num1064; - if (npc.velocity.X < 0f && num1058 > 0f) + float num1063 = 14f; //changed from 14 not a prob + float num1064 = 0.1f; //changed from 0.1 not a prob + vector120 = vector119; + num1058 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector120.X; + num1059 = Main.player[npc.target].position.Y + (float)(Main.player[npc.target].height / 2) - vector120.Y; + num1060 = (float)Math.Sqrt((double)(num1058 * num1058 + num1059 * num1059)); + num1060 = num1063 / num1060; + if (npc.velocity.X < num1058) { npc.velocity.X = npc.velocity.X + num1064; + if (npc.velocity.X < 0f && num1058 > 0f) + { + npc.velocity.X = npc.velocity.X + num1064; + } } - } - else if (npc.velocity.X > num1058) - { - npc.velocity.X = npc.velocity.X - num1064; - if (npc.velocity.X > 0f && num1058 < 0f) + else if (npc.velocity.X > num1058) { npc.velocity.X = npc.velocity.X - num1064; + if (npc.velocity.X > 0f && num1058 < 0f) + { + npc.velocity.X = npc.velocity.X - num1064; + } } - } - if (npc.velocity.Y < num1059) - { - npc.velocity.Y = npc.velocity.Y + num1064; - if (npc.velocity.Y < 0f && num1059 > 0f) + if (npc.velocity.Y < num1059) { npc.velocity.Y = npc.velocity.Y + num1064; + if (npc.velocity.Y < 0f && num1059 > 0f) + { + npc.velocity.Y = npc.velocity.Y + num1064; + } } - } - else if (npc.velocity.Y > num1059) - { - npc.velocity.Y = npc.velocity.Y - num1064; - if (npc.velocity.Y > 0f && num1059 < 0f) + else if (npc.velocity.Y > num1059) { npc.velocity.Y = npc.velocity.Y - num1064; + if (npc.velocity.Y > 0f && num1059 < 0f) + { + npc.velocity.Y = npc.velocity.Y - num1064; + } } } + else + { + npc.velocity *= 0.9f; + } + npc.spriteDirection = npc.direction; + if (npc.ai[2] > 3f) + { + npc.ai[0] = -1f; + npc.ai[1] = 1f; + npc.netUpdate = true; + return; + } } - else - { - npc.velocity *= 0.9f; - } - npc.spriteDirection = npc.direction; - if (npc.ai[2] > 3f) + } + if (timer >= 1000 && timer <= 1250) + { + Shoot(); + npc.ai[0]++; + if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active) { - npc.ai[0] = -1f; - npc.ai[1] = 1f; - npc.netUpdate = true; - return; + npc.TargetClosest(true); } - } - } - if (timer >= 1000 && timer <= 1250) - { - Shoot(); - npc.ai[0]++; - if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active) - { - npc.TargetClosest(true); - } - npc.netUpdate = true; - npc.ai[1]++; - if (npc.ai[1] >= 100 && npc.ai[1] < 200) - { - if (Main.rand.Next(10) == 0) + npc.netUpdate = true; + npc.ai[1]++; + if (npc.ai[1] >= 100 && npc.ai[1] < 200) { - npc.velocity.X *= 5.00f; - npc.velocity.Y *= 5.00f; - Vector2 vector8 = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height * 0.5f)); + if (Main.rand.Next(10) == 0) { - float rotation = (float)Math.Atan2((vector8.Y) - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), (vector8.X) - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); - npc.velocity.X = (float)(Math.Cos(rotation) * 12) * -1; - npc.velocity.Y = (float)(Math.Sin(rotation) * 12) * -1; + npc.velocity.X *= 5.00f; + npc.velocity.Y *= 5.00f; + Vector2 vector8 = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height * 0.5f)); + { + float rotation = (float)Math.Atan2((vector8.Y) - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), (vector8.X) - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); + npc.velocity.X = (float)(Math.Cos(rotation) * 12) * -1; + npc.velocity.Y = (float)(Math.Sin(rotation) * 12) * -1; + } + return; } - return; } - } - if (npc.ai[1] >= 280 && npc.ai[1] < 320) - { - if (Main.rand.Next(5) == 0) + if (npc.ai[1] >= 280 && npc.ai[1] < 320) { - npc.velocity.X *= 10.00f; - npc.velocity.Y *= 10.00f; - Vector2 vector8 = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height * 0.5f)); + if (Main.rand.Next(5) == 0) { - float rotation = (float)Math.Atan2((vector8.Y) - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), (vector8.X) - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); - npc.velocity.X = (float)(Math.Cos(rotation) * 12) * -1; - npc.velocity.Y = (float)(Math.Sin(rotation) * 12) * -1; + npc.velocity.X *= 10.00f; + npc.velocity.Y *= 10.00f; + Vector2 vector8 = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height * 0.5f)); + { + float rotation = (float)Math.Atan2((vector8.Y) - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), (vector8.X) - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); + npc.velocity.X = (float)(Math.Cos(rotation) * 12) * -1; + npc.velocity.Y = (float)(Math.Sin(rotation) * 12) * -1; + } + return; } - return; } - } - if(npc.ai[1] >= 450) + if (npc.ai[1] >= 450) + { + npc.ai[1] = 0; + } + } + if (timer >= 1250) { - npc.ai[1] = 0; + npc.velocity.Y = 0; + npc.velocity.X = 0; + npc.rotation = 0f; + if (Main.rand.Next(70) == 0) + { + NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("PixieQueenGuardian")); + } } } - if (timer >= 1250) + + public override void OnHitPlayer(Player player, int damage, bool crit) { - npc.velocity.Y = 0; - npc.velocity.X = 0; - npc.rotation = 0f; - if (Main.rand.Next(70) == 0) + if (Main.rand.Next(1) == 0) { - NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("PixieQueenGuardian")); + player.AddBuff(BuffID.Confused, 60, true); } - } - } - - public override void OnHitPlayer(Player player, int damage, bool crit) - { - if(Main.rand.Next(1) == 0) - { - player.AddBuff(BuffID.Confused, 60, true); - } - if(Main.rand.Next(1) == 0) - { - player.AddBuff(BuffID.Slow, 60, true); - } - - if(Main.rand.Next(3) == 0) - { - player.AddBuff(BuffID.Cursed, 60, true); - } - } - - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } + if (Main.rand.Next(1) == 0) + { + player.AddBuff(BuffID.Slow, 60, true); + } - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("NPCs/PixieQueenGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("NPCs/PixieQueenGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("NPCs/PixieQueenGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("NPCs/PixieQueenGore4"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("NPCs/PixieQueenGore5"), 1f); - } - } - - public override void FindFrame(int frameHeight) - { - int frameWidth = 122; - npc.spriteDirection = npc.direction; + if (Main.rand.Next(3) == 0) + { + player.AddBuff(BuffID.Cursed, 60, true); + } + } - //ЗдеÑÑŒ делаетÑÑ Ð¿Ñ€Ð¾Ñ†ÐµÑÑ: - npc.frameCounter++; - if (npc.frameCounter >= 4) + public override void HitEffect(int hitDirection, double damage) { - if (timer > 200 && timer < 1250) + if (npc.life <= 0) { - npc.frame.Y += 122; - if (npc.frame.Y >= 976) + for (int k = 0; k < 20; k++) { - npc.frame.Y = 0; - npc.frame.X = (npc.frame.X + (frameWidth * 2)) % (3 * frameWidth); + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); } + + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("NPCs/PixieQueenGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("NPCs/PixieQueenGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("NPCs/PixieQueenGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("NPCs/PixieQueenGore4"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("NPCs/PixieQueenGore5"), 1f); } - if (timer <= 200) + } + + public override void FindFrame(int frameHeight) + { + int frameWidth = 122; + npc.spriteDirection = npc.direction; + + //ЗдеÑÑŒ делаетÑÑ Ð¿Ñ€Ð¾Ñ†ÐµÑÑ: + npc.frameCounter++; + if (npc.frameCounter >= 4) { - npc.frame.Y += 122; - if (npc.frame.Y >= 976) + if (timer > 200 && timer < 1250) { - npc.frame.Y = 0; - npc.frame.X = 0; + npc.frame.Y += 122; + if (npc.frame.Y >= 976) + { + npc.frame.Y = 0; + npc.frame.X = (npc.frame.X + (frameWidth * 2)) % (3 * frameWidth); + } } - } - if (timer >= 1250) - { - npc.frame.Y += 122; - if (npc.frame.Y >= 976) + if (timer <= 200) { - npc.frame.Y = 0; - npc.frame.X = (npc.frame.X + frameWidth) % (2 * frameWidth); - ///SpawnMinion = false; + npc.frame.Y += 122; + if (npc.frame.Y >= 976) + { + npc.frame.Y = 0; + npc.frame.X = 0; + } + } + if (timer >= 1250) + { + npc.frame.Y += 122; + if (npc.frame.Y >= 976) + { + npc.frame.Y = 0; + npc.frame.X = (npc.frame.X + frameWidth) % (2 * frameWidth); + ///SpawnMinion = false; + } } + npc.frameCounter = 0; } - npc.frameCounter = 0; - } - npc.frame.Width = frameWidth; - } + npc.frame.Width = frameWidth; + } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Texture2D drawTexture = Main.npcTexture[npc.type]; - Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D drawTexture = Main.npcTexture[npc.type]; + Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); - Vector2 drawPos = new Vector2( - npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, - npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); + Vector2 drawPos = new Vector2( + npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, + npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); - SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, 0f, origin, npc.scale, effects, 0); + SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, 0f, origin, npc.scale, effects, 0); + + return false; + } - return false; - } - - void Shoot() - { - if (!Shoots && npc.target < 0) //еÑли не Ð²Ñ€ÐµÐ¼Ñ Ð´Ð»Ñ Ð½Ðµ Ñтрельбы, то вырубаем автоматом - return; - if (--TimeToShoot > 0) //еÑли таймер меньше нулÑ, то вырубаем автоматом - return; - TimeToShoot = (int)Helper.DistortFloat(ShootRate, DistortPercent); //уÑтанавливаем чаÑтоту выÑтрела - for (int i = 0; i < ((Main.expertMode) ? 4 : 2); i++) //в цикле указываем кол-во перьев при выÑтреле - { + void Shoot() + { + if (!Shoots && npc.target < 0) //еÑли не Ð²Ñ€ÐµÐ¼Ñ Ð´Ð»Ñ Ð½Ðµ Ñтрельбы, то вырубаем автоматом + return; + if (--TimeToShoot > 0) //еÑли таймер меньше нулÑ, то вырубаем автоматом + return; + TimeToShoot = (int)Helper.DistortFloat(ShootRate, DistortPercent); //уÑтанавливаем чаÑтоту выÑтрела + for (int i = 0; i < ((Main.expertMode) ? 4 : 2); i++) //в цикле указываем кол-во перьев при выÑтреле + { Player player = Main.player[Main.myPlayer]; Vector2 position1 = player.Center; - Vector2 vector2 = new Vector2(player.position.X +75f *(float)Math.Cos(12), player.position.Y + 1075f * (float)Math.Sin(12)); - Vector2 Velocity = Helper.VelocityToPoint(vector2, Helper.RandomPointInArea(new Vector2(Main.player[npc.target].Center.X - 10, Main.player[npc.target].Center.Y - 10), new Vector2(Main.player[npc.target].Center.X + 20, Main.player[npc.target].Center.Y + 20)), ShootSpeed); //здеÑÑŒ уÑтанавливаем позиции (здеÑÑŒ от перÑа в плеера) - int Proj = Projectile.NewProjectile(vector2.X, vector2.Y, Velocity.X, Velocity.Y, 671, (int)Helper.DistortFloat(ShootDamage, DistortPercent), Helper.DistortFloat(ShootKnockback, DistortPercent)); //подтверждаем вÑе выше дейÑтвие: от перÑа к мобу, от моба к перÑу (второе выÑтрел) - //Main.projectile[Proj].Center = npc.Center; + Vector2 vector2 = new Vector2(player.position.X + 75f * (float)Math.Cos(12), player.position.Y + 1075f * (float)Math.Sin(12)); + Vector2 Velocity = Helper.VelocityToPoint(vector2, Helper.RandomPointInArea(new Vector2(Main.player[npc.target].Center.X - 10, Main.player[npc.target].Center.Y - 10), new Vector2(Main.player[npc.target].Center.X + 20, Main.player[npc.target].Center.Y + 20)), ShootSpeed); //здеÑÑŒ уÑтанавливаем позиции (здеÑÑŒ от перÑа в плеера) + int Proj = Projectile.NewProjectile(vector2.X, vector2.Y, Velocity.X, Velocity.Y, 671, (int)Helper.DistortFloat(ShootDamage, DistortPercent), Helper.DistortFloat(ShootKnockback, DistortPercent)); //подтверждаем вÑе выше дейÑтвие: от перÑа к мобу, от моба к перÑу (второе выÑтрел) + //Main.projectile[Proj].Center = npc.Center; Main.projectile[Proj].friendly = false; Main.projectile[Proj].damage = npc.damage; - } - } - - public static Vector2 VelocityToPoint2(Vector2 A, Vector2 B, float Speed) - { - Vector2 Move = (B - A); - return Move * (Speed / (float)Math.Sqrt(Move.X * Move.X + Move.Y * Move.Y)); - } + } + } - public override void NPCLoot() - { - if(Main.expertMode) - { - npc.DropBossBags(); - } - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; + public static Vector2 VelocityToPoint2(Vector2 A, Vector2 B, float Speed) + { + Vector2 Move = (B - A); + return Move * (Speed / (float)Math.Sqrt(Move.X * Move.X + Move.Y * Move.Y)); + } - if(!Main.expertMode && Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PixieQueenMask")); - } - if(!Main.expertMode && Main.rand.Next(6) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EtherealFeather")); - } - if(!Main.expertMode && Main.rand.Next(6) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PixiePulse")); - } - if(!Main.expertMode && Main.rand.Next(6) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HeartMagnet")); - } - if(!Main.expertMode && Main.rand.Next(6) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DopelgangerCandle")); - } - if(Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PixieQueenTrophy")); - } - if(!Main.expertMode && Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ChaosBar"), Main.rand.Next(25,30)); - } - TremorWorld.downedPixieQueen = true; - } - } -}} \ No newline at end of file + public override void NPCLoot() + { + if (Main.expertMode) + { + npc.DropBossBags(); + } + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + + if (!Main.expertMode && Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PixieQueenMask")); + } + if (!Main.expertMode && Main.rand.Next(6) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("EtherealFeather")); + } + if (!Main.expertMode && Main.rand.Next(6) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PixiePulse")); + } + if (!Main.expertMode && Main.rand.Next(6) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HeartMagnet")); + } + if (!Main.expertMode && Main.rand.Next(6) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DopelgangerCandle")); + } + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PixieQueenTrophy")); + } + if (!Main.expertMode && Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ChaosBar"), Main.rand.Next(25, 30)); + } + TremorWorld.downedPixieQueen = true; + } + } + } +} \ No newline at end of file diff --git a/NPCs/PixieQueenGuardian.cs b/NPCs/PixieQueenGuardian.cs index b15a8791..d7b305a8 100644 --- a/NPCs/PixieQueenGuardian.cs +++ b/NPCs/PixieQueenGuardian.cs @@ -5,82 +5,84 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class PixieQueenGuardian : ModNPC +namespace Tremor.NPCs { + + public class PixieQueenGuardian : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Pixie Queen Guardian"); Main.npcFrameCount[npc.type] = 6; } - - public override void SetDefaults() - { - npc.lifeMax = 200; - npc.damage = 75; - npc.defense = 25; - npc.knockBackResist = 0f; - npc.width = 28; - npc.height = 30; - animationType = 116; - npc.aiStyle = 44; - npc.npcSlots = 15f; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit5; - npc.DeathSound = SoundID.NPCDeath7; - npc.noGravity = true; - npc.value = Item.buyPrice(0, 0, 0, 9); - } + + public override void SetDefaults() + { + npc.lifeMax = 200; + npc.damage = 75; + npc.defense = 25; + npc.knockBackResist = 0f; + npc.width = 28; + npc.height = 30; + animationType = 116; + npc.aiStyle = 44; + npc.npcSlots = 15f; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit5; + npc.DeathSound = SoundID.NPCDeath7; + npc.noGravity = true; + npc.value = Item.buyPrice(0, 0, 0, 9); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 57, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + } + } - public override void OnHitPlayer(Player player, int damage, bool crit) - { - if(Main.rand.Next(3) == 0) - { - player.AddBuff(BuffID.Confused, 1800, true); - } + public override void OnHitPlayer(Player player, int damage, bool crit) + { + if (Main.rand.Next(3) == 0) + { + player.AddBuff(BuffID.Confused, 1800, true); + } - if(Main.rand.Next(2) == 0) - { - player.AddBuff(BuffID.Slow, 1800, true); - } - } + if (Main.rand.Next(2) == 0) + { + player.AddBuff(BuffID.Slow, 1800, true); + } + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Texture2D drawTexture = Main.npcTexture[npc.type]; - Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D drawTexture = Main.npcTexture[npc.type]; + Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); - Vector2 drawPos = new Vector2( - npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, - npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); + Vector2 drawPos = new Vector2( + npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, + npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); - SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, 0f, origin, npc.scale, effects, 0); + SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, 0f, origin, npc.scale, effects, 0); - return false; - } -}} \ No newline at end of file + return false; + } + } +} \ No newline at end of file diff --git a/NPCs/PlagueSoul.cs b/NPCs/PlagueSoul.cs index 8cb44058..60d167d7 100644 --- a/NPCs/PlagueSoul.cs +++ b/NPCs/PlagueSoul.cs @@ -6,18 +6,19 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class PlagueSoul : ModNPC +namespace Tremor.NPCs { + + public class PlagueSoul : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Plague Soul"); Main.npcFrameCount[npc.type] = 6; } - - public override void SetDefaults() - { + + public override void SetDefaults() + { npc.width = 40; npc.height = 24; npc.damage = 41; @@ -27,37 +28,38 @@ public override void SetDefaults() npc.DeathSound = SoundID.NPCDeath55; npc.knockBackResist = 0f; aiType = 472; - npc.noGravity = true; - npc.aiStyle = 86; + npc.noGravity = true; + npc.aiStyle = 86; animationType = 472; - } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 60; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - } - else - { + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 60; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + } + else + { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 27, (float)hitDirection, -2f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } - } + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 27, (float)hitDirection, -2f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, (float)hitDirection, -1f, 0, default(Color), 0.7f); + } + } + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/Polaris.cs b/NPCs/Polaris.cs index 80d7220f..ce2846ef 100644 --- a/NPCs/Polaris.cs +++ b/NPCs/Polaris.cs @@ -6,89 +6,91 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Polaris : ModNPC +namespace Tremor.NPCs { + + public class Polaris : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Polaris"); Main.npcFrameCount[npc.type] = 10; } - public override void SetDefaults() - { - npc.lifeMax = 125; - npc.damage = 20; - npc.defense = 12; - npc.knockBackResist = 0.4f; - npc.width = 56; - npc.height = 48; - aiType = 429; - animationType = 429; - npc.aiStyle = 3; - npc.npcSlots = 0.2f; - npc.HitSound = SoundID.NPCHit37; - npc.DeathSound = SoundID.NPCDeath57; - npc.value = Item.buyPrice(0, 0, 6, 9); - banner = npc.type; - bannerItem = mod.ItemType("PolarisBanner"); - } + public override void SetDefaults() + { + npc.lifeMax = 125; + npc.damage = 20; + npc.defense = 12; + npc.knockBackResist = 0.4f; + npc.width = 56; + npc.height = 48; + aiType = 429; + animationType = 429; + npc.aiStyle = 3; + npc.npcSlots = 0.2f; + npc.HitSound = SoundID.NPCHit37; + npc.DeathSound = SoundID.NPCDeath57; + npc.value = Item.buyPrice(0, 0, 6, 9); + banner = npc.type; + bannerItem = mod.ItemType("PolarisBanner"); + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FrostFreshness")); - }; - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FrostCore")); - }; - if(NPC.downedMoonlord && Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); - } - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FrostFreshness")); + }; + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FrostCore")); + }; + if (NPC.downedMoonlord && Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); + } + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.8f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PolarisGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PolarisGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PolarisGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PolarisGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PolarisGore3"), 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2f); - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.8f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PolarisGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PolarisGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PolarisGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PolarisGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PolarisGore3"), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2f); + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); - } -} + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && Main.cloudAlpha > 0f && y < Main.worldSurface && spawnInfo.player.ZoneSnow ? 0.03f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && Main.cloudAlpha > 0f && y < Main.worldSurface && spawnInfo.player.ZoneSnow ? 0.03f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/PossessedHornet1.cs b/NPCs/PossessedHornet1.cs index 7bc295ba..7be77a13 100644 --- a/NPCs/PossessedHornet1.cs +++ b/NPCs/PossessedHornet1.cs @@ -5,75 +5,77 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class PossessedHornet1 : ModNPC +namespace Tremor.NPCs { + + public class PossessedHornet1 : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Possessed Hornet"); Main.npcFrameCount[npc.type] = 2; } - - public override void SetDefaults() - { - npc.lifeMax = 1500; - npc.damage = 140; - npc.defense = 72; - npc.knockBackResist = 0.05f; - npc.width = 32; - npc.height = 40; - animationType = 176; - npc.aiStyle = 5; - aiType = 176; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath44; - npc.noGravity = true; - npc.value = Item.buyPrice(0, 0, 10, 0); - banner = npc.type; - bannerItem = mod.ItemType("PossessedHornetBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 1500; + npc.damage = 140; + npc.defense = 72; + npc.knockBackResist = 0.05f; + npc.width = 32; + npc.height = 40; + animationType = 176; + npc.aiStyle = 5; + aiType = 176; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath44; + npc.noGravity = true; + npc.value = Item.buyPrice(0, 0, 10, 0); + banner = npc.type; + bannerItem = mod.ItemType("PossessedHornetBanner"); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PurpleQuartz"), 2); - } - } - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("NightmareFlame"), 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PHGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PHGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PHGore3"), 1f); - } -} + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PurpleQuartz"), 2); + } + } + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("NightmareFlame"), 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PHGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PHGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PHGore3"), 1f); + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneJungle && NPC.downedMoonlord && Main.hardMode && y > Main.rockLayer ? 0.01f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneJungle && NPC.downedMoonlord && Main.hardMode && y > Main.rockLayer ? 0.01f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/PossessedHornet2.cs b/NPCs/PossessedHornet2.cs index 2a18d8fb..4334d098 100644 --- a/NPCs/PossessedHornet2.cs +++ b/NPCs/PossessedHornet2.cs @@ -5,75 +5,77 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class PossessedHornet2 : ModNPC +namespace Tremor.NPCs { + + public class PossessedHornet2 : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Possessed Hornet"); Main.npcFrameCount[npc.type] = 2; } - - public override void SetDefaults() - { - npc.lifeMax = 1500; - npc.noGravity = true; - npc.damage = 132; - npc.defense = 68; - npc.knockBackResist = 0.05f; - npc.width = 32; - npc.height = 40; - animationType = 176; - npc.aiStyle = 5; - aiType = 176; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath44; - npc.value = Item.buyPrice(0, 0, 10, 0); - banner = npc.type; - bannerItem = mod.ItemType("PossessedHornetBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 1500; + npc.noGravity = true; + npc.damage = 132; + npc.defense = 68; + npc.knockBackResist = 0.05f; + npc.width = 32; + npc.height = 40; + animationType = 176; + npc.aiStyle = 5; + aiType = 176; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath44; + npc.value = Item.buyPrice(0, 0, 10, 0); + banner = npc.type; + bannerItem = mod.ItemType("PossessedHornetBanner"); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PurpleQuartz"), 2); - } - } - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("NightmareFlame"), 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PHGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PHGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PHGore4"), 1f); - } -} + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PurpleQuartz"), 2); + } + } + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("NightmareFlame"), 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PHGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PHGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PHGore4"), 1f); + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneJungle && NPC.downedMoonlord && Main.hardMode && y > Main.rockLayer ? 0.01f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneJungle && NPC.downedMoonlord && Main.hardMode && y > Main.rockLayer ? 0.01f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/PossessedHound.cs b/NPCs/PossessedHound.cs index 478f27f0..430dd9ce 100644 --- a/NPCs/PossessedHound.cs +++ b/NPCs/PossessedHound.cs @@ -6,81 +6,83 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class PossessedHound : ModNPC +namespace Tremor.NPCs { + + public class PossessedHound : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Possessed Hound"); Main.npcFrameCount[npc.type] = 10; } - - public override void SetDefaults() - { - npc.lifeMax = 3200; - npc.damage = 180; - npc.defense = 50; - npc.knockBackResist = 0.1f; - npc.width = 46; - npc.height = 30; - animationType = 329; - npc.aiStyle = 26; - npc.npcSlots = 0.3f; - npc.HitSound = SoundID.NPCHit2; - npc.DeathSound = SoundID.NPCDeath5; - npc.value = Item.buyPrice(0, 0, 15, 0); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 3200; + npc.damage = 180; + npc.defense = 50; + npc.knockBackResist = 0.1f; + npc.width = 46; + npc.height = 30; + animationType = 329; + npc.aiStyle = 26; + npc.npcSlots = 0.3f; + npc.HitSound = SoundID.NPCHit2; + npc.DeathSound = SoundID.NPCDeath5; + npc.value = Item.buyPrice(0, 0, 15, 0); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void AI() - { + public override void AI() + { -if (Main.rand.Next(1000) == 0) - { - Main.PlaySound(22, (int)npc.position.X, (int)npc.position.Y, 1); - } - } + if (Main.rand.Next(1000) == 0) + { + Main.PlaySound(22, (int)npc.position.X, (int)npc.position.Y, 1); + } + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ConcentratedEther")); - } - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ConcentratedEther")); + } + } + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HoundGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HoundGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HoundGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HoundGore2"), 1f); + } + } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && Main.bloodMoon && y < Main.worldSurface ? 0.007f : 0f; + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HoundGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HoundGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HoundGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HoundGore2"), 1f); - } -} - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && Main.bloodMoon && y < Main.worldSurface ? 0.007f : 0f; - } - -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/Professor.cs b/NPCs/Professor.cs index 5e552186..051b90f8 100644 --- a/NPCs/Professor.cs +++ b/NPCs/Professor.cs @@ -6,10 +6,11 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { -[AutoloadHead] -public class Professor : ModNPC +namespace Tremor.NPCs { + [AutoloadHead] + public class Professor : ModNPC + { public override string Texture { get @@ -17,14 +18,14 @@ public override string Texture return "Tremor/NPCs/Professor"; } } - + public override string[] AltTextures { get { - return new string[] { "Tremor/NPCs/Professor"}; + return new string[] { "Tremor/NPCs/Professor" }; } - } + } public override bool Autoload(ref string name) { @@ -44,154 +45,155 @@ public override void SetStaticDefaults() NPCID.Sets.AttackAverageChance[npc.type] = 30; } - public override void SetDefaults() - { - npc.townNPC = true; - npc.friendly = true; - npc.width = 24; - npc.height = 46; - npc.aiStyle = 7; - npc.damage = 40; - npc.defense = 15; - npc.lifeMax = 250; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.knockBackResist = 0.5f; - animationType = NPCID.GoblinTinkerer; - } - - public override string TownNPCName() - { - switch(WorldGen.genRand.Next(5)) - { - case 0: - return "James"; - case 1: - return "Harold"; - case 2: - return "Steven"; - case 3: - return "David"; - case 4: - return "John"; - case 5: - return "Brus Bunner"; - default: - return "Alfred"; - } - } - - public override string GetChat() - { - switch(Main.rand.Next(6)) - { - case 0: - return "Don't pay attention to my appearance. This is just the result of a failed experiment."; - case 1: - return "What do you have? Carrot? Oh, never mind."; - case 2: - return "Imagine that in all those rabbits that you have killed were imprisoned soul of common people! Just think about it."; - case 3: - return "Someday we'll all get into the warm embrace of death. Bring me some more carrot soup before this happens."; - case 4: - return "Magic allows you to do what cannot be done scientifically. The main thing is not to overdo it, if you know what I mean."; - case 5: - return "I don't like people that like how wizards get rabbits out of their magic hats. It's horrible!"; - default: - return "I studied the anomalies in this world long time ago. Exactly during this I became the anomaly myself. Funny."; - } - } + public override void SetDefaults() + { + npc.townNPC = true; + npc.friendly = true; + npc.width = 24; + npc.height = 46; + npc.aiStyle = 7; + npc.damage = 40; + npc.defense = 15; + npc.lifeMax = 250; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.knockBackResist = 0.5f; + animationType = NPCID.GoblinTinkerer; + } + + public override string TownNPCName() + { + switch (WorldGen.genRand.Next(5)) + { + case 0: + return "James"; + case 1: + return "Harold"; + case 2: + return "Steven"; + case 3: + return "David"; + case 4: + return "John"; + case 5: + return "Brus Bunner"; + default: + return "Alfred"; + } + } + + public override string GetChat() + { + switch (Main.rand.Next(6)) + { + case 0: + return "Don't pay attention to my appearance. This is just the result of a failed experiment."; + case 1: + return "What do you have? Carrot? Oh, never mind."; + case 2: + return "Imagine that in all those rabbits that you have killed were imprisoned soul of common people! Just think about it."; + case 3: + return "Someday we'll all get into the warm embrace of death. Bring me some more carrot soup before this happens."; + case 4: + return "Magic allows you to do what cannot be done scientifically. The main thing is not to overdo it, if you know what I mean."; + case 5: + return "I don't like people that like how wizards get rabbits out of their magic hats. It's horrible!"; + default: + return "I studied the anomalies in this world long time ago. Exactly during this I became the anomaly myself. Funny."; + } + } public override bool CanTownNPCSpawn(int numTownNPCs, int money) { - if(Main.hardMode) - return true; + if (Main.hardMode) + return true; return false; } - public override void SetChatButtons(ref string button, ref string button2) - { - button = Lang.inter[28].Value; - } - - public override void OnChatButtonClicked(bool firstButton, ref bool shop) - { - if(firstButton) - { - shop = true; - } - } - - public override void SetupShop(Chest shop, ref int nextSlot) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("KeyMold")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("LifeMachine")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("AncientTechnology")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("BagofDust")); - nextSlot++; - shop.item[nextSlot].SetDefaults(1337); - nextSlot++; - - if(NPC.downedAncientCultist) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("ManaGenerator")); - nextSlot++; - } - if(NPC.downedMechBossAny) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("ChaoticAmplifier")); - nextSlot++; - } - - } - - - public override void TownNPCAttackStrength(ref int damage, ref float knockback) - { - damage = 40; - knockback = 4f; - } - - public override void TownNPCAttackCooldown(ref int cooldown, ref int randExtraCooldown) - { - cooldown = 5; - randExtraCooldown = 5; - } - - public override void DrawTownAttackGun(ref float scale, ref int item, ref int closeness) //Allows you to customize how this town NPC's weapon is drawn when this NPC is shooting (this NPC must have an attack type of 1). Scale is a multiplier for the item's drawing size, item is the ID of the item to be drawn, and closeness is how close the item should be drawn to the NPC. - { - scale = 1f; - item = mod.ItemType("AlienBlaster"); - closeness = 14; - } - public override void TownNPCAttackProj(ref int projType, ref int attackDelay)//Allows you to determine the projectile type of this town NPC's attack, and how long it takes for the projectile to actually appear - { - projType = 440; - attackDelay = 1; - } - - public override void TownNPCAttackProjSpeed(ref float multiplier, ref float gravityCorrection, ref float randomOffset)//Allows you to determine the speed at which this town NPC throws a projectile when it attacks. Multiplier is the speed of the projectile, gravityCorrection is how much extra the projectile gets thrown upwards, and randomOffset allows you to randomize the projectile's velocity in a square centered around the original velocity - { - multiplier = 7f; - // randomOffset = 4f; - - } - - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfessorGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfessorGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfessorGore3"), 1f); - } -} -}} \ No newline at end of file + public override void SetChatButtons(ref string button, ref string button2) + { + button = Lang.inter[28].Value; + } + + public override void OnChatButtonClicked(bool firstButton, ref bool shop) + { + if (firstButton) + { + shop = true; + } + } + + public override void SetupShop(Chest shop, ref int nextSlot) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("KeyMold")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("LifeMachine")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("AncientTechnology")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("BagofDust")); + nextSlot++; + shop.item[nextSlot].SetDefaults(1337); + nextSlot++; + + if (NPC.downedAncientCultist) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("ManaGenerator")); + nextSlot++; + } + if (NPC.downedMechBossAny) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("ChaoticAmplifier")); + nextSlot++; + } + + } + + + public override void TownNPCAttackStrength(ref int damage, ref float knockback) + { + damage = 40; + knockback = 4f; + } + + public override void TownNPCAttackCooldown(ref int cooldown, ref int randExtraCooldown) + { + cooldown = 5; + randExtraCooldown = 5; + } + + public override void DrawTownAttackGun(ref float scale, ref int item, ref int closeness) //Allows you to customize how this town NPC's weapon is drawn when this NPC is shooting (this NPC must have an attack type of 1). Scale is a multiplier for the item's drawing size, item is the ID of the item to be drawn, and closeness is how close the item should be drawn to the NPC. + { + scale = 1f; + item = mod.ItemType("AlienBlaster"); + closeness = 14; + } + public override void TownNPCAttackProj(ref int projType, ref int attackDelay)//Allows you to determine the projectile type of this town NPC's attack, and how long it takes for the projectile to actually appear + { + projType = 440; + attackDelay = 1; + } + + public override void TownNPCAttackProjSpeed(ref float multiplier, ref float gravityCorrection, ref float randomOffset)//Allows you to determine the speed at which this town NPC throws a projectile when it attacks. Multiplier is the speed of the projectile, gravityCorrection is how much extra the projectile gets thrown upwards, and randomOffset allows you to randomize the projectile's velocity in a square centered around the original velocity + { + multiplier = 7f; + // randomOffset = 4f; + + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfessorGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfessorGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ProfessorGore3"), 1f); + } + } + } +} \ No newline at end of file diff --git a/NPCs/PyramidHead.cs b/NPCs/PyramidHead.cs index 1ca9291f..941eec01 100644 --- a/NPCs/PyramidHead.cs +++ b/NPCs/PyramidHead.cs @@ -6,72 +6,74 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class PyramidHead : ModNPC +namespace Tremor.NPCs { + + public class PyramidHead : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Pyramid Head"); Main.npcFrameCount[npc.type] = 15; } - - public override void SetDefaults() - { - npc.lifeMax = 130; - npc.damage = 24; - npc.defense = 6; - npc.knockBackResist = 0.3f; - npc.width = 18; - npc.height = 44; -animationType = 21; - npc.aiStyle = 3; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit1; - aiType = 140; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 6, 7); - banner = npc.type; - bannerItem = mod.ItemType("PyramidHeadBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 130; + npc.damage = 24; + npc.defense = 6; + npc.knockBackResist = 0.3f; + npc.width = 18; + npc.height = 44; + animationType = 21; + npc.aiStyle = 3; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit1; + aiType = 140; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 0, 6, 7); + banner = npc.type; + bannerItem = mod.ItemType("PyramidHeadBanner"); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PyramidGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PyramidGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PyramidGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PyramidGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PyramidGore4"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PyramidGore4"), 1f); - } -} + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - } - } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDesert && !Main.dayTime && y < Main.worldSurface ? 0.08f : 0f; - } -}} \ No newline at end of file + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PyramidGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PyramidGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PyramidGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PyramidGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PyramidGore4"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PyramidGore4"), 1f); + } + } + + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + } + } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDesert && !Main.dayTime && y < Main.worldSurface ? 0.08f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/PyramidRider.cs b/NPCs/PyramidRider.cs index 4239d9c5..00fef01d 100644 --- a/NPCs/PyramidRider.cs +++ b/NPCs/PyramidRider.cs @@ -6,65 +6,67 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class PyramidRider : ModNPC +namespace Tremor.NPCs { + + public class PyramidRider : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Pyramid Rider"); Main.npcFrameCount[npc.type] = 6; } - - public override void SetDefaults() - { - npc.lifeMax = 116; - npc.damage = 20; - npc.defense = 10; - npc.knockBackResist = 0.6f; - npc.width = 76; - npc.height = 38; - animationType = 508; - npc.aiStyle = 26; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit1; - npc.value = Item.buyPrice(0, 0, 5, 0); - } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 18, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } -NPC.NewNPC((int)npc.position.X, (int)npc.position.Y + 55, 508); -NPC.NewNPC((int)npc.position.X - 22, (int)npc.position.Y + 55, mod.NPCType("PyramidHead")); - } -} + public override void SetDefaults() + { + npc.lifeMax = 116; + npc.damage = 20; + npc.defense = 10; + npc.knockBackResist = 0.6f; + npc.width = 76; + npc.height = 38; + animationType = 508; + npc.aiStyle = 26; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit1; + npc.value = Item.buyPrice(0, 0, 5, 0); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - } - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 18, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + NPC.NewNPC((int)npc.position.X, (int)npc.position.Y + 55, 508); + NPC.NewNPC((int)npc.position.X - 22, (int)npc.position.Y + 55, mod.NPCType("PyramidHead")); + } + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + } + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDesert && NPC.downedBoss1 && !Main.dayTime && y < Main.worldSurface ? 0.03f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDesert && NPC.downedBoss1 && !Main.dayTime && y < Main.worldSurface ? 0.03f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/QuartzBeetle.cs b/NPCs/QuartzBeetle.cs index dd65ea81..68fdddef 100644 --- a/NPCs/QuartzBeetle.cs +++ b/NPCs/QuartzBeetle.cs @@ -5,72 +5,74 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class QuartzBeetle : ModNPC +namespace Tremor.NPCs { + + public class QuartzBeetle : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Quartz Beetle"); Main.npcFrameCount[npc.type] = 12; } - - public override void SetDefaults() - { - npc.lifeMax = 3500; - npc.damage = 140; - npc.defense = 62; - npc.knockBackResist = 0.05f; - npc.width = 32; - npc.height = 50; - animationType = 185; - npc.aiStyle = 3; - aiType = 525; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit41; - npc.DeathSound = SoundID.NPCDeath44; - npc.value = Item.buyPrice(0, 0, 8, 0); - banner = npc.type; - bannerItem = mod.ItemType("QuartzBeetleBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 3500; + npc.damage = 140; + npc.defense = 62; + npc.knockBackResist = 0.05f; + npc.width = 32; + npc.height = 50; + animationType = 185; + npc.aiStyle = 3; + aiType = 525; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit41; + npc.DeathSound = SoundID.NPCDeath44; + npc.value = Item.buyPrice(0, 0, 8, 0); + banner = npc.type; + bannerItem = mod.ItemType("QuartzBeetleBanner"); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PurpleQuartz"), 2); - } - } - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("NightmareFlame"), 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/QBGore1"), 1f); - } -} + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("PurpleQuartz"), 2); + } + } + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, mod.DustType("NightmareFlame"), 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/QBGore1"), 1f); + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneJungle && NPC.downedMoonlord && Main.hardMode && y > Main.rockLayer ? 0.01f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneJungle && NPC.downedMoonlord && Main.hardMode && y > Main.rockLayer ? 0.01f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/Quetzalcoatl.cs b/NPCs/Quetzalcoatl.cs index 5cb71baa..a7c79ef7 100644 --- a/NPCs/Quetzalcoatl.cs +++ b/NPCs/Quetzalcoatl.cs @@ -5,58 +5,60 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Quetzalcoatl : ModNPC +namespace Tremor.NPCs { + + public class Quetzalcoatl : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Quetzalcoatl"); Main.npcFrameCount[npc.type] = 2; } - - public override void SetDefaults() - { - npc.lifeMax = 3000; - npc.damage = 170; - npc.defense = 73; - npc.knockBackResist = 1f; - npc.width = 32; - npc.height = 62; - animationType = 62; - npc.aiStyle = 14; - //aiType = 226; - npc.npcSlots = 1f; - npc.HitSound = SoundID.NPCHit7; - npc.DeathSound = SoundID.NPCDeath10; - npc.value = Item.buyPrice(0, 6, 1, 0); - npc.noTileCollide = true; - } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/QGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/QGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/QGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/QGore3"), 1f); - } - else - { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 59, (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } -}} \ No newline at end of file + public override void SetDefaults() + { + npc.lifeMax = 3000; + npc.damage = 170; + npc.defense = 73; + npc.knockBackResist = 1f; + npc.width = 32; + npc.height = 62; + animationType = 62; + npc.aiStyle = 14; + //aiType = 226; + npc.npcSlots = 1f; + npc.HitSound = SoundID.NPCHit7; + npc.DeathSound = SoundID.NPCDeath10; + npc.value = Item.buyPrice(0, 6, 1, 0); + npc.noTileCollide = true; + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/QGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/QGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/QGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/QGore3"), 1f); + } + else + { + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 59, (float)hitDirection, -1f, 0, default(Color), 0.7f); + } + } + } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } + } +} \ No newline at end of file diff --git a/NPCs/RGiantSlime.cs b/NPCs/RGiantSlime.cs index f36a4361..759e99de 100644 --- a/NPCs/RGiantSlime.cs +++ b/NPCs/RGiantSlime.cs @@ -7,77 +7,79 @@ using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class RGiantSlime : ModNPC +namespace Tremor.NPCs { + + public class RGiantSlime : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Red Slime"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 1000; - npc.damage = 100; - npc.defense = 30; - npc.knockBackResist = 0.3f; - npc.width = 70; - npc.alpha = 175; - npc.color = new Color(255, 30, 0, 100); - npc.height = 46; - animationType = 244; - npc.aiStyle = 1; - aiType = 138; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath23; - npc.value = Item.buyPrice(0, 0, 12, 15); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 1000; + npc.damage = 100; + npc.defense = 30; + npc.knockBackResist = 0.3f; + npc.width = 70; + npc.alpha = 175; + npc.color = new Color(255, 30, 0, 100); + npc.height = 46; + animationType = 244; + npc.aiStyle = 1; + aiType = 138; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath23; + npc.value = Item.buyPrice(0, 0, 12, 15); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Red, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Red, 0.7f); - } - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Red, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Red, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Red, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 1, 2.5f * (float)hitDirection, -2.5f, 0, Color.Red, 0.7f); - } -} + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return Main.hardMode && NPC.downedMoonlord && !spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.1f : 0f; - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Red, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Red, 0.7f); + } + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Red, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Red, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Red, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 1, 2.5f * (float)hitDirection, -2.5f, 0, Color.Red, 0.7f); + } + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return Main.hardMode && NPC.downedMoonlord && !spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.1f : 0f; + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 23); - }; - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 23); + }; + } + } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/RichSlime.cs b/NPCs/RichSlime.cs index 16580316..37a98272 100644 --- a/NPCs/RichSlime.cs +++ b/NPCs/RichSlime.cs @@ -7,76 +7,78 @@ using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class RichSlime : ModNPC +namespace Tremor.NPCs { + + public class RichSlime : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Rich Slime"); Main.npcFrameCount[npc.type] = 2; } - - public override void SetDefaults() - { - npc.lifeMax = 1100; - npc.damage = 210; - npc.defense = 45; - npc.knockBackResist = 0.3f; - npc.width = 32; - npc.height = 46; - animationType = 1; - npc.aiStyle = 1; - aiType = 1; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath23; - npc.value = Item.buyPrice(1, 0, 0, 0); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 1100; + npc.damage = 210; + npc.defense = 45; + npc.knockBackResist = 0.3f; + npc.width = 32; + npc.height = 46; + animationType = 1; + npc.aiStyle = 1; + aiType = 1; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath23; + npc.value = Item.buyPrice(1, 0, 0, 0); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Yellow, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Yellow, 0.7f); - } - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Yellow, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Yellow, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Yellow, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 1, 2.5f * (float)hitDirection, -2.5f, 0, Color.Yellow, 0.7f); - } -} + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Yellow, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Yellow, 0.7f); + } + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Yellow, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Yellow, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Yellow, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 1, 2.5f * (float)hitDirection, -2.5f, 0, Color.Yellow, 0.7f); + } + } public override float SpawnChance(NPCSpawnInfo spawnInfo) { return spawnInfo.spawnTileY < Main.rockLayer && Main.hardMode && Tremor.NoInvasion(spawnInfo) && NPC.downedMoonlord && Main.dayTime ? 0.005f : 0f; } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 23, Main.rand.Next(5, 9)); - }; - if(Main.rand.Next(50) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FashionableHat")); - }; - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 23, Main.rand.Next(5, 9)); + }; + if (Main.rand.Next(50) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FashionableHat")); + }; + } + } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/Rogue.cs b/NPCs/Rogue.cs index 712623b4..0c36010b 100644 --- a/NPCs/Rogue.cs +++ b/NPCs/Rogue.cs @@ -13,7 +13,7 @@ public override void SetStaticDefaults() DisplayName.SetDefault("Rogue"); Main.npcFrameCount[npc.type] = 12; } - + public override void SetDefaults() { npc.width = 18; @@ -23,85 +23,85 @@ public override void SetDefaults() npc.lifeMax = 86; npc.HitSound = SoundID.NPCHit40; npc.DeathSound = SoundID.NPCDeath42; - npc.value = Item.buyPrice(0, 0, 4, 7); + npc.value = Item.buyPrice(0, 0, 4, 7); npc.knockBackResist = 0.5f; npc.aiStyle = 3; aiType = 111; animationType = 379; - banner = npc.type; - bannerItem = mod.ItemType("RogueBanner"); + banner = npc.type; + bannerItem = mod.ItemType("RogueBanner"); } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(15) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 177, Main.rand.Next(1,2)); - } - if(Main.rand.Next(15) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 178, Main.rand.Next(1,2)); - } - if(Main.rand.Next(15) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 179, Main.rand.Next(1,2)); - } - if(Main.rand.Next(15) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 180, Main.rand.Next(1,2)); - } - if(Main.rand.Next(15) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 181, Main.rand.Next(1,2)); - } - if(Main.rand.Next(15) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 182, Main.rand.Next(1,2)); - } - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 40, Main.rand.Next(2,6)); - } - if(Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 41, Main.rand.Next(2,6)); - } - if(Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 279, Main.rand.Next(2,6)); - } - if(Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 287, Main.rand.Next(2,3)); - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(15) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 177, Main.rand.Next(1, 2)); + } + if (Main.rand.Next(15) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 178, Main.rand.Next(1, 2)); + } + if (Main.rand.Next(15) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 179, Main.rand.Next(1, 2)); + } + if (Main.rand.Next(15) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 180, Main.rand.Next(1, 2)); + } + if (Main.rand.Next(15) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 181, Main.rand.Next(1, 2)); + } + if (Main.rand.Next(15) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 182, Main.rand.Next(1, 2)); + } + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 40, Main.rand.Next(2, 6)); + } + if (Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 41, Main.rand.Next(2, 6)); + } + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 279, Main.rand.Next(2, 6)); + } + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 287, Main.rand.Next(2, 3)); + } - } - } + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/RogueGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/RogueGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/RogueGore3"), 1f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/RogueGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/RogueGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/RogueGore3"), 1f); + } + } public override float SpawnChance(NPCSpawnInfo spawnInfo) { diff --git a/NPCs/RuinGhost1.cs b/NPCs/RuinGhost1.cs index c6197ff6..0d175981 100644 --- a/NPCs/RuinGhost1.cs +++ b/NPCs/RuinGhost1.cs @@ -8,54 +8,54 @@ namespace Tremor.NPCs { - public class RuinGhost1 : ModNPC - { + public class RuinGhost1 : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Ruin Ghost"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.width = 24; - npc.height = 46; - npc.damage = 4; - npc.defense = 12; - npc.npcSlots = 1; - npc.lifeMax = 90; - npc.HitSound = SoundID.NPCHit1; + + public override void SetDefaults() + { + npc.width = 24; + npc.height = 46; + npc.damage = 4; + npc.defense = 12; + npc.npcSlots = 1; + npc.lifeMax = 90; + npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath6; - npc.value = 100; - npc.knockBackResist = 0.3f; - npc.noGravity = true; - npc.noTileCollide = true; - npc.aiStyle = 22; - aiType = NPCID.Wraith; - animationType = NPCID.Wraith; - npc.stepSpeed = .5f; - npc.lavaImmune = true; - } + npc.value = 100; + npc.knockBackResist = 0.3f; + npc.noGravity = true; + npc.noTileCollide = true; + npc.aiStyle = 22; + aiType = NPCID.Wraith; + animationType = NPCID.Wraith; + npc.stepSpeed = .5f; + npc.lavaImmune = true; + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int[] TileArray2 = { mod.TileType("RuinAltar"), mod.TileType("RuinChest"), 120 }; - return TileArray2.Contains(Main.tile[spawnInfo.spawnTileX, spawnInfo.spawnTileY].type) && TremorWorld.downedTikiTotem ? 45f : 0f; - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int[] TileArray2 = { mod.TileType("RuinAltar"), mod.TileType("RuinChest"), 120 }; + return TileArray2.Contains(Main.tile[spawnInfo.spawnTileX, spawnInfo.spawnTileY].type) && TremorWorld.downedTikiTotem ? 45f : 0f; + } - public override void HitEffect(int hitDirection, double damage) - { - if (npc.life <= 0) - { - Gore.NewGore(npc.position, npc.velocity, 13); - Gore.NewGore(npc.position, npc.velocity, 12); - Gore.NewGore(npc.position, npc.velocity, 11); - } - } - public override void NPCLoot() - { - if (Main.rand.Next(33) == 0) - Item.NewItem((int)npc.position.X, (int)npc.position.Y, 12, 12, mod.ItemType("RuinKey"), 1); - } - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Gore.NewGore(npc.position, npc.velocity, 13); + Gore.NewGore(npc.position, npc.velocity, 12); + Gore.NewGore(npc.position, npc.velocity, 11); + } + } + public override void NPCLoot() + { + if (Main.rand.Next(33) == 0) + Item.NewItem((int)npc.position.X, (int)npc.position.Y, 12, 12, mod.ItemType("RuinKey"), 1); + } + } } \ No newline at end of file diff --git a/NPCs/RuinGhost2.cs b/NPCs/RuinGhost2.cs index 1848ac19..5e63b745 100644 --- a/NPCs/RuinGhost2.cs +++ b/NPCs/RuinGhost2.cs @@ -8,63 +8,63 @@ namespace Tremor.NPCs { - public class RuinGhost2 : ModNPC - { + public class RuinGhost2 : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Ruin Ghost"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.width = 24; - npc.height = 46; - npc.damage = 6; - npc.defense = 10; - npc.npcSlots = 1; - npc.lifeMax = 105; - npc.HitSound = SoundID.NPCHit1; + + public override void SetDefaults() + { + npc.width = 24; + npc.height = 46; + npc.damage = 6; + npc.defense = 10; + npc.npcSlots = 1; + npc.lifeMax = 105; + npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath6; - npc.value = 100; - npc.knockBackResist = 0.3f; - npc.noGravity = true; - npc.noTileCollide = true; - npc.aiStyle = 22; - aiType = NPCID.Wraith; - animationType = NPCID.Wraith; - npc.stepSpeed = .5f; - npc.lavaImmune = true; - } + npc.value = 100; + npc.knockBackResist = 0.3f; + npc.noGravity = true; + npc.noTileCollide = true; + npc.aiStyle = 22; + aiType = NPCID.Wraith; + animationType = NPCID.Wraith; + npc.stepSpeed = .5f; + npc.lavaImmune = true; + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int[] TileArray2 = { mod.TileType("RuinAltar"), mod.TileType("RuinChest"), 120 }; - return TileArray2.Contains(Main.tile[spawnInfo.spawnTileX, spawnInfo.spawnTileY].type) && TremorWorld.downedTikiTotem ? 45f : 0f; - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int[] TileArray2 = { mod.TileType("RuinAltar"), mod.TileType("RuinChest"), 120 }; + return TileArray2.Contains(Main.tile[spawnInfo.spawnTileX, spawnInfo.spawnTileY].type) && TremorWorld.downedTikiTotem ? 45f : 0f; + } - public override void HitEffect(int hitDirection, double damage) - { - if (npc.life <= 0) - { - Gore.NewGore(npc.position, npc.velocity, 13); - Gore.NewGore(npc.position, npc.velocity, 12); - Gore.NewGore(npc.position, npc.velocity, 11); - } - } - public override void AI() - { - if (Main.rand.Next(700) == 0) - { - Main.PlaySound(29, (int)npc.position.X, (int)npc.position.Y, Main.rand.Next(81, 84)); - } - } - public override void NPCLoot() - { - if (Main.rand.Next(6) == 0) - Item.NewItem((int)npc.position.X, (int)npc.position.Y, 12, 12, mod.ItemType("RuinKey"), 1); - if (Main.rand.Next(6) == 0) - Item.NewItem((int)npc.position.X, (int)npc.position.Y, 12, 12, mod.ItemType("RustyLantern"), 1); - } - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Gore.NewGore(npc.position, npc.velocity, 13); + Gore.NewGore(npc.position, npc.velocity, 12); + Gore.NewGore(npc.position, npc.velocity, 11); + } + } + public override void AI() + { + if (Main.rand.Next(700) == 0) + { + Main.PlaySound(29, (int)npc.position.X, (int)npc.position.Y, Main.rand.Next(81, 84)); + } + } + public override void NPCLoot() + { + if (Main.rand.Next(6) == 0) + Item.NewItem((int)npc.position.X, (int)npc.position.Y, 12, 12, mod.ItemType("RuinKey"), 1); + if (Main.rand.Next(6) == 0) + Item.NewItem((int)npc.position.X, (int)npc.position.Y, 12, 12, mod.ItemType("RustyLantern"), 1); + } + } } \ No newline at end of file diff --git a/NPCs/SandThing.cs b/NPCs/SandThing.cs index 11c8379d..2d45fd3f 100644 --- a/NPCs/SandThing.cs +++ b/NPCs/SandThing.cs @@ -13,7 +13,7 @@ public override void SetStaticDefaults() DisplayName.SetDefault("Sand Thing"); Main.npcFrameCount[npc.type] = 13; } - + public override void SetDefaults() { npc.width = 40; @@ -23,65 +23,65 @@ public override void SetDefaults() npc.lifeMax = 145; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; - npc.value = Item.buyPrice(0, 0, 3, 7); + npc.value = Item.buyPrice(0, 0, 3, 7); npc.knockBackResist = 0.5f; npc.aiStyle = 3; aiType = 73; - npc.aiStyle = 3; + npc.aiStyle = 3; animationType = 166; - banner = npc.type; - bannerItem = mod.ItemType("SandThingBanner"); + banner = npc.type; + bannerItem = mod.ItemType("SandThingBanner"); } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(50) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 324); - } - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 169); - } - } - } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 19, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 19, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Dust.NewDust(npc.position, npc.width, npc.height, 19, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 19, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 19, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 19, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Gore.NewGore(npc.position, npc.velocity, 220, 1f); - Gore.NewGore(npc.position, npc.velocity, 221, 1f); - Gore.NewGore(npc.position, npc.velocity, 222, 1f); - } -} + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(50) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 324); + } + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 169); + } + } + } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 19, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 19, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Dust.NewDust(npc.position, npc.width, npc.height, 19, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 19, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 19, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 19, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Gore.NewGore(npc.position, npc.velocity, 220, 1f); + Gore.NewGore(npc.position, npc.velocity, 221, 1f); + Gore.NewGore(npc.position, npc.velocity, 222, 1f); + } + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDesert && NPC.downedBoss1 && Main.dayTime && y < Main.worldSurface ? 0.01f : 0f; - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDesert && NPC.downedBoss1 && Main.dayTime && y < Main.worldSurface ? 0.01f : 0f; + } } } diff --git a/NPCs/ScaryBat.cs b/NPCs/ScaryBat.cs index 2173b0aa..7ea84da9 100644 --- a/NPCs/ScaryBat.cs +++ b/NPCs/ScaryBat.cs @@ -6,72 +6,74 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class ScaryBat : ModNPC +namespace Tremor.NPCs { + + public class ScaryBat : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Scary Bat"); Main.npcFrameCount[npc.type] = 4; } - - const int SpeedMulti = 3; // Œ­®¦¨â¥«ì ᪮à®á⨠- public override void SetDefaults() - { - npc.lifeMax = 320; - npc.damage = 80; - npc.defense = 20; - npc.knockBackResist = 0.3f; - npc.width = 34; - npc.height = 48; - animationType = 93; - npc.aiStyle = 14; - npc.npcSlots = 1f; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit1; - npc.noGravity = true; - npc.DeathSound = SoundID.NPCDeath4; - npc.value = Item.buyPrice(0, 0, 6, 9); - banner = npc.type; - bannerItem = mod.ItemType("ScaryBatBanner"); - npc.behindTiles = true; - } + const int SpeedMulti = 3; // Œ­®¦¨â¥«ì ᪮à®á⨠- public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 320; + npc.damage = 80; + npc.defense = 20; + npc.knockBackResist = 0.3f; + npc.width = 34; + npc.height = 48; + animationType = 93; + npc.aiStyle = 14; + npc.npcSlots = 1f; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit1; + npc.noGravity = true; + npc.DeathSound = SoundID.NPCDeath4; + npc.value = Item.buyPrice(0, 0, 6, 9); + banner = npc.type; + bannerItem = mod.ItemType("ScaryBatBanner"); + npc.behindTiles = true; + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 60; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - } - else - { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 54, (float)hitDirection, -2f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 54, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 54, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 54, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 54, (float)hitDirection, -2f, 0, default(Color), 0.7f); - } - } - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 60; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + } + else + { + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 54, (float)hitDirection, -2f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, (float)hitDirection, -2f, 0, default(Color), 0.7f); + } + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedPlantBoss && y > Main.rockLayer ? 0.01f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedPlantBoss && y > Main.rockLayer ? 0.01f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/Scavenger.cs b/NPCs/Scavenger.cs index 00658897..ee261e16 100644 --- a/NPCs/Scavenger.cs +++ b/NPCs/Scavenger.cs @@ -6,291 +6,293 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Scavenger : ModNPC +namespace Tremor.NPCs { + + public class Scavenger : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Scavenger"); Main.npcFrameCount[npc.type] = 10; } - - public override void SetDefaults() - { - npc.lifeMax = 1000; - npc.damage = 20; - if (NPC.downedBoss2) - { - npc.lifeMax = 1500; - npc.damage = 25; - } - if (NPC.downedBoss3) - { - npc.lifeMax = 2000; - npc.damage = 30; - } - if (Main.hardMode) - { - npc.lifeMax = 5000; - npc.damage = 70; - } - if (NPC.downedMechBossAny) - { - npc.lifeMax = 10000; - npc.damage = 80; - } - if (NPC.downedPlantBoss) - { - npc.lifeMax = 12000; - npc.damage = 100; - } - if (NPC.downedGolemBoss) - { - npc.lifeMax = 15000; - npc.damage = 150; - } - npc.defense = 4; - npc.knockBackResist = 0.3f; - npc.width = 18; - npc.height = 90; - animationType = 351; - npc.aiStyle = 3; - aiType = 77; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 8, 0); - banner = npc.type; - bannerItem = mod.ItemType("ScavengerBanner"); - } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScavengerGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScavengerGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScavengerGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScavengerGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScavengerGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScavengerGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScavengerGore4"), 1f); - } -} + public override void SetDefaults() + { + npc.lifeMax = 1000; + npc.damage = 20; + if (NPC.downedBoss2) + { + npc.lifeMax = 1500; + npc.damage = 25; + } + if (NPC.downedBoss3) + { + npc.lifeMax = 2000; + npc.damage = 30; + } + if (Main.hardMode) + { + npc.lifeMax = 5000; + npc.damage = 70; + } + if (NPC.downedMechBossAny) + { + npc.lifeMax = 10000; + npc.damage = 80; + } + if (NPC.downedPlantBoss) + { + npc.lifeMax = 12000; + npc.damage = 100; + } + if (NPC.downedGolemBoss) + { + npc.lifeMax = 15000; + npc.damage = 150; + } + npc.defense = 4; + npc.knockBackResist = 0.3f; + npc.width = 18; + npc.height = 90; + animationType = 351; + npc.aiStyle = 3; + aiType = 77; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 0, 8, 0); + banner = npc.type; + bannerItem = mod.ItemType("ScavengerBanner"); + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScavengerGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScavengerGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScavengerGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScavengerGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScavengerGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScavengerGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScavengerGore4"), 1f); + } + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if (!Main.hardMode) - { - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 29, Main.rand.Next(1,2)); - }; - if(Main.rand.Next(1) == 0) - { - if(!WorldGen.crimson) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 57, Main.rand.Next(10,25)); - } - if(WorldGen.crimson) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 1257, Main.rand.Next(10,25)); - } - }; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 188, Main.rand.Next(2,10)); - }; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 189, Main.rand.Next(2,10)); - }; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 178, Main.rand.Next(5,15)); - }; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 182, Main.rand.Next(5,15)); - }; - if(Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Opal"), Main.rand.Next(1,3)); - }; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 227, Main.rand.Next(2,10)); - }; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 175, Main.rand.Next(2,10)); - }; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 3532, Main.rand.Next(1,2)); - }; - } - if (Main.hardMode) - { - if(Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 2161, Main.rand.Next(1,2)); - }; - if(Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 2351, Main.rand.Next(1,6)); - }; - if(Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 723); - }; - if(Main.rand.Next(50) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 855); - }; - if(Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 499, Main.rand.Next(1,6)); - }; - if(Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 500, Main.rand.Next(1,6)); - }; - if(Main.rand.Next(15) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 1242); - }; - if(Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 1291, Main.rand.Next(1,3)); - }; - if(Main.rand.Next(50) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 1321); - }; - if(Main.rand.Next(100) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 1326); - }; - if(Main.rand.Next(25) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 1324); - }; - if(Main.rand.Next(80) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 3368); - }; - if(Main.rand.Next(80) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 3260); - }; - if(Main.rand.Next(80) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 3262); - }; - if(Main.rand.Next(80) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 3212); - }; - if(Main.rand.Next(80) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 3099); - }; - if(Main.rand.Next(80) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 3095); - }; - if(Main.rand.Next(80) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 3096); - }; - if(Main.rand.Next(80) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 3091); - }; - if(Main.rand.Next(80) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 3092); - }; - if(Main.rand.Next(8) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 2674, Main.rand.Next(1,6)); - }; - if(Main.rand.Next(15) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 2675, Main.rand.Next(1,10)); - }; - if(Main.rand.Next(50) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 2676, Main.rand.Next(1,15)); - }; - if(Main.rand.Next(60) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 2336); - }; - if(Main.rand.Next(50) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 2335); - }; - if(Main.rand.Next(30) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 2334); - }; - if(Main.rand.Next(15) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 422, Main.rand.Next(1,10)); - }; - if(Main.rand.Next(15) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 423, Main.rand.Next(1,10)); - }; - if(Main.rand.Next(45) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 497); - }; - if(Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 502, Main.rand.Next(1,10)); - }; - if(Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 501, Main.rand.Next(1,15)); - }; - if(Main.rand.Next(26) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 507); - }; - if(Main.rand.Next(26) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 508); - }; - if(Main.rand.Next(62) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 527); - }; - if(Main.rand.Next(62) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 528); - }; - } - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (!Main.hardMode) + { + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 29, Main.rand.Next(1, 2)); + }; + if (Main.rand.Next(1) == 0) + { + if (!WorldGen.crimson) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 57, Main.rand.Next(10, 25)); + } + if (WorldGen.crimson) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 1257, Main.rand.Next(10, 25)); + } + }; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 188, Main.rand.Next(2, 10)); + }; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 189, Main.rand.Next(2, 10)); + }; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 178, Main.rand.Next(5, 15)); + }; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 182, Main.rand.Next(5, 15)); + }; + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Opal"), Main.rand.Next(1, 3)); + }; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 227, Main.rand.Next(2, 10)); + }; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 175, Main.rand.Next(2, 10)); + }; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 3532, Main.rand.Next(1, 2)); + }; + } + if (Main.hardMode) + { + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 2161, Main.rand.Next(1, 2)); + }; + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 2351, Main.rand.Next(1, 6)); + }; + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 723); + }; + if (Main.rand.Next(50) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 855); + }; + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 499, Main.rand.Next(1, 6)); + }; + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 500, Main.rand.Next(1, 6)); + }; + if (Main.rand.Next(15) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 1242); + }; + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 1291, Main.rand.Next(1, 3)); + }; + if (Main.rand.Next(50) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 1321); + }; + if (Main.rand.Next(100) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 1326); + }; + if (Main.rand.Next(25) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 1324); + }; + if (Main.rand.Next(80) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 3368); + }; + if (Main.rand.Next(80) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 3260); + }; + if (Main.rand.Next(80) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 3262); + }; + if (Main.rand.Next(80) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 3212); + }; + if (Main.rand.Next(80) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 3099); + }; + if (Main.rand.Next(80) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 3095); + }; + if (Main.rand.Next(80) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 3096); + }; + if (Main.rand.Next(80) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 3091); + }; + if (Main.rand.Next(80) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 3092); + }; + if (Main.rand.Next(8) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 2674, Main.rand.Next(1, 6)); + }; + if (Main.rand.Next(15) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 2675, Main.rand.Next(1, 10)); + }; + if (Main.rand.Next(50) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 2676, Main.rand.Next(1, 15)); + }; + if (Main.rand.Next(60) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 2336); + }; + if (Main.rand.Next(50) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 2335); + }; + if (Main.rand.Next(30) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 2334); + }; + if (Main.rand.Next(15) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 422, Main.rand.Next(1, 10)); + }; + if (Main.rand.Next(15) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 423, Main.rand.Next(1, 10)); + }; + if (Main.rand.Next(45) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 497); + }; + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 502, Main.rand.Next(1, 10)); + }; + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 501, Main.rand.Next(1, 15)); + }; + if (Main.rand.Next(26) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 507); + }; + if (Main.rand.Next(26) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 508); + }; + if (Main.rand.Next(62) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 527); + }; + if (Main.rand.Next(62) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 528); + }; + } + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && y < Main.worldSurface ? 0.0001f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && y < Main.worldSurface ? 0.0001f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/Screamer.cs b/NPCs/Screamer.cs index 575f1a7d..228fe27e 100644 --- a/NPCs/Screamer.cs +++ b/NPCs/Screamer.cs @@ -9,119 +9,119 @@ namespace Tremor.NPCs { - public class Screamer : ModNPC - { + public class Screamer : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Screamer"); Main.npcFrameCount[npc.type] = 4; } - - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScreamerGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScreamerGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScreamerGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScreamerGore3"), 1f); - } - } - public override void SetDefaults() - { - npc.aiStyle = -1; - npc.lifeMax = 12000; - npc.damage = 160; - npc.defense = 135; - animationType = 82; - npc.knockBackResist = 0f; - npc.width = 130; - npc.height = 140; - npc.value = Item.buyPrice(0, 20, 0, 0); - npc.noGravity = true; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath10; + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScreamerGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScreamerGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScreamerGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ScreamerGore3"), 1f); + } + } + + public override void SetDefaults() + { + npc.aiStyle = -1; + npc.lifeMax = 12000; + npc.damage = 160; + npc.defense = 135; + animationType = 82; + npc.knockBackResist = 0f; + npc.width = 130; + npc.height = 140; + npc.value = Item.buyPrice(0, 20, 0, 0); + npc.noGravity = true; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath10; npc.buffImmune[20] = true; npc.buffImmune[24] = true; npc.buffImmune[39] = true; npc.npcSlots = 10f; - } + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 0.625f * bossLifeScale); - npc.damage = (int)(npc.damage * 0.6f); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 0.625f * bossLifeScale); + npc.damage = (int)(npc.damage * 0.6f); + } - public override void AI() - { - float num1971 = 5f; - float moveSpeed = 0.15f; - npc.TargetClosest(true); - Vector2 desiredVelocity4 = Main.player[npc.target].Center - npc.Center + new Vector2(0f, -250f); - float num1972 = desiredVelocity4.Length(); - if (num1972 < 20f) - { - desiredVelocity4 = npc.velocity; - } - else if (num1972 < 40f) - { - desiredVelocity4.Normalize(); - desiredVelocity4 *= num1971 * 0.35f; - } - else if (num1972 < 80f) - { - desiredVelocity4.Normalize(); - desiredVelocity4 *= num1971 * 0.65f; - } - else - { - desiredVelocity4.Normalize(); - desiredVelocity4 *= num1971; - } - npc.SimpleFlyMovement(desiredVelocity4, moveSpeed); - npc.rotation = npc.velocity.X * 0.1f; - if ((npc.ai[0] += 1f) >= 70f) - { - npc.ai[0] = 0f; - if (Main.netMode != 1) - { - Vector2 vector283 = Vector2.Zero; - while (Math.Abs(vector283.X) < 1.5f) - { - vector283 = Vector2.UnitY.RotatedByRandom(1.5707963705062866) * new Vector2(5f, 3f); - } - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vector283.X, vector283.Y, 593, 60, 0f, Main.myPlayer, 0f, (float)npc.whoAmI); - return; - } - } -} + public override void AI() + { + float num1971 = 5f; + float moveSpeed = 0.15f; + npc.TargetClosest(true); + Vector2 desiredVelocity4 = Main.player[npc.target].Center - npc.Center + new Vector2(0f, -250f); + float num1972 = desiredVelocity4.Length(); + if (num1972 < 20f) + { + desiredVelocity4 = npc.velocity; + } + else if (num1972 < 40f) + { + desiredVelocity4.Normalize(); + desiredVelocity4 *= num1971 * 0.35f; + } + else if (num1972 < 80f) + { + desiredVelocity4.Normalize(); + desiredVelocity4 *= num1971 * 0.65f; + } + else + { + desiredVelocity4.Normalize(); + desiredVelocity4 *= num1971; + } + npc.SimpleFlyMovement(desiredVelocity4, moveSpeed); + npc.rotation = npc.velocity.X * 0.1f; + if ((npc.ai[0] += 1f) >= 70f) + { + npc.ai[0] = 0f; + if (Main.netMode != 1) + { + Vector2 vector283 = Vector2.Zero; + while (Math.Abs(vector283.X) < 1.5f) + { + vector283 = Vector2.UnitY.RotatedByRandom(1.5707963705062866) * new Vector2(5f, 3f); + } + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vector283.X, vector283.Y, 593, 60, 0f, Main.myPlayer, 0f, (float)npc.whoAmI); + return; + } + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return spawnInfo.spawnTileY < Main.rockLayer && NPC.downedMoonlord && Main.eclipse ? 0.001f : 0f; - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return spawnInfo.spawnTileY < Main.rockLayer && NPC.downedMoonlord && Main.eclipse ? 0.001f : 0f; + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Catalyst"), Main.rand.Next(5,12)); - } - } - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Catalyst"), Main.rand.Next(5, 12)); + } + } + } + } } \ No newline at end of file diff --git a/NPCs/ShadowHand.cs b/NPCs/ShadowHand.cs index 1cfb280c..a7f0e3a4 100644 --- a/NPCs/ShadowHand.cs +++ b/NPCs/ShadowHand.cs @@ -10,216 +10,216 @@ namespace Tremor.NPCs { - public class ShadowHand : ModNPC - { + public class ShadowHand : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Shadow Hand"); Main.npcFrameCount[npc.type] = 2; } - - public override void SetDefaults() - { - npc.width = 30; - npc.height = 30; - npc.damage = 60; - npc.defense = 25; - npc.lifeMax = 780; - npc.knockBackResist = 1.1f; - npc.noGravity = true; - npc.behindTiles = true; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit9; - npc.DeathSound = SoundID.NPCDeath11; - } - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - if(Main.expertMode) - target.AddBuff(153, 180); - } + public override void SetDefaults() + { + npc.width = 30; + npc.height = 30; + npc.damage = 60; + npc.defense = 25; + npc.lifeMax = 780; + npc.knockBackResist = 1.1f; + npc.noGravity = true; + npc.behindTiles = true; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit9; + npc.DeathSound = SoundID.NPCDeath11; + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 0.625f * bossLifeScale); - npc.damage = (int)(npc.damage * 0.6f); - } + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + if (Main.expertMode) + target.AddBuff(153, 180); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 0.625f * bossLifeScale); + npc.damage = (int)(npc.damage * 0.6f); + } - public override bool PreAI() - { - if (npc.justHit) - npc.ai[1] = 10f; - if (Main.wof < 0) - { - npc.active = false; - } - else - { - npc.TargetClosest(true); - float num1 = 0.1f; - float num2 = 300f; - if (Main.npc[Main.wof].life < Main.npc[Main.wof].lifeMax * 0.25F) - { - npc.damage = (int)(75 * Main.damageMultiplier); - npc.defense = 40; - if (!Main.expertMode) - num2 = 900; - else - num1 += 0.1F; - } - else if (Main.npc[Main.wof].life < Main.npc[Main.wof].lifeMax * 0.5F) - { - npc.damage = (int)(60 * (double)Main.damageMultiplier); - npc.defense = 30; - if (!Main.expertMode) - num2 = 700; - else - num1 += 0.066F; - } - else if (Main.npc[Main.wof].life < Main.npc[Main.wof].lifeMax * 0.75F) - { - npc.damage = (int)(45 * Main.damageMultiplier); - npc.defense = 20; - if (!Main.expertMode) - num2 = 500; - else - num1 += 0.033F; - } - if (Main.expertMode) - { - npc.defense = npc.defDefense; - if (npc.whoAmI % 4 == 0) - num2 *= 1.75F; - if (npc.whoAmI % 4 == 1) - num2 *= 1.5F; - if (npc.whoAmI % 4 == 2) - num2 *= 1.25F; - if (npc.whoAmI % 3 == 0) - num2 *= 1.5F; - if (npc.whoAmI % 3 == 1) - num2 *= 1.25F; - num2 *= 0.75F; - } - float x = Main.npc[Main.wof].position.X + (Main.npc[Main.wof].width / 2); - float num3 = Main.npc[Main.wof].position.Y; - float num4 = (Main.wofB - Main.wofT); - float y = Main.wofT + num4 * npc.ai[0]; - ++npc.ai[2]; - if (npc.ai[2] > 100) - { - num2 = (int)(num2 * 1.29999995231628F); - if (npc.ai[2] > 200) - npc.ai[2] = 0.0F; - } - Vector2 vector2 = new Vector2(x, y); - float num5 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) - (npc.width / 2) - vector2.X; - float num6 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - (npc.height / 2) - vector2.Y; - float num7 = (float)Math.Sqrt(num5 * num5 + num6 * num6); - if (npc.ai[1] == 0) - { - if (num7 > num2) - { - float num8 = num2 / num7; - num5 *= num8; - num6 *= num8; - } - if (npc.position.X < x + num5) - { - npc.velocity.X = npc.velocity.X + num1; - if (npc.velocity.X < 0 && num5 > 0) - npc.velocity.X = npc.velocity.X + num1 * 2.5F; - } - else if (npc.position.X > x + num5) - { - npc.velocity.X = npc.velocity.X - num1; - if (npc.velocity.X > 0.0 && num5 < 0) - npc.velocity.X = npc.velocity.X - num1 * 2.5F; - } - if (npc.position.Y < y + num6) - { - npc.velocity.Y = npc.velocity.Y + num1; - if (npc.velocity.Y < 0.0 && num6 > 0) - npc.velocity.Y = npc.velocity.Y + num1 * 2.5F; - } - else if (npc.position.Y > y + num6) - { - npc.velocity.Y = npc.velocity.Y - num1; - if (npc.velocity.Y > 0.0 && num6 < 0.0) - npc.velocity.Y = npc.velocity.Y - num1 * 2.5f; - } - float num9 = 4f; - if (Main.expertMode && Main.wof >= 0) - { - float num8 = 1.5f; - float num10 = (Main.npc[Main.wof].life / Main.npc[Main.wof].lifeMax); - if (num10 < 0.75) - num8 += 0.7f; - if (num10 < 0.5) - num8 += 0.7f; - if (num10 < 0.25) - num8 += 0.9f; - if (num10 < 0.1) - num8 += 0.9f; - float num11 = num8 * 1.25f + 0.3f; - num9 += num11 * 0.35f; - if (npc.Center.X < Main.npc[Main.wof].Center.X && Main.npc[Main.wof].velocity.X > 0.0) - num9 += 6f; - if (npc.Center.X > Main.npc[Main.wof].Center.X && Main.npc[Main.wof].velocity.X < 0.0) - num9 += 6f; - } - if (npc.velocity.X > num9) - npc.velocity.X = num9; - if (npc.velocity.X < -num9) - npc.velocity.X = -num9; - if (npc.velocity.Y > num9) - npc.velocity.Y = num9; - if (npc.velocity.Y < -num9) - npc.velocity.Y = -num9; - } - else if (npc.ai[1] > 0) - --npc.ai[1]; - else - npc.ai[1] = 0; - if (num5 > 0) - { - npc.spriteDirection = 1; - npc.rotation = (float)Math.Atan2(num6, num5); - } - if (num5 < 0.0) - { - npc.spriteDirection = -1; - npc.rotation = (float)Math.Atan2(num6, num5) + 3.14f; - } - Lighting.AddLight((int)(npc.position.X + (npc.width / 2)) / 16, (int)(npc.position.Y + (npc.height / 2)) / 16, 0.3f, 0.2f, 0.1f); - } + public override bool PreAI() + { + if (npc.justHit) + npc.ai[1] = 10f; + if (Main.wof < 0) + { + npc.active = false; + } + else + { + npc.TargetClosest(true); + float num1 = 0.1f; + float num2 = 300f; + if (Main.npc[Main.wof].life < Main.npc[Main.wof].lifeMax * 0.25F) + { + npc.damage = (int)(75 * Main.damageMultiplier); + npc.defense = 40; + if (!Main.expertMode) + num2 = 900; + else + num1 += 0.1F; + } + else if (Main.npc[Main.wof].life < Main.npc[Main.wof].lifeMax * 0.5F) + { + npc.damage = (int)(60 * (double)Main.damageMultiplier); + npc.defense = 30; + if (!Main.expertMode) + num2 = 700; + else + num1 += 0.066F; + } + else if (Main.npc[Main.wof].life < Main.npc[Main.wof].lifeMax * 0.75F) + { + npc.damage = (int)(45 * Main.damageMultiplier); + npc.defense = 20; + if (!Main.expertMode) + num2 = 500; + else + num1 += 0.033F; + } + if (Main.expertMode) + { + npc.defense = npc.defDefense; + if (npc.whoAmI % 4 == 0) + num2 *= 1.75F; + if (npc.whoAmI % 4 == 1) + num2 *= 1.5F; + if (npc.whoAmI % 4 == 2) + num2 *= 1.25F; + if (npc.whoAmI % 3 == 0) + num2 *= 1.5F; + if (npc.whoAmI % 3 == 1) + num2 *= 1.25F; + num2 *= 0.75F; + } + float x = Main.npc[Main.wof].position.X + (Main.npc[Main.wof].width / 2); + float num3 = Main.npc[Main.wof].position.Y; + float num4 = (Main.wofB - Main.wofT); + float y = Main.wofT + num4 * npc.ai[0]; + ++npc.ai[2]; + if (npc.ai[2] > 100) + { + num2 = (int)(num2 * 1.29999995231628F); + if (npc.ai[2] > 200) + npc.ai[2] = 0.0F; + } + Vector2 vector2 = new Vector2(x, y); + float num5 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) - (npc.width / 2) - vector2.X; + float num6 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - (npc.height / 2) - vector2.Y; + float num7 = (float)Math.Sqrt(num5 * num5 + num6 * num6); + if (npc.ai[1] == 0) + { + if (num7 > num2) + { + float num8 = num2 / num7; + num5 *= num8; + num6 *= num8; + } + if (npc.position.X < x + num5) + { + npc.velocity.X = npc.velocity.X + num1; + if (npc.velocity.X < 0 && num5 > 0) + npc.velocity.X = npc.velocity.X + num1 * 2.5F; + } + else if (npc.position.X > x + num5) + { + npc.velocity.X = npc.velocity.X - num1; + if (npc.velocity.X > 0.0 && num5 < 0) + npc.velocity.X = npc.velocity.X - num1 * 2.5F; + } + if (npc.position.Y < y + num6) + { + npc.velocity.Y = npc.velocity.Y + num1; + if (npc.velocity.Y < 0.0 && num6 > 0) + npc.velocity.Y = npc.velocity.Y + num1 * 2.5F; + } + else if (npc.position.Y > y + num6) + { + npc.velocity.Y = npc.velocity.Y - num1; + if (npc.velocity.Y > 0.0 && num6 < 0.0) + npc.velocity.Y = npc.velocity.Y - num1 * 2.5f; + } + float num9 = 4f; + if (Main.expertMode && Main.wof >= 0) + { + float num8 = 1.5f; + float num10 = (Main.npc[Main.wof].life / Main.npc[Main.wof].lifeMax); + if (num10 < 0.75) + num8 += 0.7f; + if (num10 < 0.5) + num8 += 0.7f; + if (num10 < 0.25) + num8 += 0.9f; + if (num10 < 0.1) + num8 += 0.9f; + float num11 = num8 * 1.25f + 0.3f; + num9 += num11 * 0.35f; + if (npc.Center.X < Main.npc[Main.wof].Center.X && Main.npc[Main.wof].velocity.X > 0.0) + num9 += 6f; + if (npc.Center.X > Main.npc[Main.wof].Center.X && Main.npc[Main.wof].velocity.X < 0.0) + num9 += 6f; + } + if (npc.velocity.X > num9) + npc.velocity.X = num9; + if (npc.velocity.X < -num9) + npc.velocity.X = -num9; + if (npc.velocity.Y > num9) + npc.velocity.Y = num9; + if (npc.velocity.Y < -num9) + npc.velocity.Y = -num9; + } + else if (npc.ai[1] > 0) + --npc.ai[1]; + else + npc.ai[1] = 0; + if (num5 > 0) + { + npc.spriteDirection = 1; + npc.rotation = (float)Math.Atan2(num6, num5); + } + if (num5 < 0.0) + { + npc.spriteDirection = -1; + npc.rotation = (float)Math.Atan2(num6, num5) + 3.14f; + } + Lighting.AddLight((int)(npc.position.X + (npc.width / 2)) / 16, (int)(npc.position.Y + (npc.height / 2)) / 16, 0.3f, 0.2f, 0.1f); + } - return false; - } + return false; + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Gore.NewGore(npc.position, npc.velocity, 99, 1f); - Gore.NewGore(npc.position, npc.velocity, 99, 1f); - Gore.NewGore(npc.position, npc.velocity, 99, 1f); -NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, -mod.NPCType("ShadowHandTwo")); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, + mod.NPCType("ShadowHandTwo")); + } + } - public override void FindFrame(int frameHeight) - { - npc.frameCounter++; - if (npc.frameCounter >= 15) - { - npc.frame.Y = (npc.frame.Y + frameHeight) % (Main.npcFrameCount[npc.type] * frameHeight); - npc.frameCounter = 0; - } + public override void FindFrame(int frameHeight) + { + npc.frameCounter++; + if (npc.frameCounter >= 15) + { + npc.frame.Y = (npc.frame.Y + frameHeight) % (Main.npcFrameCount[npc.type] * frameHeight); + npc.frameCounter = 0; + } - npc.spriteDirection = -npc.direction; - } - } + npc.spriteDirection = -npc.direction; + } + } } diff --git a/NPCs/ShadowHandTwo.cs b/NPCs/ShadowHandTwo.cs index 1bdab881..e49d99f6 100644 --- a/NPCs/ShadowHandTwo.cs +++ b/NPCs/ShadowHandTwo.cs @@ -6,58 +6,60 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class ShadowHandTwo : ModNPC +namespace Tremor.NPCs { + + public class ShadowHandTwo : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Shadow Hand"); Main.npcFrameCount[npc.type] = 2; } - - - public override void SetDefaults() - { - npc.lifeMax = 780; - npc.damage = 56; - npc.defense = 24; - npc.knockBackResist = 0f; - npc.width = 50; - npc.height = 78; - animationType = 6; - aiType = 6; - npc.aiStyle = 5; - npc.npcSlots = 0.5f; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit31; - npc.noGravity = true; - npc.DeathSound = SoundID.NPCDeath6; - npc.value = Item.buyPrice(0, 0, 0, 9); - } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - if(Main.expertMode) - target.AddBuff(153, 120); - } - - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } - - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Gore.NewGore(npc.position, npc.velocity, 99, 1f); - Gore.NewGore(npc.position, npc.velocity, 99, 1f); - Gore.NewGore(npc.position, npc.velocity, 99, 1f); - Gore.NewGore(npc.position, npc.velocity, 99, 1f); - Gore.NewGore(npc.position, npc.velocity, 99, 1f); - } -} - -}} \ No newline at end of file + + + public override void SetDefaults() + { + npc.lifeMax = 780; + npc.damage = 56; + npc.defense = 24; + npc.knockBackResist = 0f; + npc.width = 50; + npc.height = 78; + animationType = 6; + aiType = 6; + npc.aiStyle = 5; + npc.npcSlots = 0.5f; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit31; + npc.noGravity = true; + npc.DeathSound = SoundID.NPCDeath6; + npc.value = Item.buyPrice(0, 0, 0, 9); + } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + if (Main.expertMode) + target.AddBuff(153, 120); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + } + } + + } +} \ No newline at end of file diff --git a/NPCs/ShadowRipper.cs b/NPCs/ShadowRipper.cs index faa3f20f..6ef554d8 100644 --- a/NPCs/ShadowRipper.cs +++ b/NPCs/ShadowRipper.cs @@ -6,93 +6,95 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class ShadowRipper : ModNPC +namespace Tremor.NPCs { + + public class ShadowRipper : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Shadow Ripper"); Main.npcFrameCount[npc.type] = 2; } - - public override void SetDefaults() - { - npc.lifeMax = 2400; - npc.damage = 160; - npc.alpha = 120; - npc.defense = 32; - npc.knockBackResist = 0f; - npc.width = 50; - npc.height = 78; - animationType = 6; - aiType = 6; - npc.aiStyle = 5; - npc.npcSlots = 0.5f; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit31; - npc.noGravity = true; - npc.DeathSound = SoundID.NPCDeath6; - npc.value = Item.buyPrice(0, 0, 25, 9); - banner = npc.type; - bannerItem = mod.ItemType("ShadowRipperBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 2400; + npc.damage = 160; + npc.alpha = 120; + npc.defense = 32; + npc.knockBackResist = 0f; + npc.width = 50; + npc.height = 78; + animationType = 6; + aiType = 6; + npc.aiStyle = 5; + npc.npcSlots = 0.5f; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit31; + npc.noGravity = true; + npc.DeathSound = SoundID.NPCDeath6; + npc.value = Item.buyPrice(0, 0, 25, 9); + banner = npc.type; + bannerItem = mod.ItemType("ShadowRipperBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Doomstone")); - } - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Doomstone")); + } + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return Main.hardMode && NPC.downedMoonlord && !spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.04f : 0f; - } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/RipperGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/RipperGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/RipperGore3"), 1f); - } - else - { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 74, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 74, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 74, (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return Main.hardMode && NPC.downedMoonlord && !spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.04f : 0f; + } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/RipperGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/RipperGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/RipperGore3"), 1f); + } + else + { + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 74, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 74, (float)hitDirection, -1f, 0, default(Color), 0.7f); + } + } + } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/ShadowSteed.cs b/NPCs/ShadowSteed.cs index 729cb8ae..61bd13b4 100644 --- a/NPCs/ShadowSteed.cs +++ b/NPCs/ShadowSteed.cs @@ -11,99 +11,99 @@ namespace Tremor.NPCs { - public class ShadowSteed : ModNPC - { + public class ShadowSteed : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Shadow Steed"); - Main.npcFrameCount[npc.type] = 6; + Main.npcFrameCount[npc.type] = 6; } - public override void SetDefaults() - { - npc.width = npc.height = 48; - npc.lifeMax = 940; - npc.damage = 75; - npc.defense = 30; - npc.knockBackResist = 0.2f; - npc.HitSound = SoundID.NPCHit31; - npc.noGravity = true; - npc.DeathSound = SoundID.NPCDeath6; - npc.noTileCollide = true; - } + public override void SetDefaults() + { + npc.width = npc.height = 48; + npc.lifeMax = 940; + npc.damage = 75; + npc.defense = 30; + npc.knockBackResist = 0.2f; + npc.HitSound = SoundID.NPCHit31; + npc.noGravity = true; + npc.DeathSound = SoundID.NPCDeath6; + npc.noTileCollide = true; + } - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - if(Main.expertMode) - target.AddBuff(153, 180); - } + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + if (Main.expertMode) + target.AddBuff(153, 180); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Gore.NewGore(npc.position, npc.velocity, 99, 1f); - Gore.NewGore(npc.position, npc.velocity, 99, 1f); - Gore.NewGore(npc.position, npc.velocity, 99, 1f); - Gore.NewGore(npc.position, npc.velocity, 99, 1f); - Gore.NewGore(npc.position, npc.velocity, 99, 1f); - Gore.NewGore(npc.position, npc.velocity, 99, 1f); -NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, -mod.NPCType("ShadowHandTwo")); -NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, -mod.NPCType("ShadowHandTwo")); -NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, -mod.NPCType("ShadowHandTwo")); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, + mod.NPCType("ShadowHandTwo")); + NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, + mod.NPCType("ShadowHandTwo")); + NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, + mod.NPCType("ShadowHandTwo")); + } + } - public override bool PreAI() - { - npc.rotation = npc.velocity.ToRotation(); + public override bool PreAI() + { + npc.rotation = npc.velocity.ToRotation(); - npc.TargetClosest(true); - Player targetPlayer = Main.player[npc.target]; - if (!targetPlayer.active || targetPlayer.dead) - { - npc.target = -1; - npc.netUpdate = true; - } - else - { - float currentRot = npc.velocity.ToRotation(); - Vector2 direction = targetPlayer.Center - npc.Center; - float targetAngle = direction.ToRotation(); - if (direction == Vector2.Zero) - { - targetAngle = currentRot; - } + npc.TargetClosest(true); + Player targetPlayer = Main.player[npc.target]; + if (!targetPlayer.active || targetPlayer.dead) + { + npc.target = -1; + npc.netUpdate = true; + } + else + { + float currentRot = npc.velocity.ToRotation(); + Vector2 direction = targetPlayer.Center - npc.Center; + float targetAngle = direction.ToRotation(); + if (direction == Vector2.Zero) + { + targetAngle = currentRot; + } - float desiredRot = currentRot.AngleLerp(targetAngle, 0.06f); - npc.velocity = new Vector2(npc.velocity.Length(), 0f).RotatedBy(desiredRot, default(Vector2)); - } - return false; - } + float desiredRot = currentRot.AngleLerp(targetAngle, 0.06f); + npc.velocity = new Vector2(npc.velocity.Length(), 0f).RotatedBy(desiredRot, default(Vector2)); + } + return false; + } - public override void FindFrame(int frameHeight) - { - npc.frameCounter++; - if (npc.frameCounter >= 5) - { - npc.frame.Y = (npc.frame.Y + frameHeight) % (Main.npcFrameCount[npc.type] * frameHeight); - npc.frameCounter = 0; - } - // npc.spriteDirection = -npc.direction; - } + public override void FindFrame(int frameHeight) + { + npc.frameCounter++; + if (npc.frameCounter >= 5) + { + npc.frame.Y = (npc.frame.Y + frameHeight) % (Main.npcFrameCount[npc.type] * frameHeight); + npc.frameCounter = 0; + } + // npc.spriteDirection = -npc.direction; + } - public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) - { - Texture2D texture = Main.npcTexture[npc.type]; - Vector2 origin = new Vector2(texture.Width * 0.5F, (texture.Height / Main.npcFrameCount[npc.type]) * 0.5F); - SpriteEffects effects = npc.velocity.X < 0 ? SpriteEffects.FlipVertically : SpriteEffects.None; - spriteBatch.Draw(texture, npc.Center - Main.screenPosition, npc.frame, drawColor, npc.rotation, origin, 1, effects, 0); + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) + { + Texture2D texture = Main.npcTexture[npc.type]; + Vector2 origin = new Vector2(texture.Width * 0.5F, (texture.Height / Main.npcFrameCount[npc.type]) * 0.5F); + SpriteEffects effects = npc.velocity.X < 0 ? SpriteEffects.FlipVertically : SpriteEffects.None; + spriteBatch.Draw(texture, npc.Center - Main.screenPosition, npc.frame, drawColor, npc.rotation, origin, 1, effects, 0); - return false; - } - } + return false; + } + } } diff --git a/NPCs/Shnoot.cs b/NPCs/Shnoot.cs index 96187cff..cd2e3ed0 100644 --- a/NPCs/Shnoot.cs +++ b/NPCs/Shnoot.cs @@ -6,88 +6,90 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Shnoot : ModNPC +namespace Tremor.NPCs { + + public class Shnoot : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Shnoot"); Main.npcFrameCount[npc.type] = 3; } - - public override void SetDefaults() - { - npc.lifeMax = 300; - npc.damage = 23; - npc.defense = 34; - npc.knockBackResist = 0.3f; - npc.width = 130; - npc.height = 140; - animationType = 141; - npc.aiStyle = 1; - npc.npcSlots = 1f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath17; - npc.value = Item.buyPrice(0, 0, 1, 24); - banner = npc.type; - bannerItem = mod.ItemType("ShnootBanner"); - } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Gloomstone"), Main.rand.Next(6,15)); - } - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("RockHorn"), Main.rand.Next(1,3)); - } - } - } + public override void SetDefaults() + { + npc.lifeMax = 300; + npc.damage = 23; + npc.defense = 34; + npc.knockBackResist = 0.3f; + npc.width = 130; + npc.height = 140; + animationType = 141; + npc.aiStyle = 1; + npc.npcSlots = 1f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath17; + npc.value = Item.buyPrice(0, 0, 1, 24); + banner = npc.type; + bannerItem = mod.ItemType("ShnootBanner"); + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Gloomstone"), Main.rand.Next(6, 15)); + } + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("RockHorn"), Main.rand.Next(1, 3)); + } + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && y > Main.rockLayer ? 0.005f : 0f; - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && y > Main.rockLayer ? 0.005f : 0f; + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 60; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ShnootGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ShnootGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ShnootGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ShnootGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ShnootGore2"), 1f); - } - else - { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } -} -}} \ No newline at end of file + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 60; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ShnootGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ShnootGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ShnootGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ShnootGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ShnootGore2"), 1f); + } + else + { + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + } + } + } + } +} \ No newline at end of file diff --git a/NPCs/Shroot.cs b/NPCs/Shroot.cs index 8a35497d..a3999ef4 100644 --- a/NPCs/Shroot.cs +++ b/NPCs/Shroot.cs @@ -6,89 +6,91 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Shroot : ModNPC +namespace Tremor.NPCs { + + public class Shroot : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Shroot"); Main.npcFrameCount[npc.type] = 3; } - - public override void SetDefaults() - { - npc.lifeMax = 275; - npc.damage = 28; - npc.defense = 34; - npc.knockBackResist = 0.3f; - npc.width = 130; - npc.height = 140; - animationType = 141; - npc.aiStyle = 1; - npc.npcSlots = 1f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath17; - npc.scale = 0.7f; - npc.value = Item.buyPrice(0, 0, 1, 24); - banner = npc.type; - bannerItem = mod.ItemType("ShrootBanner"); - } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Gloomstone"), Main.rand.Next(5,12)); - } - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("RockHorn"), Main.rand.Next(1,2)); - } - } - } + public override void SetDefaults() + { + npc.lifeMax = 275; + npc.damage = 28; + npc.defense = 34; + npc.knockBackResist = 0.3f; + npc.width = 130; + npc.height = 140; + animationType = 141; + npc.aiStyle = 1; + npc.npcSlots = 1f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath17; + npc.scale = 0.7f; + npc.value = Item.buyPrice(0, 0, 1, 24); + banner = npc.type; + bannerItem = mod.ItemType("ShrootBanner"); + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Gloomstone"), Main.rand.Next(5, 12)); + } + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("RockHorn"), Main.rand.Next(1, 2)); + } + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && y > Main.rockLayer ? 0.003f : 0f; - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && y > Main.rockLayer ? 0.003f : 0f; + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 60; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ShnootGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ShnootGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ShnootGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ShnootGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ShnootGore2"), 1f); - } - else - { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } -} -}} \ No newline at end of file + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 60; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ShnootGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ShnootGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ShnootGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ShnootGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ShnootGore2"), 1f); + } + else + { + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, (float)hitDirection, -1f, 0, default(Color), 0.7f); + } + } + } + } +} \ No newline at end of file diff --git a/NPCs/Sighted.cs b/NPCs/Sighted.cs index f5fe7789..11e61dda 100644 --- a/NPCs/Sighted.cs +++ b/NPCs/Sighted.cs @@ -6,63 +6,65 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Sighted : ModNPC +namespace Tremor.NPCs { + + public class Sighted : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Sighted"); Main.npcFrameCount[npc.type] = 6; } - - public override void SetDefaults() - { - npc.lifeMax = 2400; - npc.damage = 120; - npc.defense = 70; - npc.knockBackResist = 0.3f; - npc.width = 34; - npc.height = 46; - npc.noTileCollide = true; - animationType = 4; - npc.aiStyle = 4; - npc.noGravity = true; - npc.npcSlots = 6f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 1, 4, 7); - banner = npc.type; - bannerItem = mod.ItemType("SightedBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 2400; + npc.damage = 120; + npc.defense = 70; + npc.knockBackResist = 0.3f; + npc.width = 34; + npc.height = 46; + npc.noTileCollide = true; + animationType = 4; + npc.aiStyle = 4; + npc.noGravity = true; + npc.npcSlots = 6f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 1, 4, 7); + banner = npc.type; + bannerItem = mod.ItemType("SightedBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SightedGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SightedGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SightedGore3"), 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3f); - } -} - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.01f : 0f; - } -}} \ No newline at end of file + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SightedGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SightedGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SightedGore3"), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3f); + } + } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.01f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/SignalDron.cs b/NPCs/SignalDron.cs index f2be824c..27490a03 100644 --- a/NPCs/SignalDron.cs +++ b/NPCs/SignalDron.cs @@ -6,84 +6,84 @@ namespace Tremor.NPCs { - public class SignalDron : ModNPC - { + public class SignalDron : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Signal Drone"); } - - public override void SetDefaults() - { - npc.noTileCollide = true; - npc.noGravity = true; - npc.lifeMax = 1500; - npc.damage = 75; - npc.defense = 18; - npc.knockBackResist = 0f; - npc.width = 90; - npc.height = 90; - npc.aiStyle = 0; - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath14; - } - - public override void AI() - { - if (Main.npc[(int)npc.ai[3]].type != mod.NPCType("Motherboard") || !Main.npc[(int)npc.ai[3]].active) - { - npc.active = false; - npc.netUpdate = true; - } - else if ((double)npc.ai[0] == 0.0) - { - Vector2 vector2 = new Vector2(npc.Center.X, npc.Center.Y); - float num1 = Main.npc[(int)npc.ai[3]].Center.X - vector2.X; - float num2 = Main.npc[(int)npc.ai[3]].Center.Y - vector2.Y; - float num3 = (float)Math.Sqrt((double)num1 * (double)num1 + (double)num2 * (double)num2); - if ((double)num3 > 90.0) - { - float num4 = 8f / num3; - float num5 = num1 * num4; - float num6 = num2 * num4; - npc.velocity.X = (float)(((double)npc.velocity.X * 15.0 + (double)num5) / 16.0); - npc.velocity.Y = (float)(((double)npc.velocity.Y * 15.0 + (double)num6) / 16.0); - } - else - { - if ((double)Math.Abs(npc.velocity.X) + (double)Math.Abs(npc.velocity.Y) < 8.0) - { - npc.velocity.Y *= 1.05f; - npc.velocity.X *= 1.05f; - } - if (Main.netMode == 1 || (!Main.expertMode || Main.rand.Next(100) != 0) && Main.rand.Next(200) != 0) - return; - npc.TargetClosest(true); - vector2 = new Vector2(npc.Center.X, npc.Center.Y); - float num4 = Main.player[npc.target].Center.X - vector2.X; - float num5 = Main.player[npc.target].Center.Y - vector2.Y; - float num6 = 8f / (float)Math.Sqrt((double)num4 * (double)num4 + (double)num5 * (double)num5); - npc.velocity.X = num4 * num6; - npc.velocity.Y = num5 * num6; - npc.ai[0] = 1f; - npc.netUpdate = true; - } - } - else - { - if (Main.expertMode) - { - Vector2 vector2 = Main.player[npc.target].Center - npc.Center; - vector2.Normalize(); - npc.velocity = (npc.velocity * 99f + vector2 * 9f) / 100f; - } - Vector2 vector2_1 = new Vector2(npc.Center.X, npc.Center.Y); - float num1 = Main.npc[(int)npc.ai[3]].Center.X - vector2_1.X; - float num2 = Main.npc[(int)npc.ai[3]].Center.Y - vector2_1.Y; - if (Math.Sqrt((double)num1 * (double)num1 + (double)num2 * (double)num2) <= 700.0 && !npc.justHit) - return; - npc.ai[0] = 0.0f; - } - } - } + + public override void SetDefaults() + { + npc.noTileCollide = true; + npc.noGravity = true; + npc.lifeMax = 1500; + npc.damage = 75; + npc.defense = 18; + npc.knockBackResist = 0f; + npc.width = 90; + npc.height = 90; + npc.aiStyle = 0; + npc.HitSound = SoundID.NPCHit4; + npc.DeathSound = SoundID.NPCDeath14; + } + + public override void AI() + { + if (Main.npc[(int)npc.ai[3]].type != mod.NPCType("Motherboard") || !Main.npc[(int)npc.ai[3]].active) + { + npc.active = false; + npc.netUpdate = true; + } + else if ((double)npc.ai[0] == 0.0) + { + Vector2 vector2 = new Vector2(npc.Center.X, npc.Center.Y); + float num1 = Main.npc[(int)npc.ai[3]].Center.X - vector2.X; + float num2 = Main.npc[(int)npc.ai[3]].Center.Y - vector2.Y; + float num3 = (float)Math.Sqrt((double)num1 * (double)num1 + (double)num2 * (double)num2); + if ((double)num3 > 90.0) + { + float num4 = 8f / num3; + float num5 = num1 * num4; + float num6 = num2 * num4; + npc.velocity.X = (float)(((double)npc.velocity.X * 15.0 + (double)num5) / 16.0); + npc.velocity.Y = (float)(((double)npc.velocity.Y * 15.0 + (double)num6) / 16.0); + } + else + { + if ((double)Math.Abs(npc.velocity.X) + (double)Math.Abs(npc.velocity.Y) < 8.0) + { + npc.velocity.Y *= 1.05f; + npc.velocity.X *= 1.05f; + } + if (Main.netMode == 1 || (!Main.expertMode || Main.rand.Next(100) != 0) && Main.rand.Next(200) != 0) + return; + npc.TargetClosest(true); + vector2 = new Vector2(npc.Center.X, npc.Center.Y); + float num4 = Main.player[npc.target].Center.X - vector2.X; + float num5 = Main.player[npc.target].Center.Y - vector2.Y; + float num6 = 8f / (float)Math.Sqrt((double)num4 * (double)num4 + (double)num5 * (double)num5); + npc.velocity.X = num4 * num6; + npc.velocity.Y = num5 * num6; + npc.ai[0] = 1f; + npc.netUpdate = true; + } + } + else + { + if (Main.expertMode) + { + Vector2 vector2 = Main.player[npc.target].Center - npc.Center; + vector2.Normalize(); + npc.velocity = (npc.velocity * 99f + vector2 * 9f) / 100f; + } + Vector2 vector2_1 = new Vector2(npc.Center.X, npc.Center.Y); + float num1 = Main.npc[(int)npc.ai[3]].Center.X - vector2_1.X; + float num2 = Main.npc[(int)npc.ai[3]].Center.Y - vector2_1.Y; + if (Math.Sqrt((double)num1 * (double)num1 + (double)num2 * (double)num2) <= 700.0 && !npc.justHit) + return; + npc.ai[0] = 0.0f; + } + } + } } \ No newline at end of file diff --git a/NPCs/SkeletonKnight.cs b/NPCs/SkeletonKnight.cs index 3ad04615..7621f455 100644 --- a/NPCs/SkeletonKnight.cs +++ b/NPCs/SkeletonKnight.cs @@ -13,7 +13,7 @@ public override void SetStaticDefaults() DisplayName.SetDefault("Skeleton Knight"); Main.npcFrameCount[npc.type] = 7; } - + public override void SetDefaults() { npc.width = 40; @@ -23,65 +23,65 @@ public override void SetDefaults() npc.lifeMax = 270; npc.HitSound = SoundID.NPCHit2; npc.DeathSound = SoundID.NPCDeath6; - npc.value = Item.buyPrice(0, 0, 5, 7); + npc.value = Item.buyPrice(0, 0, 5, 7); npc.knockBackResist = 0.5f; npc.aiStyle = 3; aiType = 434; animationType = 434; - banner = npc.type; - bannerItem = mod.ItemType("SkeletonKnightBanner"); + banner = npc.type; + bannerItem = mod.ItemType("SkeletonKnightBanner"); } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedBoss3 && y > Main.rockLayer ? 0.02f : 0f; - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedBoss3 && y > Main.rockLayer ? 0.02f : 0f; + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 150, Main.rand.Next(3,6)); - } - if(Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 154, Main.rand.Next(1,3)); - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 150, Main.rand.Next(3, 6)); + } + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 154, Main.rand.Next(1, 3)); + } - if(Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TornPapyrus")); - }; + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TornPapyrus")); + }; - } - } + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SkelKnightGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SkelKnightGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SkelKnightGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SkelKnightGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SkelKnightGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, -mod.GetGoreSlot("Gores/SkelKnightGore4"), 1f); + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SkelKnightGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SkelKnightGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SkelKnightGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SkelKnightGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SkelKnightGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, + mod.GetGoreSlot("Gores/SkelKnightGore4"), 1f); - } -} + } + } } } diff --git a/NPCs/Skullker.cs b/NPCs/Skullker.cs index 541eec69..9c98f1b7 100644 --- a/NPCs/Skullker.cs +++ b/NPCs/Skullker.cs @@ -6,75 +6,77 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Skullker : ModNPC +namespace Tremor.NPCs { + + public class Skullker : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Skullker"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 4000; - npc.damage = 122; - npc.defense = 90; - npc.knockBackResist = 0.2f; - npc.width = 75; - npc.height = 95; - animationType = 82; - npc.noGravity = true; - npc.noTileCollide = true; - npc.aiStyle = 22; - aiType = 82; - npc.npcSlots = 5f; - npc.HitSound = SoundID.NPCHit2; - npc.DeathSound = SoundID.NPCDeath52; - npc.value = Item.buyPrice(0, 0, 8, 0); - banner = npc.type; - bannerItem = mod.ItemType("SkullkerBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 4000; + npc.damage = 122; + npc.defense = 90; + npc.knockBackResist = 0.2f; + npc.width = 75; + npc.height = 95; + animationType = 82; + npc.noGravity = true; + npc.noTileCollide = true; + npc.aiStyle = 22; + aiType = 82; + npc.npcSlots = 5f; + npc.HitSound = SoundID.NPCHit2; + npc.DeathSound = SoundID.NPCDeath52; + npc.value = Item.buyPrice(0, 0, 8, 0); + banner = npc.type; + bannerItem = mod.ItemType("SkullkerBanner"); + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDungeon && NPC.downedMoonlord && Main.hardMode && y > Main.rockLayer ? 0.006f : 0f; - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 60; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SkullkerGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SkullkerGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SkullkerGore3"), 1f); - } - else - { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - } -} -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDungeon && NPC.downedMoonlord && Main.hardMode && y > Main.rockLayer ? 0.006f : 0f; + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 60; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SkullkerGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SkullkerGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SkullkerGore3"), 1f); + } + else + { + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + } + } + } +} \ No newline at end of file diff --git a/NPCs/SnowBat.cs b/NPCs/SnowBat.cs index 7d299cd2..262b3bc2 100644 --- a/NPCs/SnowBat.cs +++ b/NPCs/SnowBat.cs @@ -6,76 +6,78 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class SnowBat : ModNPC +namespace Tremor.NPCs { + + public class SnowBat : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Snow Bat"); Main.npcFrameCount[npc.type] = 5; } - - public override void SetDefaults() - { - npc.lifeMax = 30; - npc.damage = 16; - npc.defense = 5; - npc.knockBackResist = 0.3f; - npc.width = 22; - npc.height = 18; - animationType = 49; - npc.aiStyle = 14; - npc.npcSlots = 0.2f; - npc.HitSound = SoundID.NPCHit1; - npc.noGravity = true; - npc.DeathSound = SoundID.NPCDeath4; - npc.value = Item.buyPrice(0, 0, 2, 9); - banner = npc.type; - bannerItem = mod.ItemType("SnowBatBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 30; + npc.damage = 16; + npc.defense = 5; + npc.knockBackResist = 0.3f; + npc.width = 22; + npc.height = 18; + animationType = 49; + npc.aiStyle = 14; + npc.npcSlots = 0.2f; + npc.HitSound = SoundID.NPCHit1; + npc.noGravity = true; + npc.DeathSound = SoundID.NPCDeath4; + npc.value = Item.buyPrice(0, 0, 2, 9); + banner = npc.type; + bannerItem = mod.ItemType("SnowBatBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 593); - } - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 593); + } + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); - } - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3f); - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2f); - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3f); + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && Main.cloudAlpha > 0f && y < Main.worldSurface && spawnInfo.player.ZoneSnow ? 0.01f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && Main.cloudAlpha > 0f && y < Main.worldSurface && spawnInfo.player.ZoneSnow ? 0.01f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/SnowEater.cs b/NPCs/SnowEater.cs index 04a366c7..103d12b8 100644 --- a/NPCs/SnowEater.cs +++ b/NPCs/SnowEater.cs @@ -6,191 +6,193 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class SnowEater : ModNPC +namespace Tremor.NPCs { + + public class SnowEater : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Snow Eater"); Main.npcFrameCount[npc.type] = 5; } - - public override void SetDefaults() - { - npc.lifeMax = 70; - npc.damage = 13; - npc.defense = 7; - npc.knockBackResist = 0.0f; - npc.width = 24; - npc.height = 24; - animationType = 69; - npc.aiStyle = -1; - npc.behindTiles = true; - npc.npcSlots = 0.1f; - npc.HitSound = SoundID.NPCHit31; - npc.DeathSound = SoundID.NPCDeath34; - npc.value = Item.buyPrice(0, 0, 12, 0); - banner = npc.type; - bannerItem = mod.ItemType("SnowEaterBanner"); - } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FrostCore")); - }; - if(NPC.downedMoonlord && Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); - } - } - } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return spawnInfo.player.ZoneSnow && y > Main.rockLayer ? 0.01f : 0f; - } + public override void SetDefaults() + { + npc.lifeMax = 70; + npc.damage = 13; + npc.defense = 7; + npc.knockBackResist = 0.0f; + npc.width = 24; + npc.height = 24; + animationType = 69; + npc.aiStyle = -1; + npc.behindTiles = true; + npc.npcSlots = 0.1f; + npc.HitSound = SoundID.NPCHit31; + npc.DeathSound = SoundID.NPCDeath34; + npc.value = Item.buyPrice(0, 0, 12, 0); + banner = npc.type; + bannerItem = mod.ItemType("SnowEaterBanner"); + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FrostCore")); + }; + if (NPC.downedMoonlord && Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); + } + } + } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return spawnInfo.player.ZoneSnow && y > Main.rockLayer ? 0.01f : 0f; + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SEGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SEGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SEGore2"), 1f); - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); - } - } -} + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void AI() - { -npc.TargetClosest(true); - float num679 = 12f; - Vector2 vector67 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float num680 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector67.X; - float num681 = Main.player[npc.target].position.Y - vector67.Y; - float num682 = (float)Math.Sqrt((double)(num680 * num680 + num681 * num681)); - num682 = num679 / num682; - num680 *= num682; - num681 *= num682; - bool flag74 = false; - if (npc.directionY < 0) - { - npc.rotation = (float)(Math.Atan2((double)num681, (double)num680) + 1.57); - flag74 = ((double)npc.rotation >= -1.2 && (double)npc.rotation <= 1.2); - if ((double)npc.rotation < -0.8) - { - npc.rotation = -0.8f; - } - else if ((double)npc.rotation > 0.8) - { - npc.rotation = 0.8f; - } - if (npc.velocity.X != 0f) - { - npc.velocity.X = npc.velocity.X * 0.9f; - if ((double)npc.velocity.X > -0.1 || (double)npc.velocity.X < 0.1) - { - npc.netUpdate = true; - npc.velocity.X = 0f; - } - } - } - if (npc.ai[0] > 0f) - { - if (npc.ai[0] == 200f) - { - Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 5); - } - npc.ai[0] -= 1f; - } - if (Main.netMode != 1 && flag74 && npc.ai[0] == 0f && Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SEGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SEGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SEGore2"), 1f); + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 80, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); + } + } + } + + public override void AI() + { + npc.TargetClosest(true); + float num679 = 12f; + Vector2 vector67 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float num680 = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - vector67.X; + float num681 = Main.player[npc.target].position.Y - vector67.Y; + float num682 = (float)Math.Sqrt((double)(num680 * num680 + num681 * num681)); + num682 = num679 / num682; + num680 *= num682; + num681 *= num682; + bool flag74 = false; + if (npc.directionY < 0) + { + npc.rotation = (float)(Math.Atan2((double)num681, (double)num680) + 1.57); + flag74 = ((double)npc.rotation >= -1.2 && (double)npc.rotation <= 1.2); + if ((double)npc.rotation < -0.8) + { + npc.rotation = -0.8f; + } + else if ((double)npc.rotation > 0.8) + { + npc.rotation = 0.8f; + } + if (npc.velocity.X != 0f) + { + npc.velocity.X = npc.velocity.X * 0.9f; + if ((double)npc.velocity.X > -0.1 || (double)npc.velocity.X < 0.1) { - npc.ai[0] = 200f; - int num683 = 10; - int num684 = 109; - int num685 = Projectile.NewProjectile(vector67.X, vector67.Y, num680, num681, num684, num683, 0f, Main.myPlayer, 0f, 0f); - Main.projectile[num685].ai[0] = 2f; - Main.projectile[num685].timeLeft = 300; - Main.projectile[num685].friendly = false; - //NetMessage.SendData(27, -1, -1, "", num685, 0f, 0f, 0f, 0, 0, 0); npc.netUpdate = true; + npc.velocity.X = 0f; } - try + } + } + if (npc.ai[0] > 0f) + { + if (npc.ai[0] == 200f) + { + Main.PlaySound(2, (int)npc.position.X, (int)npc.position.Y, 5); + } + npc.ai[0] -= 1f; + } + if (Main.netMode != 1 && flag74 && npc.ai[0] == 0f && Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + { + npc.ai[0] = 200f; + int num683 = 10; + int num684 = 109; + int num685 = Projectile.NewProjectile(vector67.X, vector67.Y, num680, num681, num684, num683, 0f, Main.myPlayer, 0f, 0f); + Main.projectile[num685].ai[0] = 2f; + Main.projectile[num685].timeLeft = 300; + Main.projectile[num685].friendly = false; + //NetMessage.SendData(27, -1, -1, "", num685, 0f, 0f, 0f, 0, 0, 0); + npc.netUpdate = true; + } + try + { + int num686 = (int)npc.position.X / 16; + int num687 = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int num688 = (int)(npc.position.X + (float)npc.width) / 16; + int num689 = (int)(npc.position.Y + (float)npc.height) / 16; + bool flag75 = false; + if (Main.tile[num686, num689] == null) + { + Main.tile[num686, num689] = new Tile(); + } + if (Main.tile[num687, num689] == null) + { + Main.tile[num686, num689] = new Tile(); + } + if (Main.tile[num688, num689] == null) + { + Main.tile[num686, num689] = new Tile(); + } + if ((Main.tile[num686, num689].nactive() && Main.tileSolid[(int)Main.tile[num686, num689].type]) || (Main.tile[num687, num689].nactive() && Main.tileSolid[(int)Main.tile[num687, num689].type]) || (Main.tile[num688, num689].nactive() && Main.tileSolid[(int)Main.tile[num688, num689].type])) + { + flag75 = true; + } + if (flag75) + { + npc.noGravity = true; + npc.noTileCollide = true; + npc.velocity.Y = -0.2f; + } + else + { + npc.noGravity = false; + npc.noTileCollide = false; + if (Main.rand.Next(2) == 0) { - int num686 = (int)npc.position.X / 16; - int num687 = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int num688 = (int)(npc.position.X + (float)npc.width) / 16; - int num689 = (int)(npc.position.Y + (float)npc.height) / 16; - bool flag75 = false; - if (Main.tile[num686, num689] == null) - { - Main.tile[num686, num689] = new Tile(); - } - if (Main.tile[num687, num689] == null) - { - Main.tile[num686, num689] = new Tile(); - } - if (Main.tile[num688, num689] == null) + int num690 = Dust.NewDust(new Vector2(npc.position.X - 4f, npc.position.Y + (float)npc.height - 8f), npc.width + 8, 24, 80, 0f, npc.velocity.Y / 2f, 0, default(Color), 1f); + Dust expr_28A1C_cp_0 = Main.dust[num690]; + expr_28A1C_cp_0.velocity.X = expr_28A1C_cp_0.velocity.X * 0.4f; + Dust expr_28A3C_cp_0 = Main.dust[num690]; + expr_28A3C_cp_0.velocity.Y = expr_28A3C_cp_0.velocity.Y * -1f; + if (Main.rand.Next(2) == 0) { - Main.tile[num686, num689] = new Tile(); + Main.dust[num690].noGravity = true; + Main.dust[num690].scale += 0.2f; } - if ((Main.tile[num686, num689].nactive() && Main.tileSolid[(int)Main.tile[num686, num689].type]) || (Main.tile[num687, num689].nactive() && Main.tileSolid[(int)Main.tile[num687, num689].type]) || (Main.tile[num688, num689].nactive() && Main.tileSolid[(int)Main.tile[num688, num689].type])) - { - flag75 = true; - } - if (flag75) - { - npc.noGravity = true; - npc.noTileCollide = true; - npc.velocity.Y = -0.2f; - } - else - { - npc.noGravity = false; - npc.noTileCollide = false; - if (Main.rand.Next(2) == 0) - { - int num690 = Dust.NewDust(new Vector2(npc.position.X - 4f, npc.position.Y + (float)npc.height - 8f), npc.width + 8, 24, 80, 0f, npc.velocity.Y / 2f, 0, default(Color), 1f); - Dust expr_28A1C_cp_0 = Main.dust[num690]; - expr_28A1C_cp_0.velocity.X = expr_28A1C_cp_0.velocity.X * 0.4f; - Dust expr_28A3C_cp_0 = Main.dust[num690]; - expr_28A3C_cp_0.velocity.Y = expr_28A3C_cp_0.velocity.Y * -1f; - if (Main.rand.Next(2) == 0) - { - Main.dust[num690].noGravity = true; - Main.dust[num690].scale += 0.2f; - } - } - } - return; - } - catch - { - return; } - } + } + return; + } + catch + { + return; + } + } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/Snowcopter.cs b/NPCs/Snowcopter.cs index 05ef007c..f8acbc95 100644 --- a/NPCs/Snowcopter.cs +++ b/NPCs/Snowcopter.cs @@ -6,65 +6,67 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Snowcopter : ModNPC +namespace Tremor.NPCs { + + public class Snowcopter : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Snowcopter"); Main.npcFrameCount[npc.type] = 8; } - - public override void SetDefaults() - { - npc.lifeMax = 600; - npc.damage = 55; - npc.defense = 46; - npc.knockBackResist = 0.1f; - npc.width = 58; - npc.height = 36; - animationType = 347; - npc.aiStyle = 62; - aiType = 347; - npc.noGravity = true; - npc.noTileCollide = true; - npc.npcSlots = 3f; - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath6; - npc.value = Item.buyPrice(0, 0, 8, 7); - banner = npc.type; - bannerItem = mod.ItemType("SnowcopterBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 600; + npc.damage = 55; + npc.defense = 46; + npc.knockBackResist = 0.1f; + npc.width = 58; + npc.height = 36; + animationType = 347; + npc.aiStyle = 62; + aiType = 347; + npc.noGravity = true; + npc.noTileCollide = true; + npc.npcSlots = 3f; + npc.HitSound = SoundID.NPCHit4; + npc.DeathSound = SoundID.NPCDeath6; + npc.value = Item.buyPrice(0, 0, 8, 7); + banner = npc.type; + bannerItem = mod.ItemType("SnowcopterBanner"); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, 61, 1f); - Gore.NewGore(npc.position, npc.velocity, 61, 1f); - Gore.NewGore(npc.position, npc.velocity, 62, 1f); - Gore.NewGore(npc.position, npc.velocity, 62, 1f); - Gore.NewGore(npc.position, npc.velocity, 63, 1f); - } -} + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return NPC.AnyNPCs(145) && Main.hardMode && y < Main.worldSurface ? 0.06f : 0f; - } -}} \ No newline at end of file + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, 61, 1f); + Gore.NewGore(npc.position, npc.velocity, 61, 1f); + Gore.NewGore(npc.position, npc.velocity, 62, 1f); + Gore.NewGore(npc.position, npc.velocity, 62, 1f); + Gore.NewGore(npc.position, npc.velocity, 63, 1f); + } + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return NPC.AnyNPCs(145) && Main.hardMode && y < Main.worldSurface ? 0.06f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/SnowmanBomber.cs b/NPCs/SnowmanBomber.cs index 9301597d..e779dd5e 100644 --- a/NPCs/SnowmanBomber.cs +++ b/NPCs/SnowmanBomber.cs @@ -6,60 +6,62 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class SnowmanBomber : ModNPC +namespace Tremor.NPCs { + + public class SnowmanBomber : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Snowman Bomber"); Main.npcFrameCount[npc.type] = 20; } - - public override void SetDefaults() - { - npc.lifeMax = 400; - npc.damage = 60; - npc.defense = 15; - npc.knockBackResist = 0.1f; - npc.width = 34; - npc.height = 46; - animationType = 293; - npc.aiStyle = 3; - aiType = 293; - npc.npcSlots = 0.3f; - npc.HitSound = SoundID.NPCHit11; - npc.DeathSound = SoundID.NPCDeath38; - npc.value = Item.buyPrice(0, 0, 4, 7); - banner = npc.type; - bannerItem = mod.ItemType("SnowmanBomberBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 400; + npc.damage = 60; + npc.defense = 15; + npc.knockBackResist = 0.1f; + npc.width = 34; + npc.height = 46; + animationType = 293; + npc.aiStyle = 3; + aiType = 293; + npc.npcSlots = 0.3f; + npc.HitSound = SoundID.NPCHit11; + npc.DeathSound = SoundID.NPCDeath38; + npc.value = Item.buyPrice(0, 0, 4, 7); + banner = npc.type; + bannerItem = mod.ItemType("SnowmanBomberBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); - } - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3f); - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2f); - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3f); + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return NPC.AnyNPCs(144) && Main.hardMode && y < Main.worldSurface ? 0.08f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return NPC.AnyNPCs(144) && Main.hardMode && y < Main.worldSurface ? 0.08f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/SnowmanWarrior.cs b/NPCs/SnowmanWarrior.cs index ff8e3fa5..f3d24946 100644 --- a/NPCs/SnowmanWarrior.cs +++ b/NPCs/SnowmanWarrior.cs @@ -6,60 +6,62 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class SnowmanWarrior : ModNPC +namespace Tremor.NPCs { + public class SnowmanWarrior : ModNPC + { + public override void SetStaticDefaults() { DisplayName.SetDefault("Snowman Warrior"); Main.npcFrameCount[npc.type] = 5; } - public override void SetDefaults() - { - npc.lifeMax = 350; - npc.damage = 60; - npc.defense = 12; - npc.knockBackResist = 0.1f; - npc.width = 34; - npc.height = 46; - animationType = 174; - npc.aiStyle = 41; - aiType = 174; - npc.npcSlots = 0.3f; - npc.HitSound = SoundID.NPCHit11; - npc.DeathSound = SoundID.NPCDeath15; - npc.value = Item.buyPrice(0, 0, 8, 7); - banner = npc.type; - bannerItem = mod.ItemType("SnowmanWarriorBanner"); - } + public override void SetDefaults() + { + npc.lifeMax = 350; + npc.damage = 60; + npc.defense = 12; + npc.knockBackResist = 0.1f; + npc.width = 34; + npc.height = 46; + animationType = 174; + npc.aiStyle = 41; + aiType = 174; + npc.npcSlots = 0.3f; + npc.HitSound = SoundID.NPCHit11; + npc.DeathSound = SoundID.NPCDeath15; + npc.value = Item.buyPrice(0, 0, 8, 7); + banner = npc.type; + bannerItem = mod.ItemType("SnowmanWarriorBanner"); + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); - } - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3f); - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2f); - Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2f); + Dust.NewDust(npc.position, npc.width, npc.height, 76, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3f); + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return NPC.AnyNPCs(144) && Main.hardMode && y < Main.worldSurface ? 0.08f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return NPC.AnyNPCs(144) && Main.hardMode && y < Main.worldSurface ? 0.08f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/Sorcerer.cs b/NPCs/Sorcerer.cs index cd90e270..915bbfa7 100644 --- a/NPCs/Sorcerer.cs +++ b/NPCs/Sorcerer.cs @@ -6,10 +6,11 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { -[AutoloadHead] -public class Sorcerer : ModNPC +namespace Tremor.NPCs { + [AutoloadHead] + public class Sorcerer : ModNPC + { public override string Texture { get @@ -17,14 +18,14 @@ public override string Texture return "Tremor/NPCs/Sorcerer"; } } - + public override string[] AltTextures { get { - return new string[] { "Tremor/NPCs/Sorcerer"}; + return new string[] { "Tremor/NPCs/Sorcerer" }; } - } + } public override bool Autoload(ref string name) { @@ -44,147 +45,148 @@ public override void SetStaticDefaults() NPCID.Sets.AttackAverageChance[npc.type] = 30; } - public override void SetDefaults() - { - npc.townNPC = true; - npc.friendly = true; - npc.width = 32; - npc.height = 54; - npc.aiStyle = 7; - npc.damage = 10; - npc.defense = 15; - npc.lifeMax = 250; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.knockBackResist = 0.5f; - animationType = NPCID.Guide; - } - - public override bool CanTownNPCSpawn(int numTownNPCs, int money) - { - return true; - } - - - public override string TownNPCName() - { - switch(WorldGen.genRand.Next(4)) - { - case 0: - return "Merdok"; - case 1: - return "Avalon"; - case 2: - return "Aron"; - case 3: - return "Harry"; - case 4: - return "Edgar"; - default: - return "Marco"; - } - } - - public override string GetChat() - { - switch(Main.rand.Next(6)) - { - case 0: - return "You'll never find me trapped underground."; - case 1: - return "I can share the magic with you for free. Almost free."; - case 2: - return "Sorcery is all about control. It's different from magic in that it requires symbols and fetishes."; - case 3: - return "Sorry. I don't do parties."; - case 4: - return "Don't touch that if you want to keep your hand. It's still quite unstable."; - default: - return "I want to get the rabbit out of the hat! You want? Don't want a rabbit? Seriously? Someone in this house will buy my rabbits or not!"; - } - } - - public override void SetChatButtons(ref string button, ref string button2) - { - button = Lang.inter[28].Value; - } - - public override void OnChatButtonClicked(bool firstButton, ref bool shop) - { - if(firstButton) - { - shop = true; - } - } - - public override void SetupShop(Chest shop, ref int nextSlot) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("BurningTome")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("RazorleavesTome")); - nextSlot++; - shop.item[nextSlot].SetDefaults(2019); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("EnchantedShield")); - nextSlot++; - if(NPC.downedBoss1) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("StarfallTome")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("GoldenHat")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("GoldenRobe")); - nextSlot++; - } - if(NPC.downedBoss2) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("LightningTome")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("Bloomstone")); - nextSlot++; - } - if(Main.hardMode) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("ManaDagger")); - nextSlot++; - } - } - - public override void TownNPCAttackStrength(ref int damage, ref float knockback) - { - damage = 22; - knockback = 4f; - } - - public override void TownNPCAttackCooldown(ref int cooldown, ref int randExtraCooldown) - { - cooldown = 10; - randExtraCooldown = 10; - } - - public override void TownNPCAttackProj(ref int projType, ref int attackDelay) - { - projType = 124; - attackDelay = 4; - } - - public override void TownNPCAttackProjSpeed(ref float multiplier, ref float gravityCorrection, ref float randomOffset) - { - multiplier = 12f; - randomOffset = 2f; - } - - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SorcererGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SorcererGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SorcererGore3"), 1f); - } -} -}} \ No newline at end of file + public override void SetDefaults() + { + npc.townNPC = true; + npc.friendly = true; + npc.width = 32; + npc.height = 54; + npc.aiStyle = 7; + npc.damage = 10; + npc.defense = 15; + npc.lifeMax = 250; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.knockBackResist = 0.5f; + animationType = NPCID.Guide; + } + + public override bool CanTownNPCSpawn(int numTownNPCs, int money) + { + return true; + } + + + public override string TownNPCName() + { + switch (WorldGen.genRand.Next(4)) + { + case 0: + return "Merdok"; + case 1: + return "Avalon"; + case 2: + return "Aron"; + case 3: + return "Harry"; + case 4: + return "Edgar"; + default: + return "Marco"; + } + } + + public override string GetChat() + { + switch (Main.rand.Next(6)) + { + case 0: + return "You'll never find me trapped underground."; + case 1: + return "I can share the magic with you for free. Almost free."; + case 2: + return "Sorcery is all about control. It's different from magic in that it requires symbols and fetishes."; + case 3: + return "Sorry. I don't do parties."; + case 4: + return "Don't touch that if you want to keep your hand. It's still quite unstable."; + default: + return "I want to get the rabbit out of the hat! You want? Don't want a rabbit? Seriously? Someone in this house will buy my rabbits or not!"; + } + } + + public override void SetChatButtons(ref string button, ref string button2) + { + button = Lang.inter[28].Value; + } + + public override void OnChatButtonClicked(bool firstButton, ref bool shop) + { + if (firstButton) + { + shop = true; + } + } + + public override void SetupShop(Chest shop, ref int nextSlot) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("BurningTome")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("RazorleavesTome")); + nextSlot++; + shop.item[nextSlot].SetDefaults(2019); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("EnchantedShield")); + nextSlot++; + if (NPC.downedBoss1) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("StarfallTome")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("GoldenHat")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("GoldenRobe")); + nextSlot++; + } + if (NPC.downedBoss2) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("LightningTome")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("Bloomstone")); + nextSlot++; + } + if (Main.hardMode) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("ManaDagger")); + nextSlot++; + } + } + + public override void TownNPCAttackStrength(ref int damage, ref float knockback) + { + damage = 22; + knockback = 4f; + } + + public override void TownNPCAttackCooldown(ref int cooldown, ref int randExtraCooldown) + { + cooldown = 10; + randExtraCooldown = 10; + } + + public override void TownNPCAttackProj(ref int projType, ref int attackDelay) + { + projType = 124; + attackDelay = 4; + } + + public override void TownNPCAttackProjSpeed(ref float multiplier, ref float gravityCorrection, ref float randomOffset) + { + multiplier = 12f; + randomOffset = 2f; + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SorcererGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SorcererGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SorcererGore3"), 1f); + } + } + } +} \ No newline at end of file diff --git a/NPCs/SoulofHope.cs b/NPCs/SoulofHope.cs index edd44114..4e311953 100644 --- a/NPCs/SoulofHope.cs +++ b/NPCs/SoulofHope.cs @@ -10,357 +10,357 @@ namespace Tremor.NPCs { [AutoloadBossHead] - public class SoulofHope : ModNPC - { + public class SoulofHope : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("The Hope"); } - - const int NormalShootRate = 60; - const int NormalLaserDamage = 10; - const float NormalLaserKB = 1.0f; - const float NormalLaserSpeed = 15.0f; - const int NormalAiStyle = 2; - - const int PowerShootRate = 80; - const int PowerLaserDamage = 24; - const float PowerLaserKB = 2.0f; - const float PowerLaserSpeed = 10.0f; - const int PowerAiStyle = 5; - - const float DistantionToPower = 300f; - const int BonusDefenseInPower = 5; - const int BonusDamageInPower = 10; - const int ShootType = 435; - const float RotationSpeed = 0.3f; - - bool Power = false; - bool OnlyPower = false; - int TimeToShoot = NormalShootRate; - float Rotation = 0.0f; - Color TextColor = Color.Orange; - bool StateFlag = true; - - System.Random rnd = new System.Random(); - - public override void SetDefaults() - { - npc.lifeMax = 75000; - npc.damage = 37; - npc.defense = 150; - npc.knockBackResist = 0.0f; - npc.width = 200; - npc.height = 194; - npc.aiStyle = 5; - npc.noGravity = true; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath10; - //npc.boss = true; - npc.value = Item.buyPrice(0, 1, 0, 0); - bossBag = mod.ItemType("TrinityBag3"); - } - - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 0.625f * bossLifeScale); - npc.damage = (int)(npc.damage * 0.6f); - } - - bool RunAway = false; - public override void AI() - { - npc.position += npc.velocity * 1.7f; - if (Main.rand.Next(500) == 0 && Main.expertMode) - { - for (int i = 0; i < 50; i++) - { - int dust = Dust.NewDust(npc.position, npc.width, npc.height, 5); - Main.dust[dust].scale = 1.5f; - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 0f; - Main.dust[dust].velocity *= 0f; - } - npc.position.X = (Main.player[npc.target].position.X - 250) + Main.rand.Next(500); - npc.position.Y = (Main.player[npc.target].position.Y - 250) + Main.rand.Next(500); - } - - if (Main.rand.Next(500) == 0 && !Main.expertMode) - { - npc.TargetClosest(true); - Vector2 vector142 = new Vector2(npc.Center.X, npc.Center.Y); - float num1243 = Main.player[npc.target].Center.X - vector142.X; - float num1244 = Main.player[npc.target].Center.Y - vector142.Y; - float num1245 = (float)Math.Sqrt((double)(num1243 * num1243 + num1244 * num1244)); - if (npc.ai[1] == 0f) - { - if (Main.netMode != 1) - { - npc.localAI[1] += 1f; - if (npc.localAI[1] >= (float)(120 + Main.rand.Next(200))) - { - npc.localAI[1] = 0f; - npc.TargetClosest(true); - int num1249 = 0; - int num1250; - int num1251; - while (true) - { - num1249++; - num1250 = (int)Main.player[npc.target].Center.X / 16; - num1251 = (int)Main.player[npc.target].Center.Y / 16; - num1250 += Main.rand.Next(-50, 51); - num1251 += Main.rand.Next(-50, 51); - if (!WorldGen.SolidTile(num1250, num1251) && Collision.CanHit(new Vector2((float)(num1250 * 16), (float)(num1251 * 16)), 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) - { - break; - } - if (num1249 > 100) - { - //return; - } - } - npc.ai[1] = 1f; - npc.ai[2] = (float)num1250; - npc.ai[3] = (float)num1251; - npc.netUpdate = true; - //return; - } - } - } - else if (npc.ai[1] == 1f) - { - npc.alpha += 3; - if (npc.alpha >= 255) - { - npc.alpha = 255; - npc.position.X = npc.ai[2] * 16f - (float)(npc.width / 2); - npc.position.Y = npc.ai[3] * 16f - (float)(npc.height / 2); - npc.ai[1] = 2f; - //return; - } - } - else if (npc.ai[1] == 2f) - { - npc.alpha -= 3; - if (npc.alpha <= 0) - { - npc.alpha = 0; - npc.ai[1] = 0f; - //return; - } - } - } - - if (Main.rand.Next(2500) == 0) - { - NPC.NewNPC((int)npc.position.X - 150, (int)npc.position.Y - 50, 420); - NPC.NewNPC((int)npc.position.X + 150, (int)npc.position.Y - 50, 420); - } - - if (npc.target != -1 && !RunAway) - if (!Main.player[npc.target].active) - { - if (Helper2.GetNearestAlivePlayer(npc) == -1) - RunAway = true; - else - { - if (Main.player[Helper2.GetNearestAlivePlayer(npc)].Distance(npc.Center) > 2500f) - RunAway = true; - else - npc.target = Helper2.GetNearestAlivePlayer(npc); - } - } - if (Main.dayTime || RunAway || npc.localAI[3] == 1) - { - npc.localAI[3] = 1; - if (Main.npc[(int)npc.ai[2]].type == mod.NPCType("SoulofTrust") && Main.npc[(int)npc.ai[2]].active == true) - Main.npc[(int)npc.ai[2]].localAI[3] = 1; - if (Main.npc[(int)npc.ai[3]].type == mod.NPCType("SoulofTruth") && Main.npc[(int)npc.ai[3]].active == true) - Main.npc[(int)npc.ai[3]].localAI[3] = 1; - npc.life += 11; - npc.aiStyle = 0; - npc.rotation = 0; - npc.velocity = Helper2.VelocityFPTP(npc.Center, new Vector2(npc.Center.X, npc.Center.Y - 4815162342), 30.0f); - CreateDust(); - return; - } - if (StateFlag) - if ( - !((Main.npc[(int)npc.ai[2]].type == mod.NPCType("SoulofTrust") && Main.npc[(int)npc.ai[2]].active == true)) || - !((Main.npc[(int)npc.ai[3]].type == mod.NPCType("SoulofTruth") && Main.npc[(int)npc.ai[3]].active == true)) - ) - { - StateFlag = false; - OnlyPower = true; - } - if (OnlyPower) - SetStage(true); - else - SetStage(Main.player[Helper2.GetNearestPlayer(npc)].Distance(npc.Center) <= DistantionToPower); - SetRotation(); - CreateDust(); - TimeToShoot--; - if (TimeToShoot <= 0) - { - TimeToShoot = (Power) ? PowerShootRate : NormalShootRate; - Shoot(); - } - } - - void CreateDust() - { - if (rnd.Next(3) == 0) - Dust.NewDust(npc.position, npc.width, npc.height, 62); - } - - void SetRotation() - { - if (Power) - { - Rotation += RotationSpeed; - npc.rotation = Rotation; - } - else - { - while (Rotation - 36.0f >= 0.0f) - Rotation -= 36.0f; - if (Rotation != 0.0f) - { - Rotation -= (RotationSpeed * 2.0f); - Vector2 velocity = Helper2.VelocityFPTP(npc.Center, Helper2.RandomPositin(new Vector2(npc.Center.X - 250, npc.Center.Y - 250), new Vector2(npc.Center.X + 250, npc.Center.Y + 250)), PowerLaserSpeed); - int i = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, velocity.X, velocity.Y, ShootType, PowerLaserDamage, PowerLaserKB); - Main.projectile[i].tileCollide = false; - } - if (Rotation < 0.0f) - Rotation = 0.0f; - npc.rotation = Rotation; - } - } - - void SetStage(bool stage) - { - if (Power == stage) - return; - Power = stage; - if (Power) - { - npc.defense += BonusDefenseInPower; - npc.damage += BonusDamageInPower; - npc.aiStyle = PowerAiStyle; - } - else - { - npc.defense -= BonusDefenseInPower; - npc.damage -= BonusDamageInPower; - npc.aiStyle = NormalAiStyle; - } - } - - void Shoot() - { - if (Helper2.GetNearestPlayer(npc) != -1) - { - npc.target = Helper2.GetNearestPlayer(npc); - Vector2 velocity = Helper2.VelocityFPTP(npc.Center, Main.player[npc.target].Center, (Power) ? PowerLaserSpeed : NormalLaserSpeed); - int i = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, velocity.X, velocity.Y, ShootType, (Power) ? PowerLaserDamage : NormalLaserDamage, (Power) ? PowerLaserKB : NormalLaserKB); - Main.projectile[i].tileCollide = false; - Main.projectile[i].friendly = false; - } - } - - public override void HitEffect(int hitDirection, double damage) - { - if (npc.life <= 0) - { - for (int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HopeGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HopeGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HopeGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HopeGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HopeGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HopeGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HopeGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HopeGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HopeGore3"), 1f); - if (!NPC.AnyNPCs(mod.NPCType("SoulofTruth")) && !NPC.AnyNPCs(mod.NPCType("SoulofTrust"))) - { - Main.NewText("The Trinity has been defeated!", 175, 75, 255); - } - } - } - - public override void NPCLoot() - { - - if (Main.expertMode && !NPC.AnyNPCs(mod.NPCType("SoulofTruth")) && !NPC.AnyNPCs(mod.NPCType("SoulofTrust"))) - { - npc.DropBossBags(); - } - - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - - - - - if (!NPC.AnyNPCs(mod.NPCType("SoulofTruth")) && !NPC.AnyNPCs(mod.NPCType("SoulofTrust"))) - { - - if (!Main.expertMode && Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TrinityTrophy")); - } - - if (!Main.expertMode && Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OmnikronBar"), Main.rand.Next(9, 15)); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TrueEssense"), Main.rand.Next(10, 25)); - } - - if (!TremorWorld.downedTrinity) - { - Main.NewText("This world has been enlightened with Angelite!", 0, 191, 255); - Main.NewText("This world has been attacked with Collapsium!", 255, 20, 147); - - - for (int k = 0; k < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 6E-05); k++) - { - WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)(Main.maxTilesY * .3f), (int)(Main.maxTilesY * .65f)), (double)WorldGen.genRand.Next(9, 15), WorldGen.genRand.Next(9, 15), mod.TileType("CollapsiumOreTile"), false, 0f, 0f, false, true); - } - for (int k = 0; k < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 6E-05); k++) - { - WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)(Main.maxTilesY * .3f), (int)(Main.maxTilesY * .65f)), (double)WorldGen.genRand.Next(9, 15), WorldGen.genRand.Next(9, 15), mod.TileType("AngeliteOreTile"), false, 0f, 0f, false, true); - } - TremorWorld.downedTrinity = true; - } - - } - - - if (!Main.expertMode && Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HopeMask")); - } - - if (!Main.expertMode && Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Banhammer")); - } - - if (!Main.expertMode && Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BestNightmare")); - } - - } - } - } + + const int NormalShootRate = 60; + const int NormalLaserDamage = 10; + const float NormalLaserKB = 1.0f; + const float NormalLaserSpeed = 15.0f; + const int NormalAiStyle = 2; + + const int PowerShootRate = 80; + const int PowerLaserDamage = 24; + const float PowerLaserKB = 2.0f; + const float PowerLaserSpeed = 10.0f; + const int PowerAiStyle = 5; + + const float DistantionToPower = 300f; + const int BonusDefenseInPower = 5; + const int BonusDamageInPower = 10; + const int ShootType = 435; + const float RotationSpeed = 0.3f; + + bool Power = false; + bool OnlyPower = false; + int TimeToShoot = NormalShootRate; + float Rotation = 0.0f; + Color TextColor = Color.Orange; + bool StateFlag = true; + + System.Random rnd = new System.Random(); + + public override void SetDefaults() + { + npc.lifeMax = 75000; + npc.damage = 37; + npc.defense = 150; + npc.knockBackResist = 0.0f; + npc.width = 200; + npc.height = 194; + npc.aiStyle = 5; + npc.noGravity = true; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath10; + //npc.boss = true; + npc.value = Item.buyPrice(0, 1, 0, 0); + bossBag = mod.ItemType("TrinityBag3"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 0.625f * bossLifeScale); + npc.damage = (int)(npc.damage * 0.6f); + } + + bool RunAway = false; + public override void AI() + { + npc.position += npc.velocity * 1.7f; + if (Main.rand.Next(500) == 0 && Main.expertMode) + { + for (int i = 0; i < 50; i++) + { + int dust = Dust.NewDust(npc.position, npc.width, npc.height, 5); + Main.dust[dust].scale = 1.5f; + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity *= 0f; + Main.dust[dust].velocity *= 0f; + } + npc.position.X = (Main.player[npc.target].position.X - 250) + Main.rand.Next(500); + npc.position.Y = (Main.player[npc.target].position.Y - 250) + Main.rand.Next(500); + } + + if (Main.rand.Next(500) == 0 && !Main.expertMode) + { + npc.TargetClosest(true); + Vector2 vector142 = new Vector2(npc.Center.X, npc.Center.Y); + float num1243 = Main.player[npc.target].Center.X - vector142.X; + float num1244 = Main.player[npc.target].Center.Y - vector142.Y; + float num1245 = (float)Math.Sqrt((double)(num1243 * num1243 + num1244 * num1244)); + if (npc.ai[1] == 0f) + { + if (Main.netMode != 1) + { + npc.localAI[1] += 1f; + if (npc.localAI[1] >= (float)(120 + Main.rand.Next(200))) + { + npc.localAI[1] = 0f; + npc.TargetClosest(true); + int num1249 = 0; + int num1250; + int num1251; + while (true) + { + num1249++; + num1250 = (int)Main.player[npc.target].Center.X / 16; + num1251 = (int)Main.player[npc.target].Center.Y / 16; + num1250 += Main.rand.Next(-50, 51); + num1251 += Main.rand.Next(-50, 51); + if (!WorldGen.SolidTile(num1250, num1251) && Collision.CanHit(new Vector2((float)(num1250 * 16), (float)(num1251 * 16)), 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + { + break; + } + if (num1249 > 100) + { + //return; + } + } + npc.ai[1] = 1f; + npc.ai[2] = (float)num1250; + npc.ai[3] = (float)num1251; + npc.netUpdate = true; + //return; + } + } + } + else if (npc.ai[1] == 1f) + { + npc.alpha += 3; + if (npc.alpha >= 255) + { + npc.alpha = 255; + npc.position.X = npc.ai[2] * 16f - (float)(npc.width / 2); + npc.position.Y = npc.ai[3] * 16f - (float)(npc.height / 2); + npc.ai[1] = 2f; + //return; + } + } + else if (npc.ai[1] == 2f) + { + npc.alpha -= 3; + if (npc.alpha <= 0) + { + npc.alpha = 0; + npc.ai[1] = 0f; + //return; + } + } + } + + if (Main.rand.Next(2500) == 0) + { + NPC.NewNPC((int)npc.position.X - 150, (int)npc.position.Y - 50, 420); + NPC.NewNPC((int)npc.position.X + 150, (int)npc.position.Y - 50, 420); + } + + if (npc.target != -1 && !RunAway) + if (!Main.player[npc.target].active) + { + if (Helper2.GetNearestAlivePlayer(npc) == -1) + RunAway = true; + else + { + if (Main.player[Helper2.GetNearestAlivePlayer(npc)].Distance(npc.Center) > 2500f) + RunAway = true; + else + npc.target = Helper2.GetNearestAlivePlayer(npc); + } + } + if (Main.dayTime || RunAway || npc.localAI[3] == 1) + { + npc.localAI[3] = 1; + if (Main.npc[(int)npc.ai[2]].type == mod.NPCType("SoulofTrust") && Main.npc[(int)npc.ai[2]].active == true) + Main.npc[(int)npc.ai[2]].localAI[3] = 1; + if (Main.npc[(int)npc.ai[3]].type == mod.NPCType("SoulofTruth") && Main.npc[(int)npc.ai[3]].active == true) + Main.npc[(int)npc.ai[3]].localAI[3] = 1; + npc.life += 11; + npc.aiStyle = 0; + npc.rotation = 0; + npc.velocity = Helper2.VelocityFPTP(npc.Center, new Vector2(npc.Center.X, npc.Center.Y - 4815162342), 30.0f); + CreateDust(); + return; + } + if (StateFlag) + if ( + !((Main.npc[(int)npc.ai[2]].type == mod.NPCType("SoulofTrust") && Main.npc[(int)npc.ai[2]].active == true)) || + !((Main.npc[(int)npc.ai[3]].type == mod.NPCType("SoulofTruth") && Main.npc[(int)npc.ai[3]].active == true)) + ) + { + StateFlag = false; + OnlyPower = true; + } + if (OnlyPower) + SetStage(true); + else + SetStage(Main.player[Helper2.GetNearestPlayer(npc)].Distance(npc.Center) <= DistantionToPower); + SetRotation(); + CreateDust(); + TimeToShoot--; + if (TimeToShoot <= 0) + { + TimeToShoot = (Power) ? PowerShootRate : NormalShootRate; + Shoot(); + } + } + + void CreateDust() + { + if (rnd.Next(3) == 0) + Dust.NewDust(npc.position, npc.width, npc.height, 62); + } + + void SetRotation() + { + if (Power) + { + Rotation += RotationSpeed; + npc.rotation = Rotation; + } + else + { + while (Rotation - 36.0f >= 0.0f) + Rotation -= 36.0f; + if (Rotation != 0.0f) + { + Rotation -= (RotationSpeed * 2.0f); + Vector2 velocity = Helper2.VelocityFPTP(npc.Center, Helper2.RandomPositin(new Vector2(npc.Center.X - 250, npc.Center.Y - 250), new Vector2(npc.Center.X + 250, npc.Center.Y + 250)), PowerLaserSpeed); + int i = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, velocity.X, velocity.Y, ShootType, PowerLaserDamage, PowerLaserKB); + Main.projectile[i].tileCollide = false; + } + if (Rotation < 0.0f) + Rotation = 0.0f; + npc.rotation = Rotation; + } + } + + void SetStage(bool stage) + { + if (Power == stage) + return; + Power = stage; + if (Power) + { + npc.defense += BonusDefenseInPower; + npc.damage += BonusDamageInPower; + npc.aiStyle = PowerAiStyle; + } + else + { + npc.defense -= BonusDefenseInPower; + npc.damage -= BonusDamageInPower; + npc.aiStyle = NormalAiStyle; + } + } + + void Shoot() + { + if (Helper2.GetNearestPlayer(npc) != -1) + { + npc.target = Helper2.GetNearestPlayer(npc); + Vector2 velocity = Helper2.VelocityFPTP(npc.Center, Main.player[npc.target].Center, (Power) ? PowerLaserSpeed : NormalLaserSpeed); + int i = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, velocity.X, velocity.Y, ShootType, (Power) ? PowerLaserDamage : NormalLaserDamage, (Power) ? PowerLaserKB : NormalLaserKB); + Main.projectile[i].tileCollide = false; + Main.projectile[i].friendly = false; + } + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HopeGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HopeGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HopeGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HopeGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HopeGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HopeGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HopeGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HopeGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/HopeGore3"), 1f); + if (!NPC.AnyNPCs(mod.NPCType("SoulofTruth")) && !NPC.AnyNPCs(mod.NPCType("SoulofTrust"))) + { + Main.NewText("The Trinity has been defeated!", 175, 75, 255); + } + } + } + + public override void NPCLoot() + { + + if (Main.expertMode && !NPC.AnyNPCs(mod.NPCType("SoulofTruth")) && !NPC.AnyNPCs(mod.NPCType("SoulofTrust"))) + { + npc.DropBossBags(); + } + + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + + + + + if (!NPC.AnyNPCs(mod.NPCType("SoulofTruth")) && !NPC.AnyNPCs(mod.NPCType("SoulofTrust"))) + { + + if (!Main.expertMode && Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TrinityTrophy")); + } + + if (!Main.expertMode && Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OmnikronBar"), Main.rand.Next(9, 15)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TrueEssense"), Main.rand.Next(10, 25)); + } + + if (!TremorWorld.downedTrinity) + { + Main.NewText("This world has been enlightened with Angelite!", 0, 191, 255); + Main.NewText("This world has been attacked with Collapsium!", 255, 20, 147); + + + for (int k = 0; k < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 6E-05); k++) + { + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)(Main.maxTilesY * .3f), (int)(Main.maxTilesY * .65f)), (double)WorldGen.genRand.Next(9, 15), WorldGen.genRand.Next(9, 15), mod.TileType("CollapsiumOreTile"), false, 0f, 0f, false, true); + } + for (int k = 0; k < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 6E-05); k++) + { + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)(Main.maxTilesY * .3f), (int)(Main.maxTilesY * .65f)), (double)WorldGen.genRand.Next(9, 15), WorldGen.genRand.Next(9, 15), mod.TileType("AngeliteOreTile"), false, 0f, 0f, false, true); + } + TremorWorld.downedTrinity = true; + } + + } + + + if (!Main.expertMode && Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HopeMask")); + } + + if (!Main.expertMode && Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Banhammer")); + } + + if (!Main.expertMode && Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BestNightmare")); + } + + } + } + } } \ No newline at end of file diff --git a/NPCs/SoulofTrust.cs b/NPCs/SoulofTrust.cs index 35534337..fa4d462a 100644 --- a/NPCs/SoulofTrust.cs +++ b/NPCs/SoulofTrust.cs @@ -10,381 +10,381 @@ namespace Tremor.NPCs { [AutoloadBossHead] - public class SoulofTrust : ModNPC - { + public class SoulofTrust : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("The Doom"); } - - const int NormalShootRate = 142; - const int NormalBulletDamage = 10; - const float NormalBulletSpeed = 7.0f; - const float NormalBulletKB = 1.0f; - const int NormalShootType = 291; - - const int PowerBulletDamage = 20; - const int PowerShootRate = 200; - const float PowerBulletSpeed = 10.0f; - const float PowerBulletKB = 2.0f; - const int PowerShootType = 467; - - const int PowerTime = 300; - const int BonusDefenseInPower = 5; - const int BonusDamageInPower = 10; - - bool Power = false; - bool OnlyPower = false; - int TimeToShoot = NormalShootRate; - int CurrentPower = PowerTime; - int Step = -1; - Color TextColor = Color.Orange; - bool StateFlag = true; - - System.Random rnd = new System.Random(); - - public override void SetDefaults() - { - npc.lifeMax = 100000; - npc.damage = 134; - npc.defense = 120; - npc.knockBackResist = 0.0f; - npc.width = 170; - npc.height = 254; - npc.aiStyle = 5; - npc.noGravity = true; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath10; - //npc.boss = true; - npc.value = Item.buyPrice(0, 1, 0, 0); - bossBag = mod.ItemType("TrinityBag2"); - } - - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 0.625f * bossLifeScale); - npc.damage = (int)(npc.damage * 0.6f); - } - - bool RunAway = false; - - public override void AI() - { - npc.position += npc.velocity * 1.7f; - if (Main.rand.Next(500) == 0 && Main.expertMode) - { - for (int i = 0; i < 50; i++) - { - int dust = Dust.NewDust(npc.position, npc.width, npc.height, 6); - Main.dust[dust].scale = 1.5f; - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 0f; - Main.dust[dust].velocity *= 0f; - } - npc.position.X = (Main.player[npc.target].position.X - 250) + Main.rand.Next(500); - npc.position.Y = (Main.player[npc.target].position.Y - 250) + Main.rand.Next(500); - } - - if (Main.rand.Next(500) == 0 && !Main.expertMode) - { - npc.TargetClosest(true); - Vector2 vector142 = new Vector2(npc.Center.X, npc.Center.Y); - float num1243 = Main.player[npc.target].Center.X - vector142.X; - float num1244 = Main.player[npc.target].Center.Y - vector142.Y; - float num1245 = (float)Math.Sqrt((double)(num1243 * num1243 + num1244 * num1244)); - if (npc.ai[1] == 0f) - { - if (Main.netMode != 1) - { - npc.localAI[1] += 1f; - if (npc.localAI[1] >= (float)(120 + Main.rand.Next(200))) - { - npc.localAI[1] = 0f; - npc.TargetClosest(true); - int num1249 = 0; - int num1250; - int num1251; - while (true) - { - num1249++; - num1250 = (int)Main.player[npc.target].Center.X / 16; - num1251 = (int)Main.player[npc.target].Center.Y / 16; - num1250 += Main.rand.Next(-50, 51); - num1251 += Main.rand.Next(-50, 51); - if (!WorldGen.SolidTile(num1250, num1251) && Collision.CanHit(new Vector2((float)(num1250 * 16), (float)(num1251 * 16)), 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) - { - break; - } - if (num1249 > 100) - { - //return; - } - } - npc.ai[1] = 1f; - npc.ai[2] = (float)num1250; - npc.ai[3] = (float)num1251; - npc.netUpdate = true; - //return; - } - } - } - else if (npc.ai[1] == 1f) - { - npc.alpha += 3; - if (npc.alpha >= 255) - { - npc.alpha = 255; - npc.position.X = npc.ai[2] * 16f - (float)(npc.width / 2); - npc.position.Y = npc.ai[3] * 16f - (float)(npc.height / 2); - npc.ai[1] = 2f; - //return; - } - } - else if (npc.ai[1] == 2f) - { - npc.alpha -= 3; - if (npc.alpha <= 0) - { - npc.alpha = 0; - npc.ai[1] = 0f; - //return; - } - } - } - - if (NPC.AnyNPCs(mod.NPCType("SoulofHope")) || NPC.AnyNPCs(mod.NPCType("SoulofTrust"))) - { - npc.dontTakeDamage = true; - } - if (NPC.AnyNPCs(mod.NPCType("SoulofHope")) || NPC.AnyNPCs(mod.NPCType("SoulofTrust"))) - { - npc.dontTakeDamage = false; - } - - if (Main.expertMode && Main.rand.Next(4500) == 0) - { - NPC.NewNPC((int)npc.position.X - 100, (int)npc.position.Y - 50, 418); - NPC.NewNPC((int)npc.position.X + 100, (int)npc.position.Y - 50, 418); - } - - if (Main.rand.Next(2) == 0) - { - int num706 = Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 0.5f); - Main.dust[num706].velocity *= 0.6f; - } - - - if (npc.target != -1 && !RunAway) //еÑли(пнÑ.цель не варно -1 И не убегать) - if (!Main.player[npc.target].active) //еÑли (не мой.игрок[нпÑ.цель].активный) - { - if (Helper2.GetNearestAlivePlayer(npc) == -1) //еÑли (Помощьник.ПолучитьКоординатыИгрока(нпÑ) приÑвоить -1) - RunAway = true; //Убегает = да - else //или - { - if (Main.player[Helper2.GetNearestAlivePlayer(npc)].Distance(npc.Center) > 2500f) //еÑли(Мой.игрок[Помощьник.ПолучитьКоординатыИгрока(нпÑ)].ДиÑтанциÑ(нпÑ.Центр) больше 2500фунтов) - RunAway = true; //Убегает = да - else //или... - npc.target = Helper2.GetNearestAlivePlayer(npc); //нпÑ.цель равно Помощьник.ПолучитьКоординатыИгрока(нпÑ) - } - } - if (Main.dayTime || RunAway || npc.localAI[3] == 1) //еÑли(Мой.День или Убегать или нпÑ.меÑтный ИИ 3 к 1) - { - npc.localAI[3] = 1; //нпÑ.меÑтный ИИ[3] равен 3 - if (Main.npc[(int)npc.ai[2]].type == mod.NPCType("SoulofHope") && Main.npc[(int)npc.ai[2]].active == true) //еÑли(Мой.нпÑ[(значение)нпÑ.ИИ[2]].тип равен мод.ÐПС Тип("МОБ") и Мой.нпÑ[(значение)нпÑ.ИИ[2]].активен равен да) - Main.npc[(int)npc.ai[2]].localAI[3] = 1; //Мой.нпÑ[(значение)нпÑ.ИИ[2]].меÑтный ИИ[3] варно 1 - if (Main.npc[(int)npc.ai[3]].type == mod.NPCType("SoulofTruth") && Main.npc[(int)npc.ai[3]].active == true) //еÑли(Мой.нпÑ[(значение)нпÑ.ИИ[2]].тип равен мод.ÐПС Тип("МОБ") и Мой.нпÑ[(значение)нпÑ.ИИ[2]].активен равен да) - Main.npc[(int)npc.ai[3]].localAI[3] = 1; //Мой.нпÑ[(значение)нпÑ.ИИ[2]].меÑтный ИИ[3] варно 1 - npc.life += 11; //нпÑ.жизнь прибавить - npc.aiStyle = 0; //нпÑ.ИИ Стиль - 0 - npc.rotation = 0; - npc.velocity = Helper2.VelocityFPTP(npc.Center, new Vector2(npc.Center.X, npc.Center.Y - 4815162342), 30.0f); //нпÑ.поворот = Помощьник.ПоворотФПТП(нпÑ.Центр, новый Вектор2(нпÑ.Центр.X, нпÑ.Центр.Y - 4815162342)) - CreateDust(); - return; - } - if (StateFlag) - if ( - !((Main.npc[(int)npc.ai[2]].type == mod.NPCType("SoulofHope") && Main.npc[(int)npc.ai[2]].active == true)) || - !((Main.npc[(int)npc.ai[3]].type == mod.NPCType("SoulofTruth") && Main.npc[(int)npc.ai[3]].active == true)) - ) - { - StateFlag = false; - OnlyPower = true; - } - if (OnlyPower) - SetStage(true); - else - { - CurrentPower += Step; - if (CurrentPower <= 0 || CurrentPower >= PowerTime) - { - Step *= -1; - SetStage(!Power); - } - } - SetRotation(); - CreateDust(); - TimeToShoot--; - if (TimeToShoot <= 0 && !Power) - { - TimeToShoot = NormalShootRate; - Shoot(); - return; - } - if (TimeToShoot <= 0 && Power) - { - TimeToShoot = PowerShootRate; - npc.target = Helper2.GetNearestPlayer(npc); - if (npc.target != -1) - { - for (int a = 0; a < 5; a++) - { - Vector2 velocity = Helper2.VelocityFPTP(npc.Center, Main.player[npc.target].Center, PowerBulletSpeed); - int spread = 65; - float spreadMult = 0.05f; - velocity.X = velocity.X + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - velocity.Y = velocity.Y + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - int i = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, velocity.X, velocity.Y, PowerShootType, PowerBulletDamage, PowerBulletKB); - Main.projectile[i].hostile = true; - Main.projectile[i].friendly = true; - } - } - return; - } - } - - void CreateDust() - { - if (rnd.Next(3) == 0) - Dust.NewDust(npc.position, npc.width, npc.height, 6); - } - - void SetRotation() - { - npc.rotation = 0; - } - - void SetStage(bool stage) - { - if (Power == stage) - return; - Power = stage; - if (Power) - { - npc.defense += BonusDefenseInPower; - npc.damage += BonusDamageInPower; - } - else - { - npc.defense -= BonusDefenseInPower; - npc.damage -= BonusDamageInPower; - } - } - - void Shoot() - { - npc.target = Helper2.GetNearestPlayer(npc); - if (npc.target != -1) - { - Vector2 velocity = Helper2.VelocityFPTP(npc.Center, Main.player[npc.target].Center, NormalBulletSpeed); - int spread = 95; - float spreadMult = 0.075f; - for (int l = 0; l < 2; l++) - { - velocity.X = velocity.X + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - velocity.Y = velocity.Y + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - int i = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, velocity.X, velocity.Y, NormalShootType, NormalBulletDamage, NormalBulletKB); - Main.projectile[i].hostile = true; - Main.projectile[i].friendly = false; - } - } - } - - public override void HitEffect(int hitDirection, double damage) - { - if (npc.life <= 0) - { - for (int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TrustGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TrustGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TrustGore3"), 1f); - - if (!NPC.AnyNPCs(mod.NPCType("SoulofTruth")) && !NPC.AnyNPCs(mod.NPCType("SoulofHope"))) - { - Main.NewText("The Trinity has been defeated!", 175, 75, 255); - } - } - } - - public override void NPCLoot() - { - - if (Main.expertMode && !NPC.AnyNPCs(mod.NPCType("SoulofTruth")) && !NPC.AnyNPCs(mod.NPCType("SoulofHope"))) - { - npc.DropBossBags(); - } - - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - - - - - if (!NPC.AnyNPCs(mod.NPCType("SoulofHope")) && !NPC.AnyNPCs(mod.NPCType("SoulofTruth"))) - { - - if (!Main.expertMode && Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TrinityTrophy")); - } - - if (!Main.expertMode && Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OmnikronBar"), Main.rand.Next(9, 15)); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TrueEssense"), Main.rand.Next(10, 25)); - } - - if (!TremorWorld.downedTrinity) - { - Main.NewText("This world has been enlightened with Angelite!", 0, 191, 255); - Main.NewText("This world has been attacked with Collapsium!", 255, 20, 147); - - for (int k = 0; k < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 6E-05); k++) - { - WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)(Main.maxTilesY * .3f), (int)(Main.maxTilesY * .65f)), (double)WorldGen.genRand.Next(9, 15), WorldGen.genRand.Next(9, 15), mod.TileType("CollapsiumOreTile"), false, 0f, 0f, false, true); - } - for (int k = 0; k < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 6E-05); k++) - { - WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)(Main.maxTilesY * .3f), (int)(Main.maxTilesY * .65f)), (double)WorldGen.genRand.Next(9, 15), WorldGen.genRand.Next(9, 15), mod.TileType("AngeliteOreTile"), false, 0f, 0f, false, true); - } - TremorWorld.downedTrinity = true; - } - - } - - - if (!Main.expertMode && Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ThrustMask")); - } - - if (!Main.expertMode && Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Volcannon")); - } - - if (!Main.expertMode && Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HonestBlade")); - } - - } - } - } + + const int NormalShootRate = 142; + const int NormalBulletDamage = 10; + const float NormalBulletSpeed = 7.0f; + const float NormalBulletKB = 1.0f; + const int NormalShootType = 291; + + const int PowerBulletDamage = 20; + const int PowerShootRate = 200; + const float PowerBulletSpeed = 10.0f; + const float PowerBulletKB = 2.0f; + const int PowerShootType = 467; + + const int PowerTime = 300; + const int BonusDefenseInPower = 5; + const int BonusDamageInPower = 10; + + bool Power = false; + bool OnlyPower = false; + int TimeToShoot = NormalShootRate; + int CurrentPower = PowerTime; + int Step = -1; + Color TextColor = Color.Orange; + bool StateFlag = true; + + System.Random rnd = new System.Random(); + + public override void SetDefaults() + { + npc.lifeMax = 100000; + npc.damage = 134; + npc.defense = 120; + npc.knockBackResist = 0.0f; + npc.width = 170; + npc.height = 254; + npc.aiStyle = 5; + npc.noGravity = true; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath10; + //npc.boss = true; + npc.value = Item.buyPrice(0, 1, 0, 0); + bossBag = mod.ItemType("TrinityBag2"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 0.625f * bossLifeScale); + npc.damage = (int)(npc.damage * 0.6f); + } + + bool RunAway = false; + + public override void AI() + { + npc.position += npc.velocity * 1.7f; + if (Main.rand.Next(500) == 0 && Main.expertMode) + { + for (int i = 0; i < 50; i++) + { + int dust = Dust.NewDust(npc.position, npc.width, npc.height, 6); + Main.dust[dust].scale = 1.5f; + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity *= 0f; + Main.dust[dust].velocity *= 0f; + } + npc.position.X = (Main.player[npc.target].position.X - 250) + Main.rand.Next(500); + npc.position.Y = (Main.player[npc.target].position.Y - 250) + Main.rand.Next(500); + } + + if (Main.rand.Next(500) == 0 && !Main.expertMode) + { + npc.TargetClosest(true); + Vector2 vector142 = new Vector2(npc.Center.X, npc.Center.Y); + float num1243 = Main.player[npc.target].Center.X - vector142.X; + float num1244 = Main.player[npc.target].Center.Y - vector142.Y; + float num1245 = (float)Math.Sqrt((double)(num1243 * num1243 + num1244 * num1244)); + if (npc.ai[1] == 0f) + { + if (Main.netMode != 1) + { + npc.localAI[1] += 1f; + if (npc.localAI[1] >= (float)(120 + Main.rand.Next(200))) + { + npc.localAI[1] = 0f; + npc.TargetClosest(true); + int num1249 = 0; + int num1250; + int num1251; + while (true) + { + num1249++; + num1250 = (int)Main.player[npc.target].Center.X / 16; + num1251 = (int)Main.player[npc.target].Center.Y / 16; + num1250 += Main.rand.Next(-50, 51); + num1251 += Main.rand.Next(-50, 51); + if (!WorldGen.SolidTile(num1250, num1251) && Collision.CanHit(new Vector2((float)(num1250 * 16), (float)(num1251 * 16)), 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + { + break; + } + if (num1249 > 100) + { + //return; + } + } + npc.ai[1] = 1f; + npc.ai[2] = (float)num1250; + npc.ai[3] = (float)num1251; + npc.netUpdate = true; + //return; + } + } + } + else if (npc.ai[1] == 1f) + { + npc.alpha += 3; + if (npc.alpha >= 255) + { + npc.alpha = 255; + npc.position.X = npc.ai[2] * 16f - (float)(npc.width / 2); + npc.position.Y = npc.ai[3] * 16f - (float)(npc.height / 2); + npc.ai[1] = 2f; + //return; + } + } + else if (npc.ai[1] == 2f) + { + npc.alpha -= 3; + if (npc.alpha <= 0) + { + npc.alpha = 0; + npc.ai[1] = 0f; + //return; + } + } + } + + if (NPC.AnyNPCs(mod.NPCType("SoulofHope")) || NPC.AnyNPCs(mod.NPCType("SoulofTrust"))) + { + npc.dontTakeDamage = true; + } + if (NPC.AnyNPCs(mod.NPCType("SoulofHope")) || NPC.AnyNPCs(mod.NPCType("SoulofTrust"))) + { + npc.dontTakeDamage = false; + } + + if (Main.expertMode && Main.rand.Next(4500) == 0) + { + NPC.NewNPC((int)npc.position.X - 100, (int)npc.position.Y - 50, 418); + NPC.NewNPC((int)npc.position.X + 100, (int)npc.position.Y - 50, 418); + } + + if (Main.rand.Next(2) == 0) + { + int num706 = Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 0.5f); + Main.dust[num706].velocity *= 0.6f; + } + + + if (npc.target != -1 && !RunAway) //еÑли(пнÑ.цель не варно -1 И не убегать) + if (!Main.player[npc.target].active) //еÑли (не мой.игрок[нпÑ.цель].активный) + { + if (Helper2.GetNearestAlivePlayer(npc) == -1) //еÑли (Помощьник.ПолучитьКоординатыИгрока(нпÑ) приÑвоить -1) + RunAway = true; //Убегает = да + else //или + { + if (Main.player[Helper2.GetNearestAlivePlayer(npc)].Distance(npc.Center) > 2500f) //еÑли(Мой.игрок[Помощьник.ПолучитьКоординатыИгрока(нпÑ)].ДиÑтанциÑ(нпÑ.Центр) больше 2500фунтов) + RunAway = true; //Убегает = да + else //или... + npc.target = Helper2.GetNearestAlivePlayer(npc); //нпÑ.цель равно Помощьник.ПолучитьКоординатыИгрока(нпÑ) + } + } + if (Main.dayTime || RunAway || npc.localAI[3] == 1) //еÑли(Мой.День или Убегать или нпÑ.меÑтный ИИ 3 к 1) + { + npc.localAI[3] = 1; //нпÑ.меÑтный ИИ[3] равен 3 + if (Main.npc[(int)npc.ai[2]].type == mod.NPCType("SoulofHope") && Main.npc[(int)npc.ai[2]].active == true) //еÑли(Мой.нпÑ[(значение)нпÑ.ИИ[2]].тип равен мод.ÐПС Тип("МОБ") и Мой.нпÑ[(значение)нпÑ.ИИ[2]].активен равен да) + Main.npc[(int)npc.ai[2]].localAI[3] = 1; //Мой.нпÑ[(значение)нпÑ.ИИ[2]].меÑтный ИИ[3] варно 1 + if (Main.npc[(int)npc.ai[3]].type == mod.NPCType("SoulofTruth") && Main.npc[(int)npc.ai[3]].active == true) //еÑли(Мой.нпÑ[(значение)нпÑ.ИИ[2]].тип равен мод.ÐПС Тип("МОБ") и Мой.нпÑ[(значение)нпÑ.ИИ[2]].активен равен да) + Main.npc[(int)npc.ai[3]].localAI[3] = 1; //Мой.нпÑ[(значение)нпÑ.ИИ[2]].меÑтный ИИ[3] варно 1 + npc.life += 11; //нпÑ.жизнь прибавить + npc.aiStyle = 0; //нпÑ.ИИ Стиль - 0 + npc.rotation = 0; + npc.velocity = Helper2.VelocityFPTP(npc.Center, new Vector2(npc.Center.X, npc.Center.Y - 4815162342), 30.0f); //нпÑ.поворот = Помощьник.ПоворотФПТП(нпÑ.Центр, новый Вектор2(нпÑ.Центр.X, нпÑ.Центр.Y - 4815162342)) + CreateDust(); + return; + } + if (StateFlag) + if ( + !((Main.npc[(int)npc.ai[2]].type == mod.NPCType("SoulofHope") && Main.npc[(int)npc.ai[2]].active == true)) || + !((Main.npc[(int)npc.ai[3]].type == mod.NPCType("SoulofTruth") && Main.npc[(int)npc.ai[3]].active == true)) + ) + { + StateFlag = false; + OnlyPower = true; + } + if (OnlyPower) + SetStage(true); + else + { + CurrentPower += Step; + if (CurrentPower <= 0 || CurrentPower >= PowerTime) + { + Step *= -1; + SetStage(!Power); + } + } + SetRotation(); + CreateDust(); + TimeToShoot--; + if (TimeToShoot <= 0 && !Power) + { + TimeToShoot = NormalShootRate; + Shoot(); + return; + } + if (TimeToShoot <= 0 && Power) + { + TimeToShoot = PowerShootRate; + npc.target = Helper2.GetNearestPlayer(npc); + if (npc.target != -1) + { + for (int a = 0; a < 5; a++) + { + Vector2 velocity = Helper2.VelocityFPTP(npc.Center, Main.player[npc.target].Center, PowerBulletSpeed); + int spread = 65; + float spreadMult = 0.05f; + velocity.X = velocity.X + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.Y = velocity.Y + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + int i = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, velocity.X, velocity.Y, PowerShootType, PowerBulletDamage, PowerBulletKB); + Main.projectile[i].hostile = true; + Main.projectile[i].friendly = true; + } + } + return; + } + } + + void CreateDust() + { + if (rnd.Next(3) == 0) + Dust.NewDust(npc.position, npc.width, npc.height, 6); + } + + void SetRotation() + { + npc.rotation = 0; + } + + void SetStage(bool stage) + { + if (Power == stage) + return; + Power = stage; + if (Power) + { + npc.defense += BonusDefenseInPower; + npc.damage += BonusDamageInPower; + } + else + { + npc.defense -= BonusDefenseInPower; + npc.damage -= BonusDamageInPower; + } + } + + void Shoot() + { + npc.target = Helper2.GetNearestPlayer(npc); + if (npc.target != -1) + { + Vector2 velocity = Helper2.VelocityFPTP(npc.Center, Main.player[npc.target].Center, NormalBulletSpeed); + int spread = 95; + float spreadMult = 0.075f; + for (int l = 0; l < 2; l++) + { + velocity.X = velocity.X + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.Y = velocity.Y + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + int i = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, velocity.X, velocity.Y, NormalShootType, NormalBulletDamage, NormalBulletKB); + Main.projectile[i].hostile = true; + Main.projectile[i].friendly = false; + } + } + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TrustGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TrustGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TrustGore3"), 1f); + + if (!NPC.AnyNPCs(mod.NPCType("SoulofTruth")) && !NPC.AnyNPCs(mod.NPCType("SoulofHope"))) + { + Main.NewText("The Trinity has been defeated!", 175, 75, 255); + } + } + } + + public override void NPCLoot() + { + + if (Main.expertMode && !NPC.AnyNPCs(mod.NPCType("SoulofTruth")) && !NPC.AnyNPCs(mod.NPCType("SoulofHope"))) + { + npc.DropBossBags(); + } + + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + + + + + if (!NPC.AnyNPCs(mod.NPCType("SoulofHope")) && !NPC.AnyNPCs(mod.NPCType("SoulofTruth"))) + { + + if (!Main.expertMode && Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TrinityTrophy")); + } + + if (!Main.expertMode && Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OmnikronBar"), Main.rand.Next(9, 15)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TrueEssense"), Main.rand.Next(10, 25)); + } + + if (!TremorWorld.downedTrinity) + { + Main.NewText("This world has been enlightened with Angelite!", 0, 191, 255); + Main.NewText("This world has been attacked with Collapsium!", 255, 20, 147); + + for (int k = 0; k < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 6E-05); k++) + { + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)(Main.maxTilesY * .3f), (int)(Main.maxTilesY * .65f)), (double)WorldGen.genRand.Next(9, 15), WorldGen.genRand.Next(9, 15), mod.TileType("CollapsiumOreTile"), false, 0f, 0f, false, true); + } + for (int k = 0; k < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 6E-05); k++) + { + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)(Main.maxTilesY * .3f), (int)(Main.maxTilesY * .65f)), (double)WorldGen.genRand.Next(9, 15), WorldGen.genRand.Next(9, 15), mod.TileType("AngeliteOreTile"), false, 0f, 0f, false, true); + } + TremorWorld.downedTrinity = true; + } + + } + + + if (!Main.expertMode && Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ThrustMask")); + } + + if (!Main.expertMode && Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Volcannon")); + } + + if (!Main.expertMode && Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("HonestBlade")); + } + + } + } + } } \ No newline at end of file diff --git a/NPCs/SoulofTruth.cs b/NPCs/SoulofTruth.cs index 41a2b560..844af6ba 100644 --- a/NPCs/SoulofTruth.cs +++ b/NPCs/SoulofTruth.cs @@ -10,354 +10,354 @@ namespace Tremor.NPCs { [AutoloadBossHead] - public class SoulofTruth : ModNPC - { + public class SoulofTruth : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("The Truth"); } - - const int NormalIAStyle = 23; - - const int PowerAIStyle = 2; - const int PowerLaserDamage = 2; - const float PowerLaserKB = 40; - - const float DistantionToPower = 300f; - const int BonusDefenseInPower = 5; - const int BonusDamageInPower = 10; - const int ShootType = 76; - const float RotationSpeed = 0.2f; - - bool Power = false; - bool OnlyPower = false; - float Rotation = 0.0f; - Color TextColor = Color.Orange; - bool StateFlag = true; - - float[] myAI = new float[2]; - - System.Random rnd = new System.Random(); - - public override void SetDefaults() - { - npc.lifeMax = 60000; - npc.damage = 24; - npc.defense = 100; - npc.knockBackResist = 0f; - npc.width = 180; - npc.height = 266; - npc.aiStyle = 5; - npc.noGravity = true; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit37; - npc.DeathSound = SoundID.NPCDeath10; - //npc.boss = true; - npc.value = Item.buyPrice(0, 1, 0, 0); - bossBag = mod.ItemType("TrinityBag1"); - } - - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 0.625f * bossLifeScale); - npc.damage = (int)(npc.damage * 0.6f); - } - - bool RunAway = false; - - public override void AI() - { - npc.position += npc.velocity * 1.7f; - if (Main.rand.Next(500) == 0 && Main.expertMode) - { - for (int i = 0; i < 50; i++) - { - int dust = Dust.NewDust(npc.position, npc.width, npc.height, 5); - Main.dust[dust].scale = 1.5f; - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 0f; - Main.dust[dust].velocity *= 0f; - } - npc.position.X = (Main.player[npc.target].position.X - 250) + Main.rand.Next(500); - npc.position.Y = (Main.player[npc.target].position.Y - 250) + Main.rand.Next(500); - } - - if (Main.rand.Next(500) == 0 && !Main.expertMode) - { - npc.TargetClosest(true); - Vector2 vector142 = new Vector2(npc.Center.X, npc.Center.Y); - float num1243 = Main.player[npc.target].Center.X - vector142.X; - float num1244 = Main.player[npc.target].Center.Y - vector142.Y; - float num1245 = (float)Math.Sqrt((double)(num1243 * num1243 + num1244 * num1244)); - if (npc.ai[1] == 0f) - { - if (Main.netMode != 1) - { - npc.localAI[1] += 1f; - if (npc.localAI[1] >= (float)(120 + Main.rand.Next(200))) - { - npc.localAI[1] = 0f; - npc.TargetClosest(true); - int num1249 = 0; - int num1250; - int num1251; - while (true) - { - num1249++; - num1250 = (int)Main.player[npc.target].Center.X / 16; - num1251 = (int)Main.player[npc.target].Center.Y / 16; - num1250 += Main.rand.Next(-50, 51); - num1251 += Main.rand.Next(-50, 51); - if (!WorldGen.SolidTile(num1250, num1251) && Collision.CanHit(new Vector2((float)(num1250 * 16), (float)(num1251 * 16)), 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) - { - break; - } - if (num1249 > 100) - { - //return; - } - } - npc.ai[1] = 1f; - npc.ai[2] = (float)num1250; - npc.ai[3] = (float)num1251; - npc.netUpdate = true; - //return; - } - } - } - else if (npc.ai[1] == 1f) - { - npc.alpha += 3; - if (npc.alpha >= 255) - { - npc.alpha = 255; - npc.position.X = npc.ai[2] * 16f - (float)(npc.width / 2); - npc.position.Y = npc.ai[3] * 16f - (float)(npc.height / 2); - npc.ai[1] = 2f; - //return; - } - } - else if (npc.ai[1] == 2f) - { - npc.alpha -= 3; - if (npc.alpha <= 0) - { - npc.alpha = 0; - npc.ai[1] = 0f; - //return; - } - } - } - - if (Main.expertMode && Main.rand.Next(7500) == 0) - { - NPC.NewNPC((int)npc.position.X - 150, (int)npc.position.Y - 150, 421); - NPC.NewNPC((int)npc.position.X + 150, (int)npc.position.Y - 150, 421); - NPC.NewNPC((int)npc.position.X - 150, (int)npc.position.Y + 150, 421); - NPC.NewNPC((int)npc.position.X + 150, (int)npc.position.Y + 150, 421); - } - - if (npc.target != -1 && !RunAway) - if (!Main.player[npc.target].active) - { - if (Helper2.GetNearestAlivePlayer(npc) == -1) - RunAway = true; - else - { - if (Main.player[Helper2.GetNearestAlivePlayer(npc)].Distance(npc.Center) > 2500f) - RunAway = true; - else - npc.target = Helper2.GetNearestAlivePlayer(npc); - } - } - if (Main.dayTime || RunAway || npc.localAI[3] == 1) - { - npc.localAI[3] = 1; - if (Main.npc[(int)npc.ai[2]].type == mod.NPCType("SoulofTrust") && Main.npc[(int)npc.ai[2]].active == true) - Main.npc[(int)npc.ai[2]].localAI[3] = 1; - if (Main.npc[(int)npc.ai[3]].type == mod.NPCType("SoulofTruth") && Main.npc[(int)npc.ai[3]].active == true) - Main.npc[(int)npc.ai[3]].localAI[3] = 1; - npc.life += 11; - npc.aiStyle = 0; - npc.rotation = 0; - npc.velocity = Helper2.VelocityFPTP(npc.Center, new Vector2(npc.Center.X, npc.Center.Y - 4815162342), 30.0f); - CreateDust(); - return; - } - if (StateFlag) - if ( - !((Main.npc[(int)npc.ai[2]].type == mod.NPCType("SoulofHope") && Main.npc[(int)npc.ai[2]].active == true)) || - !((Main.npc[(int)npc.ai[3]].type == mod.NPCType("SoulofTrust") && Main.npc[(int)npc.ai[3]].active == true)) - ) - { - StateFlag = false; - OnlyPower = true; - } - if (!OnlyPower) - SetStage(!(Main.player[Helper2.GetNearestPlayer(npc)].Distance(npc.Center) <= DistantionToPower)); - else - SetStage(true); - SetRotation(); - CreateDust(); - if (Power && rnd.Next(5) == 0) - Shoot(); - } - - void CreateDust() - { - if (rnd.Next(3) == 0) - Dust.NewDust(npc.position, npc.width, npc.height, 59); - } - - void SetRotation() - { - if (Power) - { - while (Rotation - 36.0f >= 0.0f) - Rotation -= 36.0f; - if (Rotation != 0.0f) - Rotation -= (RotationSpeed * 2.0f); - if (Rotation < 0.0f) - Rotation = 0.0f; - npc.rotation = Rotation; - } - else - { - Rotation = npc.rotation; - } - } - - void SetStage(bool stage) - { - if (Power == stage) - return; - Power = stage; - if (Power) - { - npc.defense += BonusDefenseInPower; - npc.damage += BonusDamageInPower; - npc.aiStyle = PowerAIStyle; - } - else - { - npc.defense -= BonusDefenseInPower; - npc.damage -= BonusDamageInPower; - npc.aiStyle = NormalIAStyle; - } - } - - void Shoot() - { - npc.target = Helper2.GetNearestPlayer(npc); - if (npc.target != -1) - { - Vector2 velocity = Helper2.VelocityFPTP(npc.Center, new Vector2(Main.player[npc.target].Center.X, Main.player[npc.target].Center.Y + 20), 0.0f); - int spread = 65; - float spreadMult = 0.05f; - for (int l = 0; l < 2; l++) - { - velocity.X = velocity.X + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - velocity.Y = velocity.Y + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; - int i = Projectile.NewProjectile(npc.Center.X, npc.Center.Y + 20, velocity.X, velocity.Y, ShootType, PowerLaserDamage, PowerLaserKB); - Main.projectile[i].hostile = true; - Main.projectile[i].friendly = false; - Main.projectile[i].tileCollide = false; - } - } - } - - public override void ReceiveExtraAI(BinaryReader reader) - { - OnlyPower = reader.ReadBoolean(); - base.ReceiveExtraAI(reader); - } - - public override void HitEffect(int hitDirection, double damage) - { - if (npc.life <= 0) - { - for (int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TruthGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TruthGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TruthGore3"), 1f); - - if (!NPC.AnyNPCs(mod.NPCType("SoulofHope")) && !NPC.AnyNPCs(mod.NPCType("SoulofTrust"))) - { - Main.NewText("The Trinity has been defeated!", 175, 75, 255); - } - } - } - - public override void NPCLoot() - { - - if (Main.expertMode && !NPC.AnyNPCs(mod.NPCType("SoulofTrust")) && !NPC.AnyNPCs(mod.NPCType("SoulofHope"))) - { - npc.DropBossBags(); - } - - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - - - - - if (!NPC.AnyNPCs(mod.NPCType("SoulofHope")) && !NPC.AnyNPCs(mod.NPCType("SoulofTrust"))) - { - - if (!Main.expertMode && Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TrinityTrophy")); - } - - if (!Main.expertMode && Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OmnikronBar"), Main.rand.Next(9, 15)); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TrueEssense"), Main.rand.Next(10, 25)); - } - - if (!TremorWorld.downedTrinity) - { - Main.NewText("This world has been enlightened with Angelite!", 0, 191, 255); - Main.NewText("This world has been attacked with Collapsium!", 255, 20, 147); - - - for (int k = 0; k < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 6E-05); k++) - { - WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)(Main.maxTilesY * .3f), (int)(Main.maxTilesY * .65f)), (double)WorldGen.genRand.Next(9, 15), WorldGen.genRand.Next(9, 15), mod.TileType("CollapsiumOreTile"), false, 0f, 0f, false, true); - } - for (int k = 0; k < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 6E-05); k++) - { - WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)(Main.maxTilesY * .3f), (int)(Main.maxTilesY * .65f)), (double)WorldGen.genRand.Next(9, 15), WorldGen.genRand.Next(9, 15), mod.TileType("AngeliteOreTile"), false, 0f, 0f, false, true); - } - TremorWorld.downedTrinity = true; - } - - } - - - if (!Main.expertMode && Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ThruthMask")); - } - - if (!Main.expertMode && Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TrebleClef")); - } - - if (!Main.expertMode && Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Revolwar")); - } - - } - } - } + + const int NormalIAStyle = 23; + + const int PowerAIStyle = 2; + const int PowerLaserDamage = 2; + const float PowerLaserKB = 40; + + const float DistantionToPower = 300f; + const int BonusDefenseInPower = 5; + const int BonusDamageInPower = 10; + const int ShootType = 76; + const float RotationSpeed = 0.2f; + + bool Power = false; + bool OnlyPower = false; + float Rotation = 0.0f; + Color TextColor = Color.Orange; + bool StateFlag = true; + + float[] myAI = new float[2]; + + System.Random rnd = new System.Random(); + + public override void SetDefaults() + { + npc.lifeMax = 60000; + npc.damage = 24; + npc.defense = 100; + npc.knockBackResist = 0f; + npc.width = 180; + npc.height = 266; + npc.aiStyle = 5; + npc.noGravity = true; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit37; + npc.DeathSound = SoundID.NPCDeath10; + //npc.boss = true; + npc.value = Item.buyPrice(0, 1, 0, 0); + bossBag = mod.ItemType("TrinityBag1"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 0.625f * bossLifeScale); + npc.damage = (int)(npc.damage * 0.6f); + } + + bool RunAway = false; + + public override void AI() + { + npc.position += npc.velocity * 1.7f; + if (Main.rand.Next(500) == 0 && Main.expertMode) + { + for (int i = 0; i < 50; i++) + { + int dust = Dust.NewDust(npc.position, npc.width, npc.height, 5); + Main.dust[dust].scale = 1.5f; + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity *= 0f; + Main.dust[dust].velocity *= 0f; + } + npc.position.X = (Main.player[npc.target].position.X - 250) + Main.rand.Next(500); + npc.position.Y = (Main.player[npc.target].position.Y - 250) + Main.rand.Next(500); + } + + if (Main.rand.Next(500) == 0 && !Main.expertMode) + { + npc.TargetClosest(true); + Vector2 vector142 = new Vector2(npc.Center.X, npc.Center.Y); + float num1243 = Main.player[npc.target].Center.X - vector142.X; + float num1244 = Main.player[npc.target].Center.Y - vector142.Y; + float num1245 = (float)Math.Sqrt((double)(num1243 * num1243 + num1244 * num1244)); + if (npc.ai[1] == 0f) + { + if (Main.netMode != 1) + { + npc.localAI[1] += 1f; + if (npc.localAI[1] >= (float)(120 + Main.rand.Next(200))) + { + npc.localAI[1] = 0f; + npc.TargetClosest(true); + int num1249 = 0; + int num1250; + int num1251; + while (true) + { + num1249++; + num1250 = (int)Main.player[npc.target].Center.X / 16; + num1251 = (int)Main.player[npc.target].Center.Y / 16; + num1250 += Main.rand.Next(-50, 51); + num1251 += Main.rand.Next(-50, 51); + if (!WorldGen.SolidTile(num1250, num1251) && Collision.CanHit(new Vector2((float)(num1250 * 16), (float)(num1251 * 16)), 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + { + break; + } + if (num1249 > 100) + { + //return; + } + } + npc.ai[1] = 1f; + npc.ai[2] = (float)num1250; + npc.ai[3] = (float)num1251; + npc.netUpdate = true; + //return; + } + } + } + else if (npc.ai[1] == 1f) + { + npc.alpha += 3; + if (npc.alpha >= 255) + { + npc.alpha = 255; + npc.position.X = npc.ai[2] * 16f - (float)(npc.width / 2); + npc.position.Y = npc.ai[3] * 16f - (float)(npc.height / 2); + npc.ai[1] = 2f; + //return; + } + } + else if (npc.ai[1] == 2f) + { + npc.alpha -= 3; + if (npc.alpha <= 0) + { + npc.alpha = 0; + npc.ai[1] = 0f; + //return; + } + } + } + + if (Main.expertMode && Main.rand.Next(7500) == 0) + { + NPC.NewNPC((int)npc.position.X - 150, (int)npc.position.Y - 150, 421); + NPC.NewNPC((int)npc.position.X + 150, (int)npc.position.Y - 150, 421); + NPC.NewNPC((int)npc.position.X - 150, (int)npc.position.Y + 150, 421); + NPC.NewNPC((int)npc.position.X + 150, (int)npc.position.Y + 150, 421); + } + + if (npc.target != -1 && !RunAway) + if (!Main.player[npc.target].active) + { + if (Helper2.GetNearestAlivePlayer(npc) == -1) + RunAway = true; + else + { + if (Main.player[Helper2.GetNearestAlivePlayer(npc)].Distance(npc.Center) > 2500f) + RunAway = true; + else + npc.target = Helper2.GetNearestAlivePlayer(npc); + } + } + if (Main.dayTime || RunAway || npc.localAI[3] == 1) + { + npc.localAI[3] = 1; + if (Main.npc[(int)npc.ai[2]].type == mod.NPCType("SoulofTrust") && Main.npc[(int)npc.ai[2]].active == true) + Main.npc[(int)npc.ai[2]].localAI[3] = 1; + if (Main.npc[(int)npc.ai[3]].type == mod.NPCType("SoulofTruth") && Main.npc[(int)npc.ai[3]].active == true) + Main.npc[(int)npc.ai[3]].localAI[3] = 1; + npc.life += 11; + npc.aiStyle = 0; + npc.rotation = 0; + npc.velocity = Helper2.VelocityFPTP(npc.Center, new Vector2(npc.Center.X, npc.Center.Y - 4815162342), 30.0f); + CreateDust(); + return; + } + if (StateFlag) + if ( + !((Main.npc[(int)npc.ai[2]].type == mod.NPCType("SoulofHope") && Main.npc[(int)npc.ai[2]].active == true)) || + !((Main.npc[(int)npc.ai[3]].type == mod.NPCType("SoulofTrust") && Main.npc[(int)npc.ai[3]].active == true)) + ) + { + StateFlag = false; + OnlyPower = true; + } + if (!OnlyPower) + SetStage(!(Main.player[Helper2.GetNearestPlayer(npc)].Distance(npc.Center) <= DistantionToPower)); + else + SetStage(true); + SetRotation(); + CreateDust(); + if (Power && rnd.Next(5) == 0) + Shoot(); + } + + void CreateDust() + { + if (rnd.Next(3) == 0) + Dust.NewDust(npc.position, npc.width, npc.height, 59); + } + + void SetRotation() + { + if (Power) + { + while (Rotation - 36.0f >= 0.0f) + Rotation -= 36.0f; + if (Rotation != 0.0f) + Rotation -= (RotationSpeed * 2.0f); + if (Rotation < 0.0f) + Rotation = 0.0f; + npc.rotation = Rotation; + } + else + { + Rotation = npc.rotation; + } + } + + void SetStage(bool stage) + { + if (Power == stage) + return; + Power = stage; + if (Power) + { + npc.defense += BonusDefenseInPower; + npc.damage += BonusDamageInPower; + npc.aiStyle = PowerAIStyle; + } + else + { + npc.defense -= BonusDefenseInPower; + npc.damage -= BonusDamageInPower; + npc.aiStyle = NormalIAStyle; + } + } + + void Shoot() + { + npc.target = Helper2.GetNearestPlayer(npc); + if (npc.target != -1) + { + Vector2 velocity = Helper2.VelocityFPTP(npc.Center, new Vector2(Main.player[npc.target].Center.X, Main.player[npc.target].Center.Y + 20), 0.0f); + int spread = 65; + float spreadMult = 0.05f; + for (int l = 0; l < 2; l++) + { + velocity.X = velocity.X + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + velocity.Y = velocity.Y + (float)Main.rand.Next(-spread, spread + 1) * spreadMult; + int i = Projectile.NewProjectile(npc.Center.X, npc.Center.Y + 20, velocity.X, velocity.Y, ShootType, PowerLaserDamage, PowerLaserKB); + Main.projectile[i].hostile = true; + Main.projectile[i].friendly = false; + Main.projectile[i].tileCollide = false; + } + } + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + OnlyPower = reader.ReadBoolean(); + base.ReceiveExtraAI(reader); + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TruthGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TruthGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TruthGore3"), 1f); + + if (!NPC.AnyNPCs(mod.NPCType("SoulofHope")) && !NPC.AnyNPCs(mod.NPCType("SoulofTrust"))) + { + Main.NewText("The Trinity has been defeated!", 175, 75, 255); + } + } + } + + public override void NPCLoot() + { + + if (Main.expertMode && !NPC.AnyNPCs(mod.NPCType("SoulofTrust")) && !NPC.AnyNPCs(mod.NPCType("SoulofHope"))) + { + npc.DropBossBags(); + } + + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + + + + + if (!NPC.AnyNPCs(mod.NPCType("SoulofHope")) && !NPC.AnyNPCs(mod.NPCType("SoulofTrust"))) + { + + if (!Main.expertMode && Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TrinityTrophy")); + } + + if (!Main.expertMode && Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OmnikronBar"), Main.rand.Next(9, 15)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TrueEssense"), Main.rand.Next(10, 25)); + } + + if (!TremorWorld.downedTrinity) + { + Main.NewText("This world has been enlightened with Angelite!", 0, 191, 255); + Main.NewText("This world has been attacked with Collapsium!", 255, 20, 147); + + + for (int k = 0; k < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 6E-05); k++) + { + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)(Main.maxTilesY * .3f), (int)(Main.maxTilesY * .65f)), (double)WorldGen.genRand.Next(9, 15), WorldGen.genRand.Next(9, 15), mod.TileType("CollapsiumOreTile"), false, 0f, 0f, false, true); + } + for (int k = 0; k < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 6E-05); k++) + { + WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)(Main.maxTilesY * .3f), (int)(Main.maxTilesY * .65f)), (double)WorldGen.genRand.Next(9, 15), WorldGen.genRand.Next(9, 15), mod.TileType("AngeliteOreTile"), false, 0f, 0f, false, true); + } + TremorWorld.downedTrinity = true; + } + + } + + + if (!Main.expertMode && Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ThruthMask")); + } + + if (!Main.expertMode && Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TrebleClef")); + } + + if (!Main.expertMode && Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Revolwar")); + } + + } + } + } } \ No newline at end of file diff --git a/NPCs/SpaceWhale.cs b/NPCs/SpaceWhale.cs index da32c2cd..13f1c9c9 100644 --- a/NPCs/SpaceWhale.cs +++ b/NPCs/SpaceWhale.cs @@ -6,853 +6,855 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - [AutoloadBossHead] -public class SpaceWhale : ModNPC +namespace Tremor.NPCs { + [AutoloadBossHead] + public class SpaceWhale : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Space Whale"); Main.npcFrameCount[npc.type] = 8; } - - public override void SetDefaults() - { + + public override void SetDefaults() + { npc.width = 500; npc.height = 80; npc.damage = 120; npc.defense = 135; npc.lifeMax = 120000; - npc.scale = 1.2f; + npc.scale = 1.2f; npc.HitSound = SoundID.NPCHit1; - npc.noTileCollide = true; + npc.noTileCollide = true; npc.DeathSound = SoundID.NPCDeath10; - npc.boss = true; + npc.boss = true; npc.knockBackResist = 0f; - npc.noGravity = true; - music = 39; - npc.aiStyle = -1; + npc.noGravity = true; + music = 39; + npc.aiStyle = -1; animationType = 370; - bossBag = mod.ItemType("SpaceWhaleTreasureBag"); - } + bossBag = mod.ItemType("SpaceWhaleTreasureBag"); + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 60; k++) + { + Dust.NewDust(npc.Center, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.Center, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.Center, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/SWGore1"), 1f); + Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/SWGore2"), 1f); + Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/SWGore2"), 1f); + Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/SWGore3"), 1f); + Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/SWGore3"), 1f); + Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/SWGore4"), 1f); + } + else + { - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 60; k++) - { - Dust.NewDust(npc.Center, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.Center, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.Center, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/SWGore1"), 1f); - Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/SWGore2"), 1f); - Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/SWGore2"), 1f); - Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/SWGore3"), 1f); - Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/SWGore3"), 1f); - Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/SWGore4"), 1f); - } - else - { + for (int k = 0; k < damage / npc.lifeMax * 20.0; k++) + { + Dust.NewDust(npc.Center, npc.width, npc.height, 226, (float)hitDirection, -2f, 0, default(Color), 0.7f); + Dust.NewDust(npc.Center, npc.width, npc.height, 27, (float)hitDirection, -1f, 0, default(Color), 0.7f); + } + } + } - for(int k = 0; k < damage / npc.lifeMax * 20.0; k++) - { - Dust.NewDust(npc.Center, npc.width, npc.height, 226, (float)hitDirection, -2f, 0, default(Color), 0.7f); - Dust.NewDust(npc.Center, npc.width, npc.height, 27, (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } - } + public override void AI() + { - public override void AI() - { + if (NPC.AnyNPCs(mod.NPCType("SpaceWhaleMinion"))) + { + npc.dontTakeDamage = true; + } + if (!NPC.AnyNPCs(mod.NPCType("SpaceWhaleMinion"))) + { + npc.dontTakeDamage = false; + } - if (NPC.AnyNPCs(mod.NPCType("SpaceWhaleMinion"))) - { - npc.dontTakeDamage = true; - } - if (!NPC.AnyNPCs(mod.NPCType("SpaceWhaleMinion"))) - { - npc.dontTakeDamage = false; - } + bool flag75 = npc.life <= 45000; + if (flag75) + { + npc.damage = 150; + npc.defense = 50; + } + int num1076 = 60; + float num1077 = 0.45f; + float scaleFactor = 7.5f; + if (npc.ai[0] == 5f) + { + num1077 = 0.5f; + scaleFactor = 8f; + } + int num1078 = 30; + float scaleFactor2 = 16f; + if (npc.ai[0] < 4f && npc.ai[3] < 10f) + { + num1076 = 30; + } + else if (npc.ai[0] > 4f && npc.ai[3] < 10f) + { + num1076 = 20; + num1078 = 30; + } + int num1079 = 80; + int num1080 = 4; + float num1081 = 0.3f; + float scaleFactor3 = 5f; + int num1082 = 90; + int num1083 = 180; + int num1084 = 120; + int num1085 = 4; + float scaleFactor4 = 6f; + float scaleFactor5 = 20f; + float num1086 = 6.28318548f / (float)(num1084 / 2); + int num1087 = 75; + Vector2 vector134 = npc.Center; + Player player2 = Main.player[npc.target]; + if (npc.target < 0 || npc.target == 255 || player2.dead || !player2.active) + { + npc.TargetClosest(true); + player2 = Main.player[npc.target]; + npc.netUpdate = true; + } + if (player2.dead || Vector2.Distance(player2.Center, vector134) > 2400f) + { + npc.velocity.Y = npc.velocity.Y - 0.4f; + if (npc.timeLeft > 10) + { + npc.timeLeft = 10; + } + if (npc.ai[0] > 4f) + { + npc.ai[0] = 5f; + } + else + { + npc.ai[0] = 0f; + } + npc.ai[2] = 0f; + } + if (npc.localAI[0] == 0f) + { + npc.localAI[0] = 1f; + npc.alpha = 255; + npc.rotation = 0f; + if (Main.netMode != 1) + { + npc.ai[0] = -1f; + npc.netUpdate = true; + } + } + float num1088 = (float)Math.Atan2((double)(player2.Center.Y - vector134.Y), (double)(player2.Center.X - vector134.X)); + if (npc.spriteDirection == 1) + { + num1088 += 3.14159274f; + } + if (num1088 < 0f) + { + num1088 += 6.28318548f; + } + if (num1088 > 6.28318548f) + { + num1088 -= 6.28318548f; + } + if (npc.ai[0] == -1f) + { + num1088 = 0f; + } + if (npc.ai[0] == 3f) + { + num1088 = 0f; + } + if (npc.ai[0] == 4f) + { + num1088 = 0f; + } + if (npc.ai[0] == 8f) + { + num1088 = 0f; + } + float num1089 = 0.04f; + if (npc.ai[0] == 1f || npc.ai[0] == 6f) + { + num1089 = 0f; + } + if (npc.ai[0] == 7f) + { + num1089 = 0f; + } + if (npc.ai[0] == 3f) + { + num1089 = 0.01f; + } + if (npc.ai[0] == 4f) + { + num1089 = 0.01f; + } + if (npc.ai[0] == 8f) + { + num1089 = 0.01f; + } + if (npc.rotation < num1088) + { + if ((double)(num1088 - npc.rotation) > 3.1415926535897931) + { + npc.rotation -= num1089; + } + else + { + npc.rotation += num1089; + } + } + if (npc.rotation > num1088) + { + if ((double)(npc.rotation - num1088) > 3.1415926535897931) + { + npc.rotation += num1089; + } + else + { + npc.rotation -= num1089; + } + } + if (npc.rotation > num1088 - num1089 && npc.rotation < num1088 + num1089) + { + npc.rotation = num1088; + } + if (npc.rotation < 0f) + { + npc.rotation += 6.28318548f; + } + if (npc.rotation > 6.28318548f) + { + npc.rotation -= 6.28318548f; + } + if (npc.rotation > num1088 - num1089 && npc.rotation < num1088 + num1089) + { + npc.rotation = num1088; + } + if (npc.ai[0] != -1f) + { + bool flag76 = Collision.SolidCollision(npc.position, npc.width, npc.height); + if (flag76) + { + npc.alpha += 15; + } + else + { + npc.alpha -= 15; + } + if (npc.alpha < 0) + { + npc.alpha = 0; + } + if (npc.alpha > 150) + { + npc.alpha = 150; + } + } + if (npc.ai[0] == -1f) + { + npc.velocity *= 0.98f; + int num1090 = Math.Sign(player2.Center.X - vector134.X); + if (num1090 != 0) + { + npc.direction = num1090; + npc.spriteDirection = -npc.direction; + } + if (npc.ai[2] > 20f) + { + npc.velocity.Y = -2f; + npc.alpha -= 5; + bool flag77 = Collision.SolidCollision(npc.position, npc.width, npc.height); + if (flag77) + { + npc.alpha += 15; + } + if (npc.alpha < 0) + { + npc.alpha = 0; + } + if (npc.alpha > 150) + { + npc.alpha = 150; + } + } + if (npc.ai[2] == (float)(num1082 - 30)) + { + int num1091 = 36; + for (int num1092 = 0; num1092 < num1091; num1092++) + { + Vector2 vector135 = Vector2.Normalize(npc.velocity) * new Vector2((float)npc.width / 2f, (float)npc.height) * 0.75f * 0.5f; + vector135 = vector135.RotatedBy((double)((float)(num1092 - (num1091 / 2 - 1)) * 6.28318548f / (float)num1091), default(Vector2)) + npc.Center; + Vector2 value2 = vector135 - npc.Center; + int num1093 = Dust.NewDust(vector135 + value2, 0, 0, 172, value2.X * 2f, value2.Y * 2f, 100, default(Color), 1.4f); + Main.dust[num1093].noGravity = true; + Main.dust[num1093].noLight = true; + Main.dust[num1093].velocity = Vector2.Normalize(value2) * 3f; + } + Main.PlaySound(29, (int)vector134.X, (int)vector134.Y, 96); + } + npc.ai[2] += 1f; + if (npc.ai[2] >= (float)num1087) + { + npc.ai[0] = 0f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.netUpdate = true; + return; + } + } + else if (npc.ai[0] == 0f && !player2.dead) + { + if (npc.ai[1] == 0f) + { + npc.ai[1] = (float)(300 * Math.Sign((vector134 - player2.Center).X)); + } + Vector2 value3 = player2.Center + new Vector2(npc.ai[1], -200f) - vector134; + Vector2 vector136 = Vector2.Normalize(value3 - npc.velocity) * scaleFactor; + if (npc.velocity.X < vector136.X) + { + npc.velocity.X = npc.velocity.X + num1077; + if (npc.velocity.X < 0f && vector136.X > 0f) + { + npc.velocity.X = npc.velocity.X + num1077; + } + } + else if (npc.velocity.X > vector136.X) + { + npc.velocity.X = npc.velocity.X - num1077; + if (npc.velocity.X > 0f && vector136.X < 0f) + { + npc.velocity.X = npc.velocity.X - num1077; + } + } + if (npc.velocity.Y < vector136.Y) + { + npc.velocity.Y = npc.velocity.Y + num1077; + if (npc.velocity.Y < 0f && vector136.Y > 0f) + { + npc.velocity.Y = npc.velocity.Y + num1077; + } + } + else if (npc.velocity.Y > vector136.Y) + { + npc.velocity.Y = npc.velocity.Y - num1077; + if (npc.velocity.Y > 0f && vector136.Y < 0f) + { + npc.velocity.Y = npc.velocity.Y - num1077; + } + } + int num1094 = Math.Sign(player2.Center.X - vector134.X); + if (num1094 != 0) + { + if (npc.ai[2] == 0f && num1094 != npc.direction) + { + npc.rotation += 3.14159274f; + } + npc.direction = num1094; + if (npc.spriteDirection != -npc.direction) + { + npc.rotation += 3.14159274f; + } + npc.spriteDirection = -npc.direction; + } + npc.ai[2] += 1f; + if (npc.ai[2] >= (float)num1076) + { + int num1095 = 0; + switch ((int)npc.ai[3]) + { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + num1095 = 1; + break; + case 10: + npc.ai[3] = 1f; + num1095 = 2; + break; + case 11: + npc.ai[3] = 0f; + num1095 = 3; + break; + } + if (flag75) + { + num1095 = 4; + } + if (num1095 == 1) + { + npc.ai[0] = 1f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.velocity = Vector2.Normalize(player2.Center - vector134) * scaleFactor2; + npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X); + if (num1094 != 0) + { + npc.direction = num1094; + if (npc.spriteDirection == 1) + { + npc.rotation += 3.14159274f; + } + npc.spriteDirection = -npc.direction; + } + } + else if (num1095 == 2) + { + npc.ai[0] = 2f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + } + else if (num1095 == 3) + { + npc.ai[0] = 3f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + } + else if (num1095 == 4) + { + npc.ai[0] = 4f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + } + npc.netUpdate = true; + return; + } + } + else if (npc.ai[0] == 1f) + { + int num1096 = 7; + for (int num1097 = 0; num1097 < num1096; num1097++) + { + Vector2 vector137 = Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f; + vector137 = vector137.RotatedBy((double)(num1097 - (num1096 / 2 - 1)) * 3.1415926535897931 / (double)((float)num1096), default(Vector2)) + vector134; + Vector2 value4 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); + int num1098 = Dust.NewDust(vector137 + value4, 0, 0, 172, value4.X * 2f, value4.Y * 2f, 100, default(Color), 1.4f); + Main.dust[num1098].noGravity = true; + Main.dust[num1098].noLight = true; + Main.dust[num1098].velocity /= 4f; + Main.dust[num1098].velocity -= npc.velocity; + } + npc.ai[2] += 1f; + if (npc.ai[2] >= (float)num1078) + { + npc.ai[0] = 0f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] += 2f; + npc.netUpdate = true; + return; + } + } + else if (npc.ai[0] == 2f) + { + if (npc.ai[1] == 0f) + { + npc.ai[1] = (float)(300 * Math.Sign((vector134 - player2.Center).X)); + } + Vector2 value5 = player2.Center + new Vector2(npc.ai[1], -200f) - vector134; + Vector2 vector138 = Vector2.Normalize(value5 - npc.velocity) * scaleFactor3; + if (npc.velocity.X < vector138.X) + { + npc.velocity.X = npc.velocity.X + num1081; + if (npc.velocity.X < 0f && vector138.X > 0f) + { + npc.velocity.X = npc.velocity.X + num1081; + } + } + else if (npc.velocity.X > vector138.X) + { + npc.velocity.X = npc.velocity.X - num1081; + if (npc.velocity.X > 0f && vector138.X < 0f) + { + npc.velocity.X = npc.velocity.X - num1081; + } + } + if (npc.velocity.Y < vector138.Y) + { + npc.velocity.Y = npc.velocity.Y + num1081; + if (npc.velocity.Y < 0f && vector138.Y > 0f) + { + npc.velocity.Y = npc.velocity.Y + num1081; + } + } + else if (npc.velocity.Y > vector138.Y) + { + npc.velocity.Y = npc.velocity.Y - num1081; + if (npc.velocity.Y > 0f && vector138.Y < 0f) + { + npc.velocity.Y = npc.velocity.Y - num1081; + } + } + if (npc.ai[2] == 0f) + { + Main.PlaySound(29, (int)vector134.X, (int)vector134.Y, 96); + } + if (npc.ai[2] % (float)num1080 == 0f) + { + Main.PlaySound(4, (int)npc.Center.X, (int)npc.Center.Y, 19); + if (Main.netMode != 1) + { + Vector2 vector139 = Vector2.Normalize(player2.Center - vector134) * (float)(npc.width + 20) / 2f + vector134; + NPC.NewNPC((int)vector139.X, (int)vector139.Y + 45, mod.NPCType("SpaceWhaleMinion"), 0); + } + } + int num1099 = Math.Sign(player2.Center.X - vector134.X); + if (num1099 != 0) + { + npc.direction = num1099; + if (npc.spriteDirection != -npc.direction) + { + npc.rotation += 3.14159274f; + } + npc.spriteDirection = -npc.direction; + } + npc.ai[2] += 1f; + if (npc.ai[2] >= (float)num1079) + { + npc.ai[0] = 0f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.netUpdate = true; + return; + } + } + else if (npc.ai[0] == 3f) + { + npc.velocity *= 0.98f; + npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); + if (npc.ai[2] == (float)(num1082 - 30)) + { + Main.PlaySound(29, (int)vector134.X, (int)vector134.Y, 95); + } + if (Main.netMode != 1 && npc.ai[2] == (float)(num1082 - 30)) + { + Vector2 vector140 = npc.rotation.ToRotationVector2() * (Vector2.UnitX * (float)npc.direction) * (float)(npc.width + 20) / 2f + vector134; + Projectile.NewProjectile(vector140.X, vector140.Y, (float)(npc.direction * 2), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); Projectile.NewProjectile(vector140.X, vector140.Y, (float)(npc.direction * 3), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); Projectile.NewProjectile(vector140.X, vector140.Y, (float)(npc.direction * 4), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); Projectile.NewProjectile(vector140.X, vector140.Y, (float)(npc.direction * 5), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); Projectile.NewProjectile(vector140.X, vector140.Y, (float)(npc.direction * 6), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); Projectile.NewProjectile(vector140.X, vector140.Y, (float)(npc.direction * 7), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); Projectile.NewProjectile(vector140.X, vector140.Y, (float)(npc.direction * 8), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); Projectile.NewProjectile(vector140.X, vector140.Y, (float)(npc.direction * 9), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector140.X, vector140.Y, (float)(-(float)npc.direction * 2), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector140.X, vector140.Y, (float)(-(float)npc.direction * 3), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector140.X, vector140.Y, (float)(-(float)npc.direction * 4), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector140.X, vector140.Y, (float)(-(float)npc.direction * 5), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector140.X, vector140.Y, (float)(-(float)npc.direction * 6), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector140.X, vector140.Y, (float)(-(float)npc.direction * 7), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector140.X, vector140.Y, (float)(-(float)npc.direction * 8), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(vector140.X, vector140.Y, (float)(-(float)npc.direction * 9), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); + } + npc.ai[2] += 1f; + if (npc.ai[2] >= (float)num1082) + { + npc.ai[0] = 0f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.netUpdate = true; + return; + } + } + else if (npc.ai[0] == 4f) + { + npc.velocity *= 0.98f; + npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); + if (npc.ai[2] == (float)(num1083 - 60)) + { + Main.PlaySound(29, (int)vector134.X, (int)vector134.Y, 98); + } + npc.ai[2] += 1f; + if (npc.ai[2] >= (float)num1083) + { + npc.ai[0] = 5f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + npc.netUpdate = true; + return; + } + } + else if (npc.ai[0] == 5f && !player2.dead) + { + if (npc.ai[1] == 0f) + { + npc.ai[1] = (float)(300 * Math.Sign((vector134 - player2.Center).X)); + } + Vector2 value6 = player2.Center + new Vector2(npc.ai[1], -200f) - vector134; + Vector2 vector141 = Vector2.Normalize(value6 - npc.velocity) * scaleFactor; + if (npc.velocity.X < vector141.X) + { + npc.velocity.X = npc.velocity.X + num1077; + if (npc.velocity.X < 0f && vector141.X > 0f) + { + npc.velocity.X = npc.velocity.X + num1077; + } + } + else if (npc.velocity.X > vector141.X) + { + npc.velocity.X = npc.velocity.X - num1077; + if (npc.velocity.X > 0f && vector141.X < 0f) + { + npc.velocity.X = npc.velocity.X - num1077; + } + } + if (npc.velocity.Y < vector141.Y) + { + npc.velocity.Y = npc.velocity.Y + num1077; + if (npc.velocity.Y < 0f && vector141.Y > 0f) + { + npc.velocity.Y = npc.velocity.Y + num1077; + } + } + else if (npc.velocity.Y > vector141.Y) + { + npc.velocity.Y = npc.velocity.Y - num1077; + if (npc.velocity.Y > 0f && vector141.Y < 0f) + { + npc.velocity.Y = npc.velocity.Y - num1077; + } + } + int num1100 = Math.Sign(player2.Center.X - vector134.X); + if (num1100 != 0) + { + if (npc.ai[2] == 0f && num1100 != npc.direction) + { + npc.rotation += 3.14159274f; + } + npc.direction = num1100; + if (npc.spriteDirection != -npc.direction) + { + npc.rotation += 3.14159274f; + } + npc.spriteDirection = -npc.direction; + } + npc.ai[2] += 1f; + if (npc.ai[2] >= (float)num1076) + { + int num1101 = 0; + switch ((int)npc.ai[3]) + { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + num1101 = 1; + break; + case 6: + npc.ai[3] = 1f; + num1101 = 2; + break; + case 7: + npc.ai[3] = 0f; + num1101 = 3; + break; + } + if (num1101 == 1) + { + npc.ai[0] = 6f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.velocity = Vector2.Normalize(player2.Center - vector134) * scaleFactor2; + npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X); + if (num1100 != 0) + { + npc.direction = num1100; + if (npc.spriteDirection == 1) + { + npc.rotation += 3.14159274f; + } + npc.spriteDirection = -npc.direction; + } + } + else if (num1101 == 2) + { + npc.velocity = Vector2.Normalize(player2.Center - vector134) * scaleFactor5; + npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X); + if (num1100 != 0) + { + npc.direction = num1100; + if (npc.spriteDirection == 1) + { + npc.rotation += 3.14159274f; + } + npc.spriteDirection = -npc.direction; + } + npc.ai[0] = 7f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + } + else if (num1101 == 3) + { + npc.ai[0] = 8f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + } + npc.netUpdate = true; + return; + } + } + else if (npc.ai[0] == 6f) + { + int num1102 = 7; + for (int num1103 = 0; num1103 < num1102; num1103++) + { + Vector2 vector142 = Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f; + vector142 = vector142.RotatedBy((double)(num1103 - (num1102 / 2 - 1)) * 3.1415926535897931 / (double)((float)num1102), default(Vector2)) + vector134; + Vector2 value7 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); + int num1104 = Dust.NewDust(vector142 + value7, 0, 0, 172, value7.X * 2f, value7.Y * 2f, 100, default(Color), 1.4f); + Main.dust[num1104].noGravity = true; + Main.dust[num1104].noLight = true; + Main.dust[num1104].velocity /= 4f; + Main.dust[num1104].velocity -= npc.velocity; + } + npc.ai[2] += 1f; + if (npc.ai[2] >= (float)num1078) + { + npc.ai[0] = 5f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] += 2f; + npc.netUpdate = true; + return; + } + } + else if (npc.ai[0] == 7f) + { + if (npc.ai[2] == 0f) + { + Main.PlaySound(29, (int)vector134.X, (int)vector134.Y, 98); + } + if (npc.ai[2] % (float)num1085 == 0f) + { + Main.PlaySound(4, (int)npc.Center.X, (int)npc.Center.Y, 19); + if (Main.netMode != 1) + { + Vector2 vector143 = Vector2.Normalize(npc.velocity) * (float)(npc.width + 20) / 2f + vector134; + int num1105 = NPC.NewNPC((int)vector143.X, (int)vector143.Y + 45, mod.NPCType("SpaceWhaleMinion"), 0); + Main.npc[num1105].target = npc.target; + Main.npc[num1105].velocity = Vector2.Normalize(npc.velocity).RotatedBy((double)(1.57079637f * (float)npc.direction), default(Vector2)) * scaleFactor4; + Main.npc[num1105].netUpdate = true; + Main.npc[num1105].ai[3] = (float)Main.rand.Next(80, 121) / 100f; + } + } + npc.velocity = npc.velocity.RotatedBy((double)(-(double)num1086 * (float)npc.direction), default(Vector2)); + npc.rotation -= num1086 * (float)npc.direction; + npc.ai[2] += 1f; + if (npc.ai[2] >= (float)num1084) + { + npc.ai[0] = 5f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.netUpdate = true; + return; + } + } + else if (npc.ai[0] == 8f) + { + npc.velocity *= 0.98f; + npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); + if (npc.ai[2] == (float)(num1082 - 30)) + { + Main.PlaySound(29, (int)vector134.X, (int)vector134.Y, 94); + } + if (Main.netMode != 1 && npc.ai[2] == (float)(num1082 - 30)) + { + Projectile.NewProjectile(vector134.X, vector134.Y, 0f, 0f, mod.ProjectileType("SpaceMeteorPro"), 0, 0f, Main.myPlayer, 1f, (float)(npc.target + 1)); + } + npc.ai[2] += 1f; + if (npc.ai[2] >= (float)num1082) + { + npc.ai[0] = 5f; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.netUpdate = true; + return; + } + } - bool flag75 = npc.life <= 45000; - if (flag75) - { - npc.damage = 150; - npc.defense = 50; - } - int num1076 = 60; - float num1077 = 0.45f; - float scaleFactor = 7.5f; - if (npc.ai[0] == 5f) - { - num1077 = 0.5f; - scaleFactor = 8f; - } - int num1078 = 30; - float scaleFactor2 = 16f; - if (npc.ai[0] < 4f && npc.ai[3] < 10f) - { - num1076 = 30; - } - else if (npc.ai[0] > 4f && npc.ai[3] < 10f) - { - num1076 = 20; - num1078 = 30; - } - int num1079 = 80; - int num1080 = 4; - float num1081 = 0.3f; - float scaleFactor3 = 5f; - int num1082 = 90; - int num1083 = 180; - int num1084 = 120; - int num1085 = 4; - float scaleFactor4 = 6f; - float scaleFactor5 = 20f; - float num1086 = 6.28318548f / (float)(num1084 / 2); - int num1087 = 75; - Vector2 vector134 = npc.Center; - Player player2 = Main.player[npc.target]; - if (npc.target < 0 || npc.target == 255 || player2.dead || !player2.active) - { - npc.TargetClosest(true); - player2 = Main.player[npc.target]; - npc.netUpdate = true; - } - if (player2.dead || Vector2.Distance(player2.Center, vector134) > 2400f) - { - npc.velocity.Y = npc.velocity.Y - 0.4f; - if (npc.timeLeft > 10) - { - npc.timeLeft = 10; - } - if (npc.ai[0] > 4f) - { - npc.ai[0] = 5f; - } - else - { - npc.ai[0] = 0f; - } - npc.ai[2] = 0f; - } - if (npc.localAI[0] == 0f) - { - npc.localAI[0] = 1f; - npc.alpha = 255; - npc.rotation = 0f; - if (Main.netMode != 1) - { - npc.ai[0] = -1f; - npc.netUpdate = true; - } - } - float num1088 = (float)Math.Atan2((double)(player2.Center.Y - vector134.Y), (double)(player2.Center.X - vector134.X)); - if (npc.spriteDirection == 1) - { - num1088 += 3.14159274f; - } - if (num1088 < 0f) - { - num1088 += 6.28318548f; - } - if (num1088 > 6.28318548f) - { - num1088 -= 6.28318548f; - } - if (npc.ai[0] == -1f) - { - num1088 = 0f; - } - if (npc.ai[0] == 3f) - { - num1088 = 0f; - } - if (npc.ai[0] == 4f) - { - num1088 = 0f; - } - if (npc.ai[0] == 8f) - { - num1088 = 0f; - } - float num1089 = 0.04f; - if (npc.ai[0] == 1f || npc.ai[0] == 6f) - { - num1089 = 0f; - } - if (npc.ai[0] == 7f) - { - num1089 = 0f; - } - if (npc.ai[0] == 3f) - { - num1089 = 0.01f; - } - if (npc.ai[0] == 4f) - { - num1089 = 0.01f; - } - if (npc.ai[0] == 8f) - { - num1089 = 0.01f; - } - if (npc.rotation < num1088) - { - if ((double)(num1088 - npc.rotation) > 3.1415926535897931) - { - npc.rotation -= num1089; - } - else - { - npc.rotation += num1089; - } - } - if (npc.rotation > num1088) - { - if ((double)(npc.rotation - num1088) > 3.1415926535897931) - { - npc.rotation += num1089; - } - else - { - npc.rotation -= num1089; - } - } - if (npc.rotation > num1088 - num1089 && npc.rotation < num1088 + num1089) - { - npc.rotation = num1088; - } - if (npc.rotation < 0f) - { - npc.rotation += 6.28318548f; - } - if (npc.rotation > 6.28318548f) - { - npc.rotation -= 6.28318548f; - } - if (npc.rotation > num1088 - num1089 && npc.rotation < num1088 + num1089) - { - npc.rotation = num1088; - } - if (npc.ai[0] != -1f) - { - bool flag76 = Collision.SolidCollision(npc.position, npc.width, npc.height); - if (flag76) - { - npc.alpha += 15; - } - else - { - npc.alpha -= 15; - } - if (npc.alpha < 0) - { - npc.alpha = 0; - } - if (npc.alpha > 150) - { - npc.alpha = 150; - } - } - if (npc.ai[0] == -1f) - { - npc.velocity *= 0.98f; - int num1090 = Math.Sign(player2.Center.X - vector134.X); - if (num1090 != 0) - { - npc.direction = num1090; - npc.spriteDirection = -npc.direction; - } - if (npc.ai[2] > 20f) - { - npc.velocity.Y = -2f; - npc.alpha -= 5; - bool flag77 = Collision.SolidCollision(npc.position, npc.width, npc.height); - if (flag77) - { - npc.alpha += 15; - } - if (npc.alpha < 0) - { - npc.alpha = 0; - } - if (npc.alpha > 150) - { - npc.alpha = 150; - } - } - if (npc.ai[2] == (float)(num1082 - 30)) - { - int num1091 = 36; - for (int num1092 = 0; num1092 < num1091; num1092++) - { - Vector2 vector135 = Vector2.Normalize(npc.velocity) * new Vector2((float)npc.width / 2f, (float)npc.height) * 0.75f * 0.5f; - vector135 = vector135.RotatedBy((double)((float)(num1092 - (num1091 / 2 - 1)) * 6.28318548f / (float)num1091), default(Vector2)) + npc.Center; - Vector2 value2 = vector135 - npc.Center; - int num1093 = Dust.NewDust(vector135 + value2, 0, 0, 172, value2.X * 2f, value2.Y * 2f, 100, default(Color), 1.4f); - Main.dust[num1093].noGravity = true; - Main.dust[num1093].noLight = true; - Main.dust[num1093].velocity = Vector2.Normalize(value2) * 3f; - } - Main.PlaySound(29, (int)vector134.X, (int)vector134.Y, 96); - } - npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num1087) - { - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.netUpdate = true; - return; - } - } - else if (npc.ai[0] == 0f && !player2.dead) - { - if (npc.ai[1] == 0f) - { - npc.ai[1] = (float)(300 * Math.Sign((vector134 - player2.Center).X)); - } - Vector2 value3 = player2.Center + new Vector2(npc.ai[1], -200f) - vector134; - Vector2 vector136 = Vector2.Normalize(value3 - npc.velocity) * scaleFactor; - if (npc.velocity.X < vector136.X) - { - npc.velocity.X = npc.velocity.X + num1077; - if (npc.velocity.X < 0f && vector136.X > 0f) - { - npc.velocity.X = npc.velocity.X + num1077; - } - } - else if (npc.velocity.X > vector136.X) - { - npc.velocity.X = npc.velocity.X - num1077; - if (npc.velocity.X > 0f && vector136.X < 0f) - { - npc.velocity.X = npc.velocity.X - num1077; - } - } - if (npc.velocity.Y < vector136.Y) - { - npc.velocity.Y = npc.velocity.Y + num1077; - if (npc.velocity.Y < 0f && vector136.Y > 0f) - { - npc.velocity.Y = npc.velocity.Y + num1077; - } - } - else if (npc.velocity.Y > vector136.Y) - { - npc.velocity.Y = npc.velocity.Y - num1077; - if (npc.velocity.Y > 0f && vector136.Y < 0f) - { - npc.velocity.Y = npc.velocity.Y - num1077; - } - } - int num1094 = Math.Sign(player2.Center.X - vector134.X); - if (num1094 != 0) - { - if (npc.ai[2] == 0f && num1094 != npc.direction) - { - npc.rotation += 3.14159274f; - } - npc.direction = num1094; - if (npc.spriteDirection != -npc.direction) - { - npc.rotation += 3.14159274f; - } - npc.spriteDirection = -npc.direction; - } - npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num1076) - { - int num1095 = 0; - switch ((int)npc.ai[3]) - { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - num1095 = 1; - break; - case 10: - npc.ai[3] = 1f; - num1095 = 2; - break; - case 11: - npc.ai[3] = 0f; - num1095 = 3; - break; - } - if (flag75) - { - num1095 = 4; - } - if (num1095 == 1) - { - npc.ai[0] = 1f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.velocity = Vector2.Normalize(player2.Center - vector134) * scaleFactor2; - npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X); - if (num1094 != 0) - { - npc.direction = num1094; - if (npc.spriteDirection == 1) - { - npc.rotation += 3.14159274f; - } - npc.spriteDirection = -npc.direction; - } - } - else if (num1095 == 2) - { - npc.ai[0] = 2f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - else if (num1095 == 3) - { - npc.ai[0] = 3f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - else if (num1095 == 4) - { - npc.ai[0] = 4f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - npc.netUpdate = true; - return; - } - } - else if (npc.ai[0] == 1f) - { - int num1096 = 7; - for (int num1097 = 0; num1097 < num1096; num1097++) - { - Vector2 vector137 = Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f; - vector137 = vector137.RotatedBy((double)(num1097 - (num1096 / 2 - 1)) * 3.1415926535897931 / (double)((float)num1096), default(Vector2)) + vector134; - Vector2 value4 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); - int num1098 = Dust.NewDust(vector137 + value4, 0, 0, 172, value4.X * 2f, value4.Y * 2f, 100, default(Color), 1.4f); - Main.dust[num1098].noGravity = true; - Main.dust[num1098].noLight = true; - Main.dust[num1098].velocity /= 4f; - Main.dust[num1098].velocity -= npc.velocity; - } - npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num1078) - { - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] += 2f; - npc.netUpdate = true; - return; - } - } - else if (npc.ai[0] == 2f) - { - if (npc.ai[1] == 0f) - { - npc.ai[1] = (float)(300 * Math.Sign((vector134 - player2.Center).X)); - } - Vector2 value5 = player2.Center + new Vector2(npc.ai[1], -200f) - vector134; - Vector2 vector138 = Vector2.Normalize(value5 - npc.velocity) * scaleFactor3; - if (npc.velocity.X < vector138.X) - { - npc.velocity.X = npc.velocity.X + num1081; - if (npc.velocity.X < 0f && vector138.X > 0f) - { - npc.velocity.X = npc.velocity.X + num1081; - } - } - else if (npc.velocity.X > vector138.X) - { - npc.velocity.X = npc.velocity.X - num1081; - if (npc.velocity.X > 0f && vector138.X < 0f) - { - npc.velocity.X = npc.velocity.X - num1081; - } - } - if (npc.velocity.Y < vector138.Y) - { - npc.velocity.Y = npc.velocity.Y + num1081; - if (npc.velocity.Y < 0f && vector138.Y > 0f) - { - npc.velocity.Y = npc.velocity.Y + num1081; - } - } - else if (npc.velocity.Y > vector138.Y) - { - npc.velocity.Y = npc.velocity.Y - num1081; - if (npc.velocity.Y > 0f && vector138.Y < 0f) - { - npc.velocity.Y = npc.velocity.Y - num1081; - } - } - if (npc.ai[2] == 0f) - { - Main.PlaySound(29, (int)vector134.X, (int)vector134.Y, 96); - } - if (npc.ai[2] % (float)num1080 == 0f) - { - Main.PlaySound(4, (int)npc.Center.X, (int)npc.Center.Y, 19); - if (Main.netMode != 1) - { - Vector2 vector139 = Vector2.Normalize(player2.Center - vector134) * (float)(npc.width + 20) / 2f + vector134; - NPC.NewNPC((int)vector139.X, (int)vector139.Y + 45, mod.NPCType("SpaceWhaleMinion"), 0); - } - } - int num1099 = Math.Sign(player2.Center.X - vector134.X); - if (num1099 != 0) - { - npc.direction = num1099; - if (npc.spriteDirection != -npc.direction) - { - npc.rotation += 3.14159274f; - } - npc.spriteDirection = -npc.direction; - } - npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num1079) - { - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.netUpdate = true; - return; - } - } - else if (npc.ai[0] == 3f) - { - npc.velocity *= 0.98f; - npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); - if (npc.ai[2] == (float)(num1082 - 30)) - { - Main.PlaySound(29, (int)vector134.X, (int)vector134.Y, 95); - } - if (Main.netMode != 1 && npc.ai[2] == (float)(num1082 - 30)) - { - Vector2 vector140 = npc.rotation.ToRotationVector2() * (Vector2.UnitX * (float)npc.direction) * (float)(npc.width + 20) / 2f + vector134; - Projectile.NewProjectile(vector140.X, vector140.Y, (float)(npc.direction * 2), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); Projectile.NewProjectile(vector140.X, vector140.Y, (float)(npc.direction * 3), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); Projectile.NewProjectile(vector140.X, vector140.Y, (float)(npc.direction * 4), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); Projectile.NewProjectile(vector140.X, vector140.Y, (float)(npc.direction * 5), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); Projectile.NewProjectile(vector140.X, vector140.Y, (float)(npc.direction * 6), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); Projectile.NewProjectile(vector140.X, vector140.Y, (float)(npc.direction * 7), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); Projectile.NewProjectile(vector140.X, vector140.Y, (float)(npc.direction * 8), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); Projectile.NewProjectile(vector140.X, vector140.Y, (float)(npc.direction * 9), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(vector140.X, vector140.Y, (float)(-(float)npc.direction * 2), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(vector140.X, vector140.Y, (float)(-(float)npc.direction * 3), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(vector140.X, vector140.Y, (float)(-(float)npc.direction * 4), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(vector140.X, vector140.Y, (float)(-(float)npc.direction * 5), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(vector140.X, vector140.Y, (float)(-(float)npc.direction * 6), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(vector140.X, vector140.Y, (float)(-(float)npc.direction * 7), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(vector140.X, vector140.Y, (float)(-(float)npc.direction * 8), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(vector140.X, vector140.Y, (float)(-(float)npc.direction * 9), 8f, 467, 0, 0f, Main.myPlayer, 0f, 0f); - } - npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num1082) - { - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.netUpdate = true; - return; - } - } - else if (npc.ai[0] == 4f) - { - npc.velocity *= 0.98f; - npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); - if (npc.ai[2] == (float)(num1083 - 60)) - { - Main.PlaySound(29, (int)vector134.X, (int)vector134.Y, 98); - } - npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num1083) - { - npc.ai[0] = 5f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - npc.netUpdate = true; - return; - } - } - else if (npc.ai[0] == 5f && !player2.dead) - { - if (npc.ai[1] == 0f) - { - npc.ai[1] = (float)(300 * Math.Sign((vector134 - player2.Center).X)); - } - Vector2 value6 = player2.Center + new Vector2(npc.ai[1], -200f) - vector134; - Vector2 vector141 = Vector2.Normalize(value6 - npc.velocity) * scaleFactor; - if (npc.velocity.X < vector141.X) - { - npc.velocity.X = npc.velocity.X + num1077; - if (npc.velocity.X < 0f && vector141.X > 0f) - { - npc.velocity.X = npc.velocity.X + num1077; - } - } - else if (npc.velocity.X > vector141.X) - { - npc.velocity.X = npc.velocity.X - num1077; - if (npc.velocity.X > 0f && vector141.X < 0f) - { - npc.velocity.X = npc.velocity.X - num1077; - } - } - if (npc.velocity.Y < vector141.Y) - { - npc.velocity.Y = npc.velocity.Y + num1077; - if (npc.velocity.Y < 0f && vector141.Y > 0f) - { - npc.velocity.Y = npc.velocity.Y + num1077; - } - } - else if (npc.velocity.Y > vector141.Y) - { - npc.velocity.Y = npc.velocity.Y - num1077; - if (npc.velocity.Y > 0f && vector141.Y < 0f) - { - npc.velocity.Y = npc.velocity.Y - num1077; - } - } - int num1100 = Math.Sign(player2.Center.X - vector134.X); - if (num1100 != 0) - { - if (npc.ai[2] == 0f && num1100 != npc.direction) - { - npc.rotation += 3.14159274f; - } - npc.direction = num1100; - if (npc.spriteDirection != -npc.direction) - { - npc.rotation += 3.14159274f; - } - npc.spriteDirection = -npc.direction; - } - npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num1076) - { - int num1101 = 0; - switch ((int)npc.ai[3]) - { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - num1101 = 1; - break; - case 6: - npc.ai[3] = 1f; - num1101 = 2; - break; - case 7: - npc.ai[3] = 0f; - num1101 = 3; - break; - } - if (num1101 == 1) - { - npc.ai[0] = 6f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.velocity = Vector2.Normalize(player2.Center - vector134) * scaleFactor2; - npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X); - if (num1100 != 0) - { - npc.direction = num1100; - if (npc.spriteDirection == 1) - { - npc.rotation += 3.14159274f; - } - npc.spriteDirection = -npc.direction; - } - } - else if (num1101 == 2) - { - npc.velocity = Vector2.Normalize(player2.Center - vector134) * scaleFactor5; - npc.rotation = (float)Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X); - if (num1100 != 0) - { - npc.direction = num1100; - if (npc.spriteDirection == 1) - { - npc.rotation += 3.14159274f; - } - npc.spriteDirection = -npc.direction; - } - npc.ai[0] = 7f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - else if (num1101 == 3) - { - npc.ai[0] = 8f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - npc.netUpdate = true; - return; - } - } - else if (npc.ai[0] == 6f) - { - int num1102 = 7; - for (int num1103 = 0; num1103 < num1102; num1103++) - { - Vector2 vector142 = Vector2.Normalize(npc.velocity) * new Vector2((float)(npc.width + 50) / 2f, (float)npc.height) * 0.75f; - vector142 = vector142.RotatedBy((double)(num1103 - (num1102 / 2 - 1)) * 3.1415926535897931 / (double)((float)num1102), default(Vector2)) + vector134; - Vector2 value7 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); - int num1104 = Dust.NewDust(vector142 + value7, 0, 0, 172, value7.X * 2f, value7.Y * 2f, 100, default(Color), 1.4f); - Main.dust[num1104].noGravity = true; - Main.dust[num1104].noLight = true; - Main.dust[num1104].velocity /= 4f; - Main.dust[num1104].velocity -= npc.velocity; - } - npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num1078) - { - npc.ai[0] = 5f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] += 2f; - npc.netUpdate = true; - return; - } - } - else if (npc.ai[0] == 7f) - { - if (npc.ai[2] == 0f) - { - Main.PlaySound(29, (int)vector134.X, (int)vector134.Y, 98); - } - if (npc.ai[2] % (float)num1085 == 0f) - { - Main.PlaySound(4, (int)npc.Center.X, (int)npc.Center.Y, 19); - if (Main.netMode != 1) - { - Vector2 vector143 = Vector2.Normalize(npc.velocity) * (float)(npc.width + 20) / 2f + vector134; - int num1105 = NPC.NewNPC((int)vector143.X, (int)vector143.Y + 45, mod.NPCType("SpaceWhaleMinion"), 0); - Main.npc[num1105].target = npc.target; - Main.npc[num1105].velocity = Vector2.Normalize(npc.velocity).RotatedBy((double)(1.57079637f * (float)npc.direction), default(Vector2)) * scaleFactor4; - Main.npc[num1105].netUpdate = true; - Main.npc[num1105].ai[3] = (float)Main.rand.Next(80, 121) / 100f; - } - } - npc.velocity = npc.velocity.RotatedBy((double)(-(double)num1086 * (float)npc.direction), default(Vector2)); - npc.rotation -= num1086 * (float)npc.direction; - npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num1084) - { - npc.ai[0] = 5f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.netUpdate = true; - return; - } - } - else if (npc.ai[0] == 8f) - { - npc.velocity *= 0.98f; - npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); - if (npc.ai[2] == (float)(num1082 - 30)) - { - Main.PlaySound(29, (int)vector134.X, (int)vector134.Y, 94); - } - if (Main.netMode != 1 && npc.ai[2] == (float)(num1082 - 30)) - { - Projectile.NewProjectile(vector134.X, vector134.Y, 0f, 0f, mod.ProjectileType("SpaceMeteorPro"), 0, 0f, Main.myPlayer, 1f, (float)(npc.target + 1)); - } - npc.ai[2] += 1f; - if (npc.ai[2] >= (float)num1082) - { - npc.ai[0] = 5f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.netUpdate = true; - return; - } - } - - } + } - public override void NPCLoot() - { + public override void NPCLoot() + { - if(Main.expertMode) - { - npc.DropBossBags(); - } + if (Main.expertMode) + { + npc.DropBossBags(); + } - if (Main.netMode != 1) - { - int CenterX = (int)(npc.Center.X + (float)(npc.width / 2)) / 16; - int CenterY = (int)(npc.Center.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; + if (Main.netMode != 1) + { + int CenterX = (int)(npc.Center.X + (float)(npc.width / 2)) / 16; + int CenterY = (int)(npc.Center.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; - if(!TremorWorld.downedSpaceWhale) - { - Main.NewText("A comet has struck the ground!", 117, 187, 253); + if (!TremorWorld.downedSpaceWhale) + { + Main.NewText("A comet has struck the ground!", 117, 187, 253); TremorWorld.dropComet(); //return; - } - if(TremorWorld.downedSpaceWhale && Main.rand.Next(3) == 0) - { - Main.NewText("A comet has struck the ground!", 117, 187, 253); + } + if (TremorWorld.downedSpaceWhale && Main.rand.Next(3) == 0) + { + Main.NewText("A comet has struck the ground!", 117, 187, 253); TremorWorld.dropComet(); //return; - } -TremorWorld.downedSpaceWhale = true; + } + TremorWorld.downedSpaceWhale = true; - if(!Main.expertMode && Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("SpaceWhaleMask")); - } - if(!Main.expertMode && Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("SpaceWhaleTrophy")); - } + if (!Main.expertMode && Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("SpaceWhaleMask")); + } + if (!Main.expertMode && Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("SpaceWhaleTrophy")); + } - if(!Main.expertMode && Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("SDL")); - } + if (!Main.expertMode && Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("SDL")); + } - if(!Main.expertMode && Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("BlackHoleCannon")); - } + if (!Main.expertMode && Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("BlackHoleCannon")); + } - if(!Main.expertMode && Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("HornedWarHammer")); - } + if (!Main.expertMode && Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("HornedWarHammer")); + } - if(!Main.expertMode && Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("StarLantern")); - } + if (!Main.expertMode && Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("StarLantern")); + } - if(!Main.expertMode && Main.rand.Next(8) == 0) - { - Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("WhaleFlippers")); - } - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("CosmicFuel")); - } - } - } + if (!Main.expertMode && Main.rand.Next(8) == 0) + { + Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("WhaleFlippers")); + } + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("CosmicFuel")); + } + } + } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/SpaceWhaleMinion.cs b/NPCs/SpaceWhaleMinion.cs index 855e5ddc..78337067 100644 --- a/NPCs/SpaceWhaleMinion.cs +++ b/NPCs/SpaceWhaleMinion.cs @@ -13,61 +13,61 @@ public override void SetStaticDefaults() DisplayName.SetDefault("Space Whale Minion"); Main.npcFrameCount[npc.type] = 2; } - + public override void SetDefaults() { npc.width = 72; npc.height = 62; npc.damage = 74; npc.defense = 80; - npc.noGravity = true; - npc.noTileCollide = true; + npc.noGravity = true; + npc.noTileCollide = true; npc.lifeMax = 100; - npc.npcSlots = 5f; + npc.npcSlots = 5f; npc.HitSound = SoundID.NPCHit3; npc.DeathSound = SoundID.NPCDeath3; - npc.value = Item.buyPrice(0, 0, 3, 12); + npc.value = Item.buyPrice(0, 0, 3, 12); npc.knockBackResist = 0.1f; npc.aiStyle = 74; aiType = 418; animationType = 23; } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.6f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.6f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.6f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SpaceWhaleMinionGore"), 1f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.6f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.6f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 6, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.6f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SpaceWhaleMinionGore"), 1f); + } + } - public override void AI() - { -if (Main.rand.Next(4) == 0) - { - int num706 = Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 2f); - Main.dust[num706].velocity *= 0.3f; - } - } + public override void AI() + { + if (Main.rand.Next(4) == 0) + { + int num706 = Dust.NewDust(npc.position, npc.width, npc.height, 6, 0f, 0f, 200, npc.color, 2f); + Main.dust[num706].velocity *= 0.3f; + } + } } diff --git a/NPCs/Spaceman.cs b/NPCs/Spaceman.cs index 414c7c99..db6d0080 100644 --- a/NPCs/Spaceman.cs +++ b/NPCs/Spaceman.cs @@ -13,7 +13,7 @@ public override void SetStaticDefaults() DisplayName.SetDefault("Spaceman"); Main.npcFrameCount[npc.type] = 15; } - + public override void SetDefaults() { npc.width = 30; @@ -23,75 +23,75 @@ public override void SetDefaults() npc.lifeMax = 200; npc.HitSound = SoundID.NPCHit48; npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 3, 12); + npc.value = Item.buyPrice(0, 0, 3, 12); npc.knockBackResist = 0.3f; npc.aiStyle = 3; aiType = 73; - npc.aiStyle = 3; + npc.aiStyle = 3; animationType = 31; - banner = npc.type; - bannerItem = mod.ItemType("SpacemanBanner"); + banner = npc.type; + bannerItem = mod.ItemType("SpacemanBanner"); } - public override void AI() - { + public override void AI() + { -if (Main.rand.Next(1000) == 0) - { - Main.PlaySound(61, (int)npc.position.X, (int)npc.position.Y, 1); - } -if (Main.rand.Next(1000) == 0) - { - Main.PlaySound(62, (int)npc.position.X, (int)npc.position.Y, 1); - } - } + if (Main.rand.Next(1000) == 0) + { + Main.PlaySound(61, (int)npc.position.X, (int)npc.position.Y, 1); + } + if (Main.rand.Next(1000) == 0) + { + Main.PlaySound(62, (int)npc.position.X, (int)npc.position.Y, 1); + } + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(6) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 116, Main.rand.Next(1,6)); - } - if(Main.rand.Next(6) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 117, Main.rand.Next(1,3)); - } - if(Main.rand.Next(46) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 127, Main.rand.Next(1)); - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(6) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 116, Main.rand.Next(1, 6)); + } + if (Main.rand.Next(6) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 117, Main.rand.Next(1, 3)); + } + if (Main.rand.Next(46) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 127, Main.rand.Next(1)); + } - } - } + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SpaceManGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SpaceManGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SpaceManGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SpaceManGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SpaceManGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SpaceManGore4"), 1f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SpaceManGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SpaceManGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SpaceManGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SpaceManGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SpaceManGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SpaceManGore4"), 1f); + } + } public override float SpawnChance(NPCSpawnInfo spawnInfo) { diff --git a/NPCs/SpiderMan.cs b/NPCs/SpiderMan.cs index cac8cabc..f10e3ce5 100644 --- a/NPCs/SpiderMan.cs +++ b/NPCs/SpiderMan.cs @@ -6,74 +6,76 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class SpiderMan : ModNPC +namespace Tremor.NPCs { + + public class SpiderMan : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Spider Man"); Main.npcFrameCount[npc.type] = 15; } - - public override void SetDefaults() - { - npc.lifeMax = 400; - npc.damage = 80; - npc.defense = 25; - npc.knockBackResist = 1f; - npc.width = 46; - npc.height = 50; - animationType = 21; - npc.aiStyle = 26; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit47; - npc.DeathSound = SoundID.NPCDeath23; - npc.value = Item.buyPrice(0, 0, 25, 0); - banner = npc.type; - bannerItem = mod.ItemType("SpiderManBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 400; + npc.damage = 80; + npc.defense = 25; + npc.knockBackResist = 1f; + npc.width = 46; + npc.height = 50; + animationType = 21; + npc.aiStyle = 26; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit47; + npc.DeathSound = SoundID.NPCDeath23; + npc.value = Item.buyPrice(0, 0, 25, 0); + banner = npc.type; + bannerItem = mod.ItemType("SpiderManBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SpiderManGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SpiderManGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SpiderManGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SpiderManGore2"), 1f); - } - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SpiderManGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SpiderManGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SpiderManGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SpiderManGore2"), 1f); + } + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 2607 ,Main.rand.Next(60,150)); - }; - } - } - //public override float SpawnChance(NPCSpawnInfo spawnInfo) - //{ - //int x = spawnInfo.spawnTileX; - //int y = spawnInfo.spawnTileY; - //int tile = (int)Main.tile[x, y].type; - //return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.spiderCave ? 0.08f : 0f; - //} -}} \ No newline at end of file + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 2607, Main.rand.Next(60, 150)); + }; + } + } + //public override float SpawnChance(NPCSpawnInfo spawnInfo) + //{ + //int x = spawnInfo.spawnTileX; + //int y = spawnInfo.spawnTileY; + //int tile = (int)Main.tile[x, y].type; + //return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.spiderCave ? 0.08f : 0f; + //} + } +} \ No newline at end of file diff --git a/NPCs/SquidZombie.cs b/NPCs/SquidZombie.cs index 584ef9bc..32cd41b6 100644 --- a/NPCs/SquidZombie.cs +++ b/NPCs/SquidZombie.cs @@ -5,79 +5,81 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class SquidZombie : ModNPC +namespace Tremor.NPCs { + + public class SquidZombie : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Squid Zombie"); Main.npcFrameCount[npc.type] = 3; } - - public override void SetDefaults() - { - npc.lifeMax = 125; - npc.damage = 25; - npc.defense = 6; - npc.knockBackResist = 0.6f; - npc.width = 34; - npc.height = 60; - animationType = 3; - npc.aiStyle = 3; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 4, 0); - banner = npc.type; - bannerItem = mod.ItemType("SquidZombieBanner"); - } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SquidGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore2"), 1f); - } - } + public override void SetDefaults() + { + npc.lifeMax = 125; + npc.damage = 25; + npc.defense = 6; + npc.knockBackResist = 0.6f; + npc.width = 34; + npc.height = 60; + animationType = 3; + npc.aiStyle = 3; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 0, 4, 0); + banner = npc.type; + bannerItem = mod.ItemType("SquidZombieBanner"); + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SquidGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore2"), 1f); + } + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(24) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SquidHat"), Main.rand.Next(1)); - }; - if(Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("UntreatedFlesh")); - }; - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(24) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SquidHat"), Main.rand.Next(1)); + }; + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("UntreatedFlesh")); + }; + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && (tile == 53 || tile == 112 || tile == 116 || tile == 234) && Tremor.NoZoneAllowWater(spawnInfo) && spawnInfo.water) && y < Main.rockLayer && (x < 250 || x > Main.maxTilesX - 250) && !spawnInfo.playerSafe ? 0.01f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && (tile == 53 || tile == 112 || tile == 116 || tile == 234) && Tremor.NoZoneAllowWater(spawnInfo) && spawnInfo.water) && y < Main.rockLayer && (x < 250 || x > Main.maxTilesX - 250) && !spawnInfo.playerSafe ? 0.01f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/Squoma.cs b/NPCs/Squoma.cs index f4a76f77..24c74c12 100644 --- a/NPCs/Squoma.cs +++ b/NPCs/Squoma.cs @@ -7,83 +7,85 @@ using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Squoma : ModNPC +namespace Tremor.NPCs { + + public class Squoma : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Squoma"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 8200; - npc.damage = 122; - npc.defense = 128; - npc.knockBackResist = 0.2f; - npc.width = 34; - npc.height = 48; - animationType = 48; - npc.aiStyle = 14; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit53; - npc.noGravity = true; - npc.DeathSound = SoundID.NPCDeath45; - banner = npc.type; - bannerItem = mod.ItemType("SquomaBanner"); - } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SquomaGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SquomaGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SquomaGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SquomaGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SquomaGore2"), 1f); - } - else - { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 59, (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } - } + public override void SetDefaults() + { + npc.lifeMax = 8200; + npc.damage = 122; + npc.defense = 128; + npc.knockBackResist = 0.2f; + npc.width = 34; + npc.height = 48; + animationType = 48; + npc.aiStyle = 14; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit53; + npc.noGravity = true; + npc.DeathSound = SoundID.NPCDeath45; + banner = npc.type; + bannerItem = mod.ItemType("SquomaBanner"); + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 59, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SquomaGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SquomaGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SquomaGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SquomaGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SquomaGore2"), 1f); + } + else + { + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 59, (float)hitDirection, -1f, 0, default(Color), 0.7f); + } + } + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Squorb"), Main.rand.Next(1,3)); - } - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Squorb"), Main.rand.Next(1, 3)); + } + } + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && spawnInfo.player.ZoneSnow && y < Main.worldSurface ? 0.08f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && spawnInfo.player.ZoneSnow && y < Main.worldSurface ? 0.08f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/Startrooper.cs b/NPCs/Startrooper.cs index cfc13950..ba38d0ac 100644 --- a/NPCs/Startrooper.cs +++ b/NPCs/Startrooper.cs @@ -6,10 +6,11 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { -[AutoloadHead] -public class Startrooper : ModNPC +namespace Tremor.NPCs { + [AutoloadHead] + public class Startrooper : ModNPC + { public override string Texture { get @@ -17,14 +18,14 @@ public override string Texture return "Tremor/NPCs/Startrooper"; } } - + public override string[] AltTextures { get { - return new string[] { "Tremor/NPCs/Startrooper"}; + return new string[] { "Tremor/NPCs/Startrooper" }; } - } + } public override bool Autoload(ref string name) { @@ -44,169 +45,170 @@ public override void SetStaticDefaults() NPCID.Sets.AttackAverageChance[npc.type] = 30; } - public override void SetDefaults() - { - npc.townNPC = true; - npc.friendly = true; - npc.width = 30; - npc.height = 44; - npc.aiStyle = 7; - npc.damage = 10; - npc.defense = 15; - npc.lifeMax = 250; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.knockBackResist = 0.5f; - animationType = NPCID.GoblinTinkerer; - } - - - public override bool CanTownNPCSpawn(int numTownNPCs, int money) - { - if(TremorWorld.downedSpaceWhale) - { - return true; - } + public override void SetDefaults() + { + npc.townNPC = true; + npc.friendly = true; + npc.width = 30; + npc.height = 44; + npc.aiStyle = 7; + npc.damage = 10; + npc.defense = 15; + npc.lifeMax = 250; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.knockBackResist = 0.5f; + animationType = NPCID.GoblinTinkerer; + } + + + public override bool CanTownNPCSpawn(int numTownNPCs, int money) + { + if (TremorWorld.downedSpaceWhale) + { + return true; + } return false; - } - - - public override string TownNPCName() - { - switch(WorldGen.genRand.Next(5)) - { - case 0: - return "Ripley"; - case 1: - return "Dallas"; - case 2: - return "Brett"; - case 3: - return "Kane"; - case 4: - return "Ash"; - case 5: - return "Parker"; - default: - return "Lambert"; - } - } - - public override string GetChat() - { - switch(Main.rand.Next(6)) - { - case 0: - return "There is an explanation for anything, you know."; - case 1: - return "If you get into a trouble remember that somebody will surely save your skin."; - case 2: - return "My friend always liked to tell me the odds but now he is dead. You should know: Never tell me the odds."; - case 3: - return "That giant flying fish that you've defeated was making plans to destroy my home-planet. Glad you've killed him."; - case 4: - return "I suggest you carrying at least small blaster - nobody knows what's on mind of this creatures in this world."; - case 5: - return "Have you ever heard a tale of a giant three eyed creature with eyes in it hands and tentacles on head? I'm very glad that it is just a stupid story."; - default: - return "There were some cult of men calling themselve knights and fighting with some kind of light swords on a planet I was travelling once to. As for me, a gun is better than a useless sword."; - } - } - - public override void SetChatButtons(ref string button, ref string button2) - { - button = Lang.inter[28].Value; - } - - public override void OnChatButtonClicked(bool firstButton, ref bool shop) - { - if(firstButton) - { - shop = true; - } - } - - public override void SetupShop(Chest shop, ref int nextSlot) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("Starmine")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("ChainBow")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("EnforcerShield")); - nextSlot++; - if(!Main.dayTime) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("SniperHelmet")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("SniperBreastplate")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("SniperBoots")); - nextSlot++; - } - if(Main.dayTime) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("ParatrooperLens")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("StartrooperFlameburstPistol")); - nextSlot++; - } - if(TremorWorld.downedTrinity) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("WartimeRocketLauncher")); - nextSlot++; - } - if(TremorWorld.downedTrinity && !Main.dayTime) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("CosmicAssaultRifle")); - nextSlot++; - } - if(Main.bloodMoon) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("ParatrooperShotgun")); - nextSlot++; - } - if (Main.player[Main.myPlayer].HasItem(mod.ItemType("SuperBigCannon"))) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("SBCCannonballAmmo"), false); + } + + + public override string TownNPCName() + { + switch (WorldGen.genRand.Next(5)) + { + case 0: + return "Ripley"; + case 1: + return "Dallas"; + case 2: + return "Brett"; + case 3: + return "Kane"; + case 4: + return "Ash"; + case 5: + return "Parker"; + default: + return "Lambert"; + } + } + + public override string GetChat() + { + switch (Main.rand.Next(6)) + { + case 0: + return "There is an explanation for anything, you know."; + case 1: + return "If you get into a trouble remember that somebody will surely save your skin."; + case 2: + return "My friend always liked to tell me the odds but now he is dead. You should know: Never tell me the odds."; + case 3: + return "That giant flying fish that you've defeated was making plans to destroy my home-planet. Glad you've killed him."; + case 4: + return "I suggest you carrying at least small blaster - nobody knows what's on mind of this creatures in this world."; + case 5: + return "Have you ever heard a tale of a giant three eyed creature with eyes in it hands and tentacles on head? I'm very glad that it is just a stupid story."; + default: + return "There were some cult of men calling themselve knights and fighting with some kind of light swords on a planet I was travelling once to. As for me, a gun is better than a useless sword."; + } + } + + public override void SetChatButtons(ref string button, ref string button2) + { + button = Lang.inter[28].Value; + } + + public override void OnChatButtonClicked(bool firstButton, ref bool shop) + { + if (firstButton) + { + shop = true; + } + } + + public override void SetupShop(Chest shop, ref int nextSlot) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("Starmine")); nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("ChainBow")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("EnforcerShield")); + nextSlot++; + if (!Main.dayTime) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("SniperHelmet")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("SniperBreastplate")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("SniperBoots")); + nextSlot++; + } + if (Main.dayTime) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("ParatrooperLens")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("StartrooperFlameburstPistol")); + nextSlot++; + } + if (TremorWorld.downedTrinity) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("WartimeRocketLauncher")); + nextSlot++; + } + if (TremorWorld.downedTrinity && !Main.dayTime) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("CosmicAssaultRifle")); + nextSlot++; + } + if (Main.bloodMoon) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("ParatrooperShotgun")); + nextSlot++; + } + if (Main.player[Main.myPlayer].HasItem(mod.ItemType("SuperBigCannon"))) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("SBCCannonballAmmo"), false); + nextSlot++; + } + } + + public override void TownNPCAttackStrength(ref int damage, ref float knockback) + { + damage = 310; + knockback = 4f; + } + + public override void TownNPCAttackCooldown(ref int cooldown, ref int randExtraCooldown) + { + cooldown = 15; + randExtraCooldown = 15; + } + + public override void TownNPCAttackProj(ref int projType, ref int attackDelay) + { + projType = mod.ProjectileType("StarminePro"); + attackDelay = 4; + } + + public override void TownNPCAttackProjSpeed(ref float multiplier, ref float gravityCorrection, ref float randomOffset) + { + multiplier = 12f; + randomOffset = 2f; + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/StartrooperNGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/StartrooperNGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/StartrooperNGore3"), 1f); + } + } } - } - - public override void TownNPCAttackStrength(ref int damage, ref float knockback) - { - damage = 310; - knockback = 4f; - } - - public override void TownNPCAttackCooldown(ref int cooldown, ref int randExtraCooldown) - { - cooldown = 15; - randExtraCooldown = 15; - } - - public override void TownNPCAttackProj(ref int projType, ref int attackDelay) - { - projType = mod.ProjectileType("StarminePro"); - attackDelay = 4; - } - - public override void TownNPCAttackProjSpeed(ref float multiplier, ref float gravityCorrection, ref float randomOffset) - { - multiplier = 12f; - randomOffset = 2f; - } - - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/StartrooperNGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/StartrooperNGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/StartrooperNGore3"), 1f); - } -} -}} \ No newline at end of file +} \ No newline at end of file diff --git a/NPCs/StormJellyfish.cs b/NPCs/StormJellyfish.cs index a86d1d22..8f035579 100644 --- a/NPCs/StormJellyfish.cs +++ b/NPCs/StormJellyfish.cs @@ -6,38 +6,39 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { -[AutoloadBossHead] -public class StormJellyfish : ModNPC +namespace Tremor.NPCs { + [AutoloadBossHead] + public class StormJellyfish : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Storm Jellyfish"); Main.npcFrameCount[npc.type] = 6; } - - const int ShootRate = 100; // ×àñòîòà âûñòðåëà - const int ShootDamage = 18; // Óðîí îò ëàçåðà. - const float ShootKN = 1.0f; // Îòáðàñûâàíèå - const int ShootType = 435; // Òèï ïðîäæåêòàéëà êîòîðûì áóäåò ïðîèçâåä¸í âûñòðåë. - const float ShootSpeed = 8; // Ýòî, ÿ òàê ïîíèìàþ, âëèÿåò íà äàëüíîñòü âûñòðåëà - const int ProjID = 437; - const int UpSpeed = 6; - - const int ShootRate2 = 660; // ×àñòîòà âûñòðåëà - const int ShootDamage2 = 15; // Óðîí îò ëàçåðà. - const float ShootKN2 = 1.0f; // Îòáðàñûâàíèå - const int ShootType2 = 465; // Òèï ïðîäæåêòàéëà êîòîðûì áóäåò ïðîèçâåä¸í âûñòðåë. - const float ShootSpeed2 = 5; // Ýòî, ÿ òàê ïîíèìàþ, âëèÿåò íà äàëüíîñòü âûñòðåëà - const int ProjID2 = 437; - const int UpSpeed2 = 6; - - int TimeToShoot = ShootRate; // Âðåìÿ äî âûñòðåëà. - - int TimeToShoot2 = ShootRate2; // Âðåìÿ äî âûñòðåëà. - - public override void SetDefaults() - { + + const int ShootRate = 100; // ×àñòîòà âûñòðåëà + const int ShootDamage = 18; // Óðîí îò ëàçåðà. + const float ShootKN = 1.0f; // Îòáðàñûâàíèå + const int ShootType = 435; // Òèï ïðîäæåêòàéëà êîòîðûì áóäåò ïðîèçâåä¸í âûñòðåë. + const float ShootSpeed = 8; // Ýòî, ÿ òàê ïîíèìàþ, âëèÿåò íà äàëüíîñòü âûñòðåëà + const int ProjID = 437; + const int UpSpeed = 6; + + const int ShootRate2 = 660; // ×àñòîòà âûñòðåëà + const int ShootDamage2 = 15; // Óðîí îò ëàçåðà. + const float ShootKN2 = 1.0f; // Îòáðàñûâàíèå + const int ShootType2 = 465; // Òèï ïðîäæåêòàéëà êîòîðûì áóäåò ïðîèçâåä¸í âûñòðåë. + const float ShootSpeed2 = 5; // Ýòî, ÿ òàê ïîíèìàþ, âëèÿåò íà äàëüíîñòü âûñòðåëà + const int ProjID2 = 437; + const int UpSpeed2 = 6; + + int TimeToShoot = ShootRate; // Âðåìÿ äî âûñòðåëà. + + int TimeToShoot2 = ShootRate2; // Âðåìÿ äî âûñòðåëà. + + public override void SetDefaults() + { npc.width = 140; npc.height = 140; npc.damage = 18; @@ -45,129 +46,130 @@ public override void SetDefaults() npc.lifeMax = 2800; npc.HitSound = SoundID.NPCHit25; npc.DeathSound = SoundID.NPCDeath28; - npc.boss = true; + npc.boss = true; npc.knockBackResist = 0.1f; aiType = 472; - npc.noGravity = true; - npc.noGravity = true; - music = 39; - npc.aiStyle = 86; + npc.noGravity = true; + npc.noGravity = true; + music = 39; + npc.aiStyle = 86; animationType = 472; - bossBag = mod.ItemType("StormJellyfishBag"); - } - - public override void AI() - { - npc.position += npc.velocity * 0.5f; - - if (--TimeToShoot <= 0 && npc.target != -1) Shoot(); //  ýòîé ñòðîêå èç ïåðåìåííîé TimeToShot îòíèìàåòñÿ 1, è åñëè TimeToShot < èëè = 0, òî âûçûâàåòñÿ ìåòîä Shoot() - if (--TimeToShoot2 <= 0 && npc.target != -1) Shoot2(); //  ýòîé ñòðîêå èç ïåðåìåííîé TimeToShot îòíèìàåòñÿ 1, è åñëè TimeToShot < èëè = 0, òî âûçûâàåòñÿ ìåòîä Shoot() - - if(Main.rand.Next(400) == 0) - { - NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("FlyingJelly")); - } - } - - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 60; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/StormGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/StormGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/StormGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/StormGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/StormGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/StormGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/StormGore4"), 1f); - } - else - { - - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 226, (float)hitDirection, -2f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } - } - - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } - - void Shoot() - { - TimeToShoot = ShootRate; - Vector2 velocity = VelocityFPTP(npc.Center, Main.player[npc.target].Center, ShootSpeed); - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, velocity.X, velocity.Y, ShootType, ShootDamage, ShootKN); - } - - void Shoot2() - { - TimeToShoot2 = ShootRate2; - Vector2 velocity = VelocityFPTP(npc.Center, Main.player[npc.target].Center, ShootSpeed2); - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, velocity.X, velocity.Y, ShootType2, ShootDamage2, ShootKN2); - } - - Vector2 VelocityFPTP(Vector2 pos1, Vector2 pos2, float speed) - { - Vector2 move = pos2 - pos1; - return move * (speed / (float)System.Math.Sqrt(move.X * move.X + move.Y * move.Y)); - } - - - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - - if(Main.expertMode) - { - npc.DropBossBags(); - } - - if(!Main.expertMode && Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StormJellyfishMask")); - } - if(!Main.expertMode && Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StormBlade")); - } - if(!Main.expertMode && Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Poseidon")); - } - if(!Main.expertMode && Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("JellyfishStaff")); - } - if(!Main.expertMode && Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BoltTome")); - } - if(!Main.expertMode && Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StickyFlail")); - } - if(Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StormJellyfishTrophy")); - } - TremorWorld.downedStormJellyfish = true; - } - } - -}} \ No newline at end of file + bossBag = mod.ItemType("StormJellyfishBag"); + } + + public override void AI() + { + npc.position += npc.velocity * 0.5f; + + if (--TimeToShoot <= 0 && npc.target != -1) Shoot(); //  ýòîé ñòðîêå èç ïåðåìåííîé TimeToShot îòíèìàåòñÿ 1, è åñëè TimeToShot < èëè = 0, òî âûçûâàåòñÿ ìåòîä Shoot() + if (--TimeToShoot2 <= 0 && npc.target != -1) Shoot2(); //  ýòîé ñòðîêå èç ïåðåìåííîé TimeToShot îòíèìàåòñÿ 1, è åñëè TimeToShot < èëè = 0, òî âûçûâàåòñÿ ìåòîä Shoot() + + if (Main.rand.Next(400) == 0) + { + NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("FlyingJelly")); + } + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 60; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 226, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/StormGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/StormGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/StormGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/StormGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/StormGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/StormGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/StormGore4"), 1f); + } + else + { + + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 226, (float)hitDirection, -2f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, (float)hitDirection, -1f, 0, default(Color), 0.7f); + } + } + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } + + void Shoot() + { + TimeToShoot = ShootRate; + Vector2 velocity = VelocityFPTP(npc.Center, Main.player[npc.target].Center, ShootSpeed); + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, velocity.X, velocity.Y, ShootType, ShootDamage, ShootKN); + } + + void Shoot2() + { + TimeToShoot2 = ShootRate2; + Vector2 velocity = VelocityFPTP(npc.Center, Main.player[npc.target].Center, ShootSpeed2); + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, velocity.X, velocity.Y, ShootType2, ShootDamage2, ShootKN2); + } + + Vector2 VelocityFPTP(Vector2 pos1, Vector2 pos2, float speed) + { + Vector2 move = pos2 - pos1; + return move * (speed / (float)System.Math.Sqrt(move.X * move.X + move.Y * move.Y)); + } + + + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + + if (Main.expertMode) + { + npc.DropBossBags(); + } + + if (!Main.expertMode && Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StormJellyfishMask")); + } + if (!Main.expertMode && Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StormBlade")); + } + if (!Main.expertMode && Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Poseidon")); + } + if (!Main.expertMode && Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("JellyfishStaff")); + } + if (!Main.expertMode && Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BoltTome")); + } + if (!Main.expertMode && Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StickyFlail")); + } + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("StormJellyfishTrophy")); + } + TremorWorld.downedStormJellyfish = true; + } + } + + } +} \ No newline at end of file diff --git a/NPCs/SupremePossessedArmor.cs b/NPCs/SupremePossessedArmor.cs index de55700e..3b850fc2 100644 --- a/NPCs/SupremePossessedArmor.cs +++ b/NPCs/SupremePossessedArmor.cs @@ -6,77 +6,79 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class SupremePossessedArmor : ModNPC +namespace Tremor.NPCs { + + public class SupremePossessedArmor : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Supreme Possessed Armor"); Main.npcFrameCount[npc.type] = 20; } - - public override void SetDefaults() - { - npc.lifeMax = 1250; - npc.damage = 125; - npc.defense = 28; - npc.knockBackResist = 0.3f; - npc.width = 36; - npc.height = 44; - animationType = 482; - npc.aiStyle = 3; - aiType = 77; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit4; - npc.DeathSound = SoundID.NPCDeath6; - npc.value = Item.buyPrice(0, 0, 40, 7); - banner = npc.type; - bannerItem = mod.ItemType("SupremePossessedArmorBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 1250; + npc.damage = 125; + npc.defense = 28; + npc.knockBackResist = 0.3f; + npc.width = 36; + npc.height = 44; + animationType = 482; + npc.aiStyle = 3; + aiType = 77; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit4; + npc.DeathSound = SoundID.NPCDeath6; + npc.value = Item.buyPrice(0, 0, 40, 7); + banner = npc.type; + bannerItem = mod.ItemType("SupremePossessedArmorBanner"); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(30) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ShadowCutter")); - }; - } - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PossessedGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PossessedGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PossessedGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PossessedGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PossessedGore3"), 1f); - } -} + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(30) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ShadowCutter")); + }; + } + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PossessedGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PossessedGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PossessedGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PossessedGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/PossessedGore3"), 1f); + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMechBossAny && !Main.dayTime && y < Main.worldSurface ? 0.1f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMechBossAny && !Main.dayTime && y < Main.worldSurface ? 0.1f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/TempleSlime.cs b/NPCs/TempleSlime.cs index dcb1e2b7..fd96877b 100644 --- a/NPCs/TempleSlime.cs +++ b/NPCs/TempleSlime.cs @@ -7,75 +7,77 @@ using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class TempleSlime : ModNPC +namespace Tremor.NPCs { + + public class TempleSlime : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Temple Slime"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 2000; - npc.damage = 125; - npc.defense = 32; - npc.knockBackResist = 0.3f; - npc.width = 70; - npc.height = 46; - animationType = 244; - npc.aiStyle = 41; - aiType = 138; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath23; - npc.value = Item.buyPrice(0, 0, 12, 15); - } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Brown, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Brown, 0.7f); - } - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Brown, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Brown, 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Brown, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Brown, 1.7f); - } -} + public override void SetDefaults() + { + npc.lifeMax = 2000; + npc.damage = 125; + npc.defense = 32; + npc.knockBackResist = 0.3f; + npc.width = 70; + npc.height = 46; + animationType = 244; + npc.aiStyle = 41; + aiType = 138; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath23; + npc.value = Item.buyPrice(0, 0, 12, 15); + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Brown, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Brown, 0.7f); + } + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Brown, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Brown, 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Brown, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Brown, 1.7f); + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return Main.hardMode && (tile == 226) && NPC.downedMoonlord && y > Main.rockLayer ? 0.005f : 0f; - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return Main.hardMode && (tile == 226) && NPC.downedMoonlord && y > Main.rockLayer ? 0.005f : 0f; + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 1293); - }; - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 1293); + }; + } + } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/TheAxeman.cs b/NPCs/TheAxeman.cs index e20cf266..c02b6099 100644 --- a/NPCs/TheAxeman.cs +++ b/NPCs/TheAxeman.cs @@ -6,76 +6,78 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class TheAxeman : ModNPC +namespace Tremor.NPCs { + + public class TheAxeman : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("The Axeman"); Main.npcFrameCount[npc.type] = 16; } - - public override void SetDefaults() - { - npc.lifeMax = 4000; - npc.damage = 155; - npc.defense = 88; - npc.knockBackResist = 0.3f; - npc.width = 34; - npc.height = 54; - animationType = 460; - npc.aiStyle = 3; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit1; - aiType = 604; - npc.DeathSound = SoundID.NPCDeath52; - npc.value = Item.buyPrice(0, 3, 1, 0); - banner = npc.type; - bannerItem = mod.ItemType("TheAxemanBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 4000; + npc.damage = 155; + npc.defense = 88; + npc.knockBackResist = 0.3f; + npc.width = 34; + npc.height = 54; + animationType = 460; + npc.aiStyle = 3; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit1; + aiType = 604; + npc.DeathSound = SoundID.NPCDeath52; + npc.value = Item.buyPrice(0, 3, 1, 0); + banner = npc.type; + bannerItem = mod.ItemType("TheAxemanBanner"); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TheAxemanGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TheAxemanGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TheAxemanGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TheAxemanGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TheAxemanGore3"), 1f); - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - } - } -} + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrokenHeroArmorplate")); - } - } - } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && (tile == 53 || tile == 112 || tile == 116 || tile == 234) && spawnInfo.water) && y < Main.rockLayer && (x < 250 || x > Main.maxTilesX - 250) && !spawnInfo.playerSafe && NPC.downedMoonlord && Main.eclipse ? 0.01f : 0f; - } -}} \ No newline at end of file + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TheAxemanGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TheAxemanGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TheAxemanGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TheAxemanGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TheAxemanGore3"), 1f); + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + } + } + } + + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrokenHeroArmorplate")); + } + } + } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && (tile == 53 || tile == 112 || tile == 116 || tile == 234) && spawnInfo.water) && y < Main.rockLayer && (x < 250 || x > Main.maxTilesX - 250) && !spawnInfo.playerSafe && NPC.downedMoonlord && Main.eclipse ? 0.01f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/TheDarkEmperor.cs b/NPCs/TheDarkEmperor.cs index 1439adb0..42aab818 100644 --- a/NPCs/TheDarkEmperor.cs +++ b/NPCs/TheDarkEmperor.cs @@ -6,21 +6,22 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { +namespace Tremor.NPCs +{ [AutoloadBossHead] -public class TheDarkEmperor: ModNPC -{ + public class TheDarkEmperor : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("The Dark Emperor"); Main.npcFrameCount[npc.type] = 14; } - - public override void SetDefaults() - { + + public override void SetDefaults() + { npc.width = 126; npc.height = 106; npc.damage = 200; @@ -30,72 +31,73 @@ public override void SetDefaults() npc.DeathSound = SoundID.NPCDeath1; npc.value = 80000f; npc.knockBackResist = 0.0f; - music = 17; - npc.aiStyle = 87; - aiType = 475; + music = 17; + npc.aiStyle = 87; + aiType = 475; animationType = 473; npc.npcSlots = 10f; npc.buffImmune[20] = true; npc.buffImmune[24] = true; npc.buffImmune[39] = true; - } + } - public override void AI() - { - if(Main.rand.Next(500) == 0) - { - NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("DarkServant")); - } - if(Main.rand.Next(150) == 0) - { - NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("DarkSlime")); - } + public override void AI() + { + if (Main.rand.Next(500) == 0) + { + NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("DarkServant")); + } + if (Main.rand.Next(150) == 0) + { + NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("DarkSlime")); + } - } + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 60; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Main.PlaySound(15, 0); - NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("TheDarkEmperorTwo")); - NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("DarkServant")); - NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("DarkServant")); - NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("DarkServant")); - NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("DarkServant")); - NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("DarkServant")); - Gore.NewGore(npc.position, npc.velocity, 99, 3f); - Gore.NewGore(npc.position, npc.velocity, 99, 2f); - Gore.NewGore(npc.position, npc.velocity, 99, 3f); - Gore.NewGore(npc.position, npc.velocity, 99, 2f); - Gore.NewGore(npc.position, npc.velocity, 99, 1f); - Gore.NewGore(npc.position, npc.velocity, 99, 2f); - Gore.NewGore(npc.position, npc.velocity, 99, 4f); - Gore.NewGore(npc.position, npc.velocity, 99, 2f); - Gore.NewGore(npc.position, npc.velocity, 99, 1f); - Gore.NewGore(npc.position, npc.velocity, 99, 2f); - } - else - { + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 60; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 191, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Main.PlaySound(15, 0); + NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("TheDarkEmperorTwo")); + NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("DarkServant")); + NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("DarkServant")); + NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("DarkServant")); + NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("DarkServant")); + NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("DarkServant")); + Gore.NewGore(npc.position, npc.velocity, 99, 3f); + Gore.NewGore(npc.position, npc.velocity, 99, 2f); + Gore.NewGore(npc.position, npc.velocity, 99, 3f); + Gore.NewGore(npc.position, npc.velocity, 99, 2f); + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + Gore.NewGore(npc.position, npc.velocity, 99, 2f); + Gore.NewGore(npc.position, npc.velocity, 99, 4f); + Gore.NewGore(npc.position, npc.velocity, 99, 2f); + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + Gore.NewGore(npc.position, npc.velocity, 99, 2f); + } + else + { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 191, (float)hitDirection, -2f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 191, (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } - } + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 191, (float)hitDirection, -2f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 191, (float)hitDirection, -1f, 0, default(Color), 0.7f); + } + } + } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/TheDarkEmperorTwo.cs b/NPCs/TheDarkEmperorTwo.cs index af83c97b..91d71765 100644 --- a/NPCs/TheDarkEmperorTwo.cs +++ b/NPCs/TheDarkEmperorTwo.cs @@ -10,429 +10,429 @@ namespace Tremor.NPCs { [AutoloadBossHead] - public class TheDarkEmperorTwo : ModNPC - { + public class TheDarkEmperorTwo : ModNPC + { + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DEGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DETGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DETGore2"), 1f); + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DEGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DETGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DETGore2"), 1f); - } - } - public override void SetStaticDefaults() { DisplayName.SetDefault("The Dark Emperor"); Main.npcFrameCount[npc.type] = 6; } - - public override void SetDefaults() - { - npc.aiStyle = -1; - npc.lifeMax = 95000; - npc.damage = 180; - npc.defense = 220; - animationType = 345; - npc.knockBackResist = 0f; - npc.width = 130; - npc.height = 140; - npc.value = Item.buyPrice(0, 20, 0, 0); - npc.boss = true; - npc.lavaImmune = true; - npc.noGravity = true; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath10; - music = 17; - bossBag = mod.ItemType("DarkEmperorBag"); + + public override void SetDefaults() + { + npc.aiStyle = -1; + npc.lifeMax = 95000; + npc.damage = 180; + npc.defense = 220; + animationType = 345; + npc.knockBackResist = 0f; + npc.width = 130; + npc.height = 140; + npc.value = Item.buyPrice(0, 20, 0, 0); + npc.boss = true; + npc.lavaImmune = true; + npc.noGravity = true; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath10; + music = 17; + bossBag = mod.ItemType("DarkEmperorBag"); npc.buffImmune[20] = true; npc.buffImmune[24] = true; npc.buffImmune[39] = true; npc.npcSlots = 10f; - } + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 0.625f * bossLifeScale); - npc.damage = (int)(npc.damage * 0.6f); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 0.625f * bossLifeScale); + npc.damage = (int)(npc.damage * 0.6f); + } - public override void AI() - { + public override void AI() + { -Lighting.AddLight(npc.position, 1f, 0.3f, 0.3f); + Lighting.AddLight(npc.position, 1f, 0.3f, 0.3f); -bool allDead = false; -for(int i = 0; i < Main.player.Length; i++) -{ - if(Main.player[i].dead) allDead = true; -} + bool allDead = false; + for (int i = 0; i < Main.player.Length; i++) + { + if (Main.player[i].dead) allDead = true; + } - if (allDead) - { - if (npc.velocity.X > 0f) - { - npc.velocity.X = npc.velocity.X + 0.75f; - } - else - { - npc.velocity.X = npc.velocity.X - 0.75f; - } - npc.velocity.Y = npc.velocity.Y - 0.1f; - npc.rotation = npc.velocity.X * 0.05f; - } - else if (npc.ai[0] == 0f) - { - if (npc.ai[2] == 0f) - { - npc.TargetClosest(true); - if (npc.Center.X < Main.player[npc.target].Center.X) - { - npc.ai[2] = 1f; - } - else - { - npc.ai[2] = -1f; - } - } - npc.TargetClosest(true); - int num1319 = 800; - float num1320 = Math.Abs(npc.Center.X - Main.player[npc.target].Center.X); - if (npc.Center.X < Main.player[npc.target].Center.X && npc.ai[2] < 0f && num1320 > (float)num1319) - { - npc.ai[2] = 0f; - } - if (npc.Center.X > Main.player[npc.target].Center.X && npc.ai[2] > 0f && num1320 > (float)num1319) - { - npc.ai[2] = 0f; - } - float num1321 = 0.45f; - float num1322 = 7f; - if ((double)npc.life < (double)npc.lifeMax * 0.75) - { - num1321 = 0.55f; - num1322 = 8f; - } - if ((double)npc.life < (double)npc.lifeMax * 0.5) - { - num1321 = 0.7f; - num1322 = 10f; - } - if ((double)npc.life < (double)npc.lifeMax * 0.25) - { - num1321 = 0.8f; - num1322 = 11f; - } - npc.velocity.X = npc.velocity.X + npc.ai[2] * num1321; - if (npc.velocity.X > num1322) - { - npc.velocity.X = num1322; - } - if (npc.velocity.X < -num1322) - { - npc.velocity.X = -num1322; - } - float num1323 = Main.player[npc.target].position.Y - (npc.position.Y + (float)npc.height); - if (num1323 < 150f) - { - npc.velocity.Y = npc.velocity.Y - 0.2f; - } - if (num1323 > 200f) - { - npc.velocity.Y = npc.velocity.Y + 0.2f; - } - if (npc.velocity.Y > 8f) - { - npc.velocity.Y = 8f; - } - if (npc.velocity.Y < -8f) - { - npc.velocity.Y = -8f; - } - npc.rotation = npc.velocity.X * 0.05f; - if ((num1320 < 500f || npc.ai[3] < 0f) && npc.position.Y < Main.player[npc.target].position.Y) - { - npc.ai[3] += 1f; - int num1324 = 13; - if ((double)npc.life < (double)npc.lifeMax * 0.75) - { - num1324 = 12; - } - if ((double)npc.life < (double)npc.lifeMax * 0.5) - { - num1324 = 11; - } - if ((double)npc.life < (double)npc.lifeMax * 0.25) - { - num1324 = 10; - } - num1324++; - if (npc.ai[3] > (float)num1324) - { - npc.ai[3] = (float)(-(float)num1324); - } - if (npc.ai[3] == 0f && Main.netMode != 1) - { - Vector2 vector159 = new Vector2(npc.Center.X, npc.Center.Y); - vector159.X += npc.velocity.X * 7f; - float num1325 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector159.X; - float num1326 = Main.player[npc.target].Center.Y - vector159.Y; - float num1327 = (float)Math.Sqrt((double)(num1325 * num1325 + num1326 * num1326)); - float num1328 = 6f; - if ((double)npc.life < (double)npc.lifeMax * 0.75) - { - num1328 = 7f; - } - if ((double)npc.life < (double)npc.lifeMax * 0.5) - { - num1328 = 8f; - } - if ((double)npc.life < (double)npc.lifeMax * 0.25) - { - num1328 = 9f; - } - num1327 = num1328 / num1327; - num1325 *= num1327; - num1326 *= num1327; - Projectile.NewProjectile(vector159.X, vector159.Y, num1325, num1326, mod.ProjectileType("FallingDarkServant"), 54, 0f, Main.myPlayer, 0f, 0f); - } - } - else if (npc.ai[3] < 0f) - { - npc.ai[3] += 1f; - } - if (Main.netMode != 1) - { - npc.ai[1] += (float)Main.rand.Next(1, 4); - if (npc.ai[1] > 800f && num1320 < 600f) - { - npc.ai[0] = -1f; - } - } - } - else if (npc.ai[0] == 1f) - { - npc.TargetClosest(true); - float num1329 = 0.15f; - float num1330 = 7f; - if ((double)npc.life < (double)npc.lifeMax * 0.75) - { - num1329 = 0.17f; - num1330 = 8f; - } - if ((double)npc.life < (double)npc.lifeMax * 0.5) - { - num1329 = 0.2f; - num1330 = 9f; - } - if ((double)npc.life < (double)npc.lifeMax * 0.25) - { - num1329 = 0.25f; - num1330 = 10f; - } - num1329 -= 0.05f; - num1330 -= 1f; - if (npc.Center.X < Main.player[npc.target].Center.X) - { - npc.velocity.X = npc.velocity.X + num1329; - if (npc.velocity.X < 0f) - { - npc.velocity.X = npc.velocity.X * 0.98f; - } - } - if (npc.Center.X > Main.player[npc.target].Center.X) - { - npc.velocity.X = npc.velocity.X - num1329; - if (npc.velocity.X > 0f) - { - npc.velocity.X = npc.velocity.X * 0.98f; - } - } - if (npc.velocity.X > num1330 || npc.velocity.X < -num1330) - { - npc.velocity.X = npc.velocity.X * 0.95f; - } - float num1331 = Main.player[npc.target].position.Y - (npc.position.Y + (float)npc.height); - if (num1331 < 180f) - { - npc.velocity.Y = npc.velocity.Y - 0.1f; - } - if (num1331 > 200f) - { - npc.velocity.Y = npc.velocity.Y + 0.1f; - } - if (npc.velocity.Y > 6f) - { - npc.velocity.Y = 6f; - } - if (npc.velocity.Y < -6f) - { - npc.velocity.Y = -6f; - } - npc.rotation = npc.velocity.X * 0.01f; - if (Main.netMode != 1) - { - npc.ai[3] += 1f; - int num1332 = 15; - if ((double)npc.life < (double)npc.lifeMax * 0.75) - { - num1332 = 14; - } - if ((double)npc.life < (double)npc.lifeMax * 0.5) - { - num1332 = 12; - } - if ((double)npc.life < (double)npc.lifeMax * 0.25) - { - num1332 = 10; - } - if ((double)npc.life < (double)npc.lifeMax * 0.1) - { - num1332 = 8; - } - num1332 += 3; - if (npc.ai[3] >= (float)num1332) - { - npc.ai[3] = 0f; - Vector2 vector160 = new Vector2(npc.Center.X, npc.position.Y + (float)npc.height - 14f); - int i2 = (int)(vector160.X / 16f); - int j2 = (int)(vector160.Y / 16f); - if (!WorldGen.SolidTile(i2, j2)) - { - float num1333 = npc.velocity.Y; - if (num1333 < 0f) - { - num1333 = 0f; - } - num1333 += 3f; - float speedX2 = npc.velocity.X * 0.25f; - Projectile.NewProjectile(vector160.X, vector160.Y, speedX2, num1333, mod.ProjectileType("FallingDarkSlime"), 34, 0f, Main.myPlayer, (float)Main.rand.Next(5), 0f); - } - } - } - if (Main.netMode != 1) - { - npc.ai[1] += (float)Main.rand.Next(1, 4); - if (npc.ai[1] > 600f) - { - npc.ai[0] = -1f; - } - } - } - else if (npc.ai[0] == 2f) - { - npc.TargetClosest(true); - Vector2 vector161 = new Vector2(npc.Center.X, npc.Center.Y - 20f); - float num1334 = (float)Main.rand.Next(-1000, 1001); - float num1335 = (float)Main.rand.Next(-1000, 1001); - float num1336 = (float)Math.Sqrt((double)(num1334 * num1334 + num1335 * num1335)); - float num1337 = 15f; - npc.velocity *= 0.95f; - num1336 = num1337 / num1336; - num1334 *= num1336; - num1335 *= num1336; - npc.rotation += 0.2f; - vector161.X += num1334 * 4f; - vector161.Y += num1335 * 4f; - npc.ai[3] += 1f; - int num1338 = 7; - if ((double)npc.life < (double)npc.lifeMax * 0.75) - { - num1338--; - } - if ((double)npc.life < (double)npc.lifeMax * 0.5) - { - num1338 -= 2; - } - if ((double)npc.life < (double)npc.lifeMax * 0.25) - { - num1338 -= 3; - } - if ((double)npc.life < (double)npc.lifeMax * 0.1) - { - num1338 -= 4; - } - if (npc.ai[3] > (float)num1338) - { - npc.ai[3] = 0f; - Projectile.NewProjectile(vector161.X, vector161.Y, num1334, num1335, mod.ProjectileType("DarkBubblePro"), 40, 0f, Main.myPlayer, 0f, 0f); - } - if (Main.netMode != 1) - { - npc.ai[1] += (float)Main.rand.Next(1, 4); - if (npc.ai[1] > 500f) - { - npc.ai[0] = -1f; - } - } - } - if (npc.ai[0] == -1f) - { - int num1339 = Main.rand.Next(3); - npc.TargetClosest(true); - if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) > 1000f) - { - num1339 = 0; - } - npc.ai[0] = (float)num1339; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - return; - } + if (allDead) + { + if (npc.velocity.X > 0f) + { + npc.velocity.X = npc.velocity.X + 0.75f; + } + else + { + npc.velocity.X = npc.velocity.X - 0.75f; + } + npc.velocity.Y = npc.velocity.Y - 0.1f; + npc.rotation = npc.velocity.X * 0.05f; + } + else if (npc.ai[0] == 0f) + { + if (npc.ai[2] == 0f) + { + npc.TargetClosest(true); + if (npc.Center.X < Main.player[npc.target].Center.X) + { + npc.ai[2] = 1f; + } + else + { + npc.ai[2] = -1f; + } + } + npc.TargetClosest(true); + int num1319 = 800; + float num1320 = Math.Abs(npc.Center.X - Main.player[npc.target].Center.X); + if (npc.Center.X < Main.player[npc.target].Center.X && npc.ai[2] < 0f && num1320 > (float)num1319) + { + npc.ai[2] = 0f; + } + if (npc.Center.X > Main.player[npc.target].Center.X && npc.ai[2] > 0f && num1320 > (float)num1319) + { + npc.ai[2] = 0f; + } + float num1321 = 0.45f; + float num1322 = 7f; + if ((double)npc.life < (double)npc.lifeMax * 0.75) + { + num1321 = 0.55f; + num1322 = 8f; + } + if ((double)npc.life < (double)npc.lifeMax * 0.5) + { + num1321 = 0.7f; + num1322 = 10f; + } + if ((double)npc.life < (double)npc.lifeMax * 0.25) + { + num1321 = 0.8f; + num1322 = 11f; + } + npc.velocity.X = npc.velocity.X + npc.ai[2] * num1321; + if (npc.velocity.X > num1322) + { + npc.velocity.X = num1322; + } + if (npc.velocity.X < -num1322) + { + npc.velocity.X = -num1322; + } + float num1323 = Main.player[npc.target].position.Y - (npc.position.Y + (float)npc.height); + if (num1323 < 150f) + { + npc.velocity.Y = npc.velocity.Y - 0.2f; + } + if (num1323 > 200f) + { + npc.velocity.Y = npc.velocity.Y + 0.2f; + } + if (npc.velocity.Y > 8f) + { + npc.velocity.Y = 8f; + } + if (npc.velocity.Y < -8f) + { + npc.velocity.Y = -8f; + } + npc.rotation = npc.velocity.X * 0.05f; + if ((num1320 < 500f || npc.ai[3] < 0f) && npc.position.Y < Main.player[npc.target].position.Y) + { + npc.ai[3] += 1f; + int num1324 = 13; + if ((double)npc.life < (double)npc.lifeMax * 0.75) + { + num1324 = 12; + } + if ((double)npc.life < (double)npc.lifeMax * 0.5) + { + num1324 = 11; + } + if ((double)npc.life < (double)npc.lifeMax * 0.25) + { + num1324 = 10; + } + num1324++; + if (npc.ai[3] > (float)num1324) + { + npc.ai[3] = (float)(-(float)num1324); + } + if (npc.ai[3] == 0f && Main.netMode != 1) + { + Vector2 vector159 = new Vector2(npc.Center.X, npc.Center.Y); + vector159.X += npc.velocity.X * 7f; + float num1325 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector159.X; + float num1326 = Main.player[npc.target].Center.Y - vector159.Y; + float num1327 = (float)Math.Sqrt((double)(num1325 * num1325 + num1326 * num1326)); + float num1328 = 6f; + if ((double)npc.life < (double)npc.lifeMax * 0.75) + { + num1328 = 7f; + } + if ((double)npc.life < (double)npc.lifeMax * 0.5) + { + num1328 = 8f; + } + if ((double)npc.life < (double)npc.lifeMax * 0.25) + { + num1328 = 9f; + } + num1327 = num1328 / num1327; + num1325 *= num1327; + num1326 *= num1327; + Projectile.NewProjectile(vector159.X, vector159.Y, num1325, num1326, mod.ProjectileType("FallingDarkServant"), 54, 0f, Main.myPlayer, 0f, 0f); + } + } + else if (npc.ai[3] < 0f) + { + npc.ai[3] += 1f; + } + if (Main.netMode != 1) + { + npc.ai[1] += (float)Main.rand.Next(1, 4); + if (npc.ai[1] > 800f && num1320 < 600f) + { + npc.ai[0] = -1f; + } + } + } + else if (npc.ai[0] == 1f) + { + npc.TargetClosest(true); + float num1329 = 0.15f; + float num1330 = 7f; + if ((double)npc.life < (double)npc.lifeMax * 0.75) + { + num1329 = 0.17f; + num1330 = 8f; + } + if ((double)npc.life < (double)npc.lifeMax * 0.5) + { + num1329 = 0.2f; + num1330 = 9f; + } + if ((double)npc.life < (double)npc.lifeMax * 0.25) + { + num1329 = 0.25f; + num1330 = 10f; + } + num1329 -= 0.05f; + num1330 -= 1f; + if (npc.Center.X < Main.player[npc.target].Center.X) + { + npc.velocity.X = npc.velocity.X + num1329; + if (npc.velocity.X < 0f) + { + npc.velocity.X = npc.velocity.X * 0.98f; + } + } + if (npc.Center.X > Main.player[npc.target].Center.X) + { + npc.velocity.X = npc.velocity.X - num1329; + if (npc.velocity.X > 0f) + { + npc.velocity.X = npc.velocity.X * 0.98f; + } + } + if (npc.velocity.X > num1330 || npc.velocity.X < -num1330) + { + npc.velocity.X = npc.velocity.X * 0.95f; + } + float num1331 = Main.player[npc.target].position.Y - (npc.position.Y + (float)npc.height); + if (num1331 < 180f) + { + npc.velocity.Y = npc.velocity.Y - 0.1f; + } + if (num1331 > 200f) + { + npc.velocity.Y = npc.velocity.Y + 0.1f; + } + if (npc.velocity.Y > 6f) + { + npc.velocity.Y = 6f; + } + if (npc.velocity.Y < -6f) + { + npc.velocity.Y = -6f; + } + npc.rotation = npc.velocity.X * 0.01f; + if (Main.netMode != 1) + { + npc.ai[3] += 1f; + int num1332 = 15; + if ((double)npc.life < (double)npc.lifeMax * 0.75) + { + num1332 = 14; + } + if ((double)npc.life < (double)npc.lifeMax * 0.5) + { + num1332 = 12; + } + if ((double)npc.life < (double)npc.lifeMax * 0.25) + { + num1332 = 10; + } + if ((double)npc.life < (double)npc.lifeMax * 0.1) + { + num1332 = 8; + } + num1332 += 3; + if (npc.ai[3] >= (float)num1332) + { + npc.ai[3] = 0f; + Vector2 vector160 = new Vector2(npc.Center.X, npc.position.Y + (float)npc.height - 14f); + int i2 = (int)(vector160.X / 16f); + int j2 = (int)(vector160.Y / 16f); + if (!WorldGen.SolidTile(i2, j2)) + { + float num1333 = npc.velocity.Y; + if (num1333 < 0f) + { + num1333 = 0f; + } + num1333 += 3f; + float speedX2 = npc.velocity.X * 0.25f; + Projectile.NewProjectile(vector160.X, vector160.Y, speedX2, num1333, mod.ProjectileType("FallingDarkSlime"), 34, 0f, Main.myPlayer, (float)Main.rand.Next(5), 0f); + } + } + } + if (Main.netMode != 1) + { + npc.ai[1] += (float)Main.rand.Next(1, 4); + if (npc.ai[1] > 600f) + { + npc.ai[0] = -1f; + } + } + } + else if (npc.ai[0] == 2f) + { + npc.TargetClosest(true); + Vector2 vector161 = new Vector2(npc.Center.X, npc.Center.Y - 20f); + float num1334 = (float)Main.rand.Next(-1000, 1001); + float num1335 = (float)Main.rand.Next(-1000, 1001); + float num1336 = (float)Math.Sqrt((double)(num1334 * num1334 + num1335 * num1335)); + float num1337 = 15f; + npc.velocity *= 0.95f; + num1336 = num1337 / num1336; + num1334 *= num1336; + num1335 *= num1336; + npc.rotation += 0.2f; + vector161.X += num1334 * 4f; + vector161.Y += num1335 * 4f; + npc.ai[3] += 1f; + int num1338 = 7; + if ((double)npc.life < (double)npc.lifeMax * 0.75) + { + num1338--; + } + if ((double)npc.life < (double)npc.lifeMax * 0.5) + { + num1338 -= 2; + } + if ((double)npc.life < (double)npc.lifeMax * 0.25) + { + num1338 -= 3; + } + if ((double)npc.life < (double)npc.lifeMax * 0.1) + { + num1338 -= 4; + } + if (npc.ai[3] > (float)num1338) + { + npc.ai[3] = 0f; + Projectile.NewProjectile(vector161.X, vector161.Y, num1334, num1335, mod.ProjectileType("DarkBubblePro"), 40, 0f, Main.myPlayer, 0f, 0f); + } + if (Main.netMode != 1) + { + npc.ai[1] += (float)Main.rand.Next(1, 4); + if (npc.ai[1] > 500f) + { + npc.ai[0] = -1f; + } + } + } + if (npc.ai[0] == -1f) + { + int num1339 = Main.rand.Next(3); + npc.TargetClosest(true); + if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) > 1000f) + { + num1339 = 0; + } + npc.ai[0] = (float)num1339; + npc.ai[1] = 0f; + npc.ai[2] = 0f; + npc.ai[3] = 0f; + return; + } - } + } - public override void NPCLoot() - { - if(Main.expertMode) - { - npc.DropBossBags(); - } + public override void NPCLoot() + { + if (Main.expertMode) + { + npc.DropBossBags(); + } - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; - if(!Main.expertMode && Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DarkEmperorMask")); - } - if(Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DarkEmperorTrophy")); - } - if(!Main.expertMode && Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DrippingScythe")); - } - if(!Main.expertMode && Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DelightfulClump")); - } - if(!Main.expertMode && Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("NastyJavelin"), Main.rand.Next(30,50)); - } - if(!Main.expertMode && Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DarkGel"), Main.rand.Next(50,100)); - } - if(!Main.expertMode && Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SoulofFight"), Main.rand.Next(20,30)); - } - TremorWorld.downedDarkEmperor = true; - } - } - } + if (!Main.expertMode && Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DarkEmperorMask")); + } + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DarkEmperorTrophy")); + } + if (!Main.expertMode && Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DrippingScythe")); + } + if (!Main.expertMode && Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DelightfulClump")); + } + if (!Main.expertMode && Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("NastyJavelin"), Main.rand.Next(30, 50)); + } + if (!Main.expertMode && Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DarkGel"), Main.rand.Next(50, 100)); + } + if (!Main.expertMode && Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SoulofFight"), Main.rand.Next(20, 30)); + } + TremorWorld.downedDarkEmperor = true; + } + } + } } \ No newline at end of file diff --git a/NPCs/TheGirl.cs b/NPCs/TheGirl.cs index f8a70f53..886eac72 100644 --- a/NPCs/TheGirl.cs +++ b/NPCs/TheGirl.cs @@ -6,76 +6,78 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class TheGirl : ModNPC +namespace Tremor.NPCs { + + public class TheGirl : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("The Girl"); Main.npcFrameCount[npc.type] = 9; } - - public override void SetDefaults() - { - npc.lifeMax = 3000; - npc.damage = 175; - npc.defense = 48; - npc.knockBackResist = 0.3f; - npc.width = 34; - npc.height = 54; - animationType = 529; - npc.aiStyle = 3; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit1; - aiType = 529; - npc.DeathSound = SoundID.NPCDeath52; - npc.value = Item.buyPrice(0, 3, 1, 0); - banner = npc.type; - bannerItem = mod.ItemType("TheGirlBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 3000; + npc.damage = 175; + npc.defense = 48; + npc.knockBackResist = 0.3f; + npc.width = 34; + npc.height = 54; + animationType = 529; + npc.aiStyle = 3; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit1; + aiType = 529; + npc.DeathSound = SoundID.NPCDeath52; + npc.value = Item.buyPrice(0, 3, 1, 0); + banner = npc.type; + bannerItem = mod.ItemType("TheGirlBanner"); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 60; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - } - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrokenHeroArmorplate")); - } - } - } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && (tile == 53 || tile == 112 || tile == 116 || tile == 234) && spawnInfo.water) && y < Main.rockLayer && (x < 250 || x > Main.maxTilesX - 250) && !spawnInfo.playerSafe && NPC.downedMoonlord && Main.eclipse ? 0.01f : 0f; - } -}} \ No newline at end of file + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 60; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 54, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + } + } + + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrokenHeroArmorplate")); + } + } + } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && (tile == 53 || tile == 112 || tile == 116 || tile == 234) && spawnInfo.water) && y < Main.rockLayer && (x < 250 || x > Main.maxTilesX - 250) && !spawnInfo.playerSafe && NPC.downedMoonlord && Main.eclipse ? 0.01f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/TheThing.cs b/NPCs/TheThing.cs index 9a948658..6620cb2d 100644 --- a/NPCs/TheThing.cs +++ b/NPCs/TheThing.cs @@ -6,85 +6,87 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class TheThing : ModNPC +namespace Tremor.NPCs { + + public class TheThing : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("The Thing"); Main.npcFrameCount[npc.type] = 20; } - - public override void SetDefaults() - { - npc.lifeMax = 4000; - npc.damage = 160; - npc.defense = 82; - npc.knockBackResist = 0.1f; - npc.width = 40; - npc.height = 40; - animationType = 482; - npc.aiStyle = 3; - aiType = 482; - npc.npcSlots = 0.8f; - npc.HitSound = SoundID.NPCHit1; - npc.buffImmune[20] = true; - npc.buffImmune[24] = true; - npc.buffImmune[39] = true; - npc.buffImmune[31] = false; - npc.DeathSound = SoundID.NPCDeath27; - npc.value = Item.buyPrice(0, 0, 25, 0); - banner = npc.type; - bannerItem = mod.ItemType("TheThingBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 4000; + npc.damage = 160; + npc.defense = 82; + npc.knockBackResist = 0.1f; + npc.width = 40; + npc.height = 40; + animationType = 482; + npc.aiStyle = 3; + aiType = 482; + npc.npcSlots = 0.8f; + npc.HitSound = SoundID.NPCHit1; + npc.buffImmune[20] = true; + npc.buffImmune[24] = true; + npc.buffImmune[39] = true; + npc.buffImmune[31] = false; + npc.DeathSound = SoundID.NPCDeath27; + npc.value = Item.buyPrice(0, 0, 25, 0); + banner = npc.type; + bannerItem = mod.ItemType("TheThingBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DeadTissue")); - } - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DeadTissue")); + } + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TTGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TTGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TTGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TTGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TTGore4"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TTGore4"), 1f); - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); - } - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TTGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TTGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TTGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TTGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TTGore4"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TTGore4"), 1f); + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.6f); + } + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.002f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.002f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/Thief1.cs b/NPCs/Thief1.cs index 8efb921d..35abdd74 100644 --- a/NPCs/Thief1.cs +++ b/NPCs/Thief1.cs @@ -13,7 +13,7 @@ public override void SetStaticDefaults() DisplayName.SetDefault("Thief"); Main.npcFrameCount[npc.type] = 16; } - + public override void SetDefaults() { npc.width = 40; @@ -23,107 +23,107 @@ public override void SetDefaults() npc.lifeMax = 90; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; - npc.value = Item.buyPrice(0, 0, 2, 7); + npc.value = Item.buyPrice(0, 0, 2, 7); npc.knockBackResist = 0.5f; npc.aiStyle = 3; aiType = 73; - npc.aiStyle = 3; + npc.aiStyle = 3; animationType = 27; - banner = npc.type; - bannerItem = mod.ItemType("ThiefBanner"); + banner = npc.type; + bannerItem = mod.ItemType("ThiefBanner"); } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(6) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LeatherHat")); - }; - if(Main.rand.Next(6) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LeatherGreaves")); - }; - if(Main.rand.Next(6) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LeatherShirt")); - }; - if(Main.rand.Next(6) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ChainCoif")); - }; - if(Main.rand.Next(6) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ChainGreaves")); - }; - if(Main.rand.Next(6) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Chainmail")); - }; - if(Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 28); - }; - if(Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 31); - }; - if(Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 8); - }; - if(Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 85); - }; - if(Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 110); - }; - if(Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 259); - }; - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(6) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LeatherHat")); + }; + if (Main.rand.Next(6) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LeatherGreaves")); + }; + if (Main.rand.Next(6) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LeatherShirt")); + }; + if (Main.rand.Next(6) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ChainCoif")); + }; + if (Main.rand.Next(6) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ChainGreaves")); + }; + if (Main.rand.Next(6) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Chainmail")); + }; + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 28); + }; + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 31); + }; + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 8); + }; + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 85); + }; + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 110); + }; + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 259); + }; + } + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Thief1Gore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Thief1Gore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Thief1Gore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Thief1Gore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Thief1Gore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Thief1Gore4"), 1f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Thief1Gore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Thief1Gore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Thief1Gore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Thief1Gore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Thief1Gore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Thief1Gore4"), 1f); + } + } public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (!NPC.downedBoss2) - { - return spawnInfo.spawnTileY < Main.rockLayer && Main.dayTime ? 0.02f : 0f; - } - else - { - return spawnInfo.spawnTileY < Main.rockLayer && Main.dayTime ? 0.002f : 0f; - } + if (!NPC.downedBoss2) + { + return spawnInfo.spawnTileY < Main.rockLayer && Main.dayTime ? 0.02f : 0f; + } + else + { + return spawnInfo.spawnTileY < Main.rockLayer && Main.dayTime ? 0.002f : 0f; + } } } diff --git a/NPCs/Thief2.cs b/NPCs/Thief2.cs index 51b2f88c..4bf585e1 100644 --- a/NPCs/Thief2.cs +++ b/NPCs/Thief2.cs @@ -13,7 +13,7 @@ public override void SetStaticDefaults() DisplayName.SetDefault("Thief"); Main.npcFrameCount[npc.type] = 16; } - + public override void SetDefaults() { npc.width = 40; @@ -23,106 +23,106 @@ public override void SetDefaults() npc.lifeMax = 80; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; - npc.value = Item.buyPrice(0, 0, 2, 7); + npc.value = Item.buyPrice(0, 0, 2, 7); npc.knockBackResist = 0.5f; npc.aiStyle = 3; aiType = 73; - npc.aiStyle = 3; + npc.aiStyle = 3; animationType = 27; - banner = npc.type; - bannerItem = mod.ItemType("ThiefBanner"); + banner = npc.type; + bannerItem = mod.ItemType("ThiefBanner"); } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LeatherHat")); - }; - if(Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LeatherGreaves")); - }; - if(Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LeatherShirt")); - }; - if(Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ChainCoif")); - }; - if(Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ChainGreaves")); - }; - if(Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Chainmail")); - }; - if(Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 28); - }; - if(Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 31); - }; - if(Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 8); - }; - if(Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 85); - }; - if(Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 110); - }; - if(Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 259); - }; - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LeatherHat")); + }; + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LeatherGreaves")); + }; + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LeatherShirt")); + }; + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ChainCoif")); + }; + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ChainGreaves")); + }; + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Chainmail")); + }; + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 28); + }; + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 31); + }; + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 8); + }; + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 85); + }; + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 110); + }; + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 259); + }; + } + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Thief2Gore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Thief2Gore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Thief2Gore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Thief2Gore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Thief2Gore3"), 1f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Thief2Gore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Thief2Gore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Thief2Gore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Thief2Gore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Thief2Gore3"), 1f); + } + } public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (!NPC.downedBoss2) - { - return spawnInfo.spawnTileY < Main.rockLayer && Main.dayTime ? 0.02f : 0f; - } - else - { - return spawnInfo.spawnTileY < Main.rockLayer && Main.dayTime ? 0.002f : 0f; - } + if (!NPC.downedBoss2) + { + return spawnInfo.spawnTileY < Main.rockLayer && Main.dayTime ? 0.02f : 0f; + } + else + { + return spawnInfo.spawnTileY < Main.rockLayer && Main.dayTime ? 0.002f : 0f; + } } -} + } } diff --git a/NPCs/Thief3.cs b/NPCs/Thief3.cs index a3fee114..439a2815 100644 --- a/NPCs/Thief3.cs +++ b/NPCs/Thief3.cs @@ -13,7 +13,7 @@ public override void SetStaticDefaults() DisplayName.SetDefault("Thief"); Main.npcFrameCount[npc.type] = 16; } - + public override void SetDefaults() { npc.width = 40; @@ -23,107 +23,107 @@ public override void SetDefaults() npc.lifeMax = 75; npc.HitSound = SoundID.NPCHit1; npc.DeathSound = SoundID.NPCDeath1; - npc.value = Item.buyPrice(0, 0, 2, 7); + npc.value = Item.buyPrice(0, 0, 2, 7); npc.knockBackResist = 0.5f; npc.aiStyle = 3; aiType = 73; - npc.aiStyle = 3; + npc.aiStyle = 3; animationType = 27; - banner = npc.type; - bannerItem = mod.ItemType("ThiefBanner"); + banner = npc.type; + bannerItem = mod.ItemType("ThiefBanner"); } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LeatherHat")); - }; - if(Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LeatherGreaves")); - }; - if(Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LeatherShirt")); - }; - if(Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ChainCoif")); - }; - if(Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ChainGreaves")); - }; - if(Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Chainmail")); - }; - if(Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 28); - }; - if(Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 31); - }; - if(Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 8); - }; - if(Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 85); - }; - if(Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 110); - }; - if(Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 259); - }; - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LeatherHat")); + }; + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LeatherGreaves")); + }; + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LeatherShirt")); + }; + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ChainCoif")); + }; + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ChainGreaves")); + }; + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Chainmail")); + }; + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 28); + }; + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 31); + }; + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 8); + }; + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 85); + }; + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 110); + }; + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 259); + }; + } + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Thief3Gore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Thief3Gore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Thief3Gore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Thief3Gore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Thief3Gore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Thief3Gore4"), 1f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Thief3Gore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Thief3Gore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Thief3Gore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Thief3Gore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Thief3Gore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/Thief3Gore4"), 1f); + } + } public override float SpawnChance(NPCSpawnInfo spawnInfo) { - if (!NPC.downedBoss2) - { - return spawnInfo.spawnTileY < Main.rockLayer && Main.dayTime ? 0.02f : 0f; - } - else - { - return spawnInfo.spawnTileY < Main.rockLayer && Main.dayTime ? 0.002f : 0f; - } + if (!NPC.downedBoss2) + { + return spawnInfo.spawnTileY < Main.rockLayer && Main.dayTime ? 0.02f : 0f; + } + else + { + return spawnInfo.spawnTileY < Main.rockLayer && Main.dayTime ? 0.002f : 0f; + } } } diff --git a/NPCs/ThinMan.cs b/NPCs/ThinMan.cs index 4b8f1c86..7ea5b170 100644 --- a/NPCs/ThinMan.cs +++ b/NPCs/ThinMan.cs @@ -6,78 +6,80 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class ThinMan : ModNPC +namespace Tremor.NPCs { + + public class ThinMan : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Thin Man"); Main.npcFrameCount[npc.type] = 10; } - - public override void SetDefaults() - { - npc.lifeMax = 10000; - npc.damage = 160; - npc.defense = 50; - npc.knockBackResist = 0.3f; - npc.width = 18; - npc.height = 90; - npc.aiStyle = 3; - aiType = 77; - animationType = 351; - npc.npcSlots = 0.2f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 1, 10, 9); - banner = npc.type; - bannerItem = mod.ItemType("ThinManBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 10000; + npc.damage = 160; + npc.defense = 50; + npc.knockBackResist = 0.3f; + npc.width = 18; + npc.height = 90; + npc.aiStyle = 3; + aiType = 77; + animationType = 351; + npc.npcSlots = 0.2f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 1, 10, 9); + banner = npc.type; + bannerItem = mod.ItemType("ThinManBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrokenHeroArmorplate")); - } - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrokenHeroArmorplate")); + } + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TMGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TMGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TMGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TMGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TMGore3"), 1f); + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TMGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TMGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TMGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TMGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TMGore3"), 1f); - } -} + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return spawnInfo.spawnTileY < Main.rockLayer && NPC.downedMoonlord && Main.eclipse ? 0.001f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return spawnInfo.spawnTileY < Main.rockLayer && NPC.downedMoonlord && Main.eclipse ? 0.001f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/ThunderBones.cs b/NPCs/ThunderBones.cs index 73437df6..39e1f51d 100644 --- a/NPCs/ThunderBones.cs +++ b/NPCs/ThunderBones.cs @@ -7,93 +7,95 @@ using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class ThunderBones : ModNPC +namespace Tremor.NPCs { + + public class ThunderBones : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Thunder Bones"); Main.npcFrameCount[npc.type] = 20; } - - public override void SetDefaults() - { - aiType = 77; - npc.lifeMax = 500; - npc.damage = 30; - npc.defense = 10; - npc.knockBackResist = 0.3f; - npc.width = 36; - npc.height = 44; - animationType = 482; - npc.aiStyle = 3; - npc.npcSlots = 0.6f; - npc.HitSound = SoundID.NPCHit2; - npc.DeathSound = SoundID.NPCDeath6; - npc.value = Item.buyPrice(0, 0, 6, 9); - banner = npc.type; - bannerItem = mod.ItemType("ThunderBonesBanner"); - } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Bonecrusher")); - }; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TearsofDeath"), Main.rand.Next(1, 5)); - }; - } - } - public override void AI() - { -if (Main.rand.Next(9) == 0) - { - int num706 = Dust.NewDust(npc.position, npc.width , npc.height, 180, 0f, 0f, 200, npc.color, 1f); - Main.dust[num706].velocity *= 0.3f; - } - } + public override void SetDefaults() + { + aiType = 77; + npc.lifeMax = 500; + npc.damage = 30; + npc.defense = 10; + npc.knockBackResist = 0.3f; + npc.width = 36; + npc.height = 44; + animationType = 482; + npc.aiStyle = 3; + npc.npcSlots = 0.6f; + npc.HitSound = SoundID.NPCHit2; + npc.DeathSound = SoundID.NPCDeath6; + npc.value = Item.buyPrice(0, 0, 6, 9); + banner = npc.type; + bannerItem = mod.ItemType("ThunderBonesBanner"); + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Bonecrusher")); + }; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TearsofDeath"), Main.rand.Next(1, 5)); + }; + } + } + public override void AI() + { + if (Main.rand.Next(9) == 0) + { + int num706 = Dust.NewDust(npc.position, npc.width, npc.height, 180, 0f, 0f, 200, npc.color, 1f); + Main.dust[num706].velocity *= 0.3f; + } + } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { -NPC.NewNPC((int)npc.position.X +32, (int)npc.position.Y - 48, mod.NPCType("BoneFish")); -NPC.NewNPC((int)npc.position.X +16, (int)npc.position.Y - 48, mod.NPCType("BoneFish")); -NPC.NewNPC((int)npc.position.X -32, (int)npc.position.Y - 48, mod.NPCType("BoneFish")); -NPC.NewNPC((int)npc.position.X -16, (int)npc.position.Y - 48, mod.NPCType("BoneFish")); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TBGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TBGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TBGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TBGore4"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TBGore4"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TBGore5"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TBGore5"), 1f); - } -} - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedBoss3 && Main.bloodMoon && y < Main.worldSurface ? 0.01f : 0f; - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + NPC.NewNPC((int)npc.position.X + 32, (int)npc.position.Y - 48, mod.NPCType("BoneFish")); + NPC.NewNPC((int)npc.position.X + 16, (int)npc.position.Y - 48, mod.NPCType("BoneFish")); + NPC.NewNPC((int)npc.position.X - 32, (int)npc.position.Y - 48, mod.NPCType("BoneFish")); + NPC.NewNPC((int)npc.position.X - 16, (int)npc.position.Y - 48, mod.NPCType("BoneFish")); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TBGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TBGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TBGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TBGore4"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TBGore4"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TBGore5"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TBGore5"), 1f); + } + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedBoss3 && Main.bloodMoon && y < Main.worldSurface ? 0.01f : 0f; + } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/TikiSorcerer.cs b/NPCs/TikiSorcerer.cs index 8ed97beb..a1efffd6 100644 --- a/NPCs/TikiSorcerer.cs +++ b/NPCs/TikiSorcerer.cs @@ -6,66 +6,68 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class TikiSorcerer : ModNPC +namespace Tremor.NPCs { + + public class TikiSorcerer : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Tiki Sorcerer"); Main.npcFrameCount[npc.type] = 3; } - - public override void SetDefaults() - { - npc.lifeMax = 80; - npc.damage = 25; - npc.defense = 3; - npc.knockBackResist = 0.6f; - npc.width = 30; - npc.height = 46; - animationType = 29; - npc.aiStyle = 8; - npc.npcSlots = 15f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.value = Item.buyPrice(0, 0, 0, 0); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 80; + npc.damage = 25; + npc.defense = 3; + npc.knockBackResist = 0.6f; + npc.width = 30; + npc.height = 46; + animationType = 29; + npc.aiStyle = 8; + npc.npcSlots = 15f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.value = Item.buyPrice(0, 0, 0, 0); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(45) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("WoodenFrame")); - }; - } - } + if (Main.rand.Next(45) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("WoodenFrame")); + }; + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TSGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TSGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TSGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TSGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TSGore3"), 1f); - } -} -}} \ No newline at end of file + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TSGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TSGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TSGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TSGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TSGore3"), 1f); + } + } + } +} \ No newline at end of file diff --git a/NPCs/TikiSoul.cs b/NPCs/TikiSoul.cs index 9a81df92..6aa1d5d4 100644 --- a/NPCs/TikiSoul.cs +++ b/NPCs/TikiSoul.cs @@ -9,75 +9,75 @@ namespace Tremor.NPCs { - public class TikiSoul : ModNPC - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Tiki Soul"); - Main.npcFrameCount[npc.type] = 4; - } + public class TikiSoul : ModNPC + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Tiki Soul"); + Main.npcFrameCount[npc.type] = 4; + } - public override void SetDefaults() - { - npc.lifeMax = 600; - npc.damage = 12; - npc.defense = 0; - npc.knockBackResist = 0f; - npc.width = 28; - npc.height = 34; - npc.aiStyle = -1; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit31; - npc.noGravity = true; - npc.DeathSound = SoundID.NPCDeath6; - npc.value = Item.buyPrice(0, 0, 15, 0); - NPCID.Sets.TrailCacheLength[npc.type] = 5; - } + public override void SetDefaults() + { + npc.lifeMax = 600; + npc.damage = 12; + npc.defense = 0; + npc.knockBackResist = 0f; + npc.width = 28; + npc.height = 34; + npc.aiStyle = -1; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit31; + npc.noGravity = true; + npc.DeathSound = SoundID.NPCDeath6; + npc.value = Item.buyPrice(0, 0, 15, 0); + NPCID.Sets.TrailCacheLength[npc.type] = 5; + } - int ShootRate = 4; - int TimeToShoot = 4; - public override bool PreAI() - { - bool expertMode = Main.expertMode; - npc.TargetClosest(true); - Vector2 direction = Main.player[npc.target].Center - npc.Center; - direction.Normalize(); - direction *= 9f; - Player player = Main.player[npc.target]; - NPC parent = Main.npc[NPC.FindFirstNPC(mod.NPCType("TikiTotem"))]; - double deg = (double)npc.ai[1] / 2; - double rad = deg * (Math.PI / 150); - double dist = 240; - npc.position.X = parent.Center.X - (int)(Math.Cos(rad) * dist) - npc.width / 2; - npc.position.Y = parent.Center.Y - (int)(Math.Sin(rad) * dist) - npc.height / 2; - npc.ai[1] += 2f; - if (--this.TimeToShoot <= 0) - { - this.TimeToShoot = this.ShootRate; - NPC parent2 = Main.npc[NPC.FindFirstNPC(mod.NPCType("TikiTotem"))]; - Vector2 Velocity = Helper.VelocityToPoint(npc.Center, parent2.Center, 20); - //int k = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, Velocity.X, Velocity.Y, mod.ProjectileType("TikiSoulPro"), 0, 1f); - //Main.projectile[k].friendly = false; - //Main.projectile[k].tileCollide = false; - //Main.projectile[k].hostile = true; - } - return false; - } + int ShootRate = 4; + int TimeToShoot = 4; + public override bool PreAI() + { + bool expertMode = Main.expertMode; + npc.TargetClosest(true); + Vector2 direction = Main.player[npc.target].Center - npc.Center; + direction.Normalize(); + direction *= 9f; + Player player = Main.player[npc.target]; + NPC parent = Main.npc[NPC.FindFirstNPC(mod.NPCType("TikiTotem"))]; + double deg = (double)npc.ai[1] / 2; + double rad = deg * (Math.PI / 150); + double dist = 240; + npc.position.X = parent.Center.X - (int)(Math.Cos(rad) * dist) - npc.width / 2; + npc.position.Y = parent.Center.Y - (int)(Math.Sin(rad) * dist) - npc.height / 2; + npc.ai[1] += 2f; + if (--this.TimeToShoot <= 0) + { + this.TimeToShoot = this.ShootRate; + NPC parent2 = Main.npc[NPC.FindFirstNPC(mod.NPCType("TikiTotem"))]; + Vector2 Velocity = Helper.VelocityToPoint(npc.Center, parent2.Center, 20); + //int k = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, Velocity.X, Velocity.Y, mod.ProjectileType("TikiSoulPro"), 0, 1f); + //Main.projectile[k].friendly = false; + //Main.projectile[k].tileCollide = false; + //Main.projectile[k].hostile = true; + } + return false; + } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Texture2D drawTexture = Main.npcTexture[npc.type]; - Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D drawTexture = Main.npcTexture[npc.type]; + Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); - Vector2 drawPos = new Vector2( - npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, - npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); + Vector2 drawPos = new Vector2( + npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, + npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); - SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); + SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(drawTexture, drawPos, npc.frame, Color.White, npc.rotation, origin, npc.scale, effects, 0); - return false; - } - } + return false; + } + } } \ No newline at end of file diff --git a/NPCs/TikiTotem.cs b/NPCs/TikiTotem.cs index 1392ce5e..39a9525d 100644 --- a/NPCs/TikiTotem.cs +++ b/NPCs/TikiTotem.cs @@ -12,488 +12,488 @@ namespace Tremor.NPCs { - [AutoloadBossHead] - public class TikiTotem : ModNPC - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Tiki Totem"); - Main.npcFrameCount[npc.type] = 10; - } + [AutoloadBossHead] + public class TikiTotem : ModNPC + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Tiki Totem"); + Main.npcFrameCount[npc.type] = 10; + } - public override void SetDefaults() - { - npc.lifeMax = 2500; - npc.damage = 12; - npc.defense = 12; - npc.knockBackResist = 0.02f; - npc.width = 86; - npc.height = 162; - animationType = 325; - npc.boss = true; - music = 39; - aiType = 77; - npc.aiStyle = -1; - npc.npcSlots = 15f; - npc.HitSound = SoundID.NPCHit3; - npc.DeathSound = SoundID.NPCDeath1; - npc.value = Item.buyPrice(0, 0, 60, 0); - bossBag = mod.ItemType("TikiTotemBag"); - NPCID.Sets.TrailCacheLength[npc.type] = 5; - npc.dontTakeDamage = true; - } + public override void SetDefaults() + { + npc.lifeMax = 2500; + npc.damage = 12; + npc.defense = 12; + npc.knockBackResist = 0.02f; + npc.width = 86; + npc.height = 162; + animationType = 325; + npc.boss = true; + music = 39; + aiType = 77; + npc.aiStyle = -1; + npc.npcSlots = 15f; + npc.HitSound = SoundID.NPCHit3; + npc.DeathSound = SoundID.NPCDeath1; + npc.value = Item.buyPrice(0, 0, 60, 0); + bossBag = mod.ItemType("TikiTotemBag"); + NPCID.Sets.TrailCacheLength[npc.type] = 5; + npc.dontTakeDamage = true; + } - //Variables - bool FirstState = true; - bool SpawnTiki = false; - int Timer = 0; - bool Flag1 = true; - bool Flag2 = true; - bool Flag3 = true; - List TikiSouls = new List(); - public override void AI() - { + //Variables + bool FirstState = true; + bool SpawnTiki = false; + int Timer = 0; + bool Flag1 = true; + bool Flag2 = true; + bool Flag3 = true; + List TikiSouls = new List(); + public override void AI() + { if (NPC.AnyNPCs(mod.NPCType("HappySoul")) || NPC.AnyNPCs(mod.NPCType("AngerSoul")) || NPC.AnyNPCs(mod.NPCType("IndifferenceSoul"))) - { - npc.position += npc.velocity * 1f; - } - this.Timer++; - for (int num74 = npc.oldPos.Length - 1; num74 > 0; num74--) - { - npc.oldPos[num74] = npc.oldPos[num74 - 1]; - } - npc.oldPos[0] = npc.position; - if (Main.time % 600 == 0) - { - npc.position.X = Main.player[npc.target].position.X; - npc.position.Y = Main.player[npc.target].position.Y - 300f; - } - if (NPC.CountNPCS(mod.NPCType("TikiSoul")) <= ((Main.expertMode) ? 6 : 3) && Main.time % 60 == 0 && !this.SpawnTiki) - { - NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("TikiSoul")); - } - if (NPC.CountNPCS(mod.NPCType("TikiSoul")) >= ((Main.expertMode) ? 6 : 3)) - { - this.SpawnTiki = true; - } - if (NPC.CountNPCS(mod.NPCType("TikiSoul")) == 0 && this.Timer >= 200) - { - this.FirstState = false; - } - if (this.FirstState) - { - npc.aiStyle = 3; - } - else - { - npc.aiStyle = -1; - npc.dontTakeDamage = false; - if (Main.rand.Next(280) == 0 && NPC.CountNPCS(mod.NPCType("TikiWarrior")) < 7) - { - NPC.NewNPC((int)npc.Center.X - 70, (int)npc.Center.Y, mod.NPCType("TikiWarrior")); - } + { + npc.position += npc.velocity * 1f; + } + this.Timer++; + for (int num74 = npc.oldPos.Length - 1; num74 > 0; num74--) + { + npc.oldPos[num74] = npc.oldPos[num74 - 1]; + } + npc.oldPos[0] = npc.position; + if (Main.time % 600 == 0) + { + npc.position.X = Main.player[npc.target].position.X; + npc.position.Y = Main.player[npc.target].position.Y - 300f; + } + if (NPC.CountNPCS(mod.NPCType("TikiSoul")) <= ((Main.expertMode) ? 6 : 3) && Main.time % 60 == 0 && !this.SpawnTiki) + { + NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("TikiSoul")); + } + if (NPC.CountNPCS(mod.NPCType("TikiSoul")) >= ((Main.expertMode) ? 6 : 3)) + { + this.SpawnTiki = true; + } + if (NPC.CountNPCS(mod.NPCType("TikiSoul")) == 0 && this.Timer >= 200) + { + this.FirstState = false; + } + if (this.FirstState) + { + npc.aiStyle = 3; + } + else + { + npc.aiStyle = -1; + npc.dontTakeDamage = false; + if (Main.rand.Next(280) == 0 && NPC.CountNPCS(mod.NPCType("TikiWarrior")) < 7) + { + NPC.NewNPC((int)npc.Center.X - 70, (int)npc.Center.Y, mod.NPCType("TikiWarrior")); + } - if (Main.rand.Next(180) == 0 && NPC.CountNPCS(mod.NPCType("TikiWarrior")) < 4) - { - NPC.NewNPC((int)npc.Center.X + 30, (int)npc.Center.Y, mod.NPCType("TikiSorcerer")); - } - float num1263 = 2f; - npc.noGravity = true; - npc.noTileCollide = true; - if (!Main.dayTime) - { - npc.TargetClosest(true); - } - bool flag116 = false; - if ((double)npc.life < (double)npc.lifeMax * 0.75) - { - num1263 = 3f; - } - if ((double)npc.life < (double)npc.lifeMax * 0.5) - { - num1263 = 4f; - } - else if (npc.ai[0] == 0f) - { - npc.ai[1] += 1f; - if ((double)npc.life < (double)npc.lifeMax * 0.5) - { - npc.ai[1] += 1f; - } - if ((double)npc.life < (double)npc.lifeMax * 0.25) - { - npc.ai[1] += 1f; - } - if (npc.ai[1] >= 300f && Main.netMode != 1) - { - npc.ai[1] = 0f; - if ((double)npc.life < (double)npc.lifeMax * 0.25 && npc.type != 344) - { - npc.ai[0] = (float)Main.rand.Next(3, 5); - } - else - { - npc.ai[0] = (float)Main.rand.Next(1, 3); - } - npc.netUpdate = true; - } - } - else if (npc.ai[0] == 1f) - { - if (npc.type == 344) - { - flag116 = true; - npc.ai[1] += 1f; - if (npc.ai[1] % 5f == 0f) - { - Vector2 vector146 = new Vector2(npc.position.X + 20f + (float)Main.rand.Next(npc.width - 40), npc.position.Y + 20f + (float)Main.rand.Next(npc.height - 40)); - float num1264 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector146.X; - float num1265 = Main.player[npc.target].position.Y - vector146.Y; - num1264 += (float)Main.rand.Next(-50, 51); - num1265 += (float)Main.rand.Next(-50, 51); - num1265 -= Math.Abs(num1264) * ((float)Main.rand.Next(0, 21) * 0.01f); - float num1266 = (float)Math.Sqrt((double)(num1264 * num1264 + num1265 * num1265)); - float num1267 = 12.5f; - num1266 = num1267 / num1266; - num1264 *= num1266; - num1265 *= num1266; - num1264 *= 1f + (float)Main.rand.Next(-20, 21) * 0.02f; - num1265 *= 1f + (float)Main.rand.Next(-20, 21) * 0.02f; - Projectile.NewProjectile(vector146.X, vector146.Y, num1264, num1265, mod.ProjectileType("LizardPro"), 23, 0f, Main.myPlayer, (float)Main.rand.Next(0, 31), 0f); - } - if (npc.ai[1] >= 180f) - { - npc.ai[1] = 0f; - npc.ai[0] = 0f; - } - } - else - { - flag116 = true; - npc.ai[1] += 1f; - if (npc.ai[1] % 15f == 0f) - { - Vector2 vector147 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f + 30f); - float num1268 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector147.X; - float num1269 = Main.player[npc.target].position.Y - vector147.Y; - float num1270 = (float)Math.Sqrt((double)(num1268 * num1268 + num1269 * num1269)); - float num1271 = 10f; - num1270 = num1271 / num1270; - num1268 *= num1270; - num1269 *= num1270; - num1268 *= 1f + (float)Main.rand.Next(-20, 21) * 0.01f; - num1269 *= 1f + (float)Main.rand.Next(-20, 21) * 0.01f; - Projectile.NewProjectile(vector147.X, vector147.Y, num1268, num1269, mod.ProjectileType("LizardPro"), 50, 0f, Main.myPlayer, 0f, 0f); - } - if (npc.ai[1] >= 120f) - { - npc.ai[1] = 0f; - npc.ai[0] = 0f; - } - } - } - else if (npc.ai[0] == 2f) - { - if (npc.type == 344) - { - flag116 = true; - npc.ai[1] += 1f; - if (npc.ai[1] > 60f && npc.ai[1] < 240f && npc.ai[1] % 15f == 0f) - { - float num1272 = 4.5f; - Vector2 vector148 = new Vector2(npc.position.X + 20f + (float)Main.rand.Next(npc.width - 40), npc.position.Y + 60f + (float)Main.rand.Next(npc.height - 80)); - float num1273 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector148.X; - float num1274 = Main.player[npc.target].position.Y - vector148.Y; - num1274 -= Math.Abs(num1273) * 0.3f; - num1272 += Math.Abs(num1273) * 0.004f; - num1273 += (float)Main.rand.Next(-50, 51); - num1274 -= (float)Main.rand.Next(50, 201); - float num1275 = (float)Math.Sqrt((double)(num1273 * num1273 + num1274 * num1274)); - num1275 = num1272 / num1275; - num1273 *= num1275; - num1274 *= num1275; - num1273 *= 1f + (float)Main.rand.Next(-30, 31) * 0.01f; - num1274 *= 1f + (float)Main.rand.Next(-30, 31) * 0.01f; - Projectile.NewProjectile(vector148.X, vector148.Y, num1273, num1274, mod.ProjectileType("LizardPro"), 23, 0f, Main.myPlayer, 0f, (float)Main.rand.Next(2)); - } - if (npc.ai[1] >= 300f) - { - npc.ai[1] = 0f; - npc.ai[0] = 0f; - } - } - else - { - flag116 = true; - npc.ai[1] += 1f; - if (npc.ai[1] > 60f && npc.ai[1] < 240f && npc.ai[1] % 8f == 0f) - { - float num1276 = 10f; - Vector2 vector149 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f + 30f); - float num1277 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector149.X; - float num1278 = Main.player[npc.target].position.Y - vector149.Y; - num1278 -= Math.Abs(num1277) * 0.3f; - num1276 += Math.Abs(num1277) * 0.004f; - if (num1276 > 14f) - { - num1276 = 14f; - } - num1277 += (float)Main.rand.Next(-50, 51); - num1278 -= (float)Main.rand.Next(50, 61); - float num1279 = (float)Math.Sqrt((double)(num1277 * num1277 + num1278 * num1278)); - num1279 = num1276 / num1279; - num1277 *= num1279; - num1278 *= num1279; - num1277 *= 1f + (float)Main.rand.Next(-30, 31) * 0.01f; - num1278 *= 1f + (float)Main.rand.Next(-30, 31) * 0.01f; - Projectile.NewProjectile(vector149.X, vector149.Y, num1277, num1278, 81, 23, 0f, Main.myPlayer, 0f, 0f); - } - if (npc.ai[1] >= 300f) - { - npc.ai[1] = 0f; - npc.ai[0] = 0f; - } - } - } - else if (npc.ai[0] == 3f) - { - num1263 = 4f; - npc.ai[1] += 1f; - if (npc.ai[1] % 30f == 0f) - { - Vector2 vector150 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f + 30f); - float num1280 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector150.X; - float num1281 = Main.player[npc.target].position.Y - vector150.Y; - float num1282 = (float)Math.Sqrt((double)(num1280 * num1280 + num1281 * num1281)); - float num1283 = 16f; - num1282 = num1283 / num1282; - num1280 *= num1282; - num1281 *= num1282; - num1280 *= 1f + (float)Main.rand.Next(-20, 21) * 0.001f; - num1281 *= 1f + (float)Main.rand.Next(-20, 21) * 0.001f; - Projectile.NewProjectile(vector150.X, vector150.Y, num1280, num1281, mod.ProjectileType("LizardPro"), 23, 0f, Main.myPlayer, 0f, 0f); - } - if (npc.ai[1] >= 120f) - { - npc.ai[1] = 0f; - npc.ai[0] = 0f; - } - } - else if (npc.ai[0] == 4f) - { - num1263 = 4f; - npc.ai[1] += 1f; - if (npc.ai[1] % 10f == 0f) - { - float num1284 = 12f; - Vector2 vector151 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f + 30f); - float num1285 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector151.X; - float num1286 = Main.player[npc.target].position.Y - vector151.Y; - num1286 -= Math.Abs(num1285) * 0.2f; - num1284 += Math.Abs(num1285) * 0.002f; - if (num1284 > 16f) - { - num1284 = 16f; - } - num1285 += (float)Main.rand.Next(-50, 51); - num1286 -= (float)Main.rand.Next(50, 71); - float num1287 = (float)Math.Sqrt((double)(num1285 * num1285 + num1286 * num1286)); - num1287 = num1284 / num1287; - num1285 *= num1287; - num1286 *= num1287; - num1285 *= 1f + (float)Main.rand.Next(-30, 31) * 0.005f; - num1286 *= 1f + (float)Main.rand.Next(-30, 31) * 0.005f; - Projectile.NewProjectile(vector151.X, vector151.Y, num1285, num1286, 81, 23, 0f, Main.myPlayer, 0f, 0f); - } - if (npc.ai[1] >= 240f) - { - npc.ai[1] = 0f; - npc.ai[0] = 0f; - } - } - if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) < 50f) - { - flag116 = true; - } - if (flag116) - { - npc.velocity.X = npc.velocity.X * 0.9f; - if ((double)npc.velocity.X > -0.1 && (double)npc.velocity.X < 0.1) - { - npc.velocity.X = 0f; - } - } - else - { - if (npc.direction > 0) - { - npc.velocity.X = (npc.velocity.X * 20f + num1263) / 21f; - } - if (npc.direction < 0) - { - npc.velocity.X = (npc.velocity.X * 20f - num1263) / 21f; - } - } - int num1288 = 80; - int num1289 = 20; - Vector2 position7 = new Vector2(npc.Center.X - (float)(num1288 / 2), npc.position.Y + (float)npc.height - (float)num1289); - bool flag117 = false; - if (npc.position.X < Main.player[npc.target].position.X && npc.position.X + (float)npc.width > Main.player[npc.target].position.X + (float)Main.player[npc.target].width && npc.position.Y + (float)npc.height < Main.player[npc.target].position.Y + (float)Main.player[npc.target].height - 16f) - { - flag117 = true; - } - if (flag117) - { - npc.velocity.Y = npc.velocity.Y + 0.5f; - } - else if (Collision.SolidCollision(position7, num1288, num1289)) - { - if (npc.velocity.Y > 0f) - { - npc.velocity.Y = 0f; - } - if ((double)npc.velocity.Y > -0.2) - { - npc.velocity.Y = npc.velocity.Y - 0.025f; - } - else - { - npc.velocity.Y = npc.velocity.Y - 0.2f; - } - if (npc.velocity.Y < -4f) - { - npc.velocity.Y = -4f; - } - } - else - { - if (npc.velocity.Y < 0f) - { - npc.velocity.Y = 0f; - } - if ((double)npc.velocity.Y < 0.1) - { - npc.velocity.Y = npc.velocity.Y + 0.025f; - } - else - { - npc.velocity.Y = npc.velocity.Y + 0.5f; - } - } - if (npc.velocity.Y > 10f) - { - npc.velocity.Y = 10f; - return; - } + if (Main.rand.Next(180) == 0 && NPC.CountNPCS(mod.NPCType("TikiWarrior")) < 4) + { + NPC.NewNPC((int)npc.Center.X + 30, (int)npc.Center.Y, mod.NPCType("TikiSorcerer")); + } + float num1263 = 2f; + npc.noGravity = true; + npc.noTileCollide = true; + if (!Main.dayTime) + { + npc.TargetClosest(true); + } + bool flag116 = false; + if ((double)npc.life < (double)npc.lifeMax * 0.75) + { + num1263 = 3f; + } + if ((double)npc.life < (double)npc.lifeMax * 0.5) + { + num1263 = 4f; + } + else if (npc.ai[0] == 0f) + { + npc.ai[1] += 1f; + if ((double)npc.life < (double)npc.lifeMax * 0.5) + { + npc.ai[1] += 1f; + } + if ((double)npc.life < (double)npc.lifeMax * 0.25) + { + npc.ai[1] += 1f; + } + if (npc.ai[1] >= 300f && Main.netMode != 1) + { + npc.ai[1] = 0f; + if ((double)npc.life < (double)npc.lifeMax * 0.25 && npc.type != 344) + { + npc.ai[0] = (float)Main.rand.Next(3, 5); + } + else + { + npc.ai[0] = (float)Main.rand.Next(1, 3); + } + npc.netUpdate = true; + } + } + else if (npc.ai[0] == 1f) + { + if (npc.type == 344) + { + flag116 = true; + npc.ai[1] += 1f; + if (npc.ai[1] % 5f == 0f) + { + Vector2 vector146 = new Vector2(npc.position.X + 20f + (float)Main.rand.Next(npc.width - 40), npc.position.Y + 20f + (float)Main.rand.Next(npc.height - 40)); + float num1264 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector146.X; + float num1265 = Main.player[npc.target].position.Y - vector146.Y; + num1264 += (float)Main.rand.Next(-50, 51); + num1265 += (float)Main.rand.Next(-50, 51); + num1265 -= Math.Abs(num1264) * ((float)Main.rand.Next(0, 21) * 0.01f); + float num1266 = (float)Math.Sqrt((double)(num1264 * num1264 + num1265 * num1265)); + float num1267 = 12.5f; + num1266 = num1267 / num1266; + num1264 *= num1266; + num1265 *= num1266; + num1264 *= 1f + (float)Main.rand.Next(-20, 21) * 0.02f; + num1265 *= 1f + (float)Main.rand.Next(-20, 21) * 0.02f; + Projectile.NewProjectile(vector146.X, vector146.Y, num1264, num1265, mod.ProjectileType("LizardPro"), 23, 0f, Main.myPlayer, (float)Main.rand.Next(0, 31), 0f); + } + if (npc.ai[1] >= 180f) + { + npc.ai[1] = 0f; + npc.ai[0] = 0f; + } + } + else + { + flag116 = true; + npc.ai[1] += 1f; + if (npc.ai[1] % 15f == 0f) + { + Vector2 vector147 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f + 30f); + float num1268 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector147.X; + float num1269 = Main.player[npc.target].position.Y - vector147.Y; + float num1270 = (float)Math.Sqrt((double)(num1268 * num1268 + num1269 * num1269)); + float num1271 = 10f; + num1270 = num1271 / num1270; + num1268 *= num1270; + num1269 *= num1270; + num1268 *= 1f + (float)Main.rand.Next(-20, 21) * 0.01f; + num1269 *= 1f + (float)Main.rand.Next(-20, 21) * 0.01f; + Projectile.NewProjectile(vector147.X, vector147.Y, num1268, num1269, mod.ProjectileType("LizardPro"), 50, 0f, Main.myPlayer, 0f, 0f); + } + if (npc.ai[1] >= 120f) + { + npc.ai[1] = 0f; + npc.ai[0] = 0f; + } + } + } + else if (npc.ai[0] == 2f) + { + if (npc.type == 344) + { + flag116 = true; + npc.ai[1] += 1f; + if (npc.ai[1] > 60f && npc.ai[1] < 240f && npc.ai[1] % 15f == 0f) + { + float num1272 = 4.5f; + Vector2 vector148 = new Vector2(npc.position.X + 20f + (float)Main.rand.Next(npc.width - 40), npc.position.Y + 60f + (float)Main.rand.Next(npc.height - 80)); + float num1273 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector148.X; + float num1274 = Main.player[npc.target].position.Y - vector148.Y; + num1274 -= Math.Abs(num1273) * 0.3f; + num1272 += Math.Abs(num1273) * 0.004f; + num1273 += (float)Main.rand.Next(-50, 51); + num1274 -= (float)Main.rand.Next(50, 201); + float num1275 = (float)Math.Sqrt((double)(num1273 * num1273 + num1274 * num1274)); + num1275 = num1272 / num1275; + num1273 *= num1275; + num1274 *= num1275; + num1273 *= 1f + (float)Main.rand.Next(-30, 31) * 0.01f; + num1274 *= 1f + (float)Main.rand.Next(-30, 31) * 0.01f; + Projectile.NewProjectile(vector148.X, vector148.Y, num1273, num1274, mod.ProjectileType("LizardPro"), 23, 0f, Main.myPlayer, 0f, (float)Main.rand.Next(2)); + } + if (npc.ai[1] >= 300f) + { + npc.ai[1] = 0f; + npc.ai[0] = 0f; + } + } + else + { + flag116 = true; + npc.ai[1] += 1f; + if (npc.ai[1] > 60f && npc.ai[1] < 240f && npc.ai[1] % 8f == 0f) + { + float num1276 = 10f; + Vector2 vector149 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f + 30f); + float num1277 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector149.X; + float num1278 = Main.player[npc.target].position.Y - vector149.Y; + num1278 -= Math.Abs(num1277) * 0.3f; + num1276 += Math.Abs(num1277) * 0.004f; + if (num1276 > 14f) + { + num1276 = 14f; + } + num1277 += (float)Main.rand.Next(-50, 51); + num1278 -= (float)Main.rand.Next(50, 61); + float num1279 = (float)Math.Sqrt((double)(num1277 * num1277 + num1278 * num1278)); + num1279 = num1276 / num1279; + num1277 *= num1279; + num1278 *= num1279; + num1277 *= 1f + (float)Main.rand.Next(-30, 31) * 0.01f; + num1278 *= 1f + (float)Main.rand.Next(-30, 31) * 0.01f; + Projectile.NewProjectile(vector149.X, vector149.Y, num1277, num1278, 81, 23, 0f, Main.myPlayer, 0f, 0f); + } + if (npc.ai[1] >= 300f) + { + npc.ai[1] = 0f; + npc.ai[0] = 0f; + } + } + } + else if (npc.ai[0] == 3f) + { + num1263 = 4f; + npc.ai[1] += 1f; + if (npc.ai[1] % 30f == 0f) + { + Vector2 vector150 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f + 30f); + float num1280 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector150.X; + float num1281 = Main.player[npc.target].position.Y - vector150.Y; + float num1282 = (float)Math.Sqrt((double)(num1280 * num1280 + num1281 * num1281)); + float num1283 = 16f; + num1282 = num1283 / num1282; + num1280 *= num1282; + num1281 *= num1282; + num1280 *= 1f + (float)Main.rand.Next(-20, 21) * 0.001f; + num1281 *= 1f + (float)Main.rand.Next(-20, 21) * 0.001f; + Projectile.NewProjectile(vector150.X, vector150.Y, num1280, num1281, mod.ProjectileType("LizardPro"), 23, 0f, Main.myPlayer, 0f, 0f); + } + if (npc.ai[1] >= 120f) + { + npc.ai[1] = 0f; + npc.ai[0] = 0f; + } + } + else if (npc.ai[0] == 4f) + { + num1263 = 4f; + npc.ai[1] += 1f; + if (npc.ai[1] % 10f == 0f) + { + float num1284 = 12f; + Vector2 vector151 = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f + 30f); + float num1285 = Main.player[npc.target].position.X + (float)Main.player[npc.target].width * 0.5f - vector151.X; + float num1286 = Main.player[npc.target].position.Y - vector151.Y; + num1286 -= Math.Abs(num1285) * 0.2f; + num1284 += Math.Abs(num1285) * 0.002f; + if (num1284 > 16f) + { + num1284 = 16f; + } + num1285 += (float)Main.rand.Next(-50, 51); + num1286 -= (float)Main.rand.Next(50, 71); + float num1287 = (float)Math.Sqrt((double)(num1285 * num1285 + num1286 * num1286)); + num1287 = num1284 / num1287; + num1285 *= num1287; + num1286 *= num1287; + num1285 *= 1f + (float)Main.rand.Next(-30, 31) * 0.005f; + num1286 *= 1f + (float)Main.rand.Next(-30, 31) * 0.005f; + Projectile.NewProjectile(vector151.X, vector151.Y, num1285, num1286, 81, 23, 0f, Main.myPlayer, 0f, 0f); + } + if (npc.ai[1] >= 240f) + { + npc.ai[1] = 0f; + npc.ai[0] = 0f; + } + } + if (Math.Abs(npc.Center.X - Main.player[npc.target].Center.X) < 50f) + { + flag116 = true; + } + if (flag116) + { + npc.velocity.X = npc.velocity.X * 0.9f; + if ((double)npc.velocity.X > -0.1 && (double)npc.velocity.X < 0.1) + { + npc.velocity.X = 0f; + } + } + else + { + if (npc.direction > 0) + { + npc.velocity.X = (npc.velocity.X * 20f + num1263) / 21f; + } + if (npc.direction < 0) + { + npc.velocity.X = (npc.velocity.X * 20f - num1263) / 21f; + } + } + int num1288 = 80; + int num1289 = 20; + Vector2 position7 = new Vector2(npc.Center.X - (float)(num1288 / 2), npc.position.Y + (float)npc.height - (float)num1289); + bool flag117 = false; + if (npc.position.X < Main.player[npc.target].position.X && npc.position.X + (float)npc.width > Main.player[npc.target].position.X + (float)Main.player[npc.target].width && npc.position.Y + (float)npc.height < Main.player[npc.target].position.Y + (float)Main.player[npc.target].height - 16f) + { + flag117 = true; + } + if (flag117) + { + npc.velocity.Y = npc.velocity.Y + 0.5f; + } + else if (Collision.SolidCollision(position7, num1288, num1289)) + { + if (npc.velocity.Y > 0f) + { + npc.velocity.Y = 0f; + } + if ((double)npc.velocity.Y > -0.2) + { + npc.velocity.Y = npc.velocity.Y - 0.025f; + } + else + { + npc.velocity.Y = npc.velocity.Y - 0.2f; + } + if (npc.velocity.Y < -4f) + { + npc.velocity.Y = -4f; + } + } + else + { + if (npc.velocity.Y < 0f) + { + npc.velocity.Y = 0f; + } + if ((double)npc.velocity.Y < 0.1) + { + npc.velocity.Y = npc.velocity.Y + 0.025f; + } + else + { + npc.velocity.Y = npc.velocity.Y + 0.5f; + } + } + if (npc.velocity.Y > 10f) + { + npc.velocity.Y = 10f; + return; + } - if (npc.life < npc.lifeMax * 0.5f && this.Flag1) - { - this.Flag1 = false; - NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y + 95, mod.NPCType("HappySoul")); - } - if (npc.life < npc.lifeMax * 0.3f && this.Flag2) - { - this.Flag2 = false; - NPC.NewNPC((int)npc.Center.X - 50, (int)npc.Center.Y + 110, mod.NPCType("AngerSoul")); - } - if (npc.life < npc.lifeMax * 0.1f && this.Flag3) - { - this.Flag3 = false; - NPC.NewNPC((int)npc.Center.X + 50, (int)npc.Center.Y + 110, mod.NPCType("IndifferenceSoul")); - } - } - } + if (npc.life < npc.lifeMax * 0.5f && this.Flag1) + { + this.Flag1 = false; + NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y + 95, mod.NPCType("HappySoul")); + } + if (npc.life < npc.lifeMax * 0.3f && this.Flag2) + { + this.Flag2 = false; + NPC.NewNPC((int)npc.Center.X - 50, (int)npc.Center.Y + 110, mod.NPCType("AngerSoul")); + } + if (npc.life < npc.lifeMax * 0.1f && this.Flag3) + { + this.Flag3 = false; + NPC.NewNPC((int)npc.Center.X + 50, (int)npc.Center.Y + 110, mod.NPCType("IndifferenceSoul")); + } + } + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 0.625f * bossLifeScale); - npc.damage = (int)(npc.damage * 0.6f); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 0.625f * bossLifeScale); + npc.damage = (int)(npc.damage * 0.6f); + } - public override void HitEffect(int hitDirection, double damage) - { - if (npc.life <= 0) - { - this.Timer = 0; - Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/TikiTotemGore1"), 1f); - Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/TikiTotemGore2"), 1f); - Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/TikiTotemGore3"), 1f); - } - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + this.Timer = 0; + Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/TikiTotemGore1"), 1f); + Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/TikiTotemGore2"), 1f); + Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/TikiTotemGore3"), 1f); + } + } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Vector2 drawOrigin = new Vector2(Main.npcTexture[npc.type].Width, Main.npcTexture[npc.type].Height * 0.8f); - for (int k = 0; k < npc.oldPos.Length; k++) - { - Vector2 drawPos = npc.oldPos[k] - Main.screenPosition; - Color color = npc.GetAlpha(lightColor) * ((float)(npc.oldPos.Length - k) / (float)npc.oldPos.Length); - Rectangle frame = new Rectangle(0, 0, 86, 162); - frame.Y += 164 * (k / 60); + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Vector2 drawOrigin = new Vector2(Main.npcTexture[npc.type].Width, Main.npcTexture[npc.type].Height * 0.8f); + for (int k = 0; k < npc.oldPos.Length; k++) + { + Vector2 drawPos = npc.oldPos[k] - Main.screenPosition; + Color color = npc.GetAlpha(lightColor) * ((float)(npc.oldPos.Length - k) / (float)npc.oldPos.Length); + Rectangle frame = new Rectangle(0, 0, 86, 162); + frame.Y += 164 * (k / 60); - spriteBatch.Draw(Main.npcTexture[npc.type], drawPos, frame, color, 0, Vector2.Zero, npc.scale, SpriteEffects.None, 1f); - } - return true; - } + spriteBatch.Draw(Main.npcTexture[npc.type], drawPos, frame, color, 0, Vector2.Zero, npc.scale, SpriteEffects.None, 1f); + } + return true; + } - public override void NPCLoot() - { - if (Main.expertMode) - { - npc.DropBossBags(); - } - if (Main.netMode != 1) - { - int centerX = (int)(npc.Center.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.Center.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; + public override void NPCLoot() + { + if (Main.expertMode) + { + npc.DropBossBags(); + } + if (Main.netMode != 1) + { + int centerX = (int)(npc.Center.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.Center.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; - if (!Main.expertMode && Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("ToxicBlade")); - }; - if (!Main.expertMode && Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("JungleAlloy")); - }; - if (!Main.expertMode && Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("PickaxeofBloom")); - }; - if (!Main.expertMode && Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("ToxicHilt")); - }; - if (!Main.expertMode && Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("AngryTotemMask")); - } - if (!Main.expertMode && Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("HappyTotemMask")); - } - if (!Main.expertMode && Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("IndifferentTotemMask")); - } - if (!Main.expertMode && Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, 188, Main.rand.Next(6, 18)); - } - if (!Main.expertMode && Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, 189, Main.rand.Next(6, 18)); - } - if (Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("TikiTotemTrophy")); - } - if (!TremorWorld.downedTikiTotem) - { - Main.NewText("Ghosts are returning to ruins...", 193, 139, 77); - TremorWorld.downedTikiTotem = true; - } - } - } - } + if (!Main.expertMode && Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("ToxicBlade")); + }; + if (!Main.expertMode && Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("JungleAlloy")); + }; + if (!Main.expertMode && Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("PickaxeofBloom")); + }; + if (!Main.expertMode && Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("ToxicHilt")); + }; + if (!Main.expertMode && Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("AngryTotemMask")); + } + if (!Main.expertMode && Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("HappyTotemMask")); + } + if (!Main.expertMode && Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("IndifferentTotemMask")); + } + if (!Main.expertMode && Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, 188, Main.rand.Next(6, 18)); + } + if (!Main.expertMode && Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, 189, Main.rand.Next(6, 18)); + } + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.Center.X, (int)npc.Center.Y, npc.width, npc.height, mod.ItemType("TikiTotemTrophy")); + } + if (!TremorWorld.downedTikiTotem) + { + Main.NewText("Ghosts are returning to ruins...", 193, 139, 77); + TremorWorld.downedTikiTotem = true; + } + } + } + } } \ No newline at end of file diff --git a/NPCs/TikiWarrior.cs b/NPCs/TikiWarrior.cs index cecb3d59..fcfecd46 100644 --- a/NPCs/TikiWarrior.cs +++ b/NPCs/TikiWarrior.cs @@ -6,66 +6,68 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class TikiWarrior : ModNPC +namespace Tremor.NPCs { + + public class TikiWarrior : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Tiki Warrior"); Main.npcFrameCount[npc.type] = 3; } - - public override void SetDefaults() - { - npc.lifeMax = 120; - npc.damage = 26; - npc.defense = 5; - npc.knockBackResist = 0.3f; - npc.width = 56; - npc.height = 48; -animationType = 3; - npc.aiStyle = 3; + + public override void SetDefaults() + { + npc.lifeMax = 120; + npc.damage = 26; + npc.defense = 5; + npc.knockBackResist = 0.3f; + npc.width = 56; + npc.height = 48; + animationType = 3; + npc.aiStyle = 3; aiType = 73; - npc.npcSlots = 15f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.value = Item.buyPrice(0, 0, 0, 0); - } + npc.npcSlots = 15f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.value = Item.buyPrice(0, 0, 0, 0); + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(45) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("WoodenFrame")); - }; - } - } + if (Main.rand.Next(45) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("WoodenFrame")); + }; + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TikiWarriorGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TikiWarriorGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TikIWarriorGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TikiWarriorGore3"), 1f); - } -} -}} \ No newline at end of file + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TikiWarriorGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TikiWarriorGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TikIWarriorGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TikiWarriorGore3"), 1f); + } + } + } +} \ No newline at end of file diff --git a/NPCs/TremorGlobalNPC.cs b/NPCs/TremorGlobalNPC.cs index 954d40de..dfc9f0a1 100644 --- a/NPCs/TremorGlobalNPC.cs +++ b/NPCs/TremorGlobalNPC.cs @@ -18,8 +18,8 @@ public override bool InstancePerEntity } } - public bool dFear = false; - public bool Irradiated = false; + public bool dFear = false; + public bool Irradiated = false; public override void ResetEffects(NPC npc) { diff --git a/NPCs/TremorNPC.cs b/NPCs/TremorNPC.cs index 49d5ebd6..323db661 100644 --- a/NPCs/TremorNPC.cs +++ b/NPCs/TremorNPC.cs @@ -9,919 +9,919 @@ namespace Tremor.NPCs { - public class TremorNPC : GlobalNPC - { - public override void NPCLoot(NPC npc) - { - - if (NPC.downedMoonlord) - { - if (npc.type == 147) - { - if (Main.rand.Next(7) == 1) - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); - } - if (npc.type == 150) - { - if (Main.rand.Next(7) == 1) - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); - } - if (npc.type == 154) - { - if (Main.rand.Next(7) == 1) - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); - } - if (npc.type == 155) - { - if (Main.rand.Next(7) == 1) - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); - } - if (npc.type == 161) - { - if (Main.rand.Next(7) == 1) - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); - } - if (npc.type == 167) - { - if (Main.rand.Next(7) == 1) - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); - - } - if (npc.type == 168) - { - if (Main.rand.Next(7) == 1) - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); - - } - if (npc.type == 169) - { - if (Main.rand.Next(7) == 1) - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); - } - if (npc.type == 184) - { - if (Main.rand.Next(7) == 1) - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); - } - if (npc.type == 185) - { - if (Main.rand.Next(7) == 1) - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); - } - if (npc.type == 197) - { - if (Main.rand.Next(7) == 1) - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); - } - if (npc.type == 206) - { - if (Main.rand.Next(7) == 1) - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); - } - if (npc.type == 431) - { - if (Main.rand.Next(7) == 1) - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); - - - } - } - - if (npc.type == 77 && Main.rand.Next(3) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("TheRib")); - } - - if (npc.type == 110 && Main.rand.Next(3) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("TheRib")); - } - - if (npc.type == 483 && Main.rand.Next(4) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("StoneofLife")); - } - - if (npc.type == 481 && Main.rand.Next(4) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("StoneofLife")); - } - - if (npc.type == 140 && Main.rand.Next(25) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("PossessedHelmet")); - } - - if (npc.type == 140 && Main.rand.Next(25) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("PossessedChestplate")); - } - - if (npc.type == 140 && Main.rand.Next(25) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("PossessedGreaves")); - } - - if (!Main.expertMode && npc.type == 127 && Main.rand.Next(6) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("PrimeBlade")); - } - - if (!Main.expertMode && npc.type == 134 && Main.rand.Next(6) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("Destructor")); - } - - if (((npc.type == 381) || (npc.type == 382) || (npc.type == 383) || (npc.type == 385) || (npc.type == 386) || - (npc.type == 388) || (npc.type == 389) || (npc.type == 390) || (npc.type == 391) || (npc.type == 520)) && - Main.rand.Next(500) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("Transistor")); - } - - if (!Main.expertMode && npc.type == 113 && Main.rand.Next(1) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("PieceofFlesh"), Main.rand.Next(8, 17)); - } - - if (npc.type == 489 && Main.rand.Next(30) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, mod.ItemType("Stigmata")); - } - - if (npc.type == 62 && Main.rand.Next(2) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("DemonBlood")); - } - - if (npc.type == 66 && Main.rand.Next(2) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("DemonBlood")); - } - - if (npc.type == 111 && Main.rand.Next(20) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, mod.ItemType("LongBow")); - } - - if (npc.type == 127 && Main.rand.Next(3) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("BenderHead")); - } - - if (npc.type == 125 && Main.rand.Next(5) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("BenderBody")); - } - - if (npc.type == 126 && Main.rand.Next(5) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("BenderBody")); - } - - if (npc.type == 134 && Main.rand.Next(3) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("BenderLegs")); - } - - if (npc.type == 42 && Main.rand.Next(30) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("ToxicHilt")); - } - - if (npc.type == 231 && Main.rand.Next(30) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("ToxicHilt")); - } - - if (npc.type == 232 && Main.rand.Next(30) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("ToxicHilt")); - } - - if (npc.type == 233 && Main.rand.Next(30) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("ToxicHilt")); - } - - if (npc.type == 234 && Main.rand.Next(30) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("ToxicHilt")); - } - - if (npc.type == 235 && Main.rand.Next(30) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("ToxicHilt")); - } - - if (npc.type == 6 && Main.rand.Next(30) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("PiercingQuartz")); - } - - if (npc.type == 239 && Main.rand.Next(30) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("Vertebrow")); - } - - if (npc.type == 166 && Main.rand.Next(28) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("SwampClump")); - } - - if (npc.type == 469 && Main.rand.Next(28) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("LeechingSeed")); - } - - if (npc.type == 166 && Main.rand.Next(25) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("FiercePaw")); - } - - if (npc.type == 460 && Main.rand.Next(20) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("ButcherMask")); - } - - if (npc.type == 175 && Main.rand.Next(2) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("ThornBall"), Main.rand.Next(6, 15)); - } - - if (npc.type == 164 && Main.rand.Next(40) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("Arachnophobia")); - } - - if (npc.type == 165 && Main.rand.Next(40) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("Arachnophobia")); - } - - if (!TremorWorld.downedMotherboard && Main.hardMode && Main.rand.Next(2500) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("MechanicalBrain")); - } - - if (npc.type == 532 && Main.rand.Next(3) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("PetrifiedSpike"), Main.rand.Next(5, 10)); - } - - if (npc.type == 530 && Main.rand.Next(16) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("ScorpionStinger")); - } - - if (npc.type == 531 && Main.rand.Next(16) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("ScorpionStinger")); - } - - if (npc.type == 23 && Main.rand.Next(100) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("AncientMeteorHelmet")); - } - - if (npc.type == 346 && Main.rand.Next(7) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("SantaNK1Mask")); - } - - if (npc.type == 345 && Main.rand.Next(7) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("IceQueenMask")); - } - - if (npc.type == 344 && Main.rand.Next(7) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("EverscreamMask")); - } - - if (npc.type == 327 && Main.rand.Next(7) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("PumpkingMask")); - } - - if (npc.type == 328 && Main.rand.Next(7) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("PumpkingMask")); - } - - if (npc.type == 325 && Main.rand.Next(7) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("MourningWoodMask")); - } - - if (npc.type == 491 && Main.rand.Next(3) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("PirateChest")); - } - - if (!Main.expertMode && npc.type == 245 && Main.rand.Next(1) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("GolemCore")); - } - - if (npc.type == 124 && Main.rand.Next(1) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("ThrowingWrench"), Main.rand.Next(10, 20)); - } - - if (npc.type == 513 && Main.rand.Next(25) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("IonBlaster")); - } - - if (npc.type == 513 && Main.rand.Next(3) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("PetrifiedSpike"), Main.rand.Next(5, 10)); - } - - if ((npc.type == 3 || npc.type == 132 || npc.type == 186 || npc.type == 187 || npc.type == 188 || - npc.type == 189 || npc.type == 200 || npc.type == 132 || npc.type == 319 || npc.type == 320 || - npc.type == 321 || npc.type == 331 || npc.type == 332 || npc.type == 430 || npc.type == 432 || - npc.type == 433 || npc.type == 434 || npc.type == 435 || npc.type == 436) && Main.rand.Next(3) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("UntreatedFlesh")); - } - - if ((npc.type == 48 || npc.type == 75 || npc.type == 87) && Main.rand.Next(3) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("AirFragment")); - } - - if ((npc.type == 58 || npc.type == 65 || npc.type == 63 || npc.type == 64 || npc.type == 102 || - npc.type == 103 || npc.type == 157) && Main.rand.Next(2) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("SeaFragment")); - } - - if ((npc.type == 10 || npc.type == 95 || npc.type == 56 || npc.type == 153 || npc.type == 175 || - npc.type == 176 || npc.type == 205 || npc.type == 231 || npc.type == 232 || npc.type == 233 || - npc.type == 234 || npc.type == 235 || npc.type == 236 || npc.type == 237) && Main.rand.Next(4) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("EarthFragment")); - } - - if ((npc.type == 24 || npc.type == 59 || npc.type == 60 || npc.type == 151 || npc.type == 62 || - npc.type == 66) && Main.rand.Next(3) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("FireFragment")); - } - - if ((npc.type == 466 || npc.type == 467 || npc.type == 468 || npc.type == 463 || npc.type == 460) && - Main.rand.Next(1) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("DarkMatter"), Main.rand.Next(2, 3)); - } - - if (npc.type == 496 && Main.rand.Next(22) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("PurpleShellmet")); - } - - if (npc.type == 497 && Main.rand.Next(22) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("OrangeShellmet")); - } - - if (npc.lifeMax > 100 && npc.lifeMax < 200 && Main.rand.Next(300) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, mod.ItemType("TinySai")); - } - if (npc.value > 100f && npc.value < 1000f && Main.rand.Next(300) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("RoyalClaymore")); - } - if (npc.lifeMax > 200 && npc.lifeMax < 500 && Main.rand.Next(300) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("MassiveHammer")); - } - if (npc.defense > 10 && npc.defense < 30 && Main.rand.Next(300) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, mod.ItemType("Crowbar")); - } - if (npc.damage < 200 && npc.damage > 80 && Main.hardMode && Main.rand.Next(300) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, mod.ItemType("Narsil")); - } - if (npc.boss == true && !Main.hardMode && Main.rand.Next(5) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("HeavenHelmet")); - } - if (npc.boss == true && !Main.hardMode && Main.rand.Next(5) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("HeavenBreastplate")); - } - if (npc.boss == true && !Main.hardMode && Main.rand.Next(5) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("HeavenLeggings")); - } - - - if (npc.type == 13 && Main.rand.Next(20) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("CorruptorStaff")); - } - - if (npc.type == 266 && Main.rand.Next(3) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("CreeperStaff")); - } - - if (Main.xMas && !Main.player[Main.myPlayer].HasItem(mod.ItemType("SuspiciousLookingPresent")) && - Main.rand.Next(250) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("SuspiciousLookingPresent")); - } - - if (NPC.downedMoonlord && Main.rand.Next(250) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("SuspiciousBag")); - } - - if (NPC.downedMoonlord && Main.player[Main.myPlayer].ZoneDungeon && Main.rand.Next(4) == 0) - { - if (npc.lifeMax > 200 && !Main.expertMode) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("Phantaplasm")); - } - if (npc.lifeMax > 400 && Main.expertMode) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("Phantaplasm")); - } - } - - if (npc.type == 7 && Main.rand.Next(26) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("CorruptorGun")); - } - if ((npc.type == 69 || npc.type == 508) && Main.rand.Next(6) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("AntlionShell")); - } - if (npc.type == 298 && Main.rand.Next(100) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, mod.ItemType("RedMask")); - } - - if (npc.type == 494 && Main.rand.Next(29) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, mod.ItemType("RedClaw")); - } - if (npc.type == 495 && Main.rand.Next(29) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("GreenClaw")); - } - if ((npc.type == 498 || npc.type == 499 || npc.type == 500 || npc.type == 501 || npc.type == 502 || - npc.type == 503 || npc.type == 504 || npc.type == 505 || npc.type == 506) && Main.rand.Next(2) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("SalamanderSkin"), Main.rand.Next(2)); - } - - if ((npc.type == 173) && Main.rand.Next(40) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("CrimCudgel")); - } - - if ((npc.type == 4) && Main.rand.Next(10) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("TriangleMask")); - } - - if ((npc.type == 35) && Main.rand.Next(6) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("TheArtifact")); - } - - if (Main.eclipse && NPC.downedMoonlord && Main.rand.Next(10) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("ToothofAbraxas")); - } - - if ((npc.type == 125 || npc.type == 126 || npc.type == 127 || npc.type == 134) && NPC.downedMoonlord && - Main.rand.Next(1) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("CarbonSteel"), Main.rand.Next(6, 12)); - } - - if ((npc.type == 21 || npc.type == 449 || npc.type == 450 || npc.type == 451 || npc.type == 452 || - npc.type == 322 || npc.type == 323 || npc.type == 324 || npc.type == 294 || npc.type == 295 || - npc.type == 296 || npc.type == 201 || npc.type == 202 || npc.type == 20 || npc.type == 450 || - npc.type == 451 || npc.type == 452) && WorldGen.shadowOrbSmashed && Main.rand.Next(8) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("RedSteelArmorPiece")); - } - - if ((npc.type == 21 || npc.type == 449 || npc.type == 450 || npc.type == 451 || npc.type == 452 || - npc.type == 322 || npc.type == 323 || npc.type == 324 || npc.type == 294 || npc.type == 295 || - npc.type == 296 || npc.type == 201 || npc.type == 202 || npc.type == 20 || npc.type == 450 || - npc.type == 451 || npc.type == 452) && WorldGen.shadowOrbSmashed && Main.rand.Next(8) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("FaultyRedSteelShield")); - } - - if ((npc.type == 21 || npc.type == 449 || npc.type == 450 || npc.type == 451 || npc.type == 452 || - npc.type == 322 || npc.type == 323 || npc.type == 324 || npc.type == 294 || npc.type == 295 || - npc.type == 296 || npc.type == 201 || npc.type == 202 || npc.type == 20 || npc.type == 450 || - npc.type == 451 || npc.type == 452) && WorldGen.shadowOrbSmashed && Main.rand.Next(8) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("ChippyRedSteelSword")); - } - - if ((npc.type == 489) && Main.rand.Next(24) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, mod.ItemType("TheBrain")); - } - - if ((npc.type == 490) && Main.rand.Next(4) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("DrippingRoot")); - } - - if ((npc.aiStyle == 1) && NPC.downedMoonlord && Main.rand.Next(60) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, mod.ItemType("DarkMass")); - } - - if ((npc.type == 164 || npc.type == 165) && Main.rand.Next(5) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("SpiderMeat"), Main.rand.Next(1, 3)); - } - - if ((npc.type == 98 || npc.type == 94 || npc.type == 101 || npc.type == 170 || npc.type == 180 || - npc.type == 182) && NPC.downedMoonlord && Main.rand.Next(7) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("ClusterShard"), Main.rand.Next(1, 2)); - } - - - if ((npc.type == 175 || npc.type == 205 || npc.type == 226) && NPC.downedMoonlord && Main.rand.Next(4) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("DragonCapsule"), Main.rand.Next(1, 2)); - } - - if (npc.type == 290 && NPC.downedMoonlord && Main.rand.Next(20) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("PaladinHelmet")); - } - - if (npc.type == 290 && NPC.downedMoonlord && Main.rand.Next(20) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("PaladinBreastplate")); - } - - if (npc.type == 290 && NPC.downedMoonlord && Main.rand.Next(20) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("PaladinGreaves")); - } - - if (!Main.expertMode && npc.type == 35) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("TearsofDeath"), Main.rand.Next(1, 3)); - } - - if (npc.type == 169 && Main.rand.Next(5) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("FrostCore"), Main.rand.Next(1, 3)); - } - - if (npc.type == 431 && Main.rand.Next(8) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("FrostCore"), Main.rand.Next(1, 2)); - } - - if (npc.type == 161 && Main.rand.Next(8) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("FrostCore"), Main.rand.Next(1, 2)); - } - - if (npc.type == 477 && Main.rand.Next(4) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("BrokenHeroAmulet")); - } - - if (npc.type == 32 && Main.rand.Next(50) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("WaterStorm")); - } - - if (npc.type == 34 && Main.rand.Next(50) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("WaterStorm")); - } - - if (npc.type == 34 && Main.rand.Next(40) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("KeyKnife")); - } - - if (!Main.expertMode && npc.type == 4 && Main.rand.Next(5) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("EyeMonolith")); - } - - if (!Main.expertMode && npc.type == 4 && Main.rand.Next(3) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("MonsterTooth"), Main.rand.Next(20, 40)); - } - - if (npc.type == 167 && Main.rand.Next(32) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("NorthAxe")); - } - - if (npc.type == 167 && Main.rand.Next(32) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("NorthHammer")); - } - - if (npc.type == 167 && Main.rand.Next(32) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("NorthCutlass")); - } - - if (npc.type == 82 && Main.rand.Next(40) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("WrathofWraith")); - } - - if (npc.type == 439 && Main.rand.Next(1) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("AncientTablet"), Main.rand.Next(12, 22)); - } - - if (npc.type == 262 && Main.rand.Next(1) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("EssenseofJungle"), Main.rand.Next(2, 3)); - } - - if (npc.type == 370 && !Main.expertMode && Main.rand.Next(6) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("DukesCannon"), Main.rand.Next(2, 3)); - } - - if (npc.type == 138 && Main.rand.Next(35) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("CrystalSpear"), Main.rand.Next(2, 3)); - } - - if (npc.type == 137 && Main.rand.Next(35) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("CrystalSpear"), Main.rand.Next(2, 3)); - } - - if (npc.type == 39 && Main.rand.Next(40) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("GunBlade"), Main.rand.Next(2, 3)); - } - - if (npc.type == 346 && Main.rand.Next(1) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("SpiK3Ball"), Main.rand.Next(50, 100)); - } - - if (!NPC.downedMoonlord && (npc.type == 75 || npc.type == 86 || npc.type == 244 || npc.type == 122 || npc.type == 80 || npc.type == 527) && Main.rand.Next(50) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("UnstableCrystal")); - } - - if (npc.type == 17 && Main.rand.Next(2) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("MoneySack"), Main.rand.Next(2,4)); - } - - if (npc.type == 398) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("MultidimensionalFragment"), Main.rand.Next(6,12)); - } - - if (!Main.expertMode && npc.type == 222 && Main.rand.Next(3) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("YellowPuzzleFragment")); - } - - if ((npc.type == 381 || npc.type == 382 || npc.type == 383 || npc.type == 385 || npc.type == 386 || npc.type == 387 || npc.type == 388 || npc.type == 389 || npc.type == 390) && Main.rand.Next(100) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("WarpPad")); - } - - if ((npc.type == 273 || npc.type == 274 || npc.type == 275 || npc.type == 276 || npc.type == 269 || npc.type == 270 || npc.type == 271 || npc.type == 272 || npc.type == 277 || npc.type == 278 || npc.type == 279 || npc.type == 280 || npc.type == 283 || npc.type == 284 || npc.type == 281 || npc.type == 282 || npc.type == 285 || npc.type == 286) && Main.rand.Next(25) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("BottledSpirit")); - } - - if ((npc.type == 134 || npc.type == 125 || npc.type == 126 || npc.type == 127) && NPC.downedMechBossAny && Main.rand.Next(10) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("FlaskCore")); - } - - if (npc.type == 175 && Main.rand.Next(50) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("RichMahoganySeed")); - } - - if (!Main.expertMode && npc.type == 126 && !NPC.AnyNPCs(125) && Main.rand.Next(6) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("MechaSprayer")); - } - - if (!Main.expertMode && npc.type == 125 && !NPC.AnyNPCs(126) && Main.rand.Next(6) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("MechaSprayer")); - } - - if (npc.type == 395 && Main.rand.Next(20) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("MartianSprayer")); - } - - if (npc.type == 370 && Main.rand.Next(1) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("DukeFlask"), Main.rand.Next(550,750)); - } - - if (npc.type == 120 && Main.rand.Next(20) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("ChaosElement")); - } - - if ((npc.type == 361 || npc.type == 445) && Main.rand.Next(33) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("FrogMask")); - } - if (npc.type == 35 && Main.rand.Next(1) == 0) - { - Item.NewItem((int) npc.position.X, (int) npc.position.Y, npc.width, npc.height, - mod.ItemType("CursedSoul"), Main.rand.Next(1,5)); - } - -if (npc.type == 398) -{ -if(!TremorWorld.downedTremode) // ‘¬®âਬ ¥áâì «¨ ’६®¤ -{ - Main.NewText("Nightmares became reality!", 90, 0, 157); - Main.NewText("The moon slowly drifts towards the Earth...", 0, 255, 255); + public class TremorNPC : GlobalNPC + { + public override void NPCLoot(NPC npc) + { + + if (NPC.downedMoonlord) + { + if (npc.type == 147) + { + if (Main.rand.Next(7) == 1) + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); + } + if (npc.type == 150) + { + if (Main.rand.Next(7) == 1) + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); + } + if (npc.type == 154) + { + if (Main.rand.Next(7) == 1) + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); + } + if (npc.type == 155) + { + if (Main.rand.Next(7) == 1) + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); + } + if (npc.type == 161) + { + if (Main.rand.Next(7) == 1) + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); + } + if (npc.type == 167) + { + if (Main.rand.Next(7) == 1) + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); + + } + if (npc.type == 168) + { + if (Main.rand.Next(7) == 1) + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); + + } + if (npc.type == 169) + { + if (Main.rand.Next(7) == 1) + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); + } + if (npc.type == 184) + { + if (Main.rand.Next(7) == 1) + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); + } + if (npc.type == 185) + { + if (Main.rand.Next(7) == 1) + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); + } + if (npc.type == 197) + { + if (Main.rand.Next(7) == 1) + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); + } + if (npc.type == 206) + { + if (Main.rand.Next(7) == 1) + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); + } + if (npc.type == 431) + { + if (Main.rand.Next(7) == 1) + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("IceSoul")); + + + } + } + + if (npc.type == 77 && Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("TheRib")); + } + + if (npc.type == 110 && Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("TheRib")); + } + + if (npc.type == 483 && Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("StoneofLife")); + } + + if (npc.type == 481 && Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("StoneofLife")); + } + + if (npc.type == 140 && Main.rand.Next(25) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("PossessedHelmet")); + } + + if (npc.type == 140 && Main.rand.Next(25) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("PossessedChestplate")); + } + + if (npc.type == 140 && Main.rand.Next(25) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("PossessedGreaves")); + } + + if (!Main.expertMode && npc.type == 127 && Main.rand.Next(6) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("PrimeBlade")); + } + + if (!Main.expertMode && npc.type == 134 && Main.rand.Next(6) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("Destructor")); + } + + if (((npc.type == 381) || (npc.type == 382) || (npc.type == 383) || (npc.type == 385) || (npc.type == 386) || + (npc.type == 388) || (npc.type == 389) || (npc.type == 390) || (npc.type == 391) || (npc.type == 520)) && + Main.rand.Next(500) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("Transistor")); + } + + if (!Main.expertMode && npc.type == 113 && Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("PieceofFlesh"), Main.rand.Next(8, 17)); + } + + if (npc.type == 489 && Main.rand.Next(30) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Stigmata")); + } + + if (npc.type == 62 && Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("DemonBlood")); + } + + if (npc.type == 66 && Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("DemonBlood")); + } + + if (npc.type == 111 && Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LongBow")); + } + + if (npc.type == 127 && Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("BenderHead")); + } + + if (npc.type == 125 && Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("BenderBody")); + } + + if (npc.type == 126 && Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("BenderBody")); + } + + if (npc.type == 134 && Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("BenderLegs")); + } + + if (npc.type == 42 && Main.rand.Next(30) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("ToxicHilt")); + } + + if (npc.type == 231 && Main.rand.Next(30) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("ToxicHilt")); + } + + if (npc.type == 232 && Main.rand.Next(30) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("ToxicHilt")); + } + + if (npc.type == 233 && Main.rand.Next(30) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("ToxicHilt")); + } + + if (npc.type == 234 && Main.rand.Next(30) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("ToxicHilt")); + } + + if (npc.type == 235 && Main.rand.Next(30) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("ToxicHilt")); + } + + if (npc.type == 6 && Main.rand.Next(30) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("PiercingQuartz")); + } + + if (npc.type == 239 && Main.rand.Next(30) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("Vertebrow")); + } + + if (npc.type == 166 && Main.rand.Next(28) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("SwampClump")); + } + + if (npc.type == 469 && Main.rand.Next(28) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("LeechingSeed")); + } + + if (npc.type == 166 && Main.rand.Next(25) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("FiercePaw")); + } + + if (npc.type == 460 && Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("ButcherMask")); + } + + if (npc.type == 175 && Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("ThornBall"), Main.rand.Next(6, 15)); + } + + if (npc.type == 164 && Main.rand.Next(40) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("Arachnophobia")); + } + + if (npc.type == 165 && Main.rand.Next(40) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("Arachnophobia")); + } + + if (!TremorWorld.downedMotherboard && Main.hardMode && Main.rand.Next(2500) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("MechanicalBrain")); + } + + if (npc.type == 532 && Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("PetrifiedSpike"), Main.rand.Next(5, 10)); + } + + if (npc.type == 530 && Main.rand.Next(16) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("ScorpionStinger")); + } + + if (npc.type == 531 && Main.rand.Next(16) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("ScorpionStinger")); + } + + if (npc.type == 23 && Main.rand.Next(100) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("AncientMeteorHelmet")); + } + + if (npc.type == 346 && Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("SantaNK1Mask")); + } + + if (npc.type == 345 && Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("IceQueenMask")); + } + + if (npc.type == 344 && Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("EverscreamMask")); + } + + if (npc.type == 327 && Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("PumpkingMask")); + } + + if (npc.type == 328 && Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("PumpkingMask")); + } + + if (npc.type == 325 && Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("MourningWoodMask")); + } + + if (npc.type == 491 && Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("PirateChest")); + } + + if (!Main.expertMode && npc.type == 245 && Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("GolemCore")); + } + + if (npc.type == 124 && Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("ThrowingWrench"), Main.rand.Next(10, 20)); + } + + if (npc.type == 513 && Main.rand.Next(25) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("IonBlaster")); + } + + if (npc.type == 513 && Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("PetrifiedSpike"), Main.rand.Next(5, 10)); + } + + if ((npc.type == 3 || npc.type == 132 || npc.type == 186 || npc.type == 187 || npc.type == 188 || + npc.type == 189 || npc.type == 200 || npc.type == 132 || npc.type == 319 || npc.type == 320 || + npc.type == 321 || npc.type == 331 || npc.type == 332 || npc.type == 430 || npc.type == 432 || + npc.type == 433 || npc.type == 434 || npc.type == 435 || npc.type == 436) && Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("UntreatedFlesh")); + } + + if ((npc.type == 48 || npc.type == 75 || npc.type == 87) && Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("AirFragment")); + } + + if ((npc.type == 58 || npc.type == 65 || npc.type == 63 || npc.type == 64 || npc.type == 102 || + npc.type == 103 || npc.type == 157) && Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("SeaFragment")); + } + + if ((npc.type == 10 || npc.type == 95 || npc.type == 56 || npc.type == 153 || npc.type == 175 || + npc.type == 176 || npc.type == 205 || npc.type == 231 || npc.type == 232 || npc.type == 233 || + npc.type == 234 || npc.type == 235 || npc.type == 236 || npc.type == 237) && Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("EarthFragment")); + } + + if ((npc.type == 24 || npc.type == 59 || npc.type == 60 || npc.type == 151 || npc.type == 62 || + npc.type == 66) && Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("FireFragment")); + } + + if ((npc.type == 466 || npc.type == 467 || npc.type == 468 || npc.type == 463 || npc.type == 460) && + Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("DarkMatter"), Main.rand.Next(2, 3)); + } + + if (npc.type == 496 && Main.rand.Next(22) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("PurpleShellmet")); + } + + if (npc.type == 497 && Main.rand.Next(22) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("OrangeShellmet")); + } + + if (npc.lifeMax > 100 && npc.lifeMax < 200 && Main.rand.Next(300) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TinySai")); + } + if (npc.value > 100f && npc.value < 1000f && Main.rand.Next(300) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("RoyalClaymore")); + } + if (npc.lifeMax > 200 && npc.lifeMax < 500 && Main.rand.Next(300) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("MassiveHammer")); + } + if (npc.defense > 10 && npc.defense < 30 && Main.rand.Next(300) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Crowbar")); + } + if (npc.damage < 200 && npc.damage > 80 && Main.hardMode && Main.rand.Next(300) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Narsil")); + } + if (npc.boss == true && !Main.hardMode && Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("HeavenHelmet")); + } + if (npc.boss == true && !Main.hardMode && Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("HeavenBreastplate")); + } + if (npc.boss == true && !Main.hardMode && Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("HeavenLeggings")); + } + + + if (npc.type == 13 && Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("CorruptorStaff")); + } + + if (npc.type == 266 && Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("CreeperStaff")); + } + + if (Main.xMas && !Main.player[Main.myPlayer].HasItem(mod.ItemType("SuspiciousLookingPresent")) && + Main.rand.Next(250) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("SuspiciousLookingPresent")); + } + + if (NPC.downedMoonlord && Main.rand.Next(250) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("SuspiciousBag")); + } + + if (NPC.downedMoonlord && Main.player[Main.myPlayer].ZoneDungeon && Main.rand.Next(4) == 0) + { + if (npc.lifeMax > 200 && !Main.expertMode) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("Phantaplasm")); + } + if (npc.lifeMax > 400 && Main.expertMode) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("Phantaplasm")); + } + } + + if (npc.type == 7 && Main.rand.Next(26) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("CorruptorGun")); + } + if ((npc.type == 69 || npc.type == 508) && Main.rand.Next(6) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("AntlionShell")); + } + if (npc.type == 298 && Main.rand.Next(100) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("RedMask")); + } + + if (npc.type == 494 && Main.rand.Next(29) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("RedClaw")); + } + if (npc.type == 495 && Main.rand.Next(29) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("GreenClaw")); + } + if ((npc.type == 498 || npc.type == 499 || npc.type == 500 || npc.type == 501 || npc.type == 502 || + npc.type == 503 || npc.type == 504 || npc.type == 505 || npc.type == 506) && Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("SalamanderSkin"), Main.rand.Next(2)); + } + + if ((npc.type == 173) && Main.rand.Next(40) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("CrimCudgel")); + } + + if ((npc.type == 4) && Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("TriangleMask")); + } + + if ((npc.type == 35) && Main.rand.Next(6) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("TheArtifact")); + } + + if (Main.eclipse && NPC.downedMoonlord && Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("ToothofAbraxas")); + } + + if ((npc.type == 125 || npc.type == 126 || npc.type == 127 || npc.type == 134) && NPC.downedMoonlord && + Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("CarbonSteel"), Main.rand.Next(6, 12)); + } + + if ((npc.type == 21 || npc.type == 449 || npc.type == 450 || npc.type == 451 || npc.type == 452 || + npc.type == 322 || npc.type == 323 || npc.type == 324 || npc.type == 294 || npc.type == 295 || + npc.type == 296 || npc.type == 201 || npc.type == 202 || npc.type == 20 || npc.type == 450 || + npc.type == 451 || npc.type == 452) && WorldGen.shadowOrbSmashed && Main.rand.Next(8) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("RedSteelArmorPiece")); + } + + if ((npc.type == 21 || npc.type == 449 || npc.type == 450 || npc.type == 451 || npc.type == 452 || + npc.type == 322 || npc.type == 323 || npc.type == 324 || npc.type == 294 || npc.type == 295 || + npc.type == 296 || npc.type == 201 || npc.type == 202 || npc.type == 20 || npc.type == 450 || + npc.type == 451 || npc.type == 452) && WorldGen.shadowOrbSmashed && Main.rand.Next(8) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("FaultyRedSteelShield")); + } + + if ((npc.type == 21 || npc.type == 449 || npc.type == 450 || npc.type == 451 || npc.type == 452 || + npc.type == 322 || npc.type == 323 || npc.type == 324 || npc.type == 294 || npc.type == 295 || + npc.type == 296 || npc.type == 201 || npc.type == 202 || npc.type == 20 || npc.type == 450 || + npc.type == 451 || npc.type == 452) && WorldGen.shadowOrbSmashed && Main.rand.Next(8) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("ChippyRedSteelSword")); + } + + if ((npc.type == 489) && Main.rand.Next(24) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TheBrain")); + } + + if ((npc.type == 490) && Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("DrippingRoot")); + } + + if ((npc.aiStyle == 1) && NPC.downedMoonlord && Main.rand.Next(60) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DarkMass")); + } + + if ((npc.type == 164 || npc.type == 165) && Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("SpiderMeat"), Main.rand.Next(1, 3)); + } + + if ((npc.type == 98 || npc.type == 94 || npc.type == 101 || npc.type == 170 || npc.type == 180 || + npc.type == 182) && NPC.downedMoonlord && Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("ClusterShard"), Main.rand.Next(1, 2)); + } + + + if ((npc.type == 175 || npc.type == 205 || npc.type == 226) && NPC.downedMoonlord && Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("DragonCapsule"), Main.rand.Next(1, 2)); + } + + if (npc.type == 290 && NPC.downedMoonlord && Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("PaladinHelmet")); + } + + if (npc.type == 290 && NPC.downedMoonlord && Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("PaladinBreastplate")); + } + + if (npc.type == 290 && NPC.downedMoonlord && Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("PaladinGreaves")); + } + + if (!Main.expertMode && npc.type == 35) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("TearsofDeath"), Main.rand.Next(1, 3)); + } + + if (npc.type == 169 && Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("FrostCore"), Main.rand.Next(1, 3)); + } + + if (npc.type == 431 && Main.rand.Next(8) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("FrostCore"), Main.rand.Next(1, 2)); + } + + if (npc.type == 161 && Main.rand.Next(8) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("FrostCore"), Main.rand.Next(1, 2)); + } + + if (npc.type == 477 && Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("BrokenHeroAmulet")); + } + + if (npc.type == 32 && Main.rand.Next(50) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("WaterStorm")); + } + + if (npc.type == 34 && Main.rand.Next(50) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("WaterStorm")); + } + + if (npc.type == 34 && Main.rand.Next(40) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("KeyKnife")); + } + + if (!Main.expertMode && npc.type == 4 && Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("EyeMonolith")); + } + + if (!Main.expertMode && npc.type == 4 && Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("MonsterTooth"), Main.rand.Next(20, 40)); + } + + if (npc.type == 167 && Main.rand.Next(32) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("NorthAxe")); + } + + if (npc.type == 167 && Main.rand.Next(32) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("NorthHammer")); + } + + if (npc.type == 167 && Main.rand.Next(32) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("NorthCutlass")); + } + + if (npc.type == 82 && Main.rand.Next(40) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("WrathofWraith")); + } + + if (npc.type == 439 && Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("AncientTablet"), Main.rand.Next(12, 22)); + } + + if (npc.type == 262 && Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("EssenseofJungle"), Main.rand.Next(2, 3)); + } + + if (npc.type == 370 && !Main.expertMode && Main.rand.Next(6) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("DukesCannon"), Main.rand.Next(2, 3)); + } + + if (npc.type == 138 && Main.rand.Next(35) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("CrystalSpear"), Main.rand.Next(2, 3)); + } + + if (npc.type == 137 && Main.rand.Next(35) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("CrystalSpear"), Main.rand.Next(2, 3)); + } + + if (npc.type == 39 && Main.rand.Next(40) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("GunBlade"), Main.rand.Next(2, 3)); + } + + if (npc.type == 346 && Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("SpiK3Ball"), Main.rand.Next(50, 100)); + } + + if (!NPC.downedMoonlord && (npc.type == 75 || npc.type == 86 || npc.type == 244 || npc.type == 122 || npc.type == 80 || npc.type == 527) && Main.rand.Next(50) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("UnstableCrystal")); + } + + if (npc.type == 17 && Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("MoneySack"), Main.rand.Next(2, 4)); + } + + if (npc.type == 398) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("MultidimensionalFragment"), Main.rand.Next(6, 12)); + } + + if (!Main.expertMode && npc.type == 222 && Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("YellowPuzzleFragment")); + } + + if ((npc.type == 381 || npc.type == 382 || npc.type == 383 || npc.type == 385 || npc.type == 386 || npc.type == 387 || npc.type == 388 || npc.type == 389 || npc.type == 390) && Main.rand.Next(100) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("WarpPad")); + } + + if ((npc.type == 273 || npc.type == 274 || npc.type == 275 || npc.type == 276 || npc.type == 269 || npc.type == 270 || npc.type == 271 || npc.type == 272 || npc.type == 277 || npc.type == 278 || npc.type == 279 || npc.type == 280 || npc.type == 283 || npc.type == 284 || npc.type == 281 || npc.type == 282 || npc.type == 285 || npc.type == 286) && Main.rand.Next(25) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("BottledSpirit")); + } + + if ((npc.type == 134 || npc.type == 125 || npc.type == 126 || npc.type == 127) && NPC.downedMechBossAny && Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("FlaskCore")); + } + + if (npc.type == 175 && Main.rand.Next(50) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("RichMahoganySeed")); + } + + if (!Main.expertMode && npc.type == 126 && !NPC.AnyNPCs(125) && Main.rand.Next(6) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("MechaSprayer")); + } + + if (!Main.expertMode && npc.type == 125 && !NPC.AnyNPCs(126) && Main.rand.Next(6) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("MechaSprayer")); + } + if (npc.type == 395 && Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("MartianSprayer")); + } - for (int k = 0; k < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 6E-05); k++) - { - int i2 = WorldGen.genRand.Next(0, Main.maxTilesX); - int j2 = WorldGen.genRand.Next((int)(Main.maxTilesY * .3f), (int)(Main.maxTilesY * .45f)); - WorldGen.OreRunner(i2, j2, (double)WorldGen.genRand.Next(3, 4), WorldGen.genRand.Next(3, 8), (ushort)mod.TileType("NightmareOreTile")); - } + if (npc.type == 370 && Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("DukeFlask"), Main.rand.Next(550, 750)); + } - for (int k = 0; k < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 6E-05); k++) + if (npc.type == 120 && Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("ChaosElement")); + } + + if ((npc.type == 361 || npc.type == 445) && Main.rand.Next(33) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("FrogMask")); + } + if (npc.type == 35 && Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, + mod.ItemType("CursedSoul"), Main.rand.Next(1, 5)); + } + + if (npc.type == 398) + { + if (!TremorWorld.downedTremode) // ‘¬®âਬ ¥áâì «¨ ’६®¤ { - float value = (float)((double)k / ((double)(Main.maxTilesX * Main.maxTilesY) * 2E-05)); - bool flag2 = false; - int num = 0; - while (!flag2) + Main.NewText("Nightmares became reality!", 90, 0, 157); + Main.NewText("The moon slowly drifts towards the Earth...", 0, 255, 255); + + + for (int k = 0; k < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 6E-05); k++) { - if (TremorWorld.AddLunarRoots(WorldGen.genRand.Next(100, Main.maxTilesX + 120), WorldGen.genRand.Next((int)(WorldGen.worldSurfaceHigh + 20.0), Main.maxTilesY - 300))) - { - flag2 = true; - } - else + int i2 = WorldGen.genRand.Next(0, Main.maxTilesX); + int j2 = WorldGen.genRand.Next((int)(Main.maxTilesY * .3f), (int)(Main.maxTilesY * .45f)); + WorldGen.OreRunner(i2, j2, (double)WorldGen.genRand.Next(3, 4), WorldGen.genRand.Next(3, 8), (ushort)mod.TileType("NightmareOreTile")); + } + + for (int k = 0; k < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 6E-05); k++) + { + float value = (float)((double)k / ((double)(Main.maxTilesX * Main.maxTilesY) * 2E-05)); + bool flag2 = false; + int num = 0; + while (!flag2) { - num++; - if (num >= 10000) + if (TremorWorld.AddLunarRoots(WorldGen.genRand.Next(100, Main.maxTilesX + 120), WorldGen.genRand.Next((int)(WorldGen.worldSurfaceHigh + 20.0), Main.maxTilesY - 300))) { flag2 = true; } + else + { + num++; + if (num >= 10000) + { + flag2 = true; + } + } } } - } - TremorWorld.downedTremode = true; // ‚àã¡ ¥¬ ’६®¤ -} -} + TremorWorld.downedTremode = true; // ‚àã¡ ¥¬ ’६®¤ + } + } - } + } public override void SetupShop(int type, Chest shop, ref int nextSlot) { @@ -933,85 +933,85 @@ public override void SetupShop(int type, Chest shop, ref int nextSlot) } - public override void SetDefaults(NPC npc) - { - if (npc.type == 46) - { - npc.lifeMax = 10; - } - - if (npc.type == 140) - { - npc.lifeMax = 280; - } - - if (npc.type == 82) - { - npc.lifeMax = 200; - } - - if (npc.type == 141) - { - npc.lifeMax = 175; - } - - if (npc.type == 45) - { - npc.lifeMax = 250; - } - - if (npc.type == 58) - { - npc.lifeMax = 35; - } - - if (npc.type == 49) - { - npc.lifeMax = 22; - } - - if (npc.type == 93) - { - npc.lifeMax = 150; - } - - if (npc.type == 77) - { - npc.lifeMax = 300; - } - - if (npc.type == 110) - { - npc.lifeMax = 250; - } - - if (npc.type == 63 && Main.hardMode) - { - npc.catchItem = 2436; - } - - if (npc.type == 103 && Main.hardMode) - { - npc.catchItem = 2437; - } - - if (npc.type == 64 && Main.hardMode) - { - npc.catchItem = 2438; - } - -//if(Main.player[Main.myPlayer].FindBuffIndex(mod.BuffType("CursedCoinBuff")) != -1 && Main.rand.Next(50) == 0) -//{ -//npc.color = new Color(255, 255, 0, 100); -//npc.displayName = ("Luxuriant "+npc.displayName); -//npc.value = (float)(npc.value * 10f); -//} - - if (NPC.downedMoonlord && npc.boss == false && npc.townNPC == false && npc.type >= 0 && npc.type <= 579) - { - npc.lifeMax = npc.lifeMax*2; - npc.defense = npc.defense*2; - } - } - } + public override void SetDefaults(NPC npc) + { + if (npc.type == 46) + { + npc.lifeMax = 10; + } + + if (npc.type == 140) + { + npc.lifeMax = 280; + } + + if (npc.type == 82) + { + npc.lifeMax = 200; + } + + if (npc.type == 141) + { + npc.lifeMax = 175; + } + + if (npc.type == 45) + { + npc.lifeMax = 250; + } + + if (npc.type == 58) + { + npc.lifeMax = 35; + } + + if (npc.type == 49) + { + npc.lifeMax = 22; + } + + if (npc.type == 93) + { + npc.lifeMax = 150; + } + + if (npc.type == 77) + { + npc.lifeMax = 300; + } + + if (npc.type == 110) + { + npc.lifeMax = 250; + } + + if (npc.type == 63 && Main.hardMode) + { + npc.catchItem = 2436; + } + + if (npc.type == 103 && Main.hardMode) + { + npc.catchItem = 2437; + } + + if (npc.type == 64 && Main.hardMode) + { + npc.catchItem = 2438; + } + + //if(Main.player[Main.myPlayer].FindBuffIndex(mod.BuffType("CursedCoinBuff")) != -1 && Main.rand.Next(50) == 0) + //{ + //npc.color = new Color(255, 255, 0, 100); + //npc.displayName = ("Luxuriant "+npc.displayName); + //npc.value = (float)(npc.value * 10f); + //} + + if (NPC.downedMoonlord && npc.boss == false && npc.townNPC == false && npc.type >= 0 && npc.type <= 579) + { + npc.lifeMax = npc.lifeMax * 2; + npc.defense = npc.defense * 2; + } + } + } } \ No newline at end of file diff --git a/NPCs/TwilightBat.cs b/NPCs/TwilightBat.cs index e75296cb..77e41bda 100644 --- a/NPCs/TwilightBat.cs +++ b/NPCs/TwilightBat.cs @@ -6,78 +6,80 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class TwilightBat : ModNPC +namespace Tremor.NPCs { + + public class TwilightBat : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Twilight Bat"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 1200; - npc.damage = 110; - npc.defense = 20; - npc.knockBackResist = 0.3f; - npc.width = 56; - npc.height = 48; - animationType = 93; - npc.aiStyle = 14; - npc.npcSlots = 0.2f; - npc.HitSound = SoundID.NPCHit1; - npc.noGravity = true; - npc.DeathSound = SoundID.NPCDeath4; - npc.value = Item.buyPrice(0, 0, 6, 9); - banner = npc.type; - bannerItem = mod.ItemType("TwilightBatBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 1200; + npc.damage = 110; + npc.defense = 20; + npc.knockBackResist = 0.3f; + npc.width = 56; + npc.height = 48; + animationType = 93; + npc.aiStyle = 14; + npc.npcSlots = 0.2f; + npc.HitSound = SoundID.NPCHit1; + npc.noGravity = true; + npc.DeathSound = SoundID.NPCDeath4; + npc.value = Item.buyPrice(0, 0, 6, 9); + banner = npc.type; + bannerItem = mod.ItemType("TwilightBatBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("NightmareOre")); - } - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("NightmareOre")); + } + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TwilightGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TwilightGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TwilightGore2"), 1f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2f); - Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TwilightGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TwilightGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TwilightGore2"), 1f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 2f); + Dust.NewDust(npc.position, npc.width, npc.height, 27, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 3f); + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.02f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedMoonlord && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.02f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/UndeadArchaeologist.cs b/NPCs/UndeadArchaeologist.cs index d00275d3..0612b9f7 100644 --- a/NPCs/UndeadArchaeologist.cs +++ b/NPCs/UndeadArchaeologist.cs @@ -9,62 +9,62 @@ namespace Tremor.NPCs { - public class UndeadArchaeologist : ModNPC - { + public class UndeadArchaeologist : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Undead Archaeologist"); Main.npcFrameCount[npc.type] = 15; } - - public override void SetDefaults() - { - npc.lifeMax = 150; - npc.damage = 20; - npc.defense = 10; - npc.knockBackResist = 0.3f; - npc.width = 36; - npc.height = 44; - animationType = 21; - npc.aiStyle = 3; - npc.npcSlots = 0.5f; - aiType = 29; - npc.HitSound = SoundID.NPCHit2; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 6, 9); - banner = npc.type; - bannerItem = mod.ItemType("UndeadArchaeologistBanner"); - } + public override void SetDefaults() + { + npc.lifeMax = 150; + npc.damage = 20; + npc.defense = 10; + npc.knockBackResist = 0.3f; + npc.width = 36; + npc.height = 44; + animationType = 21; + npc.aiStyle = 3; + npc.npcSlots = 0.5f; + aiType = 29; + npc.HitSound = SoundID.NPCHit2; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 0, 6, 9); + banner = npc.type; + bannerItem = mod.ItemType("UndeadArchaeologistBanner"); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UAG1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UAG2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UAG2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UAG3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UAG3"), 1f); - } -} - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UAG1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UAG2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UAG2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UAG3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UAG3"), 1f); + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && !Main.dayTime && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDesert ? 0.01f : 0f; - } - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && !Main.dayTime && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDesert ? 0.01f : 0f; + } + } } \ No newline at end of file diff --git a/NPCs/UndeadArchaeologist2.cs b/NPCs/UndeadArchaeologist2.cs index 25c0b076..500afd80 100644 --- a/NPCs/UndeadArchaeologist2.cs +++ b/NPCs/UndeadArchaeologist2.cs @@ -9,66 +9,66 @@ namespace Tremor.NPCs { - public class UndeadArchaeologist2 : ModNPC - { + public class UndeadArchaeologist2 : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Undead Archaeologist"); Main.npcFrameCount[npc.type] = 15; } - - public override void SetDefaults() - { - npc.lifeMax = 150; - npc.damage = 27; - npc.defense = 14; - npc.knockBackResist = 0.3f; - npc.width = 36; - npc.height = 44; - animationType = 21; - npc.aiStyle = 3; - npc.npcSlots = 0.5f; - aiType = 77; - npc.HitSound = SoundID.NPCHit2; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 6, 9); - banner = npc.type; - bannerItem = mod.ItemType("UndeadArchaeologistBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 150; + npc.damage = 27; + npc.defense = 14; + npc.knockBackResist = 0.3f; + npc.width = 36; + npc.height = 44; + animationType = 21; + npc.aiStyle = 3; + npc.npcSlots = 0.5f; + aiType = 77; + npc.HitSound = SoundID.NPCHit2; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 0, 6, 9); + banner = npc.type; + bannerItem = mod.ItemType("UndeadArchaeologistBanner"); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UAG4"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UAG2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UAG2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UAG3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UAG3"), 1f); - } -} + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 5, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UAG4"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UAG2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UAG2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UAG3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UAG3"), 1f); + } + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) - { + { - int x = spawnInfo.spawnTileX; + int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; + int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; + int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && !Main.dayTime && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDesert ? 0.04f : 0f; - } - } + return (Tremor.NormalSpawn(spawnInfo) && !Main.dayTime && Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneDesert ? 0.04f : 0f; + } + } } \ No newline at end of file diff --git a/NPCs/UndeadMusketeer.cs b/NPCs/UndeadMusketeer.cs index b142992f..80965ed3 100644 --- a/NPCs/UndeadMusketeer.cs +++ b/NPCs/UndeadMusketeer.cs @@ -6,80 +6,82 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class UndeadMusketeer : ModNPC +namespace Tremor.NPCs { + + public class UndeadMusketeer : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Undead Musketeer"); Main.npcFrameCount[npc.type] = 3; } - - public override void SetDefaults() - { - npc.lifeMax = 220; - npc.damage = 50; - npc.defense = 16; - npc.knockBackResist = 0.3f; - npc.width = 34; - npc.height = 46; -animationType = 3; - npc.aiStyle = 3; - npc.npcSlots = 2f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 1, 0); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 220; + npc.damage = 50; + npc.defense = 16; + npc.knockBackResist = 0.3f; + npc.width = 34; + npc.height = 46; + animationType = 3; + npc.aiStyle = 3; + npc.npcSlots = 2f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 0, 1, 0); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieMusketeerGore"), 1f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZombieMusketeerGore"), 1f); + } + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(22) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MusketeerHat")); - }; - if(Main.rand.Next(25) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FencingRapier")); - }; - if(Main.rand.Next(28) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BlunderBuss")); - }; - } - } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedBoss2 && !Main.dayTime && y < Main.worldSurface ? 0.02f : 0f; - } -}} \ No newline at end of file + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(22) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MusketeerHat")); + }; + if (Main.rand.Next(25) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FencingRapier")); + }; + if (Main.rand.Next(28) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BlunderBuss")); + }; + } + } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedBoss2 && !Main.dayTime && y < Main.worldSurface ? 0.02f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/UndeadWarlock.cs b/NPCs/UndeadWarlock.cs index 2f464c03..b953b782 100644 --- a/NPCs/UndeadWarlock.cs +++ b/NPCs/UndeadWarlock.cs @@ -6,98 +6,100 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class UndeadWarlock : ModNPC +namespace Tremor.NPCs { + + public class UndeadWarlock : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Undead Warlock"); Main.npcFrameCount[npc.type] = 15; } - - const int ShootRate = 250; // — áâ®â  ¢ëáâ५  - const int ShootDamage = 20; // “à®­ ®â « §¥à . - const float ShootKN = 1.0f; // Žâ¡à á뢠­¨¥ - const int ShootType = 96; // ’¨¯ ¯à®¤¦¥ªâ ©«  ª®â®àë¬ ¡ã¤¥â ¯à®¨§¢¥¤ñ­ ¢ëáâ५. - const float ShootSpeed = 4; // â®, ï â ª ¯®­¨¬ î, ¢«¨ï¥â ­  ¤ «ì­®áâì ¢ëáâ५  - int TimeToShoot = ShootRate; // ‚à¥¬ï ¤® ¢ëáâ५ . + const int ShootRate = 250; // — áâ®â  ¢ëáâ५  + const int ShootDamage = 20; // “à®­ ®â « §¥à . + const float ShootKN = 1.0f; // Žâ¡à á뢠­¨¥ + const int ShootType = 96; // ’¨¯ ¯à®¤¦¥ªâ ©«  ª®â®àë¬ ¡ã¤¥â ¯à®¨§¢¥¤ñ­ ¢ëáâ५. + const float ShootSpeed = 4; // â®, ï â ª ¯®­¨¬ î, ¢«¨ï¥â ­  ¤ «ì­®áâì ¢ëáâ५  - public override void SetDefaults() - { - npc.width = 28; - npc.height = 46; - npc.damage = 20; - npc.defense = 11; - npc.lifeMax = 340; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 3, 6, 2); - npc.knockBackResist = 1f; - npc.aiStyle = 3; - aiType = 524; - animationType = 21; - } + int TimeToShoot = ShootRate; // ‚à¥¬ï ¤® ¢ëáâ५ . - public override void AI() - { - if (--TimeToShoot <= 0 && npc.target != -1) Shoot(); // ‚ í⮩ áâப¥ ¨§ ¯¥à¥¬¥­­®© TimeToShot ®â­¨¬ ¥âáï 1, ¨ ¥á«¨ TimeToShot < ¨«¨ = 0, â® ¢ë§ë¢ ¥âáï ¬¥â®¤ Shoot() + public override void SetDefaults() + { + npc.width = 28; + npc.height = 46; + npc.damage = 20; + npc.defense = 11; + npc.lifeMax = 340; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 3, 6, 2); + npc.knockBackResist = 1f; + npc.aiStyle = 3; + aiType = 524; + animationType = 21; + } - if(Main.rand.Next(210) == 0) - { - NPC.NewNPC((int)npc.position.X + 50, (int)npc.position.Y, 34); - } + public override void AI() + { + if (--TimeToShoot <= 0 && npc.target != -1) Shoot(); // ‚ í⮩ áâப¥ ¨§ ¯¥à¥¬¥­­®© TimeToShot ®â­¨¬ ¥âáï 1, ¨ ¥á«¨ TimeToShot < ¨«¨ = 0, â® ¢ë§ë¢ ¥âáï ¬¥â®¤ Shoot() - for (int num74 = npc.oldPos.Length - 1; num74 > 0; num74--) - { - npc.oldPos[num74] = npc.oldPos[num74 - 1]; - } - npc.oldPos[0] = npc.position; - } + if (Main.rand.Next(210) == 0) + { + NPC.NewNPC((int)npc.position.X + 50, (int)npc.position.Y, 34); + } - void Shoot() - { - TimeToShoot = ShootRate; // “áâ ­ ¢«¨¢ ¥¬ ªã«¤ ã­ ¢ëáâ५ã - Vector2 velocity = VelocityFPTP(npc.Center, Main.player[npc.target].Center, ShootSpeed); // ’ãâ ¬ë ¯®«ã稬 ­ã¦­ãî velocity (¯®ïá­¥­¨¥  à£ã¬¥­â®¢ ­¨¦¥) - // 1  à£ã¬¥­â - ¯®§¨æ¨ï ¨§ ª®â®à®© ¡ã¤¥â ¢ë«¥â âì ¢ëáâ५ - // 2  à£ã¬¥­â - ¯®§¨æ¨ï ¢ ª®â®àãî ®­ ¤®«¦¥­ ¯®«¥â¥âì - // 3  à£ã¬¥­â - ᪮à®áâì ¢ëáâ५  - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, velocity.X, velocity.Y, ShootType, ShootDamage, ShootKN); - } + for (int num74 = npc.oldPos.Length - 1; num74 > 0; num74--) + { + npc.oldPos[num74] = npc.oldPos[num74 - 1]; + } + npc.oldPos[0] = npc.position; + } + + void Shoot() + { + TimeToShoot = ShootRate; // “áâ ­ ¢«¨¢ ¥¬ ªã«¤ ã­ ¢ëáâ५ã + Vector2 velocity = VelocityFPTP(npc.Center, Main.player[npc.target].Center, ShootSpeed); // ’ãâ ¬ë ¯®«ã稬 ­ã¦­ãî velocity (¯®ïá­¥­¨¥  à£ã¬¥­â®¢ ­¨¦¥) + // 1  à£ã¬¥­â - ¯®§¨æ¨ï ¨§ ª®â®à®© ¡ã¤¥â ¢ë«¥â âì ¢ëáâ५ + // 2  à£ã¬¥­â - ¯®§¨æ¨ï ¢ ª®â®àãî ®­ ¤®«¦¥­ ¯®«¥â¥âì + // 3  à£ã¬¥­â - ᪮à®áâì ¢ëáâ५  + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, velocity.X, velocity.Y, ShootType, ShootDamage, ShootKN); + } - Vector2 VelocityFPTP(Vector2 pos1, Vector2 pos2, float speed) - { - Vector2 move = pos2 - pos1; - return move * (speed / (float)System.Math.Sqrt(move.X * move.X + move.Y * move.Y)); - } + Vector2 VelocityFPTP(Vector2 pos1, Vector2 pos2, float speed) + { + Vector2 move = pos2 - pos1; + return move * (speed / (float)System.Math.Sqrt(move.X * move.X + move.Y * move.Y)); + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UWGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UWGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UWGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UWGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UWGore3"), 1f); - } -} + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UWGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UWGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UWGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UWGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UWGore3"), 1f); + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedBoss3 && !Main.dayTime && y < Main.worldSurface ? 0.008f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && NPC.downedBoss3 && !Main.dayTime && y < Main.worldSurface ? 0.008f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/UndeadWarrior1.cs b/NPCs/UndeadWarrior1.cs index e32da966..034e5ecf 100644 --- a/NPCs/UndeadWarrior1.cs +++ b/NPCs/UndeadWarrior1.cs @@ -6,83 +6,85 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class UndeadWarrior1 : ModNPC +namespace Tremor.NPCs { + + public class UndeadWarrior1 : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Undead Warrior"); Main.npcFrameCount[npc.type] = 15; } - - public override void SetDefaults() - { - npc.lifeMax = 100; - npc.damage = 16; - npc.defense = 4; - npc.knockBackResist = 0.3f; - npc.width = 36; - npc.height = 44; -animationType = 21; - npc.aiStyle = 3; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit2; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 4, 7); - banner = npc.type; - bannerItem = mod.ItemType("UndeadWarriorBanner"); - } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadWarrior1Gore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadWarrior1Gore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); - } -} + public override void SetDefaults() + { + npc.lifeMax = 100; + npc.damage = 16; + npc.defense = 4; + npc.knockBackResist = 0.3f; + npc.width = 36; + npc.height = 44; + animationType = 21; + npc.aiStyle = 3; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit2; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 0, 4, 7); + banner = npc.type; + bannerItem = mod.ItemType("UndeadWarriorBanner"); + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadWarrior1Gore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadWarrior1Gore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); + } + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MeltedInvarSword")); - }; - if(Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrokenInvarShield")); - }; - if(Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OldInvarPlate")); - }; - if(Main.rand.Next(30) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TornPapyrus")); - }; - } - } + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MeltedInvarSword")); + }; + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrokenInvarShield")); + }; + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OldInvarPlate")); + }; + if (Main.rand.Next(30) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TornPapyrus")); + }; + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && y < Main.worldSurface ? 0.05f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && y < Main.worldSurface ? 0.05f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/UndeadWarrior2.cs b/NPCs/UndeadWarrior2.cs index 6edb9a29..7bd4528d 100644 --- a/NPCs/UndeadWarrior2.cs +++ b/NPCs/UndeadWarrior2.cs @@ -6,83 +6,85 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class UndeadWarrior2 : ModNPC +namespace Tremor.NPCs { + + public class UndeadWarrior2 : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Undead Warrior"); Main.npcFrameCount[npc.type] = 15; } - - public override void SetDefaults() - { - npc.lifeMax = 90; - npc.damage = 16; - npc.defense = 4; - npc.knockBackResist = 0.3f; - npc.width = 36; - npc.height = 44; -animationType = 21; - npc.aiStyle = 3; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit2; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 3, 7); - banner = npc.type; - bannerItem = mod.ItemType("UndeadWarriorBanner"); - } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadWarrior2Gore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadWarrior2Gore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); - } -} + public override void SetDefaults() + { + npc.lifeMax = 90; + npc.damage = 16; + npc.defense = 4; + npc.knockBackResist = 0.3f; + npc.width = 36; + npc.height = 44; + animationType = 21; + npc.aiStyle = 3; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit2; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 0, 3, 7); + banner = npc.type; + bannerItem = mod.ItemType("UndeadWarriorBanner"); + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadWarrior2Gore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadWarrior2Gore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); + } + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MeltedInvarSword")); - }; - if(Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrokenInvarShield")); - }; - if(Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OldInvarPlate")); - }; - if(Main.rand.Next(30) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TornPapyrus")); - }; - } - } + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MeltedInvarSword")); + }; + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrokenInvarShield")); + }; + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OldInvarPlate")); + }; + if (Main.rand.Next(30) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TornPapyrus")); + }; + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && y < Main.worldSurface ? 0.05f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && y < Main.worldSurface ? 0.05f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/UndeadWarrior3.cs b/NPCs/UndeadWarrior3.cs index b9087828..9c69b5cd 100644 --- a/NPCs/UndeadWarrior3.cs +++ b/NPCs/UndeadWarrior3.cs @@ -6,82 +6,84 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class UndeadWarrior3 : ModNPC +namespace Tremor.NPCs { + + public class UndeadWarrior3 : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Undead Warrior"); Main.npcFrameCount[npc.type] = 15; } - - public override void SetDefaults() - { - npc.lifeMax = 90; - npc.damage = 16; - npc.defense = 4; - npc.knockBackResist = 0.3f; - npc.width = 36; - npc.height = 44; -animationType = 21; - npc.aiStyle = 3; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit2; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 3, 7); - banner = npc.type; - bannerItem = mod.ItemType("UndeadWarriorBanner"); - } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadWarrior3Gore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadWarrior3Gore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); - } -} + public override void SetDefaults() + { + npc.lifeMax = 90; + npc.damage = 16; + npc.defense = 4; + npc.knockBackResist = 0.3f; + npc.width = 36; + npc.height = 44; + animationType = 21; + npc.aiStyle = 3; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit2; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 0, 3, 7); + banner = npc.type; + bannerItem = mod.ItemType("UndeadWarriorBanner"); + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadWarrior3Gore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadWarrior3Gore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); + } + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MeltedInvarSword")); - }; - if(Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrokenInvarShield")); - }; - if(Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OldInvarPlate")); - }; - if(Main.rand.Next(30) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TornPapyrus")); - }; - } - } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && y < Main.worldSurface ? 0.08f : 0f; - } -}} \ No newline at end of file + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MeltedInvarSword")); + }; + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrokenInvarShield")); + }; + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OldInvarPlate")); + }; + if (Main.rand.Next(30) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TornPapyrus")); + }; + } + } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && y < Main.worldSurface ? 0.08f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/UndeadWarrior4.cs b/NPCs/UndeadWarrior4.cs index 34682dc4..2f7ecd49 100644 --- a/NPCs/UndeadWarrior4.cs +++ b/NPCs/UndeadWarrior4.cs @@ -6,83 +6,85 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class UndeadWarrior4 : ModNPC +namespace Tremor.NPCs { + + public class UndeadWarrior4 : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Undead Warrior"); Main.npcFrameCount[npc.type] = 15; } - - public override void SetDefaults() - { - npc.lifeMax = 80; - npc.damage = 16; - npc.defense = 4; - npc.knockBackResist = 0.3f; - npc.width = 36; - npc.height = 44; -animationType = 21; - npc.aiStyle = 3; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit2; - npc.DeathSound = SoundID.NPCDeath2; - npc.value = Item.buyPrice(0, 0, 3, 7); - banner = npc.type; - bannerItem = mod.ItemType("UndeadWarriorBanner"); - } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadWarrior4Gore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadWarrior4Gore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); - } -} + public override void SetDefaults() + { + npc.lifeMax = 80; + npc.damage = 16; + npc.defense = 4; + npc.knockBackResist = 0.3f; + npc.width = 36; + npc.height = 44; + animationType = 21; + npc.aiStyle = 3; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit2; + npc.DeathSound = SoundID.NPCDeath2; + npc.value = Item.buyPrice(0, 0, 3, 7); + banner = npc.type; + bannerItem = mod.ItemType("UndeadWarriorBanner"); + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadWarrior4Gore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadWarrior4Gore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/UndeadGore2"), 1f); + } + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MeltedInvarSword")); - }; - if(Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrokenInvarShield")); - }; - if(Main.rand.Next(5) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OldInvarPlate")); - }; - if(Main.rand.Next(30) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TornPapyrus")); - }; - } - } + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MeltedInvarSword")); + }; + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrokenInvarShield")); + }; + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OldInvarPlate")); + }; + if (Main.rand.Next(30) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("TornPapyrus")); + }; + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && y < Main.worldSurface ? 0.1f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && y < Main.worldSurface ? 0.1f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/Undertaker.cs b/NPCs/Undertaker.cs index c30f021d..e032ff9a 100644 --- a/NPCs/Undertaker.cs +++ b/NPCs/Undertaker.cs @@ -6,11 +6,12 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -[AutoloadHead] -public class Undertaker : ModNPC +namespace Tremor.NPCs { + + [AutoloadHead] + public class Undertaker : ModNPC + { public override string Texture { get @@ -18,14 +19,14 @@ public override string Texture return "Tremor/NPCs/Undertaker"; } } - + public override string[] AltTextures { get { - return new string[] { "Tremor/NPCs/Undertaker"}; + return new string[] { "Tremor/NPCs/Undertaker" }; } - } + } public override bool Autoload(ref string name) { @@ -44,137 +45,138 @@ public override void SetStaticDefaults() NPCID.Sets.AttackTime[npc.type] = 30; NPCID.Sets.AttackAverageChance[npc.type] = 30; } - public override void SetDefaults() - { - npc.townNPC = true; - npc.friendly = true; - npc.width = 30; - npc.height = 44; - npc.aiStyle = 7; - npc.damage = 10; - npc.defense = 15; - npc.lifeMax = 250; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.knockBackResist = 0.5f; - animationType = NPCID.Guide; - } - - public override bool CanTownNPCSpawn(int numTownNPCs, int money) - { - if(TremorWorld.downedTrinity) - { - return true; - } + public override void SetDefaults() + { + npc.townNPC = true; + npc.friendly = true; + npc.width = 30; + npc.height = 44; + npc.aiStyle = 7; + npc.damage = 10; + npc.defense = 15; + npc.lifeMax = 250; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.knockBackResist = 0.5f; + animationType = NPCID.Guide; + } + + public override bool CanTownNPCSpawn(int numTownNPCs, int money) + { + if (TremorWorld.downedTrinity) + { + return true; + } return false; - } - - - public override string TownNPCName() - { - switch(WorldGen.genRand.Next(5)) - { - case 0: - return "Tenner"; - case 1: - return "Geyer"; - case 2: - return "Cleve"; - case 3: - return "Ferron"; - case 4: - return "Gasper"; - case 5: - return "Spots"; - default: - return "Hargon"; - } - } - - public override string GetChat() - { - switch(Main.rand.Next(6)) - { - case 0: - return "Don't worry. Nobody will get out of the coffin that I have made."; - case 1: - return "Are you afraid of ghosts? I'm not. But the ghosts are afraid of me."; - case 2: - return "If you need some help then feel free to ask me. I have a lot of undead things on my side."; - case 3: - return "What will you prefer to do if this day will be your last day?"; - case 4: - return "Our life is a challenge. To make it easier - buy my stuff."; - case 5: - return "Don't worry. I'm not a vampire even my eyes are red and my skin is of a strange color."; - default: - return "Do you prefer blood or tomato juice?"; - } - } - - public override void SetChatButtons(ref string button, ref string button2) - { - button = Lang.inter[28].Value; - } - - public override void OnChatButtonClicked(bool firstButton, ref bool shop) - { - if(firstButton) - { - shop = true; - } - } - - public override void SetupShop(Chest shop, ref int nextSlot) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("Skullheart")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("SpearofJustice")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("TheGhostClaymore")); - nextSlot++; - if(!Main.dayTime) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("LivingTombstone")); - nextSlot++; - } - } - - public override void TownNPCAttackStrength(ref int damage, ref float knockback) - { - damage = 150; - knockback = 4f; - } - - public override void TownNPCAttackCooldown(ref int cooldown, ref int randExtraCooldown) - { - cooldown = 10; - randExtraCooldown = 10; - } - - public override void TownNPCAttackProj(ref int projType, ref int attackDelay) - { - projType = 645; - attackDelay = 5; - } - - public override void TownNPCAttackProjSpeed(ref float multiplier, ref float gravityCorrection, ref float randomOffset) - { - multiplier = 12f; - randomOffset = 2f; - } - - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TheUndertakerGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TheUndertakerGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TheUndertakerGore3"), 1f); - } -} -}} \ No newline at end of file + } + + + public override string TownNPCName() + { + switch (WorldGen.genRand.Next(5)) + { + case 0: + return "Tenner"; + case 1: + return "Geyer"; + case 2: + return "Cleve"; + case 3: + return "Ferron"; + case 4: + return "Gasper"; + case 5: + return "Spots"; + default: + return "Hargon"; + } + } + + public override string GetChat() + { + switch (Main.rand.Next(6)) + { + case 0: + return "Don't worry. Nobody will get out of the coffin that I have made."; + case 1: + return "Are you afraid of ghosts? I'm not. But the ghosts are afraid of me."; + case 2: + return "If you need some help then feel free to ask me. I have a lot of undead things on my side."; + case 3: + return "What will you prefer to do if this day will be your last day?"; + case 4: + return "Our life is a challenge. To make it easier - buy my stuff."; + case 5: + return "Don't worry. I'm not a vampire even my eyes are red and my skin is of a strange color."; + default: + return "Do you prefer blood or tomato juice?"; + } + } + + public override void SetChatButtons(ref string button, ref string button2) + { + button = Lang.inter[28].Value; + } + + public override void OnChatButtonClicked(bool firstButton, ref bool shop) + { + if (firstButton) + { + shop = true; + } + } + + public override void SetupShop(Chest shop, ref int nextSlot) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("Skullheart")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("SpearofJustice")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("TheGhostClaymore")); + nextSlot++; + if (!Main.dayTime) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("LivingTombstone")); + nextSlot++; + } + } + + public override void TownNPCAttackStrength(ref int damage, ref float knockback) + { + damage = 150; + knockback = 4f; + } + + public override void TownNPCAttackCooldown(ref int cooldown, ref int randExtraCooldown) + { + cooldown = 10; + randExtraCooldown = 10; + } + + public override void TownNPCAttackProj(ref int projType, ref int attackDelay) + { + projType = 645; + attackDelay = 5; + } + + public override void TownNPCAttackProjSpeed(ref float multiplier, ref float gravityCorrection, ref float randomOffset) + { + multiplier = 12f; + randomOffset = 2f; + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TheUndertakerGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TheUndertakerGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TheUndertakerGore3"), 1f); + } + } + } +} \ No newline at end of file diff --git a/NPCs/WallOfShadow.cs b/NPCs/WallOfShadow.cs index 7d84166a..127ad604 100644 --- a/NPCs/WallOfShadow.cs +++ b/NPCs/WallOfShadow.cs @@ -14,978 +14,978 @@ namespace Tremor.NPCs { [AutoloadBossHead] - public class WallOfShadow : ModNPC - { - #region "Êîíñòàíòû" - const int AnimationRate = 8; // ×àñòîòà ñìåíû êàäðîâ (Òî, ñêîëüêî êàäðîâ íå áóäåò ñìåíÿòñÿ êàäð) - const int FrameCount = 4; // Êîë-âî êàäðîâ - - const int ShootRate = 70; // ×àñòîòà âûñòðåëà. Áóäåò ïðîèçâîäèòü 60/ShootRate âûñòðåëîâ â ñåêóíäó - const int ShootDamage = 15; // Óðîí îò âûñòðåëà - int ShootType; // Òèï âûñòðåëà (çàäà¸òñÿ â SetDefaults()) - const float ShootKnockback = 1; // Îòáðàñîâàíèå îò âûñòðåëà - float ShootSpeed = 20; // Ñêîðîñòü âûñòðåëà - - const float DistortPercent = 0.15f; // Ïðîöåíò äåôîðìàöèè ñòàòîâ (íåòî÷íîñòè) (1.0 == 100%) - - const int MinionsID = 61; // ID âóðòóëåê - const int MinionsCount = 4; // Êîë-âî âóðòóëåê êîòîðûõ çàñïàâíèò - - const int StateTime_Flying = 600; // Ñêîëüêî áóäåò ëåòàòü â âîçäóõå äî ïðèçûâà ìèíüîíîâ - const int StateTime_Minions = 120; // Ñêîëüêî âðåìåíè áóäåò ñïàâíèòü âóðòóëåê - - const int FlyingAI = 2; - const int MinionsAI = 0; - - const float MinionsState_XDeaccelerationPower = 0.05f; // Ñêîðîñòü çàìåäëåíèÿ ïî X - const float MinionsState_YMaxSpeed = 2.80f; // Ìàêñ. ñêîðîñòü âçë¸òà âî âðåìÿ ñïàâíà ìèíüîíîâ - const float MinionsStete_YSpeedStep = 0.02f; // Ñêîðîñòü óâåëè÷åíèÿ ñêîðîñòè ïî Y âî âðåìÿ ñïàâíà ìèíüîíîâ - - const int States = 2; - #endregion - - #region "Ïåðåìåííûå" - int TimeToAnimation = AnimationRate; - int Frame = 0; - bool Shoots = true; - int TimeToShoot = ShootRate; - int State = 0; - int TimeToState = StateTime_Flying; - bool runAway = false; - #endregion - - int MagicBoltCooldown - { - get { return (int)npc.ai[2]; } - set { npc.ai[2] = value; } - } - - int LaserCooldown - { - get { return (int)npc.ai[0]; } - set { npc.ai[0] = value; } - } - + public class WallOfShadow : ModNPC + { + #region "Êîíñòàíòû" + const int AnimationRate = 8; // ×àñòîòà ñìåíû êàäðîâ (Òî, ñêîëüêî êàäðîâ íå áóäåò ñìåíÿòñÿ êàäð) + const int FrameCount = 4; // Êîë-âî êàäðîâ + + const int ShootRate = 70; // ×àñòîòà âûñòðåëà. Áóäåò ïðîèçâîäèòü 60/ShootRate âûñòðåëîâ â ñåêóíäó + const int ShootDamage = 15; // Óðîí îò âûñòðåëà + int ShootType; // Òèï âûñòðåëà (çàäà¸òñÿ â SetDefaults()) + const float ShootKnockback = 1; // Îòáðàñîâàíèå îò âûñòðåëà + float ShootSpeed = 20; // Ñêîðîñòü âûñòðåëà + + const float DistortPercent = 0.15f; // Ïðîöåíò äåôîðìàöèè ñòàòîâ (íåòî÷íîñòè) (1.0 == 100%) + + const int MinionsID = 61; // ID âóðòóëåê + const int MinionsCount = 4; // Êîë-âî âóðòóëåê êîòîðûõ çàñïàâíèò + + const int StateTime_Flying = 600; // Ñêîëüêî áóäåò ëåòàòü â âîçäóõå äî ïðèçûâà ìèíüîíîâ + const int StateTime_Minions = 120; // Ñêîëüêî âðåìåíè áóäåò ñïàâíèòü âóðòóëåê + + const int FlyingAI = 2; + const int MinionsAI = 0; + + const float MinionsState_XDeaccelerationPower = 0.05f; // Ñêîðîñòü çàìåäëåíèÿ ïî X + const float MinionsState_YMaxSpeed = 2.80f; // Ìàêñ. ñêîðîñòü âçë¸òà âî âðåìÿ ñïàâíà ìèíüîíîâ + const float MinionsStete_YSpeedStep = 0.02f; // Ñêîðîñòü óâåëè÷åíèÿ ñêîðîñòè ïî Y âî âðåìÿ ñïàâíà ìèíüîíîâ + + const int States = 2; + #endregion + + #region "Ïåðåìåííûå" + int TimeToAnimation = AnimationRate; + int Frame = 0; + bool Shoots = true; + int TimeToShoot = ShootRate; + int State = 0; + int TimeToState = StateTime_Flying; + bool runAway = false; + #endregion + + int MagicBoltCooldown + { + get { return (int)npc.ai[2]; } + set { npc.ai[2] = value; } + } + + int LaserCooldown + { + get { return (int)npc.ai[0]; } + set { npc.ai[0] = value; } + } + public override void SetStaticDefaults() { DisplayName.SetDefault("Wall of Shadows"); } - - - public override void SetDefaults() - { - npc.width = 100; - npc.height = 100; - npc.value = Item.buyPrice(0, 17, 0, 0); - npc.damage = 64; - npc.defense = 57; - npc.lifeMax = 36000; - npc.knockBackResist = 0f; - npc.npcSlots = 10; - npc.boss = true; - npc.scale = 1.2f; - npc.noGravity = true; - npc.lavaImmune = true; - npc.behindTiles = true; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit8; - npc.DeathSound = SoundID.NPCDeath10; - music = MusicID.Boss4; - Main.npcFrameCount[npc.type] = 2; - bossBag = mod.ItemType("WallofShadowBag"); - } - - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 0.625f * bossLifeScale); - npc.damage = (int)(npc.damage * 0.6f); - } - - public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) - { - if(Main.expertMode) - target.AddBuff(153, 240); - } - - void ShootBall() - { - MagicBoltCooldown--; - if (MagicBoltCooldown <= 60 && MagicBoltCooldown % ((Main.expertMode) ? 12 : 20) == 0 && Main.netMode != 1) - { - var targetPos = npc.HasPlayerTarget ? Main.player[npc.target].Center : Main.npc[npc.target].Center; - var shootPos = (npc.Top + new Vector2(0, 60)).RotatedBy(npc.rotation, npc.Center); - float inaccuracy = 3f * (npc.life / npc.lifeMax); - var shootVel = targetPos - shootPos + new Vector2(Main.rand.NextFloat(-inaccuracy, inaccuracy), Main.rand.NextFloat(-inaccuracy, inaccuracy)); - shootVel.Normalize(); - shootVel *= 10f; - int proj = Projectile.NewProjectile(shootPos, shootVel, 290, npc.damage, 5f, Main.myPlayer); - } - if (MagicBoltCooldown <= 0) - { - MagicBoltCooldown = 100 + (int)(60 * (float)npc.life / npc.lifeMax); - } - } - - void Shoot() - { - if (!Shoots && npc.target < 0) //åñëè íå âðåìÿ äëÿ íå ñòðåëüáû, òî âûðóáàåì àâòîìàòîì - return; - if (--TimeToShoot > 0) //åñëè òàéìåð ìåíüøå íóëÿ, òî âûðóáàåì àâòîìàòîì - return; - TimeToShoot = (int)Helper.DistortFloat(ShootRate, DistortPercent); //óñòàíàâëèâàåì ÷àñòîòó âûñòðåëà - for (int i = 0; i < ((Main.expertMode) ? 3 : 1); i++) //â öèêëå óêàçûâàåì êîë-âî ïåðüåâ ïðè âûñòðåëå - { - if (Main.expertMode) - { - ShootSpeed = 25; - } - Vector2 Velocity = Helper.VelocityToPoint(npc.Center, Helper.RandomPointInArea(new Vector2(Main.player[npc.target].Center.X - 10, Main.player[npc.target].Center.Y - 10), new Vector2(Main.player[npc.target].Center.X + 20, Main.player[npc.target].Center.Y + 20)), ShootSpeed); //çäåñü óñòàíàâëèâàåì ïîçèöèè (çäåñü îò ïåðñà â ïëååðà) - int Proj = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, Velocity.X, Velocity.Y, 83, (int)Helper.DistortFloat(ShootDamage, DistortPercent), Helper.DistortFloat(ShootKnockback, DistortPercent)); //ïîäòâåðæäàåì âñå âûøå äåéñòâèå: îò ïåðñà ê ìîáó, îò ìîáà ê ïåðñó (âòîðîå âûñòðåë) - Main.projectile[Proj].Center = npc.Center; - } - } - - void ShootSuper() - { - LaserCooldown--; - if (LaserCooldown <= 60 && LaserCooldown % ((Main.expertMode) ? 4 : 7) == 0 && Main.netMode != 1) - { - Vector2 Velocity = Helper.VelocityToPoint(npc.Center, Helper.RandomPointInArea(new Vector2(Main.player[npc.target].Center.X - 100, Main.player[npc.target].Center.Y - 100), new Vector2(Main.player[npc.target].Center.X + 20, Main.player[npc.target].Center.Y + 20)), ((Main.expertMode) ? 20 : 15)); //çäåñü óñòàíàâëèâàåì ïîçèöèè (çäåñü îò ïåðñà â ïëååðà) - int Proj = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, Velocity.X, Velocity.Y, 83, (int)Helper.DistortFloat(ShootDamage, DistortPercent), Helper.DistortFloat(ShootKnockback, DistortPercent)); //ïîäòâåðæäàåì âñå âûøå äåéñòâèå: îò ïåðñà ê ìîáó, îò ìîáà ê ïåðñó (âòîðîå âûñòðåë) - Main.projectile[Proj].Center = npc.Center; - } - if (LaserCooldown <= 0) - { - LaserCooldown = 100 + (int)(600 * (float)npc.life / npc.lifeMax); - } - } - - public override bool PreAI() - { - Player player = Main.player[npc.target]; - npc.position.Y = player.position.Y; - player.AddBuff(22, 1); - if (player.dead) - { - npc.TargetClosest(false); - npc.velocity.Y = npc.velocity.Y + 1f; - if ((double)npc.position.Y > Main.worldSurface * 16.0) - { - npc.velocity.Y = npc.velocity.Y + 1f; - } - if ((double)npc.position.Y > Main.rockLayer * 16.0) - { - for (int num957 = 0; num957 < 200; num957++) - { - if (Main.npc[num957].aiStyle == npc.aiStyle) - { - Main.npc[num957].active = false; - } - } - } - } - - ShootBall(); - ShootSuper(); - if (npc.life < npc.lifeMax * 0.5f) - { - Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[npc.type]] = mod.GetTexture("NPCs/WallOfShadow_Head_Boss1"); - Shoot(); - - if ((int)(Main.time % 360) == 0) - { - int index = NPC.NewNPC((int)(npc.position.X + (npc.width / 2)), (int)(npc.position.Y + (npc.height / 2) + 20.0), mod.NPCType("ShadowSteed"), 1, 0.0f, 0.0f, 0.0f, 0.0f, (int)byte.MaxValue); - Main.npc[index].velocity.X = npc.direction * 6; - } - - if (npc.localAI[0] == 0.0) - { - npc.localAI[0] = 1f; - Main.wofB = -1; - Main.wofT = -1; - } - - npc.ai[1]++; - if (npc.ai[2] == 0) - { - if (npc.life < npc.lifeMax * 0.5F) - npc.ai[1]++; - if (npc.life < npc.lifeMax * 0.2F) - npc.ai[1]++; - if (npc.ai[1] > 2700.0) - npc.ai[2] = 1f; - } - if (npc.ai[2] > 0 && npc.ai[1] > 60) - { - int spawnCooldown = 3; - if (npc.life < npc.lifeMax * 0.3) - ++spawnCooldown; - npc.ai[2]++; - npc.ai[1] = 0; - if (npc.ai[2] > spawnCooldown) - npc.ai[2] = 0; - - if (Main.netMode != 1) - { - // Spawn... a Shadow Steed? - //int index = NPC.NewNPC((int)(npc.position.X + (npc.width / 2)), (int)(npc.position.Y + (npc.height / 2) + 20.0), mod.NPCType("ShadowSteed"), 1, 0.0f, 0.0f, 0.0f, 0.0f, (int)byte.MaxValue); - //int index2 = NPC.NewNPC((int)(npc.position.X + (npc.width / 2)), (int)(npc.position.Y + (npc.height / 2) + 20.0), mod.NPCType("ShadowSteed"), 1, 0.0f, 0.0f, 0.0f, 0.0f, (int)byte.MaxValue); - //NPC.NewNPC((int)(npc.position.X + (npc.width / 2)), (int)(npc.position.Y + (npc.height / 2) + 10.0), mod.NPCType("ShadowSteed"), 1, 0.0f, 0.0f, 0.0f, 0.0f, (int)byte.MaxValue); - //NPC.NewNPC((int)(npc.position.X + (npc.width / 2)), (int)(npc.position.Y + (npc.height / 2) + 30.0), mod.NPCType("ShadowSteed"), 1, 0.0f, 0.0f, 0.0f, 0.0f, (int)byte.MaxValue); - //Main.npc[index].velocity.X = npc.direction * 6; - //Main.npc[index2].velocity.X = npc.direction * 6; - } - } - - - - Main.wof = npc.whoAmI; - int npcTileX = (int)(npc.position.X / 16); - int npcRightXTile = (int)((npc.position.X + npc.width) / 16); - int npcCenterYTile = (int)((npc.position.Y + (npc.height / 2)) / 16); - int solidTiles = 0; - int npcBottom = npcCenterYTile + 7; - while (solidTiles < 15 && npcBottom > Main.maxTilesY - 200) - { - ++npcBottom; - for (int i = npcTileX; i <= npcRightXTile; ++i) - { - try - { - if (!WorldGen.SolidTile(i, npcBottom)) - { - if ((int)Main.tile[i, npcBottom].liquid <= 0) - continue; - } - ++solidTiles; - } - catch - { - solidTiles += 15; - } - } - } - int num5 = npcBottom + 4; - if (Main.wofB == -1) - Main.wofB = num5 * 16; - else if (Main.wofB > num5 * 16) - { - --Main.wofB; - if (Main.wofB < num5 * 16) - Main.wofB = num5 * 16; - } - else if (Main.wofB < num5 * 16) - { - ++Main.wofB; - if (Main.wofB > num5 * 16) - Main.wofB = num5 * 16; - } - - int num6 = 0; - int j2 = npcCenterYTile - 7; - while (num6 < 15 && j2 < Main.maxTilesY - 10) - { - --j2; - for (int i = npcTileX; i <= npcRightXTile; ++i) - { - try - { - if (!WorldGen.SolidTile(i, j2)) - { - if ((int)Main.tile[i, j2].liquid <= 0) - continue; - } - ++num6; - } - catch - { - num6 += 15; - } - } - } - int num7 = j2 - 4; - if (Main.wofT == -1) - Main.wofT = num7 * 16; - else if (Main.wofT > num7 * 16) - { - --Main.wofT; - if (Main.wofT < num7 * 16) - Main.wofT = num7 * 16; - } - else if (Main.wofT < num7 * 16) - { - ++Main.wofT; - if (Main.wofT > num7 * 16) - Main.wofT = num7 * 16; - } - - #region Movement - float num8 = ((Main.wofB + Main.wofT) / 2 - npc.height / 2); - if (npc.position.Y > num8 + 1.0) - npc.velocity.Y = -1f; - else if (npc.position.Y < num8 - 1.0) - npc.velocity.Y = 1f; - npc.velocity.Y = 0.0f; - npc.position.Y = num8; - float speed = 1.5f; - if (npc.life < npc.lifeMax * 0.75) - speed += 0.25f; - if (npc.life < npc.lifeMax * 0.5) - speed += 0.4f; - if (npc.life < npc.lifeMax * 0.25) - speed += 0.5f; - if (npc.life < npc.lifeMax * 0.1) - speed += 0.6f; - if (npc.life < npc.lifeMax * 0.66 && Main.expertMode) - speed += 0.3f; - if (npc.life < npc.lifeMax * 0.33 && Main.expertMode) - speed += 0.3f; - if (npc.life < npc.lifeMax * 0.05 && Main.expertMode) - speed += 0.6f; - if (npc.life < npc.lifeMax * 0.035 && Main.expertMode) - speed += 0.6f; - if (npc.life < npc.lifeMax * 0.025 && Main.expertMode) - speed += 0.6f; - if (Main.expertMode) - speed = speed * 1.35f + 0.35f; - if (npc.velocity.X == 0.0) - { - npc.TargetClosest(true); - npc.velocity.X = npc.direction; - } - if (npc.velocity.X < 0.0) - { - npc.velocity.X = -speed; - npc.direction = -1; - } - else - { - npc.velocity.X = speed; - npc.direction = 1; - } - #endregion - - #region Mouth Rotation - npc.spriteDirection = npc.direction; - Vector2 vector2 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); - float num10 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) - vector2.X; - float num11 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - vector2.Y; - float num12 = (float)Math.Sqrt(num10 * num10 + num11 * num11); - float num13 = num10 * num12; - float num14 = num11 * num12; - npc.rotation = npc.direction <= 0 ? (Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) >= npc.position.X + (npc.width / 2) ? 0 : (float)Math.Atan2(num14, num13) + 3.14f) : (Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) <= npc.position.X + (npc.width / 2) ? 0 : (float)Math.Atan2(-num14, -num13) + 3.14f); - #endregion - - for (int i = 0; i < 255; ++i) - { - if (Main.player[i].active && !Main.player[i].dead) - { - if (Main.player[i].Center.X > npc.Center.X && Main.player[i].direction == -1 && npc.direction == -1 && Vector2.Distance(Main.player[i].Center, npc.Center) <= 480f) - { - Main.player[i].AddBuff(BuffID.TheTongue, 600); - } - } - } - - for (int i = 0; i < 255; ++i) - { - if (Main.player[i].active && !Main.player[i].dead) - { - if (Main.player[i].Center.X < npc.Center.X && Main.player[i].direction == 1 && npc.direction == 1 && Vector2.Distance(Main.player[i].Center, npc.Center) <= 480f) - { - Main.player[i].AddBuff(BuffID.TheTongue, 600); - } - } - } - - - if (npc.localAI[0] != 1.0 || Main.netMode == 1) - return false; - npc.localAI[0] = 2f; - } - - if (npc.life > npc.lifeMax * 0.5f) - { - Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[npc.type]] = mod.GetTexture("NPCs/WallOfShadow_Head_Boss"); - Shoot(); - if (npc.position.X < 160 || npc.position.X > (Main.maxTilesX - 10) * 16) - npc.active = false; - if (npc.localAI[0] == 0.0) - { - npc.localAI[0] = 1f; - Main.wofB = -1; - Main.wofT = -1; - } - - npc.ai[1]++; - if (npc.ai[2] == 0) - { - if (npc.life < npc.lifeMax * 0.5F) - npc.ai[1]++; - if (npc.life < npc.lifeMax * 0.2F) - npc.ai[1]++; - if (npc.ai[1] > 2700.0) - npc.ai[2] = 1f; - } - if (npc.ai[2] > 0 && npc.ai[1] > 60) - { - int spawnCooldown = 3; - if (npc.life < npc.lifeMax * 0.3) - ++spawnCooldown; - npc.ai[2]++; - npc.ai[1] = 0; - if (npc.ai[2] > spawnCooldown) - npc.ai[2] = 0; - - if (Main.netMode != 1) - { - - } - } - - - - Main.wof = npc.whoAmI; - int npcTileX = (int)(npc.position.X / 16); - int npcRightXTile = (int)((npc.position.X + npc.width) / 16); - int npcCenterYTile = (int)((npc.position.Y + (npc.height / 2)) / 16); - int solidTiles = 0; - int npcBottom = npcCenterYTile + 7; - while (solidTiles < 15 && npcBottom > Main.maxTilesY - 200) - { - ++npcBottom; - for (int i = npcTileX; i <= npcRightXTile; ++i) - { - try - { - if (!WorldGen.SolidTile(i, npcBottom)) - { - if ((int)Main.tile[i, npcBottom].liquid <= 0) - continue; - } - ++solidTiles; - } - catch - { - solidTiles += 15; - } - } - } - int num5 = npcBottom + 4; - if (Main.wofB == -1) - Main.wofB = num5 * 16; - else if (Main.wofB > num5 * 16) - { - --Main.wofB; - if (Main.wofB < num5 * 16) - Main.wofB = num5 * 16; - } - else if (Main.wofB < num5 * 16) - { - ++Main.wofB; - if (Main.wofB > num5 * 16) - Main.wofB = num5 * 16; - } - - int num6 = 0; - int j2 = npcCenterYTile - 7; - while (num6 < 15 && j2 < Main.maxTilesY - 10) - { - --j2; - for (int i = npcTileX; i <= npcRightXTile; ++i) - { - try - { - if (!WorldGen.SolidTile(i, j2)) - { - if ((int)Main.tile[i, j2].liquid <= 0) - continue; - } - ++num6; - } - catch - { - num6 += 15; - } - } - } - int num7 = j2 - 4; - if (Main.wofT == -1) - Main.wofT = num7 * 16; - else if (Main.wofT > num7 * 16) - { - --Main.wofT; - if (Main.wofT < num7 * 16) - Main.wofT = num7 * 16; - } - else if (Main.wofT < num7 * 16) - { - ++Main.wofT; - if (Main.wofT > num7 * 16) - Main.wofT = num7 * 16; - } - - #region Movement - float num8 = ((Main.wofB + Main.wofT) / 2 - npc.height / 2); - if (npc.position.Y > num8 + 1.0) - npc.velocity.Y = -1f; - else if (npc.position.Y < num8 - 1.0) - npc.velocity.Y = 1f; - npc.velocity.Y = 0.0f; - npc.position.Y = num8; - float speed = 1.5f; - if (npc.life < npc.lifeMax * 0.75) - speed += 0.25f; - if (npc.life < npc.lifeMax * 0.5) - speed += 0.4f; - if (npc.life < npc.lifeMax * 0.25) - speed += 0.5f; - if (npc.life < npc.lifeMax * 0.1) - speed += 0.6f; - if (npc.life < npc.lifeMax * 0.66 && Main.expertMode) - speed += 0.3f; - if (npc.life < npc.lifeMax * 0.33 && Main.expertMode) - speed += 0.3f; - if (npc.life < npc.lifeMax * 0.05 && Main.expertMode) - speed += 0.6f; - if (npc.life < npc.lifeMax * 0.035 && Main.expertMode) - speed += 0.6f; - if (npc.life < npc.lifeMax * 0.025 && Main.expertMode) - speed += 0.6f; - if (Main.expertMode) - speed = speed * 1.35f + 0.35f; - if (npc.velocity.X == 0.0) - { - npc.TargetClosest(true); - npc.velocity.X = npc.direction; - } - if (npc.velocity.X < 0.0) - { - npc.velocity.X = -speed; - npc.direction = -1; - } - else - { - npc.velocity.X = speed; - npc.direction = 1; - } - #endregion - - #region Mouth Rotation - npc.spriteDirection = npc.direction; - Vector2 vector2 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); - float num10 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) - vector2.X; - float num11 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - vector2.Y; - float num12 = (float)Math.Sqrt(num10 * num10 + num11 * num11); - float num13 = num10 * num12; - float num14 = num11 * num12; - npc.rotation = npc.direction <= 0 ? (Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) >= npc.position.X + (npc.width / 2) ? 0 : (float)Math.Atan2(num14, num13) + 3.14f) : (Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) <= npc.position.X + (npc.width / 2) ? 0 : (float)Math.Atan2(-num14, -num13) + 3.14f); - #endregion - - for (int i = 0; i < 255; ++i) - { - if (Main.player[i].active && !Main.player[i].dead) - { - if (Main.player[i].Center.X > npc.Center.X && Main.player[i].direction == -1 && npc.direction == -1 && Vector2.Distance(Main.player[i].Center, npc.Center) <= 480f) - { - Main.player[i].AddBuff(BuffID.TheTongue, 600); - } - } - } - - for (int i = 0; i < 255; ++i) - { - if (Main.player[i].active && !Main.player[i].dead) - { - if (Main.player[i].Center.X < npc.Center.X && Main.player[i].direction == 1 && npc.direction == 1 && Vector2.Distance(Main.player[i].Center, npc.Center) <= 480f) - { - Main.player[i].AddBuff(BuffID.TheTongue, 600); - } - } - } - - //if (Main.expertMode && Main.netMode != 1) - //{ - int num15 = (int)(1.0 + npc.life / npc.lifeMax * 10.0); - int num16 = num15 * num15; - if (num16 < 400) - num16 = (num16 * 19 + 400) / 20; - if (num16 < 60) - num16 = (num16 * 3 + 60) / 4; - if (num16 < 20) - num16 = (num16 + 20) / 2; - int maxValue1 = (int)((double)num16 * 0.7); - if (Main.rand.Next(maxValue1) == 0) - { - int index1 = 0; - float[] numArray = new float[10]; - for (int index2 = 0; index2 < 200; ++index2) - { - if (index1 < 10 && Main.npc[index2].active && Main.npc[index2].type == mod.NPCType("ShadowHand")) - { - numArray[index1] = Main.npc[index2].ai[0]; - ++index1; - } - } - int maxValue2 = 1 + index1 * 2; - if (index1 < 10 && Main.rand.Next(maxValue2) <= 1) - { - int num17 = -1; - for (int index2 = 0; index2 < 1000; ++index2) - { - int num18 = Main.rand.Next(20); - float num19 = (float)((double)num18 * 0.100000001490116 - 0.0500000007450581); - bool flag = true; - for (int index3 = 0; index3 < index1; ++index3) - { - if ((double)num19 == (double)numArray[index3]) - { - flag = false; - break; - } - } - if (flag) - { - num17 = num18; - break; - } - } - if (num17 >= 0) - { - int index2 = NPC.NewNPC((int)npc.position.X, (int)num8, mod.NPCType("ShadowHand"), npc.whoAmI, 0.0f, 0.0f, 0.0f, 0.0f, 255); - Main.npc[index2].ai[0] = (num17 * 0.100000001490116F - 0.0500000007450581F); - } - } - } - //} - if (npc.localAI[0] != 1.0 || Main.netMode == 1) - return false; - npc.localAI[0] = 2f; - - float num20 = ((((Main.wofB + Main.wofT) / 2) + Main.wofB) / 2.0F); - for (int index1 = 0; index1 < 11; ++index1) - { - int index2 = NPC.NewNPC((int)npc.position.X, (int)num20, mod.NPCType("ShadowHand"), npc.whoAmI, 0.0f, 0.0f, 0.0f, 0.0f, 255); - Main.npc[index2].ai[0] = (index1 * 0.100000001490116F - 0.0500000007450581F); - } - - } - - return false; - } - - public override void FindFrame(int frameHeight) - { - ///--------------------------------------------------------------------------------------------------------------- - int frameWidth = 96; // I'm just hardcoding this, since this is the frame width of one frame along the X axis. - npc.spriteDirection = npc.direction; - - // Now if you want to animate, you can do: - npc.frameCounter++; - if (npc.frameCounter >= 12) - { - - if (npc.life > npc.lifeMax * 0.5f) - { - npc.frame.Y += 98; - if (npc.frame.Y >= 196) - { - npc.frame.Y = 0; - npc.frame.X = 0; - } - } - - if (npc.life < npc.lifeMax * 0.5f) - { - npc.frame.Y += 98; - if (npc.frame.Y >= 196) - { - npc.frame.Y = 0; - npc.frame.X = 96; - } - - } - - npc.frameCounter = 0; - } - - npc.frame.Width = frameWidth; - } - - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Gore.NewGore(npc.position, npc.velocity, 99, 2f); - Gore.NewGore(npc.position, npc.velocity, 99, 3f); - Gore.NewGore(npc.position, npc.velocity, 99, 4f); - Gore.NewGore(npc.position, npc.velocity, 99, 5f); - Gore.NewGore(npc.position, npc.velocity, 99, 4f); - Gore.NewGore(npc.position, npc.velocity, 99, 3f); - Gore.NewGore(npc.position, npc.velocity, 99, 2f); - Gore.NewGore(npc.position, npc.velocity, 99, 1f); - Gore.NewGore(npc.position, npc.velocity, 99, 2f); - Gore.NewGore(npc.position, npc.velocity, 99, 3f); - Gore.NewGore(npc.position, npc.velocity, 99, 3f); - Gore.NewGore(npc.position, npc.velocity, 99, 4f); - Gore.NewGore(npc.position, npc.velocity, 99, 4f); - Gore.NewGore(npc.position, npc.velocity, 99, 3f); - Gore.NewGore(npc.position, npc.velocity, 99, 2f); - Gore.NewGore(npc.position, npc.velocity, 99, 3f); - Gore.NewGore(npc.position, npc.velocity, 99, 4f); - Gore.NewGore(npc.position, npc.velocity, 99, 5f); - Gore.NewGore(npc.position, npc.velocity, 99, 4f); - Gore.NewGore(npc.position, npc.velocity, 99, 3f); - Gore.NewGore(npc.position, npc.velocity, 99, 2f); - Gore.NewGore(npc.position, npc.velocity, 99, 1f); - Gore.NewGore(npc.position, npc.velocity, 99, 2f); - Gore.NewGore(npc.position, npc.velocity, 99, 3f); - Gore.NewGore(npc.position, npc.velocity, 99, 3f); - Gore.NewGore(npc.position, npc.velocity, 99, 4f); - Gore.NewGore(npc.position, npc.velocity, 99, 4f); - Gore.NewGore(npc.position, npc.velocity, 99, 3f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WallOfShadowGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WallOfShadowGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WallOfShadowGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WallOfShadowGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WallOfShadowGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WallOfShadowGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WallOfShadowGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WallOfShadowGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WallOfShadowGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WallOfShadowGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WallOfShadowGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WallOfShadowGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WallOfShadowGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WallOfShadowGore2"), 1f); - } -} -public override void NPCLoot() -{ - if(Main.expertMode) - { - npc.DropBossBags(); - } - -if (Main.netMode != 1) -{ - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - - if(!Main.expertMode) - { - Helper.DropItem(new Rectangle((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height), new Drop(mod.ItemType("HeavyBeamCannon"), 1, 1), new Drop(mod.ItemType("Bolter"), 1, 1), new Drop(mod.ItemType("StrikerBlade"), 1, 1), new Drop(0, 0, 0)); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 499, Main.rand.Next(5,15)); - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DarknessCloth"), Main.rand.Next(8,15)); - if(Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("WallofShadowMask")); - } - } - - if(Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("WallofShadowTrophy")); - } -} + public override void SetDefaults() + { + npc.width = 100; + npc.height = 100; + npc.value = Item.buyPrice(0, 17, 0, 0); + npc.damage = 64; + npc.defense = 57; + npc.lifeMax = 36000; + npc.knockBackResist = 0f; + npc.npcSlots = 10; + npc.boss = true; + npc.scale = 1.2f; + npc.noGravity = true; + npc.lavaImmune = true; + npc.behindTiles = true; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit8; + npc.DeathSound = SoundID.NPCDeath10; + music = MusicID.Boss4; + Main.npcFrameCount[npc.type] = 2; + bossBag = mod.ItemType("WallofShadowBag"); + } - if (Main.netMode != 1) - { - int num1 = (int)(npc.position.X + (npc.width / 2)) / 16; - int num2 = (int)(npc.position.Y + (npc.height / 2)) / 16; - int num5 = npc.width / 2 / 16 + 1; - for (int index2 = num1 - num5; index2 <= num1 + num5; ++index2) - { - for (int index3 = num2 - num5; index3 <= num2 + num5; ++index3) - { - if ((index2 == num1 - num5 || index2 == num1 + num5 || (index3 == num2 - num5 || index3 == num2 + num5)) && !Main.tile[index2, index3].active()) - { - Main.tile[index2, index3].type = 140; - Main.tile[index2, index3].active(true); - } - Main.tile[index2, index3].lava(false); - Main.tile[index2, index3].liquid = 0; - if (Main.netMode == 2) - NetMessage.SendTileSquare(-1, index2, index3, 1); - else - WorldGen.SquareTileFrame(index2, index3, true); - } - } - - //NetMessage.SendData(7, -1, -1, "", 0, 0.0f, 0.0f, 0.0f, 0, 0, 0); - } -} + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 0.625f * bossLifeScale); + npc.damage = (int)(npc.damage * 0.6f); + } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + if (Main.expertMode) + target.AddBuff(153, 240); + } + void ShootBall() + { + MagicBoltCooldown--; + if (MagicBoltCooldown <= 60 && MagicBoltCooldown % ((Main.expertMode) ? 12 : 20) == 0 && Main.netMode != 1) + { + var targetPos = npc.HasPlayerTarget ? Main.player[npc.target].Center : Main.npc[npc.target].Center; + var shootPos = (npc.Top + new Vector2(0, 60)).RotatedBy(npc.rotation, npc.Center); + float inaccuracy = 3f * (npc.life / npc.lifeMax); + var shootVel = targetPos - shootPos + new Vector2(Main.rand.NextFloat(-inaccuracy, inaccuracy), Main.rand.NextFloat(-inaccuracy, inaccuracy)); + shootVel.Normalize(); + shootVel *= 10f; + int proj = Projectile.NewProjectile(shootPos, shootVel, 290, npc.damage, 5f, Main.myPlayer); + } + if (MagicBoltCooldown <= 0) + { + MagicBoltCooldown = 100 + (int)(60 * (float)npc.life / npc.lifeMax); + } + } + void Shoot() + { + if (!Shoots && npc.target < 0) //åñëè íå âðåìÿ äëÿ íå ñòðåëüáû, òî âûðóáàåì àâòîìàòîì + return; + if (--TimeToShoot > 0) //åñëè òàéìåð ìåíüøå íóëÿ, òî âûðóáàåì àâòîìàòîì + return; + TimeToShoot = (int)Helper.DistortFloat(ShootRate, DistortPercent); //óñòàíàâëèâàåì ÷àñòîòó âûñòðåëà + for (int i = 0; i < ((Main.expertMode) ? 3 : 1); i++) //â öèêëå óêàçûâàåì êîë-âî ïåðüåâ ïðè âûñòðåëå + { + if (Main.expertMode) + { + ShootSpeed = 25; + } + Vector2 Velocity = Helper.VelocityToPoint(npc.Center, Helper.RandomPointInArea(new Vector2(Main.player[npc.target].Center.X - 10, Main.player[npc.target].Center.Y - 10), new Vector2(Main.player[npc.target].Center.X + 20, Main.player[npc.target].Center.Y + 20)), ShootSpeed); //çäåñü óñòàíàâëèâàåì ïîçèöèè (çäåñü îò ïåðñà â ïëååðà) + int Proj = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, Velocity.X, Velocity.Y, 83, (int)Helper.DistortFloat(ShootDamage, DistortPercent), Helper.DistortFloat(ShootKnockback, DistortPercent)); //ïîäòâåðæäàåì âñå âûøå äåéñòâèå: îò ïåðñà ê ìîáó, îò ìîáà ê ïåðñó (âòîðîå âûñòðåë) + Main.projectile[Proj].Center = npc.Center; + } + } - public override bool PreDraw (SpriteBatch spriteBatch, Color drawColor) - { - Texture2D shadowChain = mod.GetTexture("NPCs/WallOfShadowChain"); - Texture2D shadowWall = mod.GetTexture("NPCs/WallOfShadow_Wall"); - for (int i = 0; i < 255; i++) - { - if (Main.player[i].active && Main.player[i].tongued && !Main.player[i].dead) - { - float num = npc.position.X + (npc.width / 2); - float num2 = npc.position.Y + (npc.height / 2); - Vector2 vector = new Vector2(Main.player[i].position.X + Main.player[i].width * 0.5f, Main.player[i].position.Y + Main.player[i].height * 0.5f); - float num3 = num - vector.X; - float num4 = num2 - vector.Y; - float rotation = (float)Math.Atan2(num4, num3) - 1.57f; - bool flag = true; - while (flag) - { - float num5 = (float)Math.Sqrt(num3 * num3 + num4 * num4); - if (num5 < 40f) - { - flag = false; - } - else - { - num5 = shadowChain.Height / num5; - num3 *= num5; - num4 *= num5; - vector.X += num3; - vector.Y += num4; - num3 = num - vector.X; - num4 = num2 - vector.Y; - Color color = Lighting.GetColor((int)vector.X / 16, (int)(vector.Y / 16f)); - spriteBatch.Draw(shadowChain, new Vector2(vector.X - Main.screenPosition.X, vector.Y - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, shadowChain.Width, shadowChain.Height)), color, rotation, new Vector2(shadowChain.Width * 0.5f, shadowChain.Height * 0.5f), 1f, SpriteEffects.None, 0f); - } - } - } - } - for (int j = 0; j < 200; j++) - { - if (Main.npc[j].active && Main.npc[j].type == mod.NPCType("ShadowHand")) - { - float num6 = npc.position.X + (npc.width / 2); - float num7 = npc.position.Y; - float num8 = (Main.wofB - Main.wofT); - bool flag2 = false; - if (Main.npc[j].frameCounter > 7.0) - { - flag2 = true; - } - num7 = Main.wofT + num8 * Main.npc[j].ai[0]; - Vector2 vector2 = new Vector2(Main.npc[j].position.X + (Main.npc[j].width / 2), Main.npc[j].position.Y + (Main.npc[j].height / 2)); - float num9 = num6 - vector2.X; - float num10 = num7 - vector2.Y; - float rotation2 = (float)Math.Atan2(num10, num9) - 1.57f; - bool flag3 = true; - while (flag3) - { - SpriteEffects effects1 = SpriteEffects.None; - if (flag2) - { - effects1 = SpriteEffects.FlipHorizontally; - flag2 = false; - } - else - { - flag2 = true; - } - int height = 28; - float num11 = (float)Math.Sqrt(num9 * num9 + num10 * num10); - if (num11 < 40f) - { - height = (int)num11 - 40 + 28; - flag3 = false; - } - num11 = 28f / num11; - num9 *= num11; - num10 *= num11; - vector2.X += num9; - vector2.Y += num10; - num9 = num6 - vector2.X; - num10 = num7 - vector2.Y; - Color color2 = Lighting.GetColor((int)vector2.X / 16, (int)(vector2.Y / 16f)); - spriteBatch.Draw(shadowChain, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, shadowChain.Width, height)), color2, rotation2, new Vector2(shadowChain.Width * 0.5f, shadowChain.Height * 0.5f), 1f, effects1, 0f); - } - } - } - int num12 = 140; - float num13 = (float)Main.wofT; - float num14 = (float)Main.wofB; - num14 = Main.screenPosition.Y + Main.screenHeight; - float num15 = (float)((int)((num13 - Main.screenPosition.Y) / (float)num12) + 1); - num15 *= num12; - if (num15 > 0f) - { - num13 -= num15; - } - float num16 = num13; - float num17 = npc.position.X; - float num18 = num14 - num13; - bool flag4 = true; - SpriteEffects effects2 = SpriteEffects.None; - if (npc.spriteDirection == 1) - { - effects2 = SpriteEffects.FlipHorizontally; - } - if (npc.direction > 0) - { - num17 -= 80f; - } - int num19 = 0; - if (!Main.gamePaused) - { - Main.wofF++; - } - if (Main.wofF > 12) - { - num19 = 280; - if (Main.wofF > 17) - { - Main.wofF = 0; - } - } - else if (Main.wofF > 6) - { - num19 = 140; - } - while (flag4) - { - num18 = num14 - num16; - if (num18 > (float)num12) - { - num18 = (float)num12; - } - bool flag5 = true; - int num20 = 0; - while (flag5) - { - int x = (int)(num17 + (float)(shadowWall.Width / 2)) / 16; - int y = (int)(num16 + (float)num20) / 16; - Main.spriteBatch.Draw(shadowWall, new Vector2(num17 - Main.screenPosition.X, num16 + (float)num20 - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, num19 + num20, shadowWall.Width, 16)), Lighting.GetColor(x, y), 0f, default(Vector2), 1f, effects2, 0f); - num20 += 16; - if ((float)num20 >= num18) - { - flag5 = false; - } - } - num16 += (float)num12; - if (num16 >= num14) - { - flag4 = false; - } - } - - Texture2D drawTexture = Main.npcTexture[npc.type]; - Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); - - Vector2 drawPos = new Vector2( - npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, - npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); - - SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - spriteBatch.Draw(drawTexture, drawPos, npc.frame, drawColor, npc.rotation, origin, npc.scale, effects, 0); - - - return false; - } - } + void ShootSuper() + { + LaserCooldown--; + if (LaserCooldown <= 60 && LaserCooldown % ((Main.expertMode) ? 4 : 7) == 0 && Main.netMode != 1) + { + Vector2 Velocity = Helper.VelocityToPoint(npc.Center, Helper.RandomPointInArea(new Vector2(Main.player[npc.target].Center.X - 100, Main.player[npc.target].Center.Y - 100), new Vector2(Main.player[npc.target].Center.X + 20, Main.player[npc.target].Center.Y + 20)), ((Main.expertMode) ? 20 : 15)); //çäåñü óñòàíàâëèâàåì ïîçèöèè (çäåñü îò ïåðñà â ïëååðà) + int Proj = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, Velocity.X, Velocity.Y, 83, (int)Helper.DistortFloat(ShootDamage, DistortPercent), Helper.DistortFloat(ShootKnockback, DistortPercent)); //ïîäòâåðæäàåì âñå âûøå äåéñòâèå: îò ïåðñà ê ìîáó, îò ìîáà ê ïåðñó (âòîðîå âûñòðåë) + Main.projectile[Proj].Center = npc.Center; + } + if (LaserCooldown <= 0) + { + LaserCooldown = 100 + (int)(600 * (float)npc.life / npc.lifeMax); + } + } + + public override bool PreAI() + { + Player player = Main.player[npc.target]; + npc.position.Y = player.position.Y; + player.AddBuff(22, 1); + if (player.dead) + { + npc.TargetClosest(false); + npc.velocity.Y = npc.velocity.Y + 1f; + if ((double)npc.position.Y > Main.worldSurface * 16.0) + { + npc.velocity.Y = npc.velocity.Y + 1f; + } + if ((double)npc.position.Y > Main.rockLayer * 16.0) + { + for (int num957 = 0; num957 < 200; num957++) + { + if (Main.npc[num957].aiStyle == npc.aiStyle) + { + Main.npc[num957].active = false; + } + } + } + } + + ShootBall(); + ShootSuper(); + if (npc.life < npc.lifeMax * 0.5f) + { + Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[npc.type]] = mod.GetTexture("NPCs/WallOfShadow_Head_Boss1"); + Shoot(); + + if ((int)(Main.time % 360) == 0) + { + int index = NPC.NewNPC((int)(npc.position.X + (npc.width / 2)), (int)(npc.position.Y + (npc.height / 2) + 20.0), mod.NPCType("ShadowSteed"), 1, 0.0f, 0.0f, 0.0f, 0.0f, (int)byte.MaxValue); + Main.npc[index].velocity.X = npc.direction * 6; + } + + if (npc.localAI[0] == 0.0) + { + npc.localAI[0] = 1f; + Main.wofB = -1; + Main.wofT = -1; + } + + npc.ai[1]++; + if (npc.ai[2] == 0) + { + if (npc.life < npc.lifeMax * 0.5F) + npc.ai[1]++; + if (npc.life < npc.lifeMax * 0.2F) + npc.ai[1]++; + if (npc.ai[1] > 2700.0) + npc.ai[2] = 1f; + } + if (npc.ai[2] > 0 && npc.ai[1] > 60) + { + int spawnCooldown = 3; + if (npc.life < npc.lifeMax * 0.3) + ++spawnCooldown; + npc.ai[2]++; + npc.ai[1] = 0; + if (npc.ai[2] > spawnCooldown) + npc.ai[2] = 0; + + if (Main.netMode != 1) + { + // Spawn... a Shadow Steed? + //int index = NPC.NewNPC((int)(npc.position.X + (npc.width / 2)), (int)(npc.position.Y + (npc.height / 2) + 20.0), mod.NPCType("ShadowSteed"), 1, 0.0f, 0.0f, 0.0f, 0.0f, (int)byte.MaxValue); + //int index2 = NPC.NewNPC((int)(npc.position.X + (npc.width / 2)), (int)(npc.position.Y + (npc.height / 2) + 20.0), mod.NPCType("ShadowSteed"), 1, 0.0f, 0.0f, 0.0f, 0.0f, (int)byte.MaxValue); + //NPC.NewNPC((int)(npc.position.X + (npc.width / 2)), (int)(npc.position.Y + (npc.height / 2) + 10.0), mod.NPCType("ShadowSteed"), 1, 0.0f, 0.0f, 0.0f, 0.0f, (int)byte.MaxValue); + //NPC.NewNPC((int)(npc.position.X + (npc.width / 2)), (int)(npc.position.Y + (npc.height / 2) + 30.0), mod.NPCType("ShadowSteed"), 1, 0.0f, 0.0f, 0.0f, 0.0f, (int)byte.MaxValue); + //Main.npc[index].velocity.X = npc.direction * 6; + //Main.npc[index2].velocity.X = npc.direction * 6; + } + } + + + + Main.wof = npc.whoAmI; + int npcTileX = (int)(npc.position.X / 16); + int npcRightXTile = (int)((npc.position.X + npc.width) / 16); + int npcCenterYTile = (int)((npc.position.Y + (npc.height / 2)) / 16); + int solidTiles = 0; + int npcBottom = npcCenterYTile + 7; + while (solidTiles < 15 && npcBottom > Main.maxTilesY - 200) + { + ++npcBottom; + for (int i = npcTileX; i <= npcRightXTile; ++i) + { + try + { + if (!WorldGen.SolidTile(i, npcBottom)) + { + if ((int)Main.tile[i, npcBottom].liquid <= 0) + continue; + } + ++solidTiles; + } + catch + { + solidTiles += 15; + } + } + } + int num5 = npcBottom + 4; + if (Main.wofB == -1) + Main.wofB = num5 * 16; + else if (Main.wofB > num5 * 16) + { + --Main.wofB; + if (Main.wofB < num5 * 16) + Main.wofB = num5 * 16; + } + else if (Main.wofB < num5 * 16) + { + ++Main.wofB; + if (Main.wofB > num5 * 16) + Main.wofB = num5 * 16; + } + + int num6 = 0; + int j2 = npcCenterYTile - 7; + while (num6 < 15 && j2 < Main.maxTilesY - 10) + { + --j2; + for (int i = npcTileX; i <= npcRightXTile; ++i) + { + try + { + if (!WorldGen.SolidTile(i, j2)) + { + if ((int)Main.tile[i, j2].liquid <= 0) + continue; + } + ++num6; + } + catch + { + num6 += 15; + } + } + } + int num7 = j2 - 4; + if (Main.wofT == -1) + Main.wofT = num7 * 16; + else if (Main.wofT > num7 * 16) + { + --Main.wofT; + if (Main.wofT < num7 * 16) + Main.wofT = num7 * 16; + } + else if (Main.wofT < num7 * 16) + { + ++Main.wofT; + if (Main.wofT > num7 * 16) + Main.wofT = num7 * 16; + } + + #region Movement + float num8 = ((Main.wofB + Main.wofT) / 2 - npc.height / 2); + if (npc.position.Y > num8 + 1.0) + npc.velocity.Y = -1f; + else if (npc.position.Y < num8 - 1.0) + npc.velocity.Y = 1f; + npc.velocity.Y = 0.0f; + npc.position.Y = num8; + float speed = 1.5f; + if (npc.life < npc.lifeMax * 0.75) + speed += 0.25f; + if (npc.life < npc.lifeMax * 0.5) + speed += 0.4f; + if (npc.life < npc.lifeMax * 0.25) + speed += 0.5f; + if (npc.life < npc.lifeMax * 0.1) + speed += 0.6f; + if (npc.life < npc.lifeMax * 0.66 && Main.expertMode) + speed += 0.3f; + if (npc.life < npc.lifeMax * 0.33 && Main.expertMode) + speed += 0.3f; + if (npc.life < npc.lifeMax * 0.05 && Main.expertMode) + speed += 0.6f; + if (npc.life < npc.lifeMax * 0.035 && Main.expertMode) + speed += 0.6f; + if (npc.life < npc.lifeMax * 0.025 && Main.expertMode) + speed += 0.6f; + if (Main.expertMode) + speed = speed * 1.35f + 0.35f; + if (npc.velocity.X == 0.0) + { + npc.TargetClosest(true); + npc.velocity.X = npc.direction; + } + if (npc.velocity.X < 0.0) + { + npc.velocity.X = -speed; + npc.direction = -1; + } + else + { + npc.velocity.X = speed; + npc.direction = 1; + } + #endregion + + #region Mouth Rotation + npc.spriteDirection = npc.direction; + Vector2 vector2 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + float num10 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) - vector2.X; + float num11 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - vector2.Y; + float num12 = (float)Math.Sqrt(num10 * num10 + num11 * num11); + float num13 = num10 * num12; + float num14 = num11 * num12; + npc.rotation = npc.direction <= 0 ? (Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) >= npc.position.X + (npc.width / 2) ? 0 : (float)Math.Atan2(num14, num13) + 3.14f) : (Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) <= npc.position.X + (npc.width / 2) ? 0 : (float)Math.Atan2(-num14, -num13) + 3.14f); + #endregion + + for (int i = 0; i < 255; ++i) + { + if (Main.player[i].active && !Main.player[i].dead) + { + if (Main.player[i].Center.X > npc.Center.X && Main.player[i].direction == -1 && npc.direction == -1 && Vector2.Distance(Main.player[i].Center, npc.Center) <= 480f) + { + Main.player[i].AddBuff(BuffID.TheTongue, 600); + } + } + } + + for (int i = 0; i < 255; ++i) + { + if (Main.player[i].active && !Main.player[i].dead) + { + if (Main.player[i].Center.X < npc.Center.X && Main.player[i].direction == 1 && npc.direction == 1 && Vector2.Distance(Main.player[i].Center, npc.Center) <= 480f) + { + Main.player[i].AddBuff(BuffID.TheTongue, 600); + } + } + } + + + if (npc.localAI[0] != 1.0 || Main.netMode == 1) + return false; + npc.localAI[0] = 2f; + } + + if (npc.life > npc.lifeMax * 0.5f) + { + Main.npcHeadBossTexture[NPCID.Sets.BossHeadTextures[npc.type]] = mod.GetTexture("NPCs/WallOfShadow_Head_Boss"); + Shoot(); + if (npc.position.X < 160 || npc.position.X > (Main.maxTilesX - 10) * 16) + npc.active = false; + if (npc.localAI[0] == 0.0) + { + npc.localAI[0] = 1f; + Main.wofB = -1; + Main.wofT = -1; + } + + npc.ai[1]++; + if (npc.ai[2] == 0) + { + if (npc.life < npc.lifeMax * 0.5F) + npc.ai[1]++; + if (npc.life < npc.lifeMax * 0.2F) + npc.ai[1]++; + if (npc.ai[1] > 2700.0) + npc.ai[2] = 1f; + } + if (npc.ai[2] > 0 && npc.ai[1] > 60) + { + int spawnCooldown = 3; + if (npc.life < npc.lifeMax * 0.3) + ++spawnCooldown; + npc.ai[2]++; + npc.ai[1] = 0; + if (npc.ai[2] > spawnCooldown) + npc.ai[2] = 0; + + if (Main.netMode != 1) + { + + } + } + + + + Main.wof = npc.whoAmI; + int npcTileX = (int)(npc.position.X / 16); + int npcRightXTile = (int)((npc.position.X + npc.width) / 16); + int npcCenterYTile = (int)((npc.position.Y + (npc.height / 2)) / 16); + int solidTiles = 0; + int npcBottom = npcCenterYTile + 7; + while (solidTiles < 15 && npcBottom > Main.maxTilesY - 200) + { + ++npcBottom; + for (int i = npcTileX; i <= npcRightXTile; ++i) + { + try + { + if (!WorldGen.SolidTile(i, npcBottom)) + { + if ((int)Main.tile[i, npcBottom].liquid <= 0) + continue; + } + ++solidTiles; + } + catch + { + solidTiles += 15; + } + } + } + int num5 = npcBottom + 4; + if (Main.wofB == -1) + Main.wofB = num5 * 16; + else if (Main.wofB > num5 * 16) + { + --Main.wofB; + if (Main.wofB < num5 * 16) + Main.wofB = num5 * 16; + } + else if (Main.wofB < num5 * 16) + { + ++Main.wofB; + if (Main.wofB > num5 * 16) + Main.wofB = num5 * 16; + } + + int num6 = 0; + int j2 = npcCenterYTile - 7; + while (num6 < 15 && j2 < Main.maxTilesY - 10) + { + --j2; + for (int i = npcTileX; i <= npcRightXTile; ++i) + { + try + { + if (!WorldGen.SolidTile(i, j2)) + { + if ((int)Main.tile[i, j2].liquid <= 0) + continue; + } + ++num6; + } + catch + { + num6 += 15; + } + } + } + int num7 = j2 - 4; + if (Main.wofT == -1) + Main.wofT = num7 * 16; + else if (Main.wofT > num7 * 16) + { + --Main.wofT; + if (Main.wofT < num7 * 16) + Main.wofT = num7 * 16; + } + else if (Main.wofT < num7 * 16) + { + ++Main.wofT; + if (Main.wofT > num7 * 16) + Main.wofT = num7 * 16; + } + + #region Movement + float num8 = ((Main.wofB + Main.wofT) / 2 - npc.height / 2); + if (npc.position.Y > num8 + 1.0) + npc.velocity.Y = -1f; + else if (npc.position.Y < num8 - 1.0) + npc.velocity.Y = 1f; + npc.velocity.Y = 0.0f; + npc.position.Y = num8; + float speed = 1.5f; + if (npc.life < npc.lifeMax * 0.75) + speed += 0.25f; + if (npc.life < npc.lifeMax * 0.5) + speed += 0.4f; + if (npc.life < npc.lifeMax * 0.25) + speed += 0.5f; + if (npc.life < npc.lifeMax * 0.1) + speed += 0.6f; + if (npc.life < npc.lifeMax * 0.66 && Main.expertMode) + speed += 0.3f; + if (npc.life < npc.lifeMax * 0.33 && Main.expertMode) + speed += 0.3f; + if (npc.life < npc.lifeMax * 0.05 && Main.expertMode) + speed += 0.6f; + if (npc.life < npc.lifeMax * 0.035 && Main.expertMode) + speed += 0.6f; + if (npc.life < npc.lifeMax * 0.025 && Main.expertMode) + speed += 0.6f; + if (Main.expertMode) + speed = speed * 1.35f + 0.35f; + if (npc.velocity.X == 0.0) + { + npc.TargetClosest(true); + npc.velocity.X = npc.direction; + } + if (npc.velocity.X < 0.0) + { + npc.velocity.X = -speed; + npc.direction = -1; + } + else + { + npc.velocity.X = speed; + npc.direction = 1; + } + #endregion + + #region Mouth Rotation + npc.spriteDirection = npc.direction; + Vector2 vector2 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + float num10 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) - vector2.X; + float num11 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - vector2.Y; + float num12 = (float)Math.Sqrt(num10 * num10 + num11 * num11); + float num13 = num10 * num12; + float num14 = num11 * num12; + npc.rotation = npc.direction <= 0 ? (Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) >= npc.position.X + (npc.width / 2) ? 0 : (float)Math.Atan2(num14, num13) + 3.14f) : (Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) <= npc.position.X + (npc.width / 2) ? 0 : (float)Math.Atan2(-num14, -num13) + 3.14f); + #endregion + + for (int i = 0; i < 255; ++i) + { + if (Main.player[i].active && !Main.player[i].dead) + { + if (Main.player[i].Center.X > npc.Center.X && Main.player[i].direction == -1 && npc.direction == -1 && Vector2.Distance(Main.player[i].Center, npc.Center) <= 480f) + { + Main.player[i].AddBuff(BuffID.TheTongue, 600); + } + } + } + + for (int i = 0; i < 255; ++i) + { + if (Main.player[i].active && !Main.player[i].dead) + { + if (Main.player[i].Center.X < npc.Center.X && Main.player[i].direction == 1 && npc.direction == 1 && Vector2.Distance(Main.player[i].Center, npc.Center) <= 480f) + { + Main.player[i].AddBuff(BuffID.TheTongue, 600); + } + } + } + + //if (Main.expertMode && Main.netMode != 1) + //{ + int num15 = (int)(1.0 + npc.life / npc.lifeMax * 10.0); + int num16 = num15 * num15; + if (num16 < 400) + num16 = (num16 * 19 + 400) / 20; + if (num16 < 60) + num16 = (num16 * 3 + 60) / 4; + if (num16 < 20) + num16 = (num16 + 20) / 2; + int maxValue1 = (int)((double)num16 * 0.7); + if (Main.rand.Next(maxValue1) == 0) + { + int index1 = 0; + float[] numArray = new float[10]; + for (int index2 = 0; index2 < 200; ++index2) + { + if (index1 < 10 && Main.npc[index2].active && Main.npc[index2].type == mod.NPCType("ShadowHand")) + { + numArray[index1] = Main.npc[index2].ai[0]; + ++index1; + } + } + int maxValue2 = 1 + index1 * 2; + if (index1 < 10 && Main.rand.Next(maxValue2) <= 1) + { + int num17 = -1; + for (int index2 = 0; index2 < 1000; ++index2) + { + int num18 = Main.rand.Next(20); + float num19 = (float)((double)num18 * 0.100000001490116 - 0.0500000007450581); + bool flag = true; + for (int index3 = 0; index3 < index1; ++index3) + { + if ((double)num19 == (double)numArray[index3]) + { + flag = false; + break; + } + } + if (flag) + { + num17 = num18; + break; + } + } + if (num17 >= 0) + { + int index2 = NPC.NewNPC((int)npc.position.X, (int)num8, mod.NPCType("ShadowHand"), npc.whoAmI, 0.0f, 0.0f, 0.0f, 0.0f, 255); + Main.npc[index2].ai[0] = (num17 * 0.100000001490116F - 0.0500000007450581F); + } + } + } + //} + if (npc.localAI[0] != 1.0 || Main.netMode == 1) + return false; + npc.localAI[0] = 2f; + + float num20 = ((((Main.wofB + Main.wofT) / 2) + Main.wofB) / 2.0F); + for (int index1 = 0; index1 < 11; ++index1) + { + int index2 = NPC.NewNPC((int)npc.position.X, (int)num20, mod.NPCType("ShadowHand"), npc.whoAmI, 0.0f, 0.0f, 0.0f, 0.0f, 255); + Main.npc[index2].ai[0] = (index1 * 0.100000001490116F - 0.0500000007450581F); + } + + } + + return false; + } + + public override void FindFrame(int frameHeight) + { + ///--------------------------------------------------------------------------------------------------------------- + int frameWidth = 96; // I'm just hardcoding this, since this is the frame width of one frame along the X axis. + npc.spriteDirection = npc.direction; + + // Now if you want to animate, you can do: + npc.frameCounter++; + if (npc.frameCounter >= 12) + { + + if (npc.life > npc.lifeMax * 0.5f) + { + npc.frame.Y += 98; + if (npc.frame.Y >= 196) + { + npc.frame.Y = 0; + npc.frame.X = 0; + } + } + + if (npc.life < npc.lifeMax * 0.5f) + { + npc.frame.Y += 98; + if (npc.frame.Y >= 196) + { + npc.frame.Y = 0; + npc.frame.X = 96; + } + + } + + npc.frameCounter = 0; + } + + npc.frame.Width = frameWidth; + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Gore.NewGore(npc.position, npc.velocity, 99, 2f); + Gore.NewGore(npc.position, npc.velocity, 99, 3f); + Gore.NewGore(npc.position, npc.velocity, 99, 4f); + Gore.NewGore(npc.position, npc.velocity, 99, 5f); + Gore.NewGore(npc.position, npc.velocity, 99, 4f); + Gore.NewGore(npc.position, npc.velocity, 99, 3f); + Gore.NewGore(npc.position, npc.velocity, 99, 2f); + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + Gore.NewGore(npc.position, npc.velocity, 99, 2f); + Gore.NewGore(npc.position, npc.velocity, 99, 3f); + Gore.NewGore(npc.position, npc.velocity, 99, 3f); + Gore.NewGore(npc.position, npc.velocity, 99, 4f); + Gore.NewGore(npc.position, npc.velocity, 99, 4f); + Gore.NewGore(npc.position, npc.velocity, 99, 3f); + Gore.NewGore(npc.position, npc.velocity, 99, 2f); + Gore.NewGore(npc.position, npc.velocity, 99, 3f); + Gore.NewGore(npc.position, npc.velocity, 99, 4f); + Gore.NewGore(npc.position, npc.velocity, 99, 5f); + Gore.NewGore(npc.position, npc.velocity, 99, 4f); + Gore.NewGore(npc.position, npc.velocity, 99, 3f); + Gore.NewGore(npc.position, npc.velocity, 99, 2f); + Gore.NewGore(npc.position, npc.velocity, 99, 1f); + Gore.NewGore(npc.position, npc.velocity, 99, 2f); + Gore.NewGore(npc.position, npc.velocity, 99, 3f); + Gore.NewGore(npc.position, npc.velocity, 99, 3f); + Gore.NewGore(npc.position, npc.velocity, 99, 4f); + Gore.NewGore(npc.position, npc.velocity, 99, 4f); + Gore.NewGore(npc.position, npc.velocity, 99, 3f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WallOfShadowGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WallOfShadowGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WallOfShadowGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WallOfShadowGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WallOfShadowGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WallOfShadowGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WallOfShadowGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WallOfShadowGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WallOfShadowGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WallOfShadowGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WallOfShadowGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WallOfShadowGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WallOfShadowGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WallOfShadowGore2"), 1f); + } + } + + + public override void NPCLoot() + { + if (Main.expertMode) + { + npc.DropBossBags(); + } + + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + + if (!Main.expertMode) + { + Helper.DropItem(new Rectangle((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height), new Drop(mod.ItemType("HeavyBeamCannon"), 1, 1), new Drop(mod.ItemType("Bolter"), 1, 1), new Drop(mod.ItemType("StrikerBlade"), 1, 1), new Drop(0, 0, 0)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 499, Main.rand.Next(5, 15)); + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("DarknessCloth"), Main.rand.Next(8, 15)); + if (Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("WallofShadowMask")); + } + } + + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("WallofShadowTrophy")); + } + } + + if (Main.netMode != 1) + { + int num1 = (int)(npc.position.X + (npc.width / 2)) / 16; + int num2 = (int)(npc.position.Y + (npc.height / 2)) / 16; + int num5 = npc.width / 2 / 16 + 1; + for (int index2 = num1 - num5; index2 <= num1 + num5; ++index2) + { + for (int index3 = num2 - num5; index3 <= num2 + num5; ++index3) + { + if ((index2 == num1 - num5 || index2 == num1 + num5 || (index3 == num2 - num5 || index3 == num2 + num5)) && !Main.tile[index2, index3].active()) + { + Main.tile[index2, index3].type = 140; + Main.tile[index2, index3].active(true); + } + Main.tile[index2, index3].lava(false); + Main.tile[index2, index3].liquid = 0; + if (Main.netMode == 2) + NetMessage.SendTileSquare(-1, index2, index3, 1); + else + WorldGen.SquareTileFrame(index2, index3, true); + } + } + + //NetMessage.SendData(7, -1, -1, "", 0, 0.0f, 0.0f, 0.0f, 0, 0, 0); + } + } + + + + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) + { + Texture2D shadowChain = mod.GetTexture("NPCs/WallOfShadowChain"); + Texture2D shadowWall = mod.GetTexture("NPCs/WallOfShadow_Wall"); + for (int i = 0; i < 255; i++) + { + if (Main.player[i].active && Main.player[i].tongued && !Main.player[i].dead) + { + float num = npc.position.X + (npc.width / 2); + float num2 = npc.position.Y + (npc.height / 2); + Vector2 vector = new Vector2(Main.player[i].position.X + Main.player[i].width * 0.5f, Main.player[i].position.Y + Main.player[i].height * 0.5f); + float num3 = num - vector.X; + float num4 = num2 - vector.Y; + float rotation = (float)Math.Atan2(num4, num3) - 1.57f; + bool flag = true; + while (flag) + { + float num5 = (float)Math.Sqrt(num3 * num3 + num4 * num4); + if (num5 < 40f) + { + flag = false; + } + else + { + num5 = shadowChain.Height / num5; + num3 *= num5; + num4 *= num5; + vector.X += num3; + vector.Y += num4; + num3 = num - vector.X; + num4 = num2 - vector.Y; + Color color = Lighting.GetColor((int)vector.X / 16, (int)(vector.Y / 16f)); + spriteBatch.Draw(shadowChain, new Vector2(vector.X - Main.screenPosition.X, vector.Y - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, shadowChain.Width, shadowChain.Height)), color, rotation, new Vector2(shadowChain.Width * 0.5f, shadowChain.Height * 0.5f), 1f, SpriteEffects.None, 0f); + } + } + } + } + for (int j = 0; j < 200; j++) + { + if (Main.npc[j].active && Main.npc[j].type == mod.NPCType("ShadowHand")) + { + float num6 = npc.position.X + (npc.width / 2); + float num7 = npc.position.Y; + float num8 = (Main.wofB - Main.wofT); + bool flag2 = false; + if (Main.npc[j].frameCounter > 7.0) + { + flag2 = true; + } + num7 = Main.wofT + num8 * Main.npc[j].ai[0]; + Vector2 vector2 = new Vector2(Main.npc[j].position.X + (Main.npc[j].width / 2), Main.npc[j].position.Y + (Main.npc[j].height / 2)); + float num9 = num6 - vector2.X; + float num10 = num7 - vector2.Y; + float rotation2 = (float)Math.Atan2(num10, num9) - 1.57f; + bool flag3 = true; + while (flag3) + { + SpriteEffects effects1 = SpriteEffects.None; + if (flag2) + { + effects1 = SpriteEffects.FlipHorizontally; + flag2 = false; + } + else + { + flag2 = true; + } + int height = 28; + float num11 = (float)Math.Sqrt(num9 * num9 + num10 * num10); + if (num11 < 40f) + { + height = (int)num11 - 40 + 28; + flag3 = false; + } + num11 = 28f / num11; + num9 *= num11; + num10 *= num11; + vector2.X += num9; + vector2.Y += num10; + num9 = num6 - vector2.X; + num10 = num7 - vector2.Y; + Color color2 = Lighting.GetColor((int)vector2.X / 16, (int)(vector2.Y / 16f)); + spriteBatch.Draw(shadowChain, new Vector2(vector2.X - Main.screenPosition.X, vector2.Y - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, 0, shadowChain.Width, height)), color2, rotation2, new Vector2(shadowChain.Width * 0.5f, shadowChain.Height * 0.5f), 1f, effects1, 0f); + } + } + } + int num12 = 140; + float num13 = (float)Main.wofT; + float num14 = (float)Main.wofB; + num14 = Main.screenPosition.Y + Main.screenHeight; + float num15 = (float)((int)((num13 - Main.screenPosition.Y) / (float)num12) + 1); + num15 *= num12; + if (num15 > 0f) + { + num13 -= num15; + } + float num16 = num13; + float num17 = npc.position.X; + float num18 = num14 - num13; + bool flag4 = true; + SpriteEffects effects2 = SpriteEffects.None; + if (npc.spriteDirection == 1) + { + effects2 = SpriteEffects.FlipHorizontally; + } + if (npc.direction > 0) + { + num17 -= 80f; + } + int num19 = 0; + if (!Main.gamePaused) + { + Main.wofF++; + } + if (Main.wofF > 12) + { + num19 = 280; + if (Main.wofF > 17) + { + Main.wofF = 0; + } + } + else if (Main.wofF > 6) + { + num19 = 140; + } + while (flag4) + { + num18 = num14 - num16; + if (num18 > (float)num12) + { + num18 = (float)num12; + } + bool flag5 = true; + int num20 = 0; + while (flag5) + { + int x = (int)(num17 + (float)(shadowWall.Width / 2)) / 16; + int y = (int)(num16 + (float)num20) / 16; + Main.spriteBatch.Draw(shadowWall, new Vector2(num17 - Main.screenPosition.X, num16 + (float)num20 - Main.screenPosition.Y), new Rectangle?(new Rectangle(0, num19 + num20, shadowWall.Width, 16)), Lighting.GetColor(x, y), 0f, default(Vector2), 1f, effects2, 0f); + num20 += 16; + if ((float)num20 >= num18) + { + flag5 = false; + } + } + num16 += (float)num12; + if (num16 >= num14) + { + flag4 = false; + } + } + + Texture2D drawTexture = Main.npcTexture[npc.type]; + Vector2 origin = new Vector2((drawTexture.Width / 2) * 0.5F, (drawTexture.Height / Main.npcFrameCount[npc.type]) * 0.5F); + + Vector2 drawPos = new Vector2( + npc.position.X - Main.screenPosition.X + (npc.width / 2) - (Main.npcTexture[npc.type].Width / 2) * npc.scale / 2f + origin.X * npc.scale, + npc.position.Y - Main.screenPosition.Y + npc.height - Main.npcTexture[npc.type].Height * npc.scale / Main.npcFrameCount[npc.type] + 4f + origin.Y * npc.scale + npc.gfxOffY); + + SpriteEffects effects = npc.spriteDirection == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + spriteBatch.Draw(drawTexture, drawPos, npc.frame, drawColor, npc.rotation, origin, npc.scale, effects, 0); + + + return false; + } + } } diff --git a/NPCs/WallOfShadowEye.cs b/NPCs/WallOfShadowEye.cs index aa5d1297..338adc75 100644 --- a/NPCs/WallOfShadowEye.cs +++ b/NPCs/WallOfShadowEye.cs @@ -10,184 +10,184 @@ namespace Tremor.NPCs { - public class WallOfShadowEye : ModNPC - { + public class WallOfShadowEye : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Wall of Shadows"); } - - public override void SetDefaults() - { - npc.width = 100; - npc.height = 100; - npc.value = Item.buyPrice(0, 0, 0, 0); - npc.damage = 78; - npc.defense = 40; - npc.lifeMax = 8000; - npc.knockBackResist = 0f; + public override void SetDefaults() + { + npc.width = 100; + npc.height = 100; + npc.value = Item.buyPrice(0, 0, 0, 0); - npc.boss = true; - npc.noGravity = true; - npc.lavaImmune = true; - npc.behindTiles = true; - npc.noTileCollide = true; + npc.damage = 78; + npc.defense = 40; + npc.lifeMax = 8000; + npc.knockBackResist = 0f; - npc.HitSound = SoundID.NPCHit8; - npc.DeathSound = SoundID.NPCDeath10; + npc.boss = true; + npc.noGravity = true; + npc.lavaImmune = true; + npc.behindTiles = true; + npc.noTileCollide = true; - music = MusicID.Boss2; - } + npc.HitSound = SoundID.NPCHit8; + npc.DeathSound = SoundID.NPCDeath10; - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 0.625f * bossLifeScale); - npc.damage = (int)(npc.damage * 0.6f); - } + music = MusicID.Boss2; + } - public override bool PreAI() - { - if (Main.wof < 0) - { - npc.active = false; - } - else - { - npc.realLife = Main.wof; - if (Main.npc[Main.wof].life > 0) - npc.life = Main.npc[Main.wof].life; - npc.TargetClosest(true); - npc.position.X = Main.npc[Main.wof].position.X; - npc.direction = Main.npc[Main.wof].direction; - npc.spriteDirection = npc.direction; - float num1 = ((Main.wofB + Main.wofT) / 2); - float num2 = (npc.ai[0] <= 0.0 ? ((num1 + Main.wofB) / 2) : ((num1 + Main.wofT) / 2)) - (npc.height / 2); - if (npc.position.Y > num2 + 1) - npc.velocity.Y = -1f; - else if (npc.position.Y < num2 - 1) - { - npc.velocity.Y = 1f; - } - else - { - npc.velocity.Y = 0.0f; - npc.position.Y = num2; - } - if (npc.velocity.Y > 5.0) - npc.velocity.Y = 5f; - if (npc.velocity.Y < -5.0) - npc.velocity.Y = -5f; - Vector2 vector2 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); - float num3 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) - vector2.X; - float num4 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - vector2.Y; - float num5 = (float)Math.Sqrt(num3 * num3 + num4 * num4); - float num6 = num3 * num5; - float num7 = num4 * num5; - bool flag = true; - if (npc.direction > 0) - { - if (Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) > npc.position.X + (npc.width / 2)) - { - npc.rotation = (float)Math.Atan2(-num7, -num6) + 3.14f; - } - else - { - npc.rotation = 0.0f; - flag = false; - } - } - else if (Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) < npc.position.X + (npc.width / 2)) - { - npc.rotation = (float)Math.Atan2(num7, num6) + 3.14f; - } - else - { - npc.rotation = 0.0f; - flag = false; - } - if (Main.netMode == 1) - return false; - int num8 = 4; - ++npc.localAI[1]; - if (Main.npc[Main.wof].life < Main.npc[Main.wof].lifeMax * 0.75F) - { - ++npc.localAI[1]; - ++num8; - } - if (Main.npc[Main.wof].life < Main.npc[Main.wof].lifeMax * 0.5F) - { - ++npc.localAI[1]; - ++num8; - } - if (Main.npc[Main.wof].life < Main.npc[Main.wof].lifeMax * 0.25F) - { - ++npc.localAI[1]; - num8 += 2; - } - if (Main.npc[Main.wof].life < Main.npc[Main.wof].lifeMax * 0.1F) - { - npc.localAI[1] += 2f; - num8 += 3; - } - if (Main.expertMode) - { - npc.localAI[1] += 0.5f; - ++num8; - if (Main.npc[Main.wof].life < Main.npc[Main.wof].lifeMax * 0.1F) - { - npc.localAI[1] += 2f; - num8 += 3; - } - } - if (npc.localAI[2] == 0) - { - if (npc.localAI[1] <= 600) - return false; - npc.localAI[2] = 1f; - npc.localAI[1] = 0.0f; - } - else - { - if (npc.localAI[1] <= 45 || !Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) - return false; - npc.localAI[1] = 0; - ++npc.localAI[2]; - if (npc.localAI[2] >= num8) - npc.localAI[2] = 0; - if (!flag) - return false; - float num9 = 9f; - int Damage = 11; - int Type = 83; - if (Main.npc[Main.wof].life < Main.npc[Main.wof].lifeMax * 0.5F) - { - ++Damage; - ++num9; - } - if (Main.npc[Main.wof].life < Main.npc[Main.wof].lifeMax * 0.25F) - { - ++Damage; - ++num9; - } - if (Main.npc[Main.wof].life < Main.npc[Main.wof].lifeMax * 0.1F) - { - Damage += 2; - num9 += 2f; - } - vector2 = new Vector2(npc.position.X + npc.width * 0.5F, npc.position.Y + npc.height * 0.5F); - float num10 = Main.player[npc.target].position.X + Main.player[npc.target].width * 0.5F - vector2.X; - float num11 = Main.player[npc.target].position.Y + Main.player[npc.target].height * 0.5F - vector2.Y; - float num12 = (float)Math.Sqrt(num10 * num10 + num11 * num11); - float num13 = num9 / num12; - float SpeedX = num10 * num13; - float SpeedY = num11 * num13; - vector2.X += SpeedX; - vector2.Y += SpeedY; - Projectile.NewProjectile(vector2.X, vector2.Y, SpeedX, SpeedY, Type, Damage, 0.0f, Main.myPlayer, 0.0f, 0.0f); - } - } - return false; - } - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 0.625f * bossLifeScale); + npc.damage = (int)(npc.damage * 0.6f); + } + + public override bool PreAI() + { + if (Main.wof < 0) + { + npc.active = false; + } + else + { + npc.realLife = Main.wof; + if (Main.npc[Main.wof].life > 0) + npc.life = Main.npc[Main.wof].life; + npc.TargetClosest(true); + npc.position.X = Main.npc[Main.wof].position.X; + npc.direction = Main.npc[Main.wof].direction; + npc.spriteDirection = npc.direction; + float num1 = ((Main.wofB + Main.wofT) / 2); + float num2 = (npc.ai[0] <= 0.0 ? ((num1 + Main.wofB) / 2) : ((num1 + Main.wofT) / 2)) - (npc.height / 2); + if (npc.position.Y > num2 + 1) + npc.velocity.Y = -1f; + else if (npc.position.Y < num2 - 1) + { + npc.velocity.Y = 1f; + } + else + { + npc.velocity.Y = 0.0f; + npc.position.Y = num2; + } + if (npc.velocity.Y > 5.0) + npc.velocity.Y = 5f; + if (npc.velocity.Y < -5.0) + npc.velocity.Y = -5f; + Vector2 vector2 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); + float num3 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) - vector2.X; + float num4 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - vector2.Y; + float num5 = (float)Math.Sqrt(num3 * num3 + num4 * num4); + float num6 = num3 * num5; + float num7 = num4 * num5; + bool flag = true; + if (npc.direction > 0) + { + if (Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) > npc.position.X + (npc.width / 2)) + { + npc.rotation = (float)Math.Atan2(-num7, -num6) + 3.14f; + } + else + { + npc.rotation = 0.0f; + flag = false; + } + } + else if (Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) < npc.position.X + (npc.width / 2)) + { + npc.rotation = (float)Math.Atan2(num7, num6) + 3.14f; + } + else + { + npc.rotation = 0.0f; + flag = false; + } + if (Main.netMode == 1) + return false; + int num8 = 4; + ++npc.localAI[1]; + if (Main.npc[Main.wof].life < Main.npc[Main.wof].lifeMax * 0.75F) + { + ++npc.localAI[1]; + ++num8; + } + if (Main.npc[Main.wof].life < Main.npc[Main.wof].lifeMax * 0.5F) + { + ++npc.localAI[1]; + ++num8; + } + if (Main.npc[Main.wof].life < Main.npc[Main.wof].lifeMax * 0.25F) + { + ++npc.localAI[1]; + num8 += 2; + } + if (Main.npc[Main.wof].life < Main.npc[Main.wof].lifeMax * 0.1F) + { + npc.localAI[1] += 2f; + num8 += 3; + } + if (Main.expertMode) + { + npc.localAI[1] += 0.5f; + ++num8; + if (Main.npc[Main.wof].life < Main.npc[Main.wof].lifeMax * 0.1F) + { + npc.localAI[1] += 2f; + num8 += 3; + } + } + if (npc.localAI[2] == 0) + { + if (npc.localAI[1] <= 600) + return false; + npc.localAI[2] = 1f; + npc.localAI[1] = 0.0f; + } + else + { + if (npc.localAI[1] <= 45 || !Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) + return false; + npc.localAI[1] = 0; + ++npc.localAI[2]; + if (npc.localAI[2] >= num8) + npc.localAI[2] = 0; + if (!flag) + return false; + float num9 = 9f; + int Damage = 11; + int Type = 83; + if (Main.npc[Main.wof].life < Main.npc[Main.wof].lifeMax * 0.5F) + { + ++Damage; + ++num9; + } + if (Main.npc[Main.wof].life < Main.npc[Main.wof].lifeMax * 0.25F) + { + ++Damage; + ++num9; + } + if (Main.npc[Main.wof].life < Main.npc[Main.wof].lifeMax * 0.1F) + { + Damage += 2; + num9 += 2f; + } + vector2 = new Vector2(npc.position.X + npc.width * 0.5F, npc.position.Y + npc.height * 0.5F); + float num10 = Main.player[npc.target].position.X + Main.player[npc.target].width * 0.5F - vector2.X; + float num11 = Main.player[npc.target].position.Y + Main.player[npc.target].height * 0.5F - vector2.Y; + float num12 = (float)Math.Sqrt(num10 * num10 + num11 * num11); + float num13 = num9 / num12; + float SpeedX = num10 * num13; + float SpeedY = num11 * num13; + vector2.X += SpeedX; + vector2.Y += SpeedY; + Projectile.NewProjectile(vector2.X, vector2.Y, SpeedX, SpeedY, Type, Damage, 0.0f, Main.myPlayer, 0.0f, 0.0f); + } + } + return false; + } + } } diff --git a/NPCs/Warlock.cs b/NPCs/Warlock.cs index 98a178c8..6f8b1c6b 100644 --- a/NPCs/Warlock.cs +++ b/NPCs/Warlock.cs @@ -6,11 +6,12 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -[AutoloadHead] -public class Warlock : ModNPC +namespace Tremor.NPCs { + + [AutoloadHead] + public class Warlock : ModNPC + { public override string Texture { get @@ -18,14 +19,14 @@ public override string Texture return "Tremor/NPCs/Warlock"; } } - + public override string[] AltTextures { get { - return new string[] { "Tremor/NPCs/Warlock"}; + return new string[] { "Tremor/NPCs/Warlock" }; } - } + } public override bool Autoload(ref string name) { @@ -45,150 +46,151 @@ public override void SetStaticDefaults() NPCID.Sets.AttackAverageChance[npc.type] = 30; } - public override void SetDefaults() - { - npc.townNPC = true; - npc.friendly = true; - npc.width = 40; - npc.height = 52; - npc.aiStyle = 7; - npc.damage = 10; - npc.defense = 15; - npc.lifeMax = 250; - npc.HitSound = SoundID.NPCHit2; - npc.DeathSound = SoundID.NPCDeath2; - npc.knockBackResist = 0.5f; - animationType = NPCID.Guide; - } + public override void SetDefaults() + { + npc.townNPC = true; + npc.friendly = true; + npc.width = 40; + npc.height = 52; + npc.aiStyle = 7; + npc.damage = 10; + npc.defense = 15; + npc.lifeMax = 250; + npc.HitSound = SoundID.NPCHit2; + npc.DeathSound = SoundID.NPCDeath2; + npc.knockBackResist = 0.5f; + animationType = NPCID.Guide; + } public override bool CanTownNPCSpawn(int numTownNPCs, int money) { - if(NPC.downedBoss2) - return true; + if (NPC.downedBoss2) + return true; return false; } - public override string TownNPCName() - { - switch(WorldGen.genRand.Next(4)) - { - case 0: - return "Azazel"; - case 1: - return "Baphomet"; - case 2: - return "Vaal"; - case 3: - return "Dis"; - case 4: - return "Nisroke"; - default: - return "Sabnak"; - } - } - - public override string GetChat() - { - switch(Main.rand.Next(6)) - { - default: - return "..."; - } - } - - public override void SetChatButtons(ref string button, ref string button2) - { - button = Lang.inter[28].Value; - } - - public override void OnChatButtonClicked(bool firstButton, ref bool shop) - { - if(firstButton) - { - shop = true; - } - } - - public override void SetupShop(Chest shop, ref int nextSlot) - { - if(NPC.downedBoss3) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("BallnChain")); - nextSlot++; - } - if(WorldGen.crimson) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("ViciousHelmet")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("ViciousChestplate")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("ViciousLeggings")); - nextSlot++; - } - - if(!WorldGen.crimson) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("VileHelmet")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("VileChestplate")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("VileLeggings")); - nextSlot++; - } - shop.item[nextSlot].SetDefaults(mod.ItemType("StrongBelt")); - nextSlot++; - if(Main.hardMode) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("Necronomicon")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("Zephyrhorn")); - nextSlot++; - } - if(NPC.downedMechBoss1 && NPC.downedMechBoss2 && NPC.downedMechBoss3) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("NecroWarhammer")); - nextSlot++; - } - } - - public override void TownNPCAttackStrength(ref int damage, ref float knockback) - { - damage = 20; - knockback = 4f; - } - - public override void TownNPCAttackCooldown(ref int cooldown, ref int randExtraCooldown) - { - cooldown = 10; - randExtraCooldown = 10; - } - - public override void TownNPCAttackProj(ref int projType, ref int attackDelay) - { - projType = 270; - attackDelay = 5; - } - - public override void TownNPCAttackProjSpeed(ref float multiplier, ref float gravityCorrection, ref float randomOffset) - { - multiplier = 12f; - randomOffset = 2f; - } - - - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WarlockGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WarlockGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WarlockGore3"), 1f); - } -} -}} \ No newline at end of file + public override string TownNPCName() + { + switch (WorldGen.genRand.Next(4)) + { + case 0: + return "Azazel"; + case 1: + return "Baphomet"; + case 2: + return "Vaal"; + case 3: + return "Dis"; + case 4: + return "Nisroke"; + default: + return "Sabnak"; + } + } + + public override string GetChat() + { + switch (Main.rand.Next(6)) + { + default: + return "..."; + } + } + + public override void SetChatButtons(ref string button, ref string button2) + { + button = Lang.inter[28].Value; + } + + public override void OnChatButtonClicked(bool firstButton, ref bool shop) + { + if (firstButton) + { + shop = true; + } + } + + public override void SetupShop(Chest shop, ref int nextSlot) + { + if (NPC.downedBoss3) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("BallnChain")); + nextSlot++; + } + if (WorldGen.crimson) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("ViciousHelmet")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("ViciousChestplate")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("ViciousLeggings")); + nextSlot++; + } + + if (!WorldGen.crimson) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("VileHelmet")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("VileChestplate")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("VileLeggings")); + nextSlot++; + } + shop.item[nextSlot].SetDefaults(mod.ItemType("StrongBelt")); + nextSlot++; + if (Main.hardMode) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("Necronomicon")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("Zephyrhorn")); + nextSlot++; + } + if (NPC.downedMechBoss1 && NPC.downedMechBoss2 && NPC.downedMechBoss3) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("NecroWarhammer")); + nextSlot++; + } + } + + public override void TownNPCAttackStrength(ref int damage, ref float knockback) + { + damage = 20; + knockback = 4f; + } + + public override void TownNPCAttackCooldown(ref int cooldown, ref int randExtraCooldown) + { + cooldown = 10; + randExtraCooldown = 10; + } + + public override void TownNPCAttackProj(ref int projType, ref int attackDelay) + { + projType = 270; + attackDelay = 5; + } + + public override void TownNPCAttackProjSpeed(ref float multiplier, ref float gravityCorrection, ref float randomOffset) + { + multiplier = 12f; + randomOffset = 2f; + } + + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WarlockGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WarlockGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WarlockGore3"), 1f); + } + } + } +} \ No newline at end of file diff --git a/NPCs/Witch.cs b/NPCs/Witch.cs index a2b485a4..8efa35a4 100644 --- a/NPCs/Witch.cs +++ b/NPCs/Witch.cs @@ -6,11 +6,12 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -[AutoloadHead] -public class Witch : ModNPC +namespace Tremor.NPCs { + + [AutoloadHead] + public class Witch : ModNPC + { public override string Texture { get @@ -18,14 +19,14 @@ public override string Texture return "Tremor/NPCs/Witch"; } } - + public override string[] AltTextures { get { - return new string[] { "Tremor/NPCs/Witch"}; + return new string[] { "Tremor/NPCs/Witch" }; } - } + } public override bool Autoload(ref string name) { @@ -45,151 +46,152 @@ public override void SetStaticDefaults() NPCID.Sets.AttackAverageChance[npc.type] = 30; } - public override void SetDefaults() - { - npc.townNPC = true; - npc.friendly = true; - npc.width = 32; - npc.height = 54; - npc.aiStyle = 7; - npc.damage = 10; - npc.defense = 15; - npc.lifeMax = 250; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.knockBackResist = 0.5f; - animationType = NPCID.Guide; - } - - public override bool CanTownNPCSpawn(int numTownNPCs, int money) - { - for(int k = 0; k < 255; k++) - { - Player player = Main.player[k]; - if(player.active) - { - for(int j = 0; j < player.inventory.Length; j++) - { - if(player.inventory[j].type == 1774) - { - return true; - } - } - } - } - return false; - } - - - public override string TownNPCName() - { - switch(WorldGen.genRand.Next(4)) - { - case 0: - return "Circe"; - case 1: - return "Kikimora"; - case 2: - return "Morgana"; - default: - return "Hecate"; - } - } - - public override string GetChat() - { - switch(Main.rand.Next(6)) - { - case 0: - return " Welcome dearies! I hope you don't mind the body parts. I was cleaning."; - case 1: - return "Eye of a newt! Tongue of a cat! Blood of a dryad... a little more blood."; - case 2: - return "Don't pull my nose! It's not a mask!"; - case 3: - return "The moon has a secret dearies! One that you'll know soon enough!"; - case 4: - return "This is halloween! Or isn't it?"; - default: - return "Blood for the blood moon! Skulls for the skull cap...or was it something else?"; - } - } - - public override void SetChatButtons(ref string button, ref string button2) - { - button = Lang.inter[28].Value; - } - - public override void OnChatButtonClicked(bool firstButton, ref bool shop) - { - if(firstButton) - { - shop = true; - } - } - - public override void SetupShop(Chest shop, ref int nextSlot) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("PlagueMask")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("PlagueRobe")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("SacrificalScythe")); - nextSlot++; - shop.item[nextSlot].SetDefaults(mod.ItemType("Scarecrow")); - nextSlot++; - if(NPC.downedBoss1) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("BoomSpear")); - nextSlot++; - } - if(NPC.downedBoss2) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("BlackRose")); - nextSlot++; - } - if(NPC.downedBoss3) - { - shop.item[nextSlot].SetDefaults(mod.ItemType("Pumpspell")); - nextSlot++; - } - } - - public override void TownNPCAttackStrength(ref int damage, ref float knockback) - { - damage = 25; - knockback = 4f; - } - - public override void TownNPCAttackCooldown(ref int cooldown, ref int randExtraCooldown) - { - cooldown = 10; - randExtraCooldown = 10; - } - - public override void TownNPCAttackProj(ref int projType, ref int attackDelay) - { - projType = mod.ProjectileType("PumpkinPro"); - attackDelay = 2; - } - - public override void TownNPCAttackProjSpeed(ref float multiplier, ref float gravityCorrection, ref float randomOffset) - { - multiplier = 12f; - randomOffset = 2f; - } - - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WitchGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WitchGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WitchGore3"), 1f); - } -} -}} \ No newline at end of file + public override void SetDefaults() + { + npc.townNPC = true; + npc.friendly = true; + npc.width = 32; + npc.height = 54; + npc.aiStyle = 7; + npc.damage = 10; + npc.defense = 15; + npc.lifeMax = 250; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.knockBackResist = 0.5f; + animationType = NPCID.Guide; + } + + public override bool CanTownNPCSpawn(int numTownNPCs, int money) + { + for (int k = 0; k < 255; k++) + { + Player player = Main.player[k]; + if (player.active) + { + for (int j = 0; j < player.inventory.Length; j++) + { + if (player.inventory[j].type == 1774) + { + return true; + } + } + } + } + return false; + } + + + public override string TownNPCName() + { + switch (WorldGen.genRand.Next(4)) + { + case 0: + return "Circe"; + case 1: + return "Kikimora"; + case 2: + return "Morgana"; + default: + return "Hecate"; + } + } + + public override string GetChat() + { + switch (Main.rand.Next(6)) + { + case 0: + return " Welcome dearies! I hope you don't mind the body parts. I was cleaning."; + case 1: + return "Eye of a newt! Tongue of a cat! Blood of a dryad... a little more blood."; + case 2: + return "Don't pull my nose! It's not a mask!"; + case 3: + return "The moon has a secret dearies! One that you'll know soon enough!"; + case 4: + return "This is halloween! Or isn't it?"; + default: + return "Blood for the blood moon! Skulls for the skull cap...or was it something else?"; + } + } + + public override void SetChatButtons(ref string button, ref string button2) + { + button = Lang.inter[28].Value; + } + + public override void OnChatButtonClicked(bool firstButton, ref bool shop) + { + if (firstButton) + { + shop = true; + } + } + + public override void SetupShop(Chest shop, ref int nextSlot) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("PlagueMask")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("PlagueRobe")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("SacrificalScythe")); + nextSlot++; + shop.item[nextSlot].SetDefaults(mod.ItemType("Scarecrow")); + nextSlot++; + if (NPC.downedBoss1) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("BoomSpear")); + nextSlot++; + } + if (NPC.downedBoss2) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("BlackRose")); + nextSlot++; + } + if (NPC.downedBoss3) + { + shop.item[nextSlot].SetDefaults(mod.ItemType("Pumpspell")); + nextSlot++; + } + } + + public override void TownNPCAttackStrength(ref int damage, ref float knockback) + { + damage = 25; + knockback = 4f; + } + + public override void TownNPCAttackCooldown(ref int cooldown, ref int randExtraCooldown) + { + cooldown = 10; + randExtraCooldown = 10; + } + + public override void TownNPCAttackProj(ref int projType, ref int attackDelay) + { + projType = mod.ProjectileType("PumpkinPro"); + attackDelay = 2; + } + + public override void TownNPCAttackProjSpeed(ref float multiplier, ref float gravityCorrection, ref float randomOffset) + { + multiplier = 12f; + randomOffset = 2f; + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 151, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WitchGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WitchGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WitchGore3"), 1f); + } + } + } +} \ No newline at end of file diff --git a/NPCs/Woodling.cs b/NPCs/Woodling.cs index b06c54d4..d0d822c5 100644 --- a/NPCs/Woodling.cs +++ b/NPCs/Woodling.cs @@ -6,78 +6,80 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Woodling : ModNPC +namespace Tremor.NPCs { + + public class Woodling : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Woodling"); Main.npcFrameCount[npc.type] = 10; } - - public override void SetDefaults() - { - npc.lifeMax = 90; - npc.damage = 14; - npc.defense = 9; - npc.knockBackResist = 0.3f; - npc.width = 56; - npc.height = 48; - aiType = 429; - animationType = 429; - npc.aiStyle = 3; - npc.npcSlots = 0.2f; - npc.HitSound = SoundID.NPCHit37; - npc.DeathSound = SoundID.NPCDeath57; - npc.value = Item.buyPrice(0, 0, 6, 9); - banner = npc.type; - bannerItem = mod.ItemType("WoodlingBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 90; + npc.damage = 14; + npc.defense = 9; + npc.knockBackResist = 0.3f; + npc.width = 56; + npc.height = 48; + aiType = 429; + animationType = 429; + npc.aiStyle = 3; + npc.npcSlots = 0.2f; + npc.HitSound = SoundID.NPCHit37; + npc.DeathSound = SoundID.NPCDeath57; + npc.value = Item.buyPrice(0, 0, 6, 9); + banner = npc.type; + bannerItem = mod.ItemType("WoodlingBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 9); - } - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 9); + } + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WoodlingGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WoodlingGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WoodlingGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WoodlingGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WoodlingGore3"), 1f); + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WoodlingGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WoodlingGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WoodlingGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WoodlingGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WoodlingGore3"), 1f); - } -} + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && NPC.downedBoss1 && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && y < Main.worldSurface ? 0.002f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && NPC.downedBoss1 && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && y < Main.worldSurface ? 0.002f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/WoodlingWarrior.cs b/NPCs/WoodlingWarrior.cs index 3819e276..19c23fbf 100644 --- a/NPCs/WoodlingWarrior.cs +++ b/NPCs/WoodlingWarrior.cs @@ -6,88 +6,90 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class WoodlingWarrior : ModNPC +namespace Tremor.NPCs { + + public class WoodlingWarrior : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Woodling Warrior"); Main.npcFrameCount[npc.type] = 10; } - - public override void SetDefaults() - { - npc.lifeMax = 160; - npc.damage = 27; - npc.defense = 14; - npc.knockBackResist = 0.3f; - npc.width = 56; - npc.height = 48; - aiType = 429; - animationType = 429; - npc.aiStyle = 3; - npc.npcSlots = 0.2f; - npc.HitSound = SoundID.NPCHit37; - npc.DeathSound = SoundID.NPCDeath57; - npc.value = Item.buyPrice(0, 0, 6, 9); - banner = npc.type; - bannerItem = mod.ItemType("WoodlingWarriorBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 160; + npc.damage = 27; + npc.defense = 14; + npc.knockBackResist = 0.3f; + npc.width = 56; + npc.height = 48; + aiType = 429; + animationType = 429; + npc.aiStyle = 3; + npc.npcSlots = 0.2f; + npc.HitSound = SoundID.NPCHit37; + npc.DeathSound = SoundID.NPCDeath57; + npc.value = Item.buyPrice(0, 0, 6, 9); + banner = npc.type; + bannerItem = mod.ItemType("WoodlingWarriorBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 9); - } - if(Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ManaFruit"), Main.rand.Next(1,2)); - } - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 9); + } + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ManaFruit"), Main.rand.Next(1, 2)); + } + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WoodlingGore4"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WoodlingGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WoodlingGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WoodlingGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WoodlingGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WoodlingGore5"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WoodlingGore5"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WoodlingGore5"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WoodlingGore5"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WoodlingGore5"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WoodlingGore5"), 1f); + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 74, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 1f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WoodlingGore4"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WoodlingGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WoodlingGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WoodlingGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WoodlingGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WoodlingGore5"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WoodlingGore5"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WoodlingGore5"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WoodlingGore5"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WoodlingGore5"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WoodlingGore5"), 1f); - } -} + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && NPC.downedBoss2 && y < Main.worldSurface ? 0.001f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && NPC.downedBoss2 && y < Main.worldSurface ? 0.001f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/Woody.cs b/NPCs/Woody.cs index 7ad9f4db..a0a65bbb 100644 --- a/NPCs/Woody.cs +++ b/NPCs/Woody.cs @@ -7,53 +7,55 @@ using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Woody : ModNPC +namespace Tremor.NPCs { + + public class Woody : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Woody"); Main.npcFrameCount[npc.type] = 3; } - - public override void SetDefaults() - { - npc.lifeMax = 40; - npc.damage = 18; - npc.defense = 13; - npc.knockBackResist = 0.3f; - npc.width = 56; - npc.height = 30; - animationType = 141; - npc.aiStyle = 1; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.value = Item.buyPrice(0, 0, 2, 0); - banner = npc.type; - bannerItem = mod.ItemType("WoodyBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 40; + npc.damage = 18; + npc.defense = 13; + npc.knockBackResist = 0.3f; + npc.width = 56; + npc.height = 30; + animationType = 141; + npc.aiStyle = 1; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.value = Item.buyPrice(0, 0, 2, 0); + banner = npc.type; + bannerItem = mod.ItemType("WoodyBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } -public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WoodyGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WoodyGore2"), 1f); - } - } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneJungle && y > Main.rockLayer ? 0.01f : 0f; - } -}} \ No newline at end of file + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WoodyGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/WoodyGore2"), 1f); + } + } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && spawnInfo.player.ZoneJungle && y > Main.rockLayer ? 0.01f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/YGiantSlime.cs b/NPCs/YGiantSlime.cs index 95c38d63..06b2982d 100644 --- a/NPCs/YGiantSlime.cs +++ b/NPCs/YGiantSlime.cs @@ -7,77 +7,79 @@ using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class YGiantSlime : ModNPC +namespace Tremor.NPCs { + + public class YGiantSlime : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Yellow Slime"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 1800; - npc.damage = 100; - npc.defense = 32; - npc.knockBackResist = 0.3f; - npc.width = 70; - npc.alpha = 175; - npc.color = new Color(255, 255, 0, 100); - npc.height = 46; - animationType = 244; - npc.aiStyle = 1; - aiType = 138; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath23; - npc.value = Item.buyPrice(0, 0, 12, 15); - } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Yellow, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Yellow, 0.7f); - } - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Yellow, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Yellow, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Yellow, 0.7f); - Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Yellow, 0.7f); - } -} + public override void SetDefaults() + { + npc.lifeMax = 1800; + npc.damage = 100; + npc.defense = 32; + npc.knockBackResist = 0.3f; + npc.width = 70; + npc.alpha = 175; + npc.color = new Color(255, 255, 0, 100); + npc.height = 46; + animationType = 244; + npc.aiStyle = 1; + aiType = 138; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath23; + npc.value = Item.buyPrice(0, 0, 12, 15); + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Yellow, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Yellow, 0.7f); + } + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Yellow, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Yellow, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Yellow, 0.7f); + Dust.NewDust(npc.position, npc.width, npc.height, 4, 2.5f * (float)hitDirection, -2.5f, 0, Color.Yellow, 0.7f); + } + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return Main.hardMode && NPC.downedMoonlord && !spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.1f : 0f; - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return Main.hardMode && NPC.downedMoonlord && !spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.1f : 0f; + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 23); - }; - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 23); + }; + } + } -}} \ No newline at end of file + } +} \ No newline at end of file diff --git a/NPCs/Zarprite.cs b/NPCs/Zarprite.cs index 080bcd52..a7e03776 100644 --- a/NPCs/Zarprite.cs +++ b/NPCs/Zarprite.cs @@ -7,56 +7,58 @@ using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Zarprite : ModNPC +namespace Tremor.NPCs { + + public class Zarprite : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Zarprite"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 150; - npc.damage = 10; - npc.defense = 12; - npc.knockBackResist = 0.3f; - npc.width = 34; - npc.height = 48; - animationType = 75; - npc.aiStyle = 14; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit35; - npc.noGravity = true; - npc.DeathSound = SoundID.NPCDeath57; - npc.value = Item.buyPrice(0, 0, 15, 0); - banner = npc.type; - bannerItem = mod.ItemType("ZarpriteBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 150; + npc.damage = 10; + npc.defense = 12; + npc.knockBackResist = 0.3f; + npc.width = 34; + npc.height = 48; + animationType = 75; + npc.aiStyle = 14; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit35; + npc.noGravity = true; + npc.DeathSound = SoundID.NPCDeath57; + npc.value = Item.buyPrice(0, 0, 15, 0); + banner = npc.type; + bannerItem = mod.ItemType("ZarpriteBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } -public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZarpriteGore"), 1f); -NPC.NewNPC((int)npc.position.X - 6, (int)npc.position.Y + 6, mod.NPCType("Parasprite")); -NPC.NewNPC((int)npc.position.X + 6, (int)npc.position.Y, mod.NPCType("Parasprite")); -NPC.NewNPC((int)npc.position.X, (int)npc.position.Y - 6, mod.NPCType("Parasprite")); - } - } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && y > Main.rockLayer ? 0.01f : 0f; - } -}} \ No newline at end of file + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZarpriteGore"), 1f); + NPC.NewNPC((int)npc.position.X - 6, (int)npc.position.Y + 6, mod.NPCType("Parasprite")); + NPC.NewNPC((int)npc.position.X + 6, (int)npc.position.Y, mod.NPCType("Parasprite")); + NPC.NewNPC((int)npc.position.X, (int)npc.position.Y - 6, mod.NPCType("Parasprite")); + } + } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && y > Main.rockLayer ? 0.01f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/Zarprute.cs b/NPCs/Zarprute.cs index 6adeb31e..53631de9 100644 --- a/NPCs/Zarprute.cs +++ b/NPCs/Zarprute.cs @@ -7,58 +7,60 @@ using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Zarprute : ModNPC +namespace Tremor.NPCs { + + public class Zarprute : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Zarprute"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 1500; - npc.damage = 70; - npc.defense = 8; - npc.knockBackResist = 0.3f; - npc.width = 92; - npc.height = 54; - animationType = 75; - npc.aiStyle = 14; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit35; - npc.noGravity = true; - npc.DeathSound = SoundID.NPCDeath57; - npc.value = Item.buyPrice(0, 0, 20, 80); - banner = npc.type; - bannerItem = mod.ItemType("ZarpruteBanner"); - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void SetDefaults() + { + npc.lifeMax = 1500; + npc.damage = 70; + npc.defense = 8; + npc.knockBackResist = 0.3f; + npc.width = 92; + npc.height = 54; + animationType = 75; + npc.aiStyle = 14; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit35; + npc.noGravity = true; + npc.DeathSound = SoundID.NPCDeath57; + npc.value = Item.buyPrice(0, 0, 20, 80); + banner = npc.type; + bannerItem = mod.ItemType("ZarpruteBanner"); + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } -public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZarpruteGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZarpruteGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZarpruteGore2"), 1f); -NPC.NewNPC((int)npc.position.X, (int)npc.position.Y+15, mod.NPCType("Zarprite")); -NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("Zarprite")); -NPC.NewNPC((int)npc.position.X, (int)npc.position.Y-15, mod.NPCType("Zarprite")); - } - } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && y > Main.rockLayer ? 0.01f : 0f; - } -}} \ No newline at end of file + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZarpruteGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZarpruteGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZarpruteGore2"), 1f); + NPC.NewNPC((int)npc.position.X, (int)npc.position.Y + 15, mod.NPCType("Zarprite")); + NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("Zarprite")); + NPC.NewNPC((int)npc.position.X, (int)npc.position.Y - 15, mod.NPCType("Zarprite")); + } + } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NoZoneAllowWater(spawnInfo)) && Main.hardMode && y > Main.rockLayer ? 0.01f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/Zootaloo.cs b/NPCs/Zootaloo.cs index 11db52b9..339f0743 100644 --- a/NPCs/Zootaloo.cs +++ b/NPCs/Zootaloo.cs @@ -7,86 +7,88 @@ using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class Zootaloo : ModNPC +namespace Tremor.NPCs { - + + public class Zootaloo : ModNPC + { + public override void SetStaticDefaults() { DisplayName.SetDefault("Zootaloo"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 120; - npc.damage = 22; - npc.defense = 8; - npc.knockBackResist = 0.2f; - npc.width = 34; - npc.height = 48; - animationType = 48; - npc.aiStyle = 14; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit35; - npc.noGravity = true; - npc.DeathSound = SoundID.NPCDeath57; - banner = npc.type; - bannerItem = mod.ItemType("ZootalooBanner"); - } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 44, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZootalooGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZootalooGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZootalooGore2"), 1f); - } - else - { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 44, (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } - } + public override void SetDefaults() + { + npc.lifeMax = 120; + npc.damage = 22; + npc.defense = 8; + npc.knockBackResist = 0.2f; + npc.width = 34; + npc.height = 48; + animationType = 48; + npc.aiStyle = 14; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit35; + npc.noGravity = true; + npc.DeathSound = SoundID.NPCDeath57; + banner = npc.type; + bannerItem = mod.ItemType("ZootalooBanner"); + } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 44, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZootalooGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZootalooGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZootalooGore2"), 1f); + } + else + { + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 44, (float)hitDirection, -1f, 0, default(Color), 0.7f); + } + } + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LightBulb"), Main.rand.Next(1,3)); - } - if(Main.rand.Next(2) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Gloomstone"), Main.rand.Next(5,12)); - } - } - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LightBulb"), Main.rand.Next(1, 3)); + } + if (Main.rand.Next(2) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Gloomstone"), Main.rand.Next(5, 12)); + } + } + } + + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && y < Main.worldSurface ? 0.01f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && y < Main.worldSurface ? 0.01f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/ZootalooMatriarch.cs b/NPCs/ZootalooMatriarch.cs index 1b191aba..32cfa34b 100644 --- a/NPCs/ZootalooMatriarch.cs +++ b/NPCs/ZootalooMatriarch.cs @@ -7,90 +7,92 @@ using Terraria.ModLoader; -namespace Tremor.NPCs { - -public class ZootalooMatriarch : ModNPC +namespace Tremor.NPCs { + + public class ZootalooMatriarch : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Zootaloo Matriarch"); Main.npcFrameCount[npc.type] = 4; } - - public override void SetDefaults() - { - npc.lifeMax = 250; - npc.damage = 30; - npc.defense = 8; - npc.knockBackResist = 0.2f; - npc.width = 34; - npc.height = 48; - animationType = 48; - npc.aiStyle = 14; - npc.scale = 1.3f; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit35; - npc.noGravity = true; - npc.DeathSound = SoundID.NPCDeath57; - banner = npc.type; - bannerItem = mod.ItemType("ZootalooMatriarchBanner"); - } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - for(int k = 0; k < 20; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 44, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); - } - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZootalooGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZootalooGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZootalooGore2"), 1f); - } - else - { - for(int k = 0; k < damage / npc.lifeMax * 50.0; k++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 44, (float)hitDirection, -1f, 0, default(Color), 0.7f); - } - } - } + public override void SetDefaults() + { + npc.lifeMax = 250; + npc.damage = 30; + npc.defense = 8; + npc.knockBackResist = 0.2f; + npc.width = 34; + npc.height = 48; + animationType = 48; + npc.aiStyle = 14; + npc.scale = 1.3f; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit35; + npc.noGravity = true; + npc.DeathSound = SoundID.NPCDeath57; + banner = npc.type; + bannerItem = mod.ItemType("ZootalooMatriarchBanner"); + } + + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + for (int k = 0; k < 20; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 44, 2.5f * (float)hitDirection, -2.5f, 0, default(Color), 0.7f); + } + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZootalooGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZootalooGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/ZootalooGore2"), 1f); + } + else + { + for (int k = 0; k < damage / npc.lifeMax * 50.0; k++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 44, (float)hitDirection, -1f, 0, default(Color), 0.7f); + } + } + } - public override void NPCLoot() - { - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LightBulb"), Main.rand.Next(1,3)); - } - if(Main.rand.Next(20) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ZootalooEgg"), Main.rand.Next(1,3)); - } - if(Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Gloomstone"), Main.rand.Next(10,20)); - } - } - } + public override void NPCLoot() + { + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("LightBulb"), Main.rand.Next(1, 3)); + } + if (Main.rand.Next(20) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ZootalooEgg"), Main.rand.Next(1, 3)); + } + if (Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Gloomstone"), Main.rand.Next(10, 20)); + } + } + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - int x = spawnInfo.spawnTileX; - int y = spawnInfo.spawnTileY; - int tile = (int)Main.tile[x, y].type; - return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && y < Main.worldSurface ? 0.001f : 0f; - } -}} \ No newline at end of file + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + int x = spawnInfo.spawnTileX; + int y = spawnInfo.spawnTileY; + int tile = (int)Main.tile[x, y].type; + return (Tremor.NormalSpawn(spawnInfo) && Tremor.NoZoneAllowWater(spawnInfo)) && !Main.dayTime && y < Main.worldSurface ? 0.001f : 0f; + } + } +} \ No newline at end of file diff --git a/NPCs/npcVultureKing.cs b/NPCs/npcVultureKing.cs index 1cb7f34d..5dbaf393 100644 --- a/NPCs/npcVultureKing.cs +++ b/NPCs/npcVultureKing.cs @@ -7,78 +7,78 @@ namespace Tremor.NPCs { [AutoloadBossHead] - public class npcVultureKing : ModNPC - { - #region "КонÑтанты" - const int AnimationRate = 8; // ЧаÑтота Ñмены кадров (То, Ñколько кадров не будет ÑменÑÑ‚ÑÑ ÐºÐ°Ð´Ñ€) - const int FrameCount = 4; // Кол-во кадров + public class npcVultureKing : ModNPC + { + #region "КонÑтанты" + const int AnimationRate = 8; // ЧаÑтота Ñмены кадров (То, Ñколько кадров не будет ÑменÑÑ‚ÑÑ ÐºÐ°Ð´Ñ€) + const int FrameCount = 4; // Кол-во кадров - const int ShootRate = 50; // ЧаÑтота выÑтрела. Будет производить 60/ShootRate выÑтрелов в Ñекунду - const int ShootDamage = 15; // Урон от выÑтрела - int ShootType; // Тип выÑтрела (задаётÑÑ Ð² SetDefaults()) - const float ShootKnockback = 1; // ОтбраÑование от выÑтрела - const float ShootSpeed = 10; // СкороÑÑ‚ÑŒ выÑтрела - - const int ShootRate2 = 400; // ЧаÑтота выÑтрела. Будет производить 60/ShootRate выÑтрелов в Ñекунду - const int ShootDamage2 = 15; // Урон от выÑтрела - int ShootType2; // Тип выÑтрела (задаётÑÑ Ð² SetDefaults()) - const float ShootKnockback2 = 1; // ОтбраÑование от выÑтрела - const float ShootSpeed2 = 0; // СкороÑÑ‚ÑŒ выÑтрела + const int ShootRate = 50; // ЧаÑтота выÑтрела. Будет производить 60/ShootRate выÑтрелов в Ñекунду + const int ShootDamage = 15; // Урон от выÑтрела + int ShootType; // Тип выÑтрела (задаётÑÑ Ð² SetDefaults()) + const float ShootKnockback = 1; // ОтбраÑование от выÑтрела + const float ShootSpeed = 10; // СкороÑÑ‚ÑŒ выÑтрела - const float DistortPercent = 0.15f; // Процент деформации Ñтатов (неточноÑти) (1.0 == 100%) + const int ShootRate2 = 400; // ЧаÑтота выÑтрела. Будет производить 60/ShootRate выÑтрелов в Ñекунду + const int ShootDamage2 = 15; // Урон от выÑтрела + int ShootType2; // Тип выÑтрела (задаётÑÑ Ð² SetDefaults()) + const float ShootKnockback2 = 1; // ОтбраÑование от выÑтрела + const float ShootSpeed2 = 0; // СкороÑÑ‚ÑŒ выÑтрела - const int MinionsID = 61; // ID вуртулек - const int MinionsCount = 4; // Кол-во вуртулек которых заÑпавнит + const float DistortPercent = 0.15f; // Процент деформации Ñтатов (неточноÑти) (1.0 == 100%) - const int StateTime_Flying = 600; // Сколько будет летать в воздухе до призыва миньонов - const int StateTime_Minions = 120; // Сколько времени будет Ñпавнить вуртулек + const int MinionsID = 61; // ID вуртулек + const int MinionsCount = 4; // Кол-во вуртулек которых заÑпавнит - const int FlyingAI = 2; - const int MinionsAI = 0; + const int StateTime_Flying = 600; // Сколько будет летать в воздухе до призыва миньонов + const int StateTime_Minions = 120; // Сколько времени будет Ñпавнить вуртулек - const float MinionsState_XDeaccelerationPower = 0.05f; // СкороÑÑ‚ÑŒ Ð·Ð°Ð¼ÐµÐ´Ð»ÐµÐ½Ð¸Ñ Ð¿Ð¾ X - const float MinionsState_YMaxSpeed = 2.80f; // МакÑ. ÑкороÑÑ‚ÑŒ взлёта во Ð²Ñ€ÐµÐ¼Ñ Ñпавна миньонов - const float MinionsStete_YSpeedStep = 0.02f; // СкороÑÑ‚ÑŒ ÑƒÐ²ÐµÐ»Ð¸Ñ‡ÐµÐ½Ð¸Ñ ÑкороÑти по Y во Ð²Ñ€ÐµÐ¼Ñ Ñпавна миньонов + const int FlyingAI = 2; + const int MinionsAI = 0; + + const float MinionsState_XDeaccelerationPower = 0.05f; // СкороÑÑ‚ÑŒ Ð·Ð°Ð¼ÐµÐ´Ð»ÐµÐ½Ð¸Ñ Ð¿Ð¾ X + const float MinionsState_YMaxSpeed = 2.80f; // МакÑ. ÑкороÑÑ‚ÑŒ взлёта во Ð²Ñ€ÐµÐ¼Ñ Ñпавна миньонов + const float MinionsStete_YSpeedStep = 0.02f; // СкороÑÑ‚ÑŒ ÑƒÐ²ÐµÐ»Ð¸Ñ‡ÐµÐ½Ð¸Ñ ÑкороÑти по Y во Ð²Ñ€ÐµÐ¼Ñ Ñпавна миньонов + + const int States = 2; + #endregion + + #region "Переменные" + int TimeToAnimation = AnimationRate; + int Frame = 0; + bool Shoots = true; + int TimeToShoot = ShootRate; + int State = 0; + int TimeToState = StateTime_Flying; + bool runAway = false; + #endregion - const int States = 2; - #endregion - #region "Переменные" - int TimeToAnimation = AnimationRate; - int Frame = 0; - bool Shoots = true; - int TimeToShoot = ShootRate; - int State = 0; - int TimeToState = StateTime_Flying; - bool runAway = false; - #endregion - - public override void SetStaticDefaults() { DisplayName.SetDefault("Rukh"); Main.npcFrameCount[npc.type] = 20; } - public override void SetDefaults() - { - npc.lifeMax = 2500; - npc.damage = 22; - npc.defense = 8; - npc.knockBackResist = 0f; - npc.width = 160; - npc.height = 210; - npc.aiStyle = 2; - npc.noGravity = true; - npc.HitSound = SoundID.NPCHit1; - npc.DeathSound = SoundID.NPCDeath1; - npc.value = Item.buyPrice(0, 0, 75, 0); - npc.boss = true; - ShootType = mod.ProjectileType("projVultureFeather"); + public override void SetDefaults() + { + npc.lifeMax = 2500; + npc.damage = 22; + npc.defense = 8; + npc.knockBackResist = 0f; + npc.width = 160; + npc.height = 210; + npc.aiStyle = 2; + npc.noGravity = true; + npc.HitSound = SoundID.NPCHit1; + npc.DeathSound = SoundID.NPCDeath1; + npc.value = Item.buyPrice(0, 0, 75, 0); + npc.boss = true; + ShootType = mod.ProjectileType("projVultureFeather"); ShootType2 = 657; - bossBag = mod.ItemType("VultureKingBag"); - npc.noTileCollide = true; - } + bossBag = mod.ItemType("VultureKingBag"); + npc.noTileCollide = true; + } public override void ScaleExpertStats(int numPlayers, float bossLifeScale) { @@ -86,172 +86,172 @@ public override void ScaleExpertStats(int numPlayers, float bossLifeScale) npc.damage = (int)(npc.damage * 0.6f); } - public override void AI() - { - PlayAnimation(); // Проигрывание анимации - if (CheckRunConditions()) - return; - ChangeState(); // Смена Ñтадии - Shoot(); // Ð’Ñ‹Ñтрел - Shoot2(); // Ð’Ñ‹Ñтрел - DoAI(); // Сам иÑкуÑтвенный интеллект - } - - void PlayAnimation() - { - if (--TimeToAnimation <= 0) - { - TimeToAnimation = (int)Helper.DistortFloat(AnimationRate, DistortPercent); - if (++Frame >= FrameCount) - Frame = 0; - } - } + public override void AI() + { + PlayAnimation(); // Проигрывание анимации + if (CheckRunConditions()) + return; + ChangeState(); // Смена Ñтадии + Shoot(); // Ð’Ñ‹Ñтрел + Shoot2(); // Ð’Ñ‹Ñтрел + DoAI(); // Сам иÑкуÑтвенный интеллект + } - bool CheckRunConditions() - { - if (runAway) - { - npc.aiStyle = 0; - if (npc.velocity.Y >= 0) - npc.velocity.Y = -1f; - npc.velocity.Y *= 1.01f; - return true; - } - int Target = Helper.GetNearestPlayer(npc.Center, true); - if (Target == -1) - { runAway = true; return true; } - return false; - } + void PlayAnimation() + { + if (--TimeToAnimation <= 0) + { + TimeToAnimation = (int)Helper.DistortFloat(AnimationRate, DistortPercent); + if (++Frame >= FrameCount) + Frame = 0; + } + } - void ChangeState() - { - if (--TimeToState < 0) - { - State++; - if (State >= States) - State = 0; - switch(State) - { - case 0: - Shoots = true; - npc.aiStyle = FlyingAI; - TimeToState = StateTime_Flying; - break; - case 1: - Shoots = false; - npc.aiStyle = MinionsAI; - TimeToState = StateTime_Minions; - break; - } - } - } + bool CheckRunConditions() + { + if (runAway) + { + npc.aiStyle = 0; + if (npc.velocity.Y >= 0) + npc.velocity.Y = -1f; + npc.velocity.Y *= 1.01f; + return true; + } + int Target = Helper.GetNearestPlayer(npc.Center, true); + if (Target == -1) + { runAway = true; return true; } + return false; + } - void Shoot() - { - if (!Shoots && npc.target < 0) - return; - if (--TimeToShoot > 0) - return; - TimeToShoot = (int)Helper.DistortFloat(ShootRate, DistortPercent); - for (int i = 0; i < ((Main.expertMode) ? 3 : 1); i++) - { - Vector2 Velocity = Helper.VelocityToPoint(npc.Center, Helper.RandomPointInArea(new Vector2(Main.player[npc.target].Center.X - 10, Main.player[npc.target].Center.Y - 10), new Vector2(Main.player[npc.target].Center.X + 20, Main.player[npc.target].Center.Y + 20)), ShootSpeed); - int Proj = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, Velocity.X, Velocity.Y, ShootType, (int)Helper.DistortFloat(ShootDamage, DistortPercent), Helper.DistortFloat(ShootKnockback, DistortPercent)); - Main.projectile[Proj].Center = npc.Center; - } - } - - void Shoot2() - { - if (!Shoots && npc.target < 0) - return; - if (--TimeToShoot > 0) - return; - TimeToShoot = (int)Helper.DistortFloat(ShootRate, DistortPercent); - for (int i = 0; i < ((Main.expertMode) ? 3 : 1); i++) - { - Vector2 Velocity = Helper.VelocityToPoint(npc.Center, Helper.RandomPointInArea(new Vector2(Main.player[npc.target].Center.X - 10, Main.player[npc.target].Center.Y - 10), new Vector2(Main.player[npc.target].Center.X + 20, Main.player[npc.target].Center.Y + 20)), ShootSpeed2); - int Proj = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, Velocity.X, Velocity.Y, ShootType2, (int)Helper.DistortFloat(ShootDamage, DistortPercent), Helper.DistortFloat(ShootKnockback, DistortPercent)); - Main.projectile[Proj].Center = npc.Center; - } - } + void ChangeState() + { + if (--TimeToState < 0) + { + State++; + if (State >= States) + State = 0; + switch (State) + { + case 0: + Shoots = true; + npc.aiStyle = FlyingAI; + TimeToState = StateTime_Flying; + break; + case 1: + Shoots = false; + npc.aiStyle = MinionsAI; + TimeToState = StateTime_Minions; + break; + } + } + } - void DoAI() - { - switch (State) - { - case 1: - npc.velocity.Y -= MinionsStete_YSpeedStep; - if (npc.velocity.Y < -MinionsState_YMaxSpeed) - npc.velocity.Y = MinionsState_YMaxSpeed; - if (TimeToState % StateTime_Minions / MinionsCount == 0) - { - Vector2 Position = Helper.RandomPointInArea(npc.Hitbox); - int index = NPC.NewNPC((int)Position.X, (int)Position.Y, MinionsID); - Main.npc[index].Center = Position; - } - break; - } - } + void Shoot() + { + if (!Shoots && npc.target < 0) + return; + if (--TimeToShoot > 0) + return; + TimeToShoot = (int)Helper.DistortFloat(ShootRate, DistortPercent); + for (int i = 0; i < ((Main.expertMode) ? 3 : 1); i++) + { + Vector2 Velocity = Helper.VelocityToPoint(npc.Center, Helper.RandomPointInArea(new Vector2(Main.player[npc.target].Center.X - 10, Main.player[npc.target].Center.Y - 10), new Vector2(Main.player[npc.target].Center.X + 20, Main.player[npc.target].Center.Y + 20)), ShootSpeed); + int Proj = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, Velocity.X, Velocity.Y, ShootType, (int)Helper.DistortFloat(ShootDamage, DistortPercent), Helper.DistortFloat(ShootKnockback, DistortPercent)); + Main.projectile[Proj].Center = npc.Center; + } + } - public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) - { - SpriteEffects Direction = (npc.target == -1) ? SpriteEffects.None : ((Main.player[npc.target].position.X < npc.position.X) ? SpriteEffects.None : SpriteEffects.FlipHorizontally); - spriteBatch.Draw(Main.npcTexture[npc.type], new Rectangle((int)(npc.position.X - Main.screenPosition.X), (int)(npc.position.Y - Main.screenPosition.Y), 240, 160), new Rectangle(0, Frame * 160, 240, 160), drawColor, 0, new Vector2(0, 0), Direction, 0); - return false; - } + void Shoot2() + { + if (!Shoots && npc.target < 0) + return; + if (--TimeToShoot > 0) + return; + TimeToShoot = (int)Helper.DistortFloat(ShootRate, DistortPercent); + for (int i = 0; i < ((Main.expertMode) ? 3 : 1); i++) + { + Vector2 Velocity = Helper.VelocityToPoint(npc.Center, Helper.RandomPointInArea(new Vector2(Main.player[npc.target].Center.X - 10, Main.player[npc.target].Center.Y - 10), new Vector2(Main.player[npc.target].Center.X + 20, Main.player[npc.target].Center.Y + 20)), ShootSpeed2); + int Proj = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, Velocity.X, Velocity.Y, ShootType2, (int)Helper.DistortFloat(ShootDamage, DistortPercent), Helper.DistortFloat(ShootKnockback, DistortPercent)); + Main.projectile[Proj].Center = npc.Center; + } + } - public override void HitEffect(int hitDirection, double damage) - { - if(npc.life <= 0) - { - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TRGore1"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TRGore2"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TRGore3"), 1f); - Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TRGore2"), 1f); - } -} + void DoAI() + { + switch (State) + { + case 1: + npc.velocity.Y -= MinionsStete_YSpeedStep; + if (npc.velocity.Y < -MinionsState_YMaxSpeed) + npc.velocity.Y = MinionsState_YMaxSpeed; + if (TimeToState % StateTime_Minions / MinionsCount == 0) + { + Vector2 Position = Helper.RandomPointInArea(npc.Hitbox); + int index = NPC.NewNPC((int)Position.X, (int)Position.Y, MinionsID); + Main.npc[index].Center = Position; + } + break; + } + } - public override void NPCLoot() - { - if(Main.expertMode) - { - npc.DropBossBags(); - } - if (Main.netMode != 1) - { - int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; - int halfLength = npc.width / 2 / 16 + 1; + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) + { + SpriteEffects Direction = (npc.target == -1) ? SpriteEffects.None : ((Main.player[npc.target].position.X < npc.position.X) ? SpriteEffects.None : SpriteEffects.FlipHorizontally); + spriteBatch.Draw(Main.npcTexture[npc.type], new Rectangle((int)(npc.position.X - Main.screenPosition.X), (int)(npc.position.Y - Main.screenPosition.Y), 240, 160), new Rectangle(0, Frame * 160, 240, 160), drawColor, 0, new Vector2(0, 0), Direction, 0); + return false; + } - if(!Main.expertMode && Main.rand.Next(7) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("VultureKingMask")); - } - if(Main.rand.Next(10) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("VultureKingTrophy")); - } - if(!Main.expertMode && Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CactusBow")); - } - if(!Main.expertMode && Main.rand.Next(3) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SandKnife")); - } - if(!Main.expertMode && Main.rand.Next(4) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("VultureFeather")); - } - if(!Main.expertMode && Main.rand.Next(1) == 0) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SandstoneBar"), Main.rand.Next(10,18)); - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TRGore1"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TRGore2"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TRGore3"), 1f); + Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/TRGore2"), 1f); + } + } + + public override void NPCLoot() + { + if (Main.expertMode) + { + npc.DropBossBags(); + } + if (Main.netMode != 1) + { + int centerX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; + int centerY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + int halfLength = npc.width / 2 / 16 + 1; + + if (!Main.expertMode && Main.rand.Next(7) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("VultureKingMask")); + } + if (Main.rand.Next(10) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("VultureKingTrophy")); + } + if (!Main.expertMode && Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CactusBow")); + } + if (!Main.expertMode && Main.rand.Next(3) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SandKnife")); + } + if (!Main.expertMode && Main.rand.Next(4) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("VultureFeather")); + } + if (!Main.expertMode && Main.rand.Next(1) == 0) + { + Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("SandstoneBar"), Main.rand.Next(10, 18)); + } - TremorWorld.downedRukh = true; + TremorWorld.downedRukh = true; - } - } - } + } + } + } } \ No newline at end of file diff --git a/NovaPillar/Alchemic/NovaBlast.cs b/NovaPillar/Alchemic/NovaBlast.cs index c5264680..6a71305c 100644 --- a/NovaPillar/Alchemic/NovaBlast.cs +++ b/NovaPillar/Alchemic/NovaBlast.cs @@ -7,42 +7,42 @@ namespace Tremor.NovaPillar.Alchemic { - public class NovaBlast : ModProjectile - { - public override void SetDefaults() - { - projectile.timeLeft = 420; - projectile.width = 60; - projectile.height = 60; - projectile.friendly = true; - Main.projFrames[projectile.type] = 10; - projectile.tileCollide = false; - projectile.penetrate = -1; - } + public class NovaBlast : ModProjectile + { + public override void SetDefaults() + { + projectile.timeLeft = 420; + projectile.width = 60; + projectile.height = 60; + projectile.friendly = true; + Main.projFrames[projectile.type] = 10; + projectile.tileCollide = false; + projectile.penetrate = -1; + } - public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) - { - if (Main.rand.Next(1, 101) <= Main.player[projectile.owner].GetModPlayer(mod).alchemistCrit) - { - crit = true; - } - } + public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) + { + if (Main.rand.Next(1, 101) <= Main.player[projectile.owner].GetModPlayer(mod).alchemistCrit) + { + crit = true; + } + } - public override Color? GetAlpha(Color lightColor) - { - return Color.White; - } + public override Color? GetAlpha(Color lightColor) + { + return Color.White; + } - public override void AI() - { - projectile.frameCounter++; - if (projectile.frameCounter > 2) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame >= 10) - { projectile.Kill(); } - } - } + public override void AI() + { + projectile.frameCounter++; + if (projectile.frameCounter > 2) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame >= 10) + { projectile.Kill(); } + } + } } \ No newline at end of file diff --git a/NovaPillar/Alchemic/NovaBurst.cs b/NovaPillar/Alchemic/NovaBurst.cs index 0343c06f..2497dbc0 100644 --- a/NovaPillar/Alchemic/NovaBurst.cs +++ b/NovaPillar/Alchemic/NovaBurst.cs @@ -7,44 +7,44 @@ namespace Tremor.NovaPillar.Alchemic { - public class NovaBurst : ModProjectile - { - public override void SetDefaults() - { - projectile.timeLeft = 420; - projectile.width = 52; - projectile.height = 52; - projectile.friendly = true; - Main.projFrames[projectile.type] = 20; - projectile.tileCollide = false; - projectile.penetrate = -1; - } + public class NovaBurst : ModProjectile + { + public override void SetDefaults() + { + projectile.timeLeft = 420; + projectile.width = 52; + projectile.height = 52; + projectile.friendly = true; + Main.projFrames[projectile.type] = 20; + projectile.tileCollide = false; + projectile.penetrate = -1; + } - public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) - { - if (Main.rand.Next(1, 101) <= Main.player[projectile.owner].GetModPlayer(mod).alchemistCrit) - { - crit = true; - } - } + public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) + { + if (Main.rand.Next(1, 101) <= Main.player[projectile.owner].GetModPlayer(mod).alchemistCrit) + { + crit = true; + } + } - public override Color? GetAlpha(Color lightColor) - { - return Color.White; - } + public override Color? GetAlpha(Color lightColor) + { + return Color.White; + } - public override void AI() - { - projectile.frameCounter++; - if (projectile.frameCounter > 2) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame >= 20) - { - projectile.Kill(); - } - } - } + public override void AI() + { + projectile.frameCounter++; + if (projectile.frameCounter > 2) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame >= 20) + { + projectile.Kill(); + } + } + } } \ No newline at end of file diff --git a/NovaPillar/Alchemic/NovaSkull.cs b/NovaPillar/Alchemic/NovaSkull.cs index 2340e7b4..3d8215a9 100644 --- a/NovaPillar/Alchemic/NovaSkull.cs +++ b/NovaPillar/Alchemic/NovaSkull.cs @@ -6,37 +6,37 @@ namespace Tremor.NovaPillar.Alchemic { - public class NovaSkull : ModProjectile - { - public override void SetDefaults() - { - projectile.width = 52; - projectile.height = 52; - projectile.friendly = true; - projectile.tileCollide = false; - projectile.ignoreWater = true; - projectile.penetrate = -1; - projectile.alpha = 255; - projectile.timeLeft = 420; - Main.projFrames[projectile.type] = 15; - } + public class NovaSkull : ModProjectile + { + public override void SetDefaults() + { + projectile.width = 52; + projectile.height = 52; + projectile.friendly = true; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.penetrate = -1; + projectile.alpha = 255; + projectile.timeLeft = 420; + Main.projFrames[projectile.type] = 15; + } - public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) - { - if (Main.rand.Next(1, 101) <= Main.player[projectile.owner].GetModPlayer(mod).alchemistCrit) - { - crit = true; - } - } + public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) + { + if (Main.rand.Next(1, 101) <= Main.player[projectile.owner].GetModPlayer(mod).alchemistCrit) + { + crit = true; + } + } - public override Color? GetAlpha(Color lightColor) + public override Color? GetAlpha(Color lightColor) { return Color.White; } - - public override void AI() - { - int num613 = 10; + + public override void AI() + { + int num613 = 10; int num614 = 15; float num615 = 1f; int num616 = 150; @@ -52,9 +52,9 @@ public override void AI() projectile.frameCounter = 0; } if (projectile.frame >= 10) - {projectile.velocity.X = 0f; projectile.velocity.Y = 0f;} + { projectile.velocity.X = 0f; projectile.velocity.Y = 0f; } if (projectile.frame >= 15) - {projectile.Kill();} + { projectile.Kill(); } if (!Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) { projectile.alpha -= 30; @@ -71,6 +71,6 @@ public override void AI() projectile.alpha = 150; } } - } - } + } + } } \ No newline at end of file diff --git a/NovaPillar/Alchemic/NovaSkullburst.cs b/NovaPillar/Alchemic/NovaSkullburst.cs index 41ee4f9e..c6de62f0 100644 --- a/NovaPillar/Alchemic/NovaSkullburst.cs +++ b/NovaPillar/Alchemic/NovaSkullburst.cs @@ -7,44 +7,44 @@ namespace Tremor.NovaPillar.Alchemic { - public class NovaSkullburst : ModProjectile - { - public override void SetDefaults() - { - projectile.timeLeft = 420; - projectile.width = 52; - projectile.height = 52; - projectile.friendly = true; - Main.projFrames[projectile.type] = 12; - projectile.tileCollide = false; - projectile.penetrate = -1; - } + public class NovaSkullburst : ModProjectile + { + public override void SetDefaults() + { + projectile.timeLeft = 420; + projectile.width = 52; + projectile.height = 52; + projectile.friendly = true; + Main.projFrames[projectile.type] = 12; + projectile.tileCollide = false; + projectile.penetrate = -1; + } - public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) - { - if (Main.rand.Next(1, 101) <= Main.player[projectile.owner].GetModPlayer(mod).alchemistCrit) - { - crit = true; - } - } + public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) + { + if (Main.rand.Next(1, 101) <= Main.player[projectile.owner].GetModPlayer(mod).alchemistCrit) + { + crit = true; + } + } - public override Color? GetAlpha(Color lightColor) - { - return Color.White; - } + public override Color? GetAlpha(Color lightColor) + { + return Color.White; + } - public override void AI() - { - projectile.frameCounter++; - if (projectile.frameCounter > 2) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame >= 7) - { projectile.velocity.X = 0f; projectile.velocity.Y = 0f; } - if (projectile.frame >= 12) - { projectile.Kill(); } - } - } + public override void AI() + { + projectile.frameCounter++; + if (projectile.frameCounter > 2) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame >= 7) + { projectile.velocity.X = 0f; projectile.velocity.Y = 0f; } + if (projectile.frame >= 12) + { projectile.Kill(); } + } + } } \ No newline at end of file diff --git a/NovaPillar/Deadling.cs b/NovaPillar/Deadling.cs index 859bb9ae..4c5631f6 100644 --- a/NovaPillar/Deadling.cs +++ b/NovaPillar/Deadling.cs @@ -16,7 +16,7 @@ public override void SetStaticDefaults() DisplayName.SetDefault("Nova Kamikaze"); Main.npcFrameCount[npc.type] = 2; } - + public override void SetDefaults() { npc.aiStyle = 87; @@ -29,76 +29,76 @@ public override void SetDefaults() animationType = 81; npc.noGravity = false; npc.noTileCollide = false; - npc.HitSound = SoundID.NPCHit55; - npc.DeathSound = SoundID.NPCDeath51; - } + npc.HitSound = SoundID.NPCHit55; + npc.DeathSound = SoundID.NPCDeath51; + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - if (spawnInfo.player.GetModPlayer(mod).ZoneTowerNova) - return 1f; - return 0; - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + if (spawnInfo.player.GetModPlayer(mod).ZoneTowerNova) + return 1f; + return 0; + } - public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) - { - TremorUtils.DrawNPCGlowMask(spriteBatch, npc, mod.GetTexture("NovaPillar/Deadling_GlowMask")); - } + public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) + { + TremorUtils.DrawNPCGlowMask(spriteBatch, npc, mod.GetTexture("NovaPillar/Deadling_GlowMask")); + } - public override void OnHitPlayer(Player player, int damage, bool crit) - { - npc.life = -1; - npc.active = false; - npc.checkDead(); - if (NovaHandler.ShieldStrength > 0) - { - NPC parent = Main.npc[NPC.FindFirstNPC(mod.NPCType("NovaPillar"))]; - Vector2 Velocity = Helper.VelocityToPoint(npc.Center, parent.Center, 20); - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, Velocity.X, Velocity.Y, mod.ProjectileType("CogLordLaser"), 1, 1f); - } - for (int i = 0; i < 5; i++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 57, Main.rand.NextFloat(-3f, 3f), Main.rand.NextFloat(-3f, 3f)); - } - for (int k = 0; k < 30; k++) - { - Vector2 Vector = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - Vector.Normalize(); - Vector *= (float)Main.rand.Next(10, 201) * 0.01f; - int i = Projectile.NewProjectile(npc.position.X, npc.position.Y, Vector.X, Vector.Y, mod.ProjectileType("NovaAlchemistCloud"), 20, 1f, Main.myPlayer, 0f, (float)Main.rand.Next(-45, 1)); - Main.projectile[i].friendly = false; - } - } + public override void OnHitPlayer(Player player, int damage, bool crit) + { + npc.life = -1; + npc.active = false; + npc.checkDead(); + if (NovaHandler.ShieldStrength > 0) + { + NPC parent = Main.npc[NPC.FindFirstNPC(mod.NPCType("NovaPillar"))]; + Vector2 Velocity = Helper.VelocityToPoint(npc.Center, parent.Center, 20); + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, Velocity.X, Velocity.Y, mod.ProjectileType("CogLordLaser"), 1, 1f); + } + for (int i = 0; i < 5; i++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 57, Main.rand.NextFloat(-3f, 3f), Main.rand.NextFloat(-3f, 3f)); + } + for (int k = 0; k < 30; k++) + { + Vector2 Vector = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector.Normalize(); + Vector *= (float)Main.rand.Next(10, 201) * 0.01f; + int i = Projectile.NewProjectile(npc.position.X, npc.position.Y, Vector.X, Vector.Y, mod.ProjectileType("NovaAlchemistCloud"), 20, 1f, Main.myPlayer, 0f, (float)Main.rand.Next(-45, 1)); + Main.projectile[i].friendly = false; + } + } - public override void HitEffect(int hitDirection, double damage) - { - if (npc.life <= 0) - { - if (NovaHandler.ShieldStrength > 0) - { - NPC parent = Main.npc[NPC.FindFirstNPC(mod.NPCType("NovaPillar"))]; - Vector2 Velocity = Helper.VelocityToPoint(npc.Center, parent.Center, 20); - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, Velocity.X, Velocity.Y, mod.ProjectileType("CogLordLaser"), 1, 1f); - } - for (int i = 0; i < 5; i++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 57, Main.rand.NextFloat(-3f, 3f), Main.rand.NextFloat(-3f, 3f)); - } - for (int k = 0; k < 30; k++) - { - Vector2 Vector = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - Vector.Normalize(); - Vector *= (float)Main.rand.Next(10, 201) * 0.01f; - int i = Projectile.NewProjectile(npc.position.X, npc.position.Y, Vector.X, Vector.Y, mod.ProjectileType("NovaAlchemistCloud"), 20, 1f, Main.myPlayer, 0f, (float)Main.rand.Next(-45, 1)); - Main.projectile[i].friendly = false; - } - } - } - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + if (NovaHandler.ShieldStrength > 0) + { + NPC parent = Main.npc[NPC.FindFirstNPC(mod.NPCType("NovaPillar"))]; + Vector2 Velocity = Helper.VelocityToPoint(npc.Center, parent.Center, 20); + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, Velocity.X, Velocity.Y, mod.ProjectileType("CogLordLaser"), 1, 1f); + } + for (int i = 0; i < 5; i++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 57, Main.rand.NextFloat(-3f, 3f), Main.rand.NextFloat(-3f, 3f)); + } + for (int k = 0; k < 30; k++) + { + Vector2 Vector = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector.Normalize(); + Vector *= (float)Main.rand.Next(10, 201) * 0.01f; + int i = Projectile.NewProjectile(npc.position.X, npc.position.Y, Vector.X, Vector.Y, mod.ProjectileType("NovaAlchemistCloud"), 20, 1f, Main.myPlayer, 0f, (float)Main.rand.Next(-45, 1)); + Main.projectile[i].friendly = false; + } + } + } + } } \ No newline at end of file diff --git a/NovaPillar/NovaAlchemist.cs b/NovaPillar/NovaAlchemist.cs index d1ca9d2e..2049607d 100644 --- a/NovaPillar/NovaAlchemist.cs +++ b/NovaPillar/NovaAlchemist.cs @@ -7,31 +7,31 @@ namespace Tremor.NovaPillar { - public class NovaAlchemist : ModNPC - { - - //Int variables - int AnimationRate = 8; - int CountFrame = 0; - int TimeToAnimation = 8; - int Timer = 0; + public class NovaAlchemist : ModNPC + { - //Bool variables - bool TimeToPortals = false; - public override void SetDefaults() - { - npc.lifeMax = 2500; - npc.damage = 100; - npc.defense = 25; - npc.knockBackResist = 0.4f; - npc.width = 34; - npc.height = 56; - npc.aiStyle = 3; - aiType = NPCID.AngryBones; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit55; - npc.DeathSound = SoundID.NPCDeath51; - } + //Int variables + int AnimationRate = 8; + int CountFrame = 0; + int TimeToAnimation = 8; + int Timer = 0; + + //Bool variables + bool TimeToPortals = false; + public override void SetDefaults() + { + npc.lifeMax = 2500; + npc.damage = 100; + npc.defense = 25; + npc.knockBackResist = 0.4f; + npc.width = 34; + npc.height = 56; + npc.aiStyle = 3; + aiType = NPCID.AngryBones; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit55; + npc.DeathSound = SoundID.NPCDeath51; + } public override void SetStaticDefaults() { @@ -39,106 +39,106 @@ public override void SetStaticDefaults() Main.npcFrameCount[npc.type] = 4; } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void HitEffect(int hitDirection, double damage) - { - if (npc.life <= 0) - { - if (NovaHandler.ShieldStrength > 0) - { - NPC parent = Main.npc[NPC.FindFirstNPC(mod.NPCType("NovaPillar"))]; - Vector2 Velocity = Helper.VelocityToPoint(npc.Center, parent.Center, 20); - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, Velocity.X, Velocity.Y, mod.ProjectileType("CogLordLaser"), 1, 1f); - } - for (int i = 0; i < 5; i++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 57, Main.rand.NextFloat(-3f, 3f), Main.rand.NextFloat(-3f, 3f)); - } - for (int i = 0; i < 2; i++) - { - Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/NovaAlchemistGore3")); - Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/NovaAlchemistGore4")); - } - Gore.NewGore(npc.Top, npc.velocity * hitDirection, mod.GetGoreSlot("Gores/NovaAlchemistGore2")); - Gore.NewGore(npc.Top, npc.velocity * hitDirection, mod.GetGoreSlot("Gores/NovaAlchemistGore1")); - } - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + if (NovaHandler.ShieldStrength > 0) + { + NPC parent = Main.npc[NPC.FindFirstNPC(mod.NPCType("NovaPillar"))]; + Vector2 Velocity = Helper.VelocityToPoint(npc.Center, parent.Center, 20); + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, Velocity.X, Velocity.Y, mod.ProjectileType("CogLordLaser"), 1, 1f); + } + for (int i = 0; i < 5; i++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 57, Main.rand.NextFloat(-3f, 3f), Main.rand.NextFloat(-3f, 3f)); + } + for (int i = 0; i < 2; i++) + { + Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/NovaAlchemistGore3")); + Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/NovaAlchemistGore4")); + } + Gore.NewGore(npc.Top, npc.velocity * hitDirection, mod.GetGoreSlot("Gores/NovaAlchemistGore2")); + Gore.NewGore(npc.Top, npc.velocity * hitDirection, mod.GetGoreSlot("Gores/NovaAlchemistGore1")); + } + } - public override void AI() - { - npc.TargetClosest(true); - npc.spriteDirection = npc.direction; - Player player = Main.player[npc.target]; - if (Main.rand.Next(800) == 0) - { - Main.PlaySound(SoundID.NPCDeath51, npc.Center); - } - this.Timer++; - this.NovaAnimation(); - if (this.Timer >= 600) - { - this.TimeToPortals = true; - } - if (this.Timer >= 600 && this.Timer % 200 == 0) - { - if (Main.netMode != 1) - { - Main.PlaySound(SoundID.NPCDeath55, npc.Center); - NPC.NewNPC((int)npc.Center.X + 25, (int)npc.Center.Y, mod.NPCType("NovaAlchemistC")); - NPC.NewNPC((int)npc.Center.X - 25, (int)npc.Center.Y, mod.NPCType("NovaAlchemistC")); - } - } - if (this.Timer < 600) - { - this.TimeToPortals = false; - } - if (this.Timer >= 800) - { - this.Timer = 0; - } - if (this.TimeToPortals) - { - npc.velocity.X = 0f; - npc.velocity.Y += 5f; - } - } + public override void AI() + { + npc.TargetClosest(true); + npc.spriteDirection = npc.direction; + Player player = Main.player[npc.target]; + if (Main.rand.Next(800) == 0) + { + Main.PlaySound(SoundID.NPCDeath51, npc.Center); + } + this.Timer++; + this.NovaAnimation(); + if (this.Timer >= 600) + { + this.TimeToPortals = true; + } + if (this.Timer >= 600 && this.Timer % 200 == 0) + { + if (Main.netMode != 1) + { + Main.PlaySound(SoundID.NPCDeath55, npc.Center); + NPC.NewNPC((int)npc.Center.X + 25, (int)npc.Center.Y, mod.NPCType("NovaAlchemistC")); + NPC.NewNPC((int)npc.Center.X - 25, (int)npc.Center.Y, mod.NPCType("NovaAlchemistC")); + } + } + if (this.Timer < 600) + { + this.TimeToPortals = false; + } + if (this.Timer >= 800) + { + this.Timer = 0; + } + if (this.TimeToPortals) + { + npc.velocity.X = 0f; + npc.velocity.Y += 5f; + } + } - public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) - { - TremorUtils.DrawNPCGlowMask(spriteBatch, npc, mod.GetTexture("NovaPillar/NovaAlchemist_GlowMask")); - } + public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) + { + TremorUtils.DrawNPCGlowMask(spriteBatch, npc, mod.GetTexture("NovaPillar/NovaAlchemist_GlowMask")); + } - public void NovaAnimation() - { - if (!this.TimeToPortals) - { - if (--this.TimeToAnimation <= 0) - { - if (++this.CountFrame > 3) - this.CountFrame = 1; - this.TimeToAnimation = this.AnimationRate; - npc.frame = this.GetFrame(this.CountFrame); - } - } - else - npc.frame = this.GetFrame(4); - } + public void NovaAnimation() + { + if (!this.TimeToPortals) + { + if (--this.TimeToAnimation <= 0) + { + if (++this.CountFrame > 3) + this.CountFrame = 1; + this.TimeToAnimation = this.AnimationRate; + npc.frame = this.GetFrame(this.CountFrame); + } + } + else + npc.frame = this.GetFrame(4); + } - Rectangle GetFrame(int Num) - { - return new Rectangle(0, npc.frame.Height * (Num - 1), npc.frame.Width, npc.frame.Height); - } + Rectangle GetFrame(int Num) + { + return new Rectangle(0, npc.frame.Height * (Num - 1), npc.frame.Width, npc.frame.Height); + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - if (spawnInfo.player.GetModPlayer(mod).ZoneTowerNova) - return 1f; - return 0; - } - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + if (spawnInfo.player.GetModPlayer(mod).ZoneTowerNova) + return 1f; + return 0; + } + } } \ No newline at end of file diff --git a/NovaPillar/NovaAlchemistC.cs b/NovaPillar/NovaAlchemistC.cs index 0dc7da67..568aac30 100644 --- a/NovaPillar/NovaAlchemistC.cs +++ b/NovaPillar/NovaAlchemistC.cs @@ -13,8 +13,8 @@ namespace Tremor.NovaPillar { - public class NovaAlchemistC : ModNPC - { + public class NovaAlchemistC : ModNPC + { public override void SetStaticDefaults() { @@ -22,71 +22,71 @@ public override void SetStaticDefaults() Main.npcFrameCount[npc.type] = 4; } - //Int variables - int AnimationRate = 8; - int CountFrame = 0; - int TimeToAnimation = 8; - int Timer = 0; - public override void SetDefaults() - { - npc.lifeMax = 1; - npc.damage = 200; - npc.defense = 50; - npc.knockBackResist = 0.4f; - npc.width = 34; - npc.height = 56; - npc.aiStyle = 3; - aiType = NPCID.AngryBones; - npc.npcSlots = 0.5f; - npc.HitSound = SoundID.NPCHit55; - npc.DeathSound = SoundID.NPCDeath51; - npc.dontTakeDamage = true; - npc.alpha = 150; - } + //Int variables + int AnimationRate = 8; + int CountFrame = 0; + int TimeToAnimation = 8; + int Timer = 0; + public override void SetDefaults() + { + npc.lifeMax = 1; + npc.damage = 200; + npc.defense = 50; + npc.knockBackResist = 0.4f; + npc.width = 34; + npc.height = 56; + npc.aiStyle = 3; + aiType = NPCID.AngryBones; + npc.npcSlots = 0.5f; + npc.HitSound = SoundID.NPCHit55; + npc.DeathSound = SoundID.NPCDeath51; + npc.dontTakeDamage = true; + npc.alpha = 150; + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.damage = 350; - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.damage = 350; + } - public override void AI() - { - npc.TargetClosest(true); - npc.spriteDirection = npc.direction; - Player player = Main.player[npc.target]; - npc.rotation = 0f; - this.NovaAnimation(); - this.Timer++; - if (this.Timer >= 350) - { - npc.life = -1; - npc.active = false; - npc.checkDead(); - for (int k = 0; k < 19; k++) - { - Vector2 Vector = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - Vector.Normalize(); - Vector *= (float)Main.rand.Next(10, 201) * 0.01f; - int i = Projectile.NewProjectile(npc.position.X, npc.position.Y, Vector.X, Vector.Y, mod.ProjectileType("NovaAlchemistCloud"), 20, 1); - Main.projectile[i].friendly = false; - } - } - } + public override void AI() + { + npc.TargetClosest(true); + npc.spriteDirection = npc.direction; + Player player = Main.player[npc.target]; + npc.rotation = 0f; + this.NovaAnimation(); + this.Timer++; + if (this.Timer >= 350) + { + npc.life = -1; + npc.active = false; + npc.checkDead(); + for (int k = 0; k < 19; k++) + { + Vector2 Vector = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector.Normalize(); + Vector *= (float)Main.rand.Next(10, 201) * 0.01f; + int i = Projectile.NewProjectile(npc.position.X, npc.position.Y, Vector.X, Vector.Y, mod.ProjectileType("NovaAlchemistCloud"), 20, 1); + Main.projectile[i].friendly = false; + } + } + } - void NovaAnimation() - { - if (--this.TimeToAnimation <= 0) - { - if (++this.CountFrame > 3) - this.CountFrame = 1; - this.TimeToAnimation = this.AnimationRate; - npc.frame = this.GetFrame(this.CountFrame + 0); - } - } + void NovaAnimation() + { + if (--this.TimeToAnimation <= 0) + { + if (++this.CountFrame > 3) + this.CountFrame = 1; + this.TimeToAnimation = this.AnimationRate; + npc.frame = this.GetFrame(this.CountFrame + 0); + } + } - Rectangle GetFrame(int Number) - { - return new Rectangle(0, npc.frame.Height * (Number - 1), npc.frame.Width, npc.frame.Height); - } - } + Rectangle GetFrame(int Number) + { + return new Rectangle(0, npc.frame.Height * (Number - 1), npc.frame.Width, npc.frame.Height); + } + } } \ No newline at end of file diff --git a/NovaPillar/NovaAlchemistCloud.cs b/NovaPillar/NovaAlchemistCloud.cs index 7b450651..3c21f3b7 100644 --- a/NovaPillar/NovaAlchemistCloud.cs +++ b/NovaPillar/NovaAlchemistCloud.cs @@ -6,42 +6,42 @@ namespace Tremor.NovaPillar { - public class NovaAlchemistCloud : ModProjectile - { + public class NovaAlchemistCloud : ModProjectile + { public override void SetStaticDefaults() { DisplayName.SetDefault("Nova Cloud"); } - public override void SetDefaults() - { - projectile.width = 40; - projectile.height = 38; - projectile.penetrate = 8; - projectile.aiStyle = -1; - projectile.timeLeft = 600; - projectile.hostile = true; - projectile.damage = 100; - } + public override void SetDefaults() + { + projectile.width = 40; + projectile.height = 38; + projectile.penetrate = 8; + projectile.aiStyle = -1; + projectile.timeLeft = 600; + projectile.hostile = true; + projectile.damage = 100; + } - public override void AI() - { - projectile.tileCollide = false; - projectile.ai[1] += 1f; - if (projectile.ai[1] > 60f) - { - projectile.ai[0] += 10f; - } - if (projectile.ai[0] > 255f) - { - projectile.Kill(); - projectile.ai[0] = 255f; - } - projectile.alpha = (int)(100.0 + (double)projectile.ai[0] * 0.7); - projectile.rotation += projectile.velocity.X * 0.1f; - projectile.rotation += (float)projectile.direction * 0.003f; - projectile.velocity *= 0.96f; - } - } + public override void AI() + { + projectile.tileCollide = false; + projectile.ai[1] += 1f; + if (projectile.ai[1] > 60f) + { + projectile.ai[0] += 10f; + } + if (projectile.ai[0] > 255f) + { + projectile.Kill(); + projectile.ai[0] = 255f; + } + projectile.alpha = (int)(100.0 + (double)projectile.ai[0] * 0.7); + projectile.rotation += projectile.velocity.X * 0.1f; + projectile.rotation += (float)projectile.direction * 0.003f; + projectile.velocity *= 0.96f; + } + } } \ No newline at end of file diff --git a/NovaPillar/NovaAlchemistProjectile.cs b/NovaPillar/NovaAlchemistProjectile.cs index 9f6db779..470f0f91 100644 --- a/NovaPillar/NovaAlchemistProjectile.cs +++ b/NovaPillar/NovaAlchemistProjectile.cs @@ -20,152 +20,152 @@ public override void SetStaticDefaults() } public override void SetDefaults() { - projectile.width = 32; - projectile.height = 32; - projectile.friendly = true; - projectile.alpha = 255; - projectile.tileCollide = false; - projectile.ignoreWater = true; - projectile.hostile = true; - } + projectile.width = 32; + projectile.height = 32; + projectile.friendly = true; + projectile.alpha = 255; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.hostile = true; + } - public override Color? GetAlpha(Color lightColor) - { - return new Color(255 - projectile.alpha, 255 - projectile.alpha, 255 - projectile.alpha, 255 - projectile.alpha); - } + public override Color? GetAlpha(Color lightColor) + { + return new Color(255 - projectile.alpha, 255 - projectile.alpha, 255 - projectile.alpha, 255 - projectile.alpha); + } - public override void AI() - { - if (projectile.localAI[0] == 0f) - { - projectile.localAI[0] = 1f; - int num960 = (int)Player.FindClosest(projectile.Center, 0, 0); - Vector2 vector103 = Main.player[num960].Center - projectile.Center; - if (vector103 == Vector2.Zero) - { - vector103 = Vector2.UnitY; - } - projectile.ai[1] = vector103.ToRotation(); - projectile.netUpdate = true; - } - projectile.ai[0] += 1f; - if (projectile.ai[0] <= 50f) - { - if (Main.rand.Next(2) == 0) - { - Vector2 vector106 = projectile.ai[1].ToRotationVector2(); - Vector2 vector107 = vector106.RotatedBy(1.5707963705062866, default(Vector2)) * (float)(Main.rand.Next(2) == 0).ToDirectionInt() * (float)Main.rand.Next(10, 21); - Vector2 value60 = vector106 * (float)Main.rand.Next(-80, 81); - Vector2 vector108 = value60 - vector107; - vector108 /= 10f; - int num961 = 57; - Dust dust14 = Main.dust[Dust.NewDust(projectile.Center, 0, 0, num961, 0f, 0f, 0, default(Color), 1f)]; - dust14.noGravity = true; - dust14.position = projectile.Center + vector107; - dust14.velocity = vector108; - dust14.scale = 0.5f + Main.rand.NextFloat(); - dust14.fadeIn = 0.5f; - value60 = vector106 * (float)Main.rand.Next(40, 121); - vector108 = value60 - vector107 / 2f; - vector108 /= 10f; - dust14 = Main.dust[Dust.NewDust(projectile.Center, 0, 0, num961, 0f, 0f, 0, default(Color), 1f)]; - dust14.noGravity = true; - dust14.position = projectile.Center + vector107 / 2f; - dust14.velocity = vector108; - dust14.scale = 1f + Main.rand.NextFloat(); - return; - } - } - else if (projectile.ai[0] <= 90f) - { - projectile.scale = (projectile.ai[0] - 50f) / 40f; - projectile.alpha = 255 - (int)(255f * projectile.scale); - Vector2 vector111 = projectile.ai[1].ToRotationVector2(); - Vector2 value61 = vector111.RotatedBy(1.5707963705062866, default(Vector2)) * (float)(Main.rand.Next(2) == 0).ToDirectionInt() * (float)Main.rand.Next(10, 21); - vector111 *= (float)Main.rand.Next(-80, 81); - Vector2 vector112 = vector111 - value61; - vector112 /= 10f; - int num962 = Utils.SelectRandom(Main.rand, new int[] - { - 57, - 57 - }); - Dust dust17 = Main.dust[Dust.NewDust(projectile.Center, 0, 0, num962, 0f, 0f, 0, default(Color), 1f)]; - dust17.noGravity = true; - dust17.position = projectile.Center + value61; - dust17.velocity = vector112; - dust17.scale = 0.5f + Main.rand.NextFloat(); - dust17.fadeIn = 0.5f; - if (projectile.ai[0] == 90f && Main.netMode != 1) - { - Vector2 vector113 = projectile.ai[1].ToRotationVector2() * 8f; - float ai2 = (float)Main.rand.Next(80); - Projectile.NewProjectile(projectile.Center.X - vector113.X, projectile.Center.Y - vector113.Y, vector113.X, vector113.Y, mod.ProjectileType("NovaAlchemistFlask"), 15, 1f, Main.myPlayer, projectile.ai[1], ai2); - return; - } - } - else - { - if (projectile.ai[0] > 120f) - { - projectile.scale = 1f - (projectile.ai[0] - 120f) / 60f; - projectile.alpha = 255 - (int)(255f * projectile.scale); - if (projectile.alpha >= 255) - { - projectile.Kill(); - } - for (int num965 = 0; num965 < 2; num965++) - { - int num966 = Main.rand.Next(3); - if (num966 == 0) - { - Vector2 vector114 = Vector2.UnitY.RotatedByRandom(6.2831854820251465) * projectile.scale; - Dust dust18 = Main.dust[Dust.NewDust(projectile.Center - vector114 * 30f, 0, 0, 57, 0f, 0f, 0, default(Color), 1f)]; - dust18.noGravity = true; - dust18.position = projectile.Center - vector114 * (float)Main.rand.Next(10, 21); - dust18.velocity = vector114.RotatedBy(1.5707963705062866, default(Vector2)) * 6f; - dust18.scale = 0.5f + Main.rand.NextFloat(); - dust18.fadeIn = 0.5f; - dust18.customData = projectile.Center; - } - else if (num966 == 1) - { - Vector2 vector115 = Vector2.UnitY.RotatedByRandom(6.2831854820251465) * projectile.scale; - Dust dust19 = Main.dust[Dust.NewDust(projectile.Center - vector115 * 30f, 0, 0, 57, 0f, 0f, 0, default(Color), 1f)]; - dust19.noGravity = true; - dust19.position = projectile.Center - vector115 * 30f; - dust19.velocity = vector115.RotatedBy(-1.5707963705062866, default(Vector2)) * 3f; - dust19.scale = 0.5f + Main.rand.NextFloat(); - dust19.fadeIn = 0.5f; - dust19.customData = projectile.Center; - } - } - return; - } - projectile.scale = 1f; - projectile.alpha = 0; - if (Main.rand.Next(2) == 0) - { - Vector2 vector116 = Vector2.UnitY.RotatedByRandom(6.2831854820251465); - Dust dust20 = Main.dust[Dust.NewDust(projectile.Center - vector116 * 30f, 0, 0, 57, 0f, 0f, 0, default(Color), 1f)]; - dust20.noGravity = true; - dust20.position = projectile.Center - vector116 * (float)Main.rand.Next(10, 21); - dust20.velocity = vector116.RotatedBy(1.5707963705062866, default(Vector2)) * 6f; - dust20.scale = 0.5f + Main.rand.NextFloat(); - dust20.fadeIn = 0.5f; - dust20.customData = projectile.Center; - return; - } - Vector2 vector117 = Vector2.UnitY.RotatedByRandom(6.2831854820251465); - Dust dust21 = Main.dust[Dust.NewDust(projectile.Center - vector117 * 30f, 0, 0, 57, 0f, 0f, 0, default(Color), 1f)]; - dust21.noGravity = true; - dust21.position = projectile.Center - vector117 * 30f; - dust21.velocity = vector117.RotatedBy(-1.5707963705062866, default(Vector2)) * 3f; - dust21.scale = 0.5f + Main.rand.NextFloat(); - dust21.fadeIn = 0.5f; - dust21.customData = projectile.Center; - return; - } - } - } + public override void AI() + { + if (projectile.localAI[0] == 0f) + { + projectile.localAI[0] = 1f; + int num960 = (int)Player.FindClosest(projectile.Center, 0, 0); + Vector2 vector103 = Main.player[num960].Center - projectile.Center; + if (vector103 == Vector2.Zero) + { + vector103 = Vector2.UnitY; + } + projectile.ai[1] = vector103.ToRotation(); + projectile.netUpdate = true; + } + projectile.ai[0] += 1f; + if (projectile.ai[0] <= 50f) + { + if (Main.rand.Next(2) == 0) + { + Vector2 vector106 = projectile.ai[1].ToRotationVector2(); + Vector2 vector107 = vector106.RotatedBy(1.5707963705062866, default(Vector2)) * (float)(Main.rand.Next(2) == 0).ToDirectionInt() * (float)Main.rand.Next(10, 21); + Vector2 value60 = vector106 * (float)Main.rand.Next(-80, 81); + Vector2 vector108 = value60 - vector107; + vector108 /= 10f; + int num961 = 57; + Dust dust14 = Main.dust[Dust.NewDust(projectile.Center, 0, 0, num961, 0f, 0f, 0, default(Color), 1f)]; + dust14.noGravity = true; + dust14.position = projectile.Center + vector107; + dust14.velocity = vector108; + dust14.scale = 0.5f + Main.rand.NextFloat(); + dust14.fadeIn = 0.5f; + value60 = vector106 * (float)Main.rand.Next(40, 121); + vector108 = value60 - vector107 / 2f; + vector108 /= 10f; + dust14 = Main.dust[Dust.NewDust(projectile.Center, 0, 0, num961, 0f, 0f, 0, default(Color), 1f)]; + dust14.noGravity = true; + dust14.position = projectile.Center + vector107 / 2f; + dust14.velocity = vector108; + dust14.scale = 1f + Main.rand.NextFloat(); + return; + } + } + else if (projectile.ai[0] <= 90f) + { + projectile.scale = (projectile.ai[0] - 50f) / 40f; + projectile.alpha = 255 - (int)(255f * projectile.scale); + Vector2 vector111 = projectile.ai[1].ToRotationVector2(); + Vector2 value61 = vector111.RotatedBy(1.5707963705062866, default(Vector2)) * (float)(Main.rand.Next(2) == 0).ToDirectionInt() * (float)Main.rand.Next(10, 21); + vector111 *= (float)Main.rand.Next(-80, 81); + Vector2 vector112 = vector111 - value61; + vector112 /= 10f; + int num962 = Utils.SelectRandom(Main.rand, new int[] + { + 57, + 57 + }); + Dust dust17 = Main.dust[Dust.NewDust(projectile.Center, 0, 0, num962, 0f, 0f, 0, default(Color), 1f)]; + dust17.noGravity = true; + dust17.position = projectile.Center + value61; + dust17.velocity = vector112; + dust17.scale = 0.5f + Main.rand.NextFloat(); + dust17.fadeIn = 0.5f; + if (projectile.ai[0] == 90f && Main.netMode != 1) + { + Vector2 vector113 = projectile.ai[1].ToRotationVector2() * 8f; + float ai2 = (float)Main.rand.Next(80); + Projectile.NewProjectile(projectile.Center.X - vector113.X, projectile.Center.Y - vector113.Y, vector113.X, vector113.Y, mod.ProjectileType("NovaAlchemistFlask"), 15, 1f, Main.myPlayer, projectile.ai[1], ai2); + return; + } + } + else + { + if (projectile.ai[0] > 120f) + { + projectile.scale = 1f - (projectile.ai[0] - 120f) / 60f; + projectile.alpha = 255 - (int)(255f * projectile.scale); + if (projectile.alpha >= 255) + { + projectile.Kill(); + } + for (int num965 = 0; num965 < 2; num965++) + { + int num966 = Main.rand.Next(3); + if (num966 == 0) + { + Vector2 vector114 = Vector2.UnitY.RotatedByRandom(6.2831854820251465) * projectile.scale; + Dust dust18 = Main.dust[Dust.NewDust(projectile.Center - vector114 * 30f, 0, 0, 57, 0f, 0f, 0, default(Color), 1f)]; + dust18.noGravity = true; + dust18.position = projectile.Center - vector114 * (float)Main.rand.Next(10, 21); + dust18.velocity = vector114.RotatedBy(1.5707963705062866, default(Vector2)) * 6f; + dust18.scale = 0.5f + Main.rand.NextFloat(); + dust18.fadeIn = 0.5f; + dust18.customData = projectile.Center; + } + else if (num966 == 1) + { + Vector2 vector115 = Vector2.UnitY.RotatedByRandom(6.2831854820251465) * projectile.scale; + Dust dust19 = Main.dust[Dust.NewDust(projectile.Center - vector115 * 30f, 0, 0, 57, 0f, 0f, 0, default(Color), 1f)]; + dust19.noGravity = true; + dust19.position = projectile.Center - vector115 * 30f; + dust19.velocity = vector115.RotatedBy(-1.5707963705062866, default(Vector2)) * 3f; + dust19.scale = 0.5f + Main.rand.NextFloat(); + dust19.fadeIn = 0.5f; + dust19.customData = projectile.Center; + } + } + return; + } + projectile.scale = 1f; + projectile.alpha = 0; + if (Main.rand.Next(2) == 0) + { + Vector2 vector116 = Vector2.UnitY.RotatedByRandom(6.2831854820251465); + Dust dust20 = Main.dust[Dust.NewDust(projectile.Center - vector116 * 30f, 0, 0, 57, 0f, 0f, 0, default(Color), 1f)]; + dust20.noGravity = true; + dust20.position = projectile.Center - vector116 * (float)Main.rand.Next(10, 21); + dust20.velocity = vector116.RotatedBy(1.5707963705062866, default(Vector2)) * 6f; + dust20.scale = 0.5f + Main.rand.NextFloat(); + dust20.fadeIn = 0.5f; + dust20.customData = projectile.Center; + return; + } + Vector2 vector117 = Vector2.UnitY.RotatedByRandom(6.2831854820251465); + Dust dust21 = Main.dust[Dust.NewDust(projectile.Center - vector117 * 30f, 0, 0, 57, 0f, 0f, 0, default(Color), 1f)]; + dust21.noGravity = true; + dust21.position = projectile.Center - vector117 * 30f; + dust21.velocity = vector117.RotatedBy(-1.5707963705062866, default(Vector2)) * 3f; + dust21.scale = 0.5f + Main.rand.NextFloat(); + dust21.fadeIn = 0.5f; + dust21.customData = projectile.Center; + return; + } + } + } } diff --git a/NovaPillar/NovaBat.cs b/NovaPillar/NovaBat.cs index 84cbe6bd..b7e260a0 100644 --- a/NovaPillar/NovaBat.cs +++ b/NovaPillar/NovaBat.cs @@ -7,86 +7,86 @@ namespace Tremor.NovaPillar { - public class NovaBat : ModNPC - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nova Bat"); - Main.npcFrameCount[npc.type] = 4; - } + public class NovaBat : ModNPC + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nova Bat"); + Main.npcFrameCount[npc.type] = 4; + } - public override void SetDefaults() - { - npc.lifeMax = 2250; - npc.damage = 100; - npc.defense = 45; - npc.knockBackResist = 0.3f; - npc.width = 40; - npc.height = 20; - animationType = 75; - npc.aiStyle = 14; - npc.npcSlots = 0.5f; - npc.noGravity = true; - } + public override void SetDefaults() + { + npc.lifeMax = 2250; + npc.damage = 100; + npc.defense = 45; + npc.knockBackResist = 0.3f; + npc.width = 40; + npc.height = 20; + animationType = 75; + npc.aiStyle = 14; + npc.npcSlots = 0.5f; + npc.noGravity = true; + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - if (spawnInfo.player.GetModPlayer(mod).ZoneTowerNova) - return 1f; - return 0; - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + if (spawnInfo.player.GetModPlayer(mod).ZoneTowerNova) + return 1f; + return 0; + } - public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) - { - TremorUtils.DrawNPCGlowMask(spriteBatch, npc, mod.GetTexture("NovaPillar/NovaBat_GlowMask")); - } + public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) + { + TremorUtils.DrawNPCGlowMask(spriteBatch, npc, mod.GetTexture("NovaPillar/NovaBat_GlowMask")); + } - public override void HitEffect(int hitDirection, double damage) - { - if (npc.life <= 0) - { - if (NovaHandler.ShieldStrength > 0) - { - NPC parent = Main.npc[NPC.FindFirstNPC(mod.NPCType("NovaPillar"))]; - Vector2 Velocity = Helper.VelocityToPoint(npc.Center, parent.Center, 20); - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, Velocity.X, Velocity.Y, mod.ProjectileType("CogLordLaser"), 1, 1f); - } - for (int k = 0; k < 19; k++) - { - Vector2 Vector = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - Vector.Normalize(); - Vector *= (float)Main.rand.Next(10, 201) * 0.01f; - int i = Projectile.NewProjectile(npc.position.X, npc.position.Y, Vector.X, Vector.Y, mod.ProjectileType("NovaAlchemistCloud"), 20, 1); - Main.projectile[i].friendly = false; - } - for (int i = 0; i < 5; i++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 57, Main.rand.NextFloat(-3f, 3f), Main.rand.NextFloat(-3f, 3f)); - } - for (int i = 0; i < 2; i++) - { - Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/NovaBatGore2")); - Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/NovaBatGore2")); - } - Gore.NewGore(npc.Top, npc.velocity * hitDirection, mod.GetGoreSlot("Gores/NovaBatGore3")); - Gore.NewGore(npc.Top, npc.velocity * hitDirection, mod.GetGoreSlot("Gores/NovaBatGore1")); - } - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + if (NovaHandler.ShieldStrength > 0) + { + NPC parent = Main.npc[NPC.FindFirstNPC(mod.NPCType("NovaPillar"))]; + Vector2 Velocity = Helper.VelocityToPoint(npc.Center, parent.Center, 20); + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, Velocity.X, Velocity.Y, mod.ProjectileType("CogLordLaser"), 1, 1f); + } + for (int k = 0; k < 19; k++) + { + Vector2 Vector = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector.Normalize(); + Vector *= (float)Main.rand.Next(10, 201) * 0.01f; + int i = Projectile.NewProjectile(npc.position.X, npc.position.Y, Vector.X, Vector.Y, mod.ProjectileType("NovaAlchemistCloud"), 20, 1); + Main.projectile[i].friendly = false; + } + for (int i = 0; i < 5; i++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 57, Main.rand.NextFloat(-3f, 3f), Main.rand.NextFloat(-3f, 3f)); + } + for (int i = 0; i < 2; i++) + { + Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/NovaBatGore2")); + Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/NovaBatGore2")); + } + Gore.NewGore(npc.Top, npc.velocity * hitDirection, mod.GetGoreSlot("Gores/NovaBatGore3")); + Gore.NewGore(npc.Top, npc.velocity * hitDirection, mod.GetGoreSlot("Gores/NovaBatGore1")); + } + } - public override void AI() - { - npc.position += npc.velocity * 1.33f; - if (Main.time % 120 == 0) - { - for (int k = 0; k < 19; k++) - { - Vector2 Vector = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - Vector.Normalize(); - Vector *= (float)Main.rand.Next(10, 201) * 0.01f; - int i = Projectile.NewProjectile(npc.position.X, npc.position.Y, Vector.X, Vector.Y, mod.ProjectileType("NovaAlchemistCloud"), 20, 1); - Main.projectile[i].friendly = false; - } - } - } - } + public override void AI() + { + npc.position += npc.velocity * 1.33f; + if (Main.time % 120 == 0) + { + for (int k = 0; k < 19; k++) + { + Vector2 Vector = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector.Normalize(); + Vector *= (float)Main.rand.Next(10, 201) * 0.01f; + int i = Projectile.NewProjectile(npc.position.X, npc.position.Y, Vector.X, Vector.Y, mod.ProjectileType("NovaAlchemistCloud"), 20, 1); + Main.projectile[i].friendly = false; + } + } + } + } } \ No newline at end of file diff --git a/NovaPillar/NovaBlock.cs b/NovaPillar/NovaBlock.cs index 9aef448f..ed8c2ea6 100644 --- a/NovaPillar/NovaBlock.cs +++ b/NovaPillar/NovaBlock.cs @@ -25,7 +25,7 @@ public override void SetDefaults() drop = mod.ItemType("NovaFragmentBlock"); AddMapEntry(Color.Yellow); } - + public override void NumDust(int i, int j, bool fail, ref int num) { num = fail ? 1 : 3; diff --git a/NovaPillar/NovaBottle.cs b/NovaPillar/NovaBottle.cs index 7c9b7f9e..5731be84 100644 --- a/NovaPillar/NovaBottle.cs +++ b/NovaPillar/NovaBottle.cs @@ -7,52 +7,52 @@ namespace Tremor.NovaPillar { - public class NovaBottle : ModProjectile - { + public class NovaBottle : ModProjectile + { public override void SetStaticDefaults() { DisplayName.SetDefault("Nova Flask"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; - ProjectileID.Sets.TrailingMode[projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + } + public override void SetDefaults() + { + projectile.width = 18; + projectile.height = 28; + projectile.aiStyle = 2; + projectile.timeLeft = 1200; + projectile.hostile = true; } - public override void SetDefaults() - { - projectile.width = 18; - projectile.height = 28; - projectile.aiStyle = 2; - projectile.timeLeft = 1200; - projectile.hostile = true; - } - public override Color? GetAlpha(Color lightColor) - { - return Color.White; - } + public override Color? GetAlpha(Color lightColor) + { + return Color.White; + } - public override void Kill(int timeLeft) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 107); - Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 704, 1f); - Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 705, 1f); - Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 705, 1f); - if (projectile.owner == Main.myPlayer) - { - int num220 = Main.rand.Next(5, 8); - for (int num221 = 0; num221 < num220; num221++) - { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - int k = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("NovaBottleCloud"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); - Main.projectile[k].friendly = false; - } - } - } + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 107); + Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 704, 1f); + Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 705, 1f); + Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 705, 1f); + if (projectile.owner == Main.myPlayer) + { + int num220 = Main.rand.Next(5, 8); + for (int num221 = 0; num221 < num220; num221++) + { + Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value17.Normalize(); + value17 *= (float)Main.rand.Next(10, 201) * 0.01f; + int k = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("NovaBottleCloud"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + Main.projectile[k].friendly = false; + } + } + } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - projectile.Kill(); - } - } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + projectile.Kill(); + } + } } \ No newline at end of file diff --git a/NovaPillar/NovaBreastplate.cs b/NovaPillar/NovaBreastplate.cs index 94716ae0..7ef32275 100644 --- a/NovaPillar/NovaBreastplate.cs +++ b/NovaPillar/NovaBreastplate.cs @@ -7,44 +7,44 @@ namespace Tremor.NovaPillar { -[AutoloadEquip(EquipType.Body)] - public class NovaBreastplate : ModItem - { - - public override void SetDefaults() - { - - item.width = 36; - item.height = 24; - - - item.rare = 10; - item.defense = 22; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nova Breastplate"); - Tooltip.SetDefault("Increases alchemic damage by 25%\nIncreases alchemic critical strike chance by 20\nGrants 40% chance to not consume flasks"); - } - - - public override void UpdateEquip(Player player) - { - player.GetModPlayer(mod).alchemistCrit += 20; - player.GetModPlayer(mod).alchemistDamage += 0.25f; - player.GetModPlayer(mod).novaChestplate = true; - Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.0f, 1.27f, 0.64f); - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "NovaFragment", 20); - recipe.AddIngredient(3467, 16); - recipe.AddTile(412); - recipe.SetResult(this, 1); - recipe.AddRecipe(); - } - } + [AutoloadEquip(EquipType.Body)] + public class NovaBreastplate : ModItem + { + + public override void SetDefaults() + { + + item.width = 36; + item.height = 24; + + + item.rare = 10; + item.defense = 22; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nova Breastplate"); + Tooltip.SetDefault("Increases alchemic damage by 25%\nIncreases alchemic critical strike chance by 20\nGrants 40% chance to not consume flasks"); + } + + + public override void UpdateEquip(Player player) + { + player.GetModPlayer(mod).alchemistCrit += 20; + player.GetModPlayer(mod).alchemistDamage += 0.25f; + player.GetModPlayer(mod).novaChestplate = true; + Lighting.AddLight((int)((item.position.X + (float)(item.width / 2)) / 16f), (int)((item.position.Y + (float)(item.height / 2)) / 16f), 0.0f, 1.27f, 0.64f); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "NovaFragment", 20); + recipe.AddIngredient(3467, 16); + recipe.AddTile(412); + recipe.SetResult(this, 1); + recipe.AddRecipe(); + } + } } diff --git a/NovaPillar/NovaCauldron.cs b/NovaPillar/NovaCauldron.cs index 5ac2cb26..56e95a50 100644 --- a/NovaPillar/NovaCauldron.cs +++ b/NovaPillar/NovaCauldron.cs @@ -7,222 +7,222 @@ namespace Tremor.NovaPillar { - public class NovaCauldron : ModProjectile - { - public override void SetDefaults() - { - projectile.netImportant = true; - projectile.friendly = true; - projectile.ignoreWater = true; - projectile.timeLeft = 18000; - projectile.penetrate = -1; - projectile.timeLeft *= 5; - projectile.tileCollide = false; - projectile.minion = true; - Main.projFrames[projectile.type] = 4; - projectile.width = 32; - projectile.height = 30; - } + public class NovaCauldron : ModProjectile + { + public override void SetDefaults() + { + projectile.netImportant = true; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.timeLeft = 18000; + projectile.penetrate = -1; + projectile.timeLeft *= 5; + projectile.tileCollide = false; + projectile.minion = true; + Main.projFrames[projectile.type] = 4; + projectile.width = 32; + projectile.height = 30; + } - public override Color? GetAlpha(Color lightColor) - { - return Color.White; - } + public override Color? GetAlpha(Color lightColor) + { + return Color.White; + } - public override void AI() - { - projectile.frameCounter++; - if (projectile.frameCounter > 4) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame >= 4) - { - projectile.frame = 0; - } - bool Flag1 = projectile.type == mod.ProjectileType("NovaCauldron"); - Player player = Main.player[projectile.owner]; - MPlayer modPlayer = player.GetModPlayer(mod); - if (Flag1) - { - if (player.dead) - { - modPlayer.novaSet = false; - } - if (modPlayer.novaSet) - { - projectile.timeLeft = 2; - } - } - if (!modPlayer.novaSet) - { - projectile.Kill(); - } - projectile.rotation = 0f; - Vector2 value = base.projectile.position; - float num2 = 500f; - bool flag = false; - base.projectile.tileCollide = true; - for (int j = 0; j < 200; j++) - { - NPC nPC = Main.npc[j]; - if (nPC.CanBeChasedBy(this, false)) - { - float num3 = Vector2.Distance(nPC.Center, base.projectile.Center); - if ((num3 < num2 || !flag) && Collision.CanHitLine(base.projectile.position, base.projectile.width, base.projectile.height, nPC.position, nPC.width, nPC.height)) - { - num2 = num3; - value = nPC.Center; - flag = true; - } - } - } - if (Vector2.Distance(player.Center, base.projectile.Center) > (flag ? 1000f : 500f)) - { - base.projectile.ai[0] = 1f; - base.projectile.netUpdate = true; - } - if (base.projectile.ai[0] == 1f) - { - base.projectile.tileCollide = false; - } - if (flag && base.projectile.ai[0] == 0f) - { - Vector2 value2 = value - base.projectile.Center; - if (value2.Length() > 200f) - { - value2.Normalize(); - base.projectile.velocity = (base.projectile.velocity * 20f + value2 * 6f) / 21f; - } - else - { - base.projectile.velocity *= (float)Math.Pow(0.97, 2.0); - } - } - else - { - if (!Collision.CanHitLine(base.projectile.Center, 1, 1, player.Center, 1, 1)) - { - base.projectile.ai[0] = 1f; - } - float num4 = 6f; - if (base.projectile.ai[0] == 1f) - { - num4 = 15f; - } - Vector2 center = base.projectile.Center; - Vector2 vector = player.Center - center; - base.projectile.ai[1] = 3600f; - base.projectile.netUpdate = true; - int num5 = 1; - for (int k = 0; k < base.projectile.whoAmI; k++) - { - if (Main.projectile[k].active && Main.projectile[k].owner == base.projectile.owner && Main.projectile[k].type == base.projectile.type) - { - num5++; - } - } - vector.X -= (float)((10 + num5 * 40) * player.direction); - vector.Y -= 70f; - float num6 = vector.Length(); - if (num6 > 200f && num4 < 9f) - { - num4 = 9f; - } - if (num6 < 100f && base.projectile.ai[0] == 1f && !Collision.SolidCollision(base.projectile.position, base.projectile.width, base.projectile.height)) - { - base.projectile.ai[0] = 0f; - base.projectile.netUpdate = true; - } - if (num6 > 2000f) - { - base.projectile.Center = player.Center; - } - if (num6 > 48f) - { - vector.Normalize(); - vector *= num4; - float num7 = 10f; - base.projectile.velocity = (base.projectile.velocity * num7 + vector) / (num7 + 1f); - } - else - { - base.projectile.direction = Main.player[base.projectile.owner].direction; - base.projectile.velocity *= (float)Math.Pow(0.9, 2.0); - } - } - base.projectile.rotation = base.projectile.velocity.X * 0.05f; - if (base.projectile.velocity.X > 0f) - { - base.projectile.spriteDirection = (base.projectile.direction = -1); - } - else if (base.projectile.velocity.X < 0f) - { - base.projectile.spriteDirection = (base.projectile.direction = 1); - } - if (base.projectile.ai[1] > 0f) - { - base.projectile.ai[1] += 1f; - } - if (base.projectile.ai[1] > 140f) - { - base.projectile.ai[1] = 0f; - base.projectile.netUpdate = true; - } - if (base.projectile.ai[0] == 0f && flag) - { - if ((value - base.projectile.Center).X > 0f) - { - base.projectile.spriteDirection = (base.projectile.direction = -1); - } - else if ((value - base.projectile.Center).X < 0f) - { - base.projectile.spriteDirection = (base.projectile.direction = 1); - } - } - if (projectile.owner == Main.myPlayer) - { - if (projectile.ai[0] != 0f) - { - projectile.ai[0] -= 1f; - return; - } - float Num3 = projectile.position.X; - float Num4 = projectile.position.Y; - float Num5 = 700f; - bool Flag2 = false; - for (int k = 0; k < 200; k++) - { - if (Main.npc[k].CanBeChasedBy(projectile, true)) - { - float Num6 = Main.npc[k].position.X + (float)(Main.npc[k].width / 2); - float Num7 = Main.npc[k].position.Y + (float)(Main.npc[k].height / 2); - float Num8 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - Num6) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - Num7); - if (Num8 < Num5 && Collision.CanHit(projectile.position, projectile.width, projectile.height, Main.npc[k].position, Main.npc[k].width, Main.npc[k].height)) - { - Num5 = Num8; - Num3 = Num6; - Num4 = Num7; - Flag2 = true; - } - } - } - if (Flag2) - { - float Num9 = 12f; - Vector2 Vector = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float Num10 = Num3 - Vector.X; - float Num11 = Num4 - Vector.Y; - float Num12 = (float)Math.Sqrt((double)(Num10 * Num10 + Num11 * Num11)); - Num12 = Num9 / Num12; - Num10 *= Num12; - Num11 *= Num12; - Projectile.NewProjectile(projectile.Center.X - 4f, projectile.Center.Y, Num10, Num11, mod.ProjectileType("NovaCauldron_Fire"), 65, projectile.knockBack, projectile.owner, 0f, 0f); - projectile.ai[0] = 50f; - return; - } - } - } - } + public override void AI() + { + projectile.frameCounter++; + if (projectile.frameCounter > 4) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame >= 4) + { + projectile.frame = 0; + } + bool Flag1 = projectile.type == mod.ProjectileType("NovaCauldron"); + Player player = Main.player[projectile.owner]; + MPlayer modPlayer = player.GetModPlayer(mod); + if (Flag1) + { + if (player.dead) + { + modPlayer.novaSet = false; + } + if (modPlayer.novaSet) + { + projectile.timeLeft = 2; + } + } + if (!modPlayer.novaSet) + { + projectile.Kill(); + } + projectile.rotation = 0f; + Vector2 value = base.projectile.position; + float num2 = 500f; + bool flag = false; + base.projectile.tileCollide = true; + for (int j = 0; j < 200; j++) + { + NPC nPC = Main.npc[j]; + if (nPC.CanBeChasedBy(this, false)) + { + float num3 = Vector2.Distance(nPC.Center, base.projectile.Center); + if ((num3 < num2 || !flag) && Collision.CanHitLine(base.projectile.position, base.projectile.width, base.projectile.height, nPC.position, nPC.width, nPC.height)) + { + num2 = num3; + value = nPC.Center; + flag = true; + } + } + } + if (Vector2.Distance(player.Center, base.projectile.Center) > (flag ? 1000f : 500f)) + { + base.projectile.ai[0] = 1f; + base.projectile.netUpdate = true; + } + if (base.projectile.ai[0] == 1f) + { + base.projectile.tileCollide = false; + } + if (flag && base.projectile.ai[0] == 0f) + { + Vector2 value2 = value - base.projectile.Center; + if (value2.Length() > 200f) + { + value2.Normalize(); + base.projectile.velocity = (base.projectile.velocity * 20f + value2 * 6f) / 21f; + } + else + { + base.projectile.velocity *= (float)Math.Pow(0.97, 2.0); + } + } + else + { + if (!Collision.CanHitLine(base.projectile.Center, 1, 1, player.Center, 1, 1)) + { + base.projectile.ai[0] = 1f; + } + float num4 = 6f; + if (base.projectile.ai[0] == 1f) + { + num4 = 15f; + } + Vector2 center = base.projectile.Center; + Vector2 vector = player.Center - center; + base.projectile.ai[1] = 3600f; + base.projectile.netUpdate = true; + int num5 = 1; + for (int k = 0; k < base.projectile.whoAmI; k++) + { + if (Main.projectile[k].active && Main.projectile[k].owner == base.projectile.owner && Main.projectile[k].type == base.projectile.type) + { + num5++; + } + } + vector.X -= (float)((10 + num5 * 40) * player.direction); + vector.Y -= 70f; + float num6 = vector.Length(); + if (num6 > 200f && num4 < 9f) + { + num4 = 9f; + } + if (num6 < 100f && base.projectile.ai[0] == 1f && !Collision.SolidCollision(base.projectile.position, base.projectile.width, base.projectile.height)) + { + base.projectile.ai[0] = 0f; + base.projectile.netUpdate = true; + } + if (num6 > 2000f) + { + base.projectile.Center = player.Center; + } + if (num6 > 48f) + { + vector.Normalize(); + vector *= num4; + float num7 = 10f; + base.projectile.velocity = (base.projectile.velocity * num7 + vector) / (num7 + 1f); + } + else + { + base.projectile.direction = Main.player[base.projectile.owner].direction; + base.projectile.velocity *= (float)Math.Pow(0.9, 2.0); + } + } + base.projectile.rotation = base.projectile.velocity.X * 0.05f; + if (base.projectile.velocity.X > 0f) + { + base.projectile.spriteDirection = (base.projectile.direction = -1); + } + else if (base.projectile.velocity.X < 0f) + { + base.projectile.spriteDirection = (base.projectile.direction = 1); + } + if (base.projectile.ai[1] > 0f) + { + base.projectile.ai[1] += 1f; + } + if (base.projectile.ai[1] > 140f) + { + base.projectile.ai[1] = 0f; + base.projectile.netUpdate = true; + } + if (base.projectile.ai[0] == 0f && flag) + { + if ((value - base.projectile.Center).X > 0f) + { + base.projectile.spriteDirection = (base.projectile.direction = -1); + } + else if ((value - base.projectile.Center).X < 0f) + { + base.projectile.spriteDirection = (base.projectile.direction = 1); + } + } + if (projectile.owner == Main.myPlayer) + { + if (projectile.ai[0] != 0f) + { + projectile.ai[0] -= 1f; + return; + } + float Num3 = projectile.position.X; + float Num4 = projectile.position.Y; + float Num5 = 700f; + bool Flag2 = false; + for (int k = 0; k < 200; k++) + { + if (Main.npc[k].CanBeChasedBy(projectile, true)) + { + float Num6 = Main.npc[k].position.X + (float)(Main.npc[k].width / 2); + float Num7 = Main.npc[k].position.Y + (float)(Main.npc[k].height / 2); + float Num8 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - Num6) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - Num7); + if (Num8 < Num5 && Collision.CanHit(projectile.position, projectile.width, projectile.height, Main.npc[k].position, Main.npc[k].width, Main.npc[k].height)) + { + Num5 = Num8; + Num3 = Num6; + Num4 = Num7; + Flag2 = true; + } + } + } + if (Flag2) + { + float Num9 = 12f; + Vector2 Vector = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float Num10 = Num3 - Vector.X; + float Num11 = Num4 - Vector.Y; + float Num12 = (float)Math.Sqrt((double)(Num10 * Num10 + Num11 * Num11)); + Num12 = Num9 / Num12; + Num10 *= Num12; + Num11 *= Num12; + Projectile.NewProjectile(projectile.Center.X - 4f, projectile.Center.Y, Num10, Num11, mod.ProjectileType("NovaCauldron_Fire"), 65, projectile.knockBack, projectile.owner, 0f, 0f); + projectile.ai[0] = 50f; + return; + } + } + } + } } \ No newline at end of file diff --git a/NovaPillar/NovaCauldron_Fire.cs b/NovaPillar/NovaCauldron_Fire.cs index ecf238d8..34fedac9 100644 --- a/NovaPillar/NovaCauldron_Fire.cs +++ b/NovaPillar/NovaCauldron_Fire.cs @@ -10,117 +10,117 @@ public class NovaCauldron_Fire : ModProjectile { public override void SetDefaults() { - projectile.width = 12; - projectile.height = 12; - projectile.hostile = true; - projectile.tileCollide = false; - projectile.penetrate = -1; - projectile.extraUpdates = 1; - projectile.friendly = true; - projectile.hostile = false; + projectile.width = 12; + projectile.height = 12; + projectile.hostile = true; + projectile.tileCollide = false; + projectile.penetrate = -1; + projectile.extraUpdates = 1; + projectile.friendly = true; + projectile.hostile = false; } - public override bool PreAI() - { - for (int i = 0; i < 10; i++) - { - float x = projectile.Center.X - projectile.velocity.X / 10f * (float)i; - float y = projectile.Center.Y - projectile.velocity.Y / 10f * (float)i; - int dust = Dust.NewDust(new Vector2(x, y), 1, 1, 57, 0f, 0f, 0, default(Color), 1f); - Main.dust[dust].alpha = projectile.alpha; - Main.dust[dust].position.X = x; - Main.dust[dust].position.Y = y; - Main.dust[dust].velocity *= 0f; - Main.dust[dust].noGravity = true; - } - if (projectile.localAI[1] == 0f) - { - projectile.localAI[1] = 1f; - } - if (projectile.ai[0] == 0f || projectile.ai[0] == 2f) - { - projectile.scale += 0.01f; - projectile.alpha -= 50; - if (projectile.alpha <= 0) - { - projectile.ai[0] = 1f; - projectile.alpha = 0; - } - } - else if (projectile.ai[0] == 1f) - { - projectile.scale -= 0.01f; - projectile.alpha += 50; - if (projectile.alpha >= 255) - { - projectile.ai[0] = 2f; - projectile.alpha = 255; - } - } - return false; - } + public override bool PreAI() + { + for (int i = 0; i < 10; i++) + { + float x = projectile.Center.X - projectile.velocity.X / 10f * (float)i; + float y = projectile.Center.Y - projectile.velocity.Y / 10f * (float)i; + int dust = Dust.NewDust(new Vector2(x, y), 1, 1, 57, 0f, 0f, 0, default(Color), 1f); + Main.dust[dust].alpha = projectile.alpha; + Main.dust[dust].position.X = x; + Main.dust[dust].position.Y = y; + Main.dust[dust].velocity *= 0f; + Main.dust[dust].noGravity = true; + } + if (projectile.localAI[1] == 0f) + { + projectile.localAI[1] = 1f; + } + if (projectile.ai[0] == 0f || projectile.ai[0] == 2f) + { + projectile.scale += 0.01f; + projectile.alpha -= 50; + if (projectile.alpha <= 0) + { + projectile.ai[0] = 1f; + projectile.alpha = 0; + } + } + else if (projectile.ai[0] == 1f) + { + projectile.scale -= 0.01f; + projectile.alpha += 50; + if (projectile.alpha >= 255) + { + projectile.ai[0] = 2f; + projectile.alpha = 255; + } + } + return false; + } - public override void AI() - { - projectile.localAI[0] += 1f; - float num472 = projectile.Center.X; - float num473 = projectile.Center.Y; - float num474 = 400f; - bool flag17 = false; - for (int num475 = 0; num475 < 200; num475++) - { - if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1)) - { - float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2); - float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2); - float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); - if (num478 < num474) - { - num474 = num478; - num472 = num476; - num473 = num477; - flag17 = true; - } - } - } - if (flag17) - { - float num483 = 10f; - Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num484 = num472 - vector35.X; - float num485 = num473 - vector35.Y; - float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485)); - num486 = num483 / num486; - num484 *= num486; - num485 *= num486; - projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f; - projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f; - return; - } - } + public override void AI() + { + projectile.localAI[0] += 1f; + float num472 = projectile.Center.X; + float num473 = projectile.Center.Y; + float num474 = 400f; + bool flag17 = false; + for (int num475 = 0; num475 < 200; num475++) + { + if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1)) + { + float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2); + float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2); + float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); + if (num478 < num474) + { + num474 = num478; + num472 = num476; + num473 = num477; + flag17 = true; + } + } + } + if (flag17) + { + float num483 = 10f; + Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num484 = num472 - vector35.X; + float num485 = num473 - vector35.Y; + float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485)); + num486 = num483 / num486; + num484 *= num486; + num485 *= num486; + projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f; + projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f; + return; + } + } - public override void Kill(int timeLeft) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); - Helper.Explode(projectile.whoAmI, 120, 120, delegate - { - for (int i = 0; i < 40; i++) - { - int num = Dust.NewDust(projectile.position, projectile.width, projectile.height, 57, 0f, -2f, 0, default(Color), 2f); - Main.dust[num].noGravity = true; - Dust expr_62_cp_0 = Main.dust[num]; - expr_62_cp_0.position.X = expr_62_cp_0.position.X + ((float)(Main.rand.Next(-50, 51) / 20) - 1.5f); - Dust expr_92_cp_0 = Main.dust[num]; - expr_92_cp_0.position.Y = expr_92_cp_0.position.Y + ((float)(Main.rand.Next(-50, 51) / 20) - 1.5f); - if (Main.dust[num].position != projectile.Center) - { - Main.dust[num].velocity = projectile.DirectionTo(Main.dust[num].position) * 6f; - } - } - }); - } + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Helper.Explode(projectile.whoAmI, 120, 120, delegate + { + for (int i = 0; i < 40; i++) + { + int num = Dust.NewDust(projectile.position, projectile.width, projectile.height, 57, 0f, -2f, 0, default(Color), 2f); + Main.dust[num].noGravity = true; + Dust expr_62_cp_0 = Main.dust[num]; + expr_62_cp_0.position.X = expr_62_cp_0.position.X + ((float)(Main.rand.Next(-50, 51) / 20) - 1.5f); + Dust expr_92_cp_0 = Main.dust[num]; + expr_92_cp_0.position.Y = expr_92_cp_0.position.Y + ((float)(Main.rand.Next(-50, 51) / 20) - 1.5f); + if (Main.dust[num].position != projectile.Center) + { + Main.dust[num].velocity = projectile.DirectionTo(Main.dust[num].position) * 6f; + } + } + }); + } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Helper.DrawAroundOrigin(projectile.whoAmI, lightColor); return false; diff --git a/NovaPillar/NovaData.cs b/NovaPillar/NovaData.cs index d55bffa0..5efb81c5 100644 --- a/NovaPillar/NovaData.cs +++ b/NovaPillar/NovaData.cs @@ -9,7 +9,7 @@ public class NovaData : ScreenShaderData { int NovaTowerIndex; - public NovaData(string passName) : base(passName) {} + public NovaData(string passName) : base(passName) { } void UpdatePuritySpiritIndex() { @@ -18,12 +18,12 @@ void UpdatePuritySpiritIndex() { return; } - NovaTowerIndex = -1; + NovaTowerIndex = -1; for (int i = 0; i < Main.npc.Length; i++) { if (Main.npc[i].active && Main.npc[i].type == NovaTowerType) { - NovaTowerIndex = i; + NovaTowerIndex = i; break; } } diff --git a/NovaPillar/NovaDye.cs b/NovaPillar/NovaDye.cs index d8e9d04d..f34f442b 100644 --- a/NovaPillar/NovaDye.cs +++ b/NovaPillar/NovaDye.cs @@ -17,13 +17,13 @@ public override void SetDefaults() item.rare = 4; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nova Dye"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nova Dye"); + Tooltip.SetDefault(""); + } + - public override void AddRecipes() { var recipe = new ModRecipe(mod); diff --git a/NovaPillar/NovaFlask.cs b/NovaPillar/NovaFlask.cs index 12c5d131..77849f8e 100644 --- a/NovaPillar/NovaFlask.cs +++ b/NovaPillar/NovaFlask.cs @@ -7,75 +7,75 @@ namespace Tremor.NovaPillar { - public class NovaFlask : AlchemistItem - { + public class NovaFlask : AlchemistItem + { - public override void SetDefaults() - { - item.damage = 46; - item.width = 18; - item.noUseGraphic = true; - item.maxStack = 999; - item.height = 28; - item.useTime = 11; - item.useAnimation = 11; - item.shoot = mod.ProjectileType("NovaFlask_Proj"); - item.shootSpeed = 13f; - item.useStyle = 1; - item.knockBack = 1; - item.UseSound = SoundID.Item106; - item.value = 30; - item.rare = 10; - item.crit = 12; - item.autoReuse = false; - item.consumable = true; - } + public override void SetDefaults() + { + item.damage = 46; + item.width = 18; + item.noUseGraphic = true; + item.maxStack = 999; + item.height = 28; + item.useTime = 11; + item.useAnimation = 11; + item.shoot = mod.ProjectileType("NovaFlask_Proj"); + item.shootSpeed = 13f; + item.useStyle = 1; + item.knockBack = 1; + item.UseSound = SoundID.Item106; + item.value = 30; + item.rare = 10; + item.crit = 12; + item.autoReuse = false; + item.consumable = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nova Flask"); - Tooltip.SetDefault("Shoots out a nova flask that explodes into two balls\nBalls explode into flames after some time or when they hit enemy\nFlames explode into damagin bursts after some time or when they hit enemy"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nova Flask"); + Tooltip.SetDefault("Shoots out a nova flask that explodes into two balls\nBalls explode into flames after some time or when they hit enemy\nFlames explode into damagin bursts after some time or when they hit enemy"); + } - public override void UpdateInventory(Player player) - { - MPlayer modPlayer = player.GetModPlayer(mod); - if (modPlayer.novaHelmet) - { - item.autoReuse = true; - } - if (!modPlayer.novaHelmet) - { - item.autoReuse = false; - } + public override void UpdateInventory(Player player) + { + MPlayer modPlayer = player.GetModPlayer(mod); + if (modPlayer.novaHelmet) + { + item.autoReuse = true; + } + if (!modPlayer.novaHelmet) + { + item.autoReuse = false; + } - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) - { - item.shootSpeed = 15f; - } - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) - { - item.shootSpeed = 13f; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) - { - item.autoReuse = true; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) - { - item.autoReuse = false; - } - } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) + { + item.shootSpeed = 15f; + } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) + { + item.shootSpeed = 13f; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) + { + item.autoReuse = true; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) + { + item.autoReuse = false; + } + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "NovaFragment", 3); - recipe.AddIngredient(null, "BasicFlask", 1); - recipe.SetResult(this, 111); - recipe.AddTile(412); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "NovaFragment", 3); + recipe.AddIngredient(null, "BasicFlask", 1); + recipe.SetResult(this, 111); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } } diff --git a/NovaPillar/NovaFlask_Proj.cs b/NovaPillar/NovaFlask_Proj.cs index f7ad6653..78222e10 100644 --- a/NovaPillar/NovaFlask_Proj.cs +++ b/NovaPillar/NovaFlask_Proj.cs @@ -8,176 +8,176 @@ namespace Tremor.NovaPillar { - public class NovaFlask_Proj : ModProjectile - { - public override void SetDefaults() - { - projectile.width = 18; - projectile.height = 28; - projectile.friendly = true; - projectile.aiStyle = 2; - projectile.timeLeft = 1200; - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) - { - projectile.penetrate = 3; - } - else - projectile.penetrate = 1; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - } + public class NovaFlask_Proj : ModProjectile + { + public override void SetDefaults() + { + projectile.width = 18; + projectile.height = 28; + projectile.friendly = true; + projectile.aiStyle = 2; + projectile.timeLeft = 1200; + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + { + projectile.penetrate = 3; + } + else + projectile.penetrate = 1; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } - public override Color? GetAlpha(Color lightColor) - { - return Color.White; - } + public override Color? GetAlpha(Color lightColor) + { + return Color.White; + } - public override bool OnTileCollide(Vector2 oldVelocity) - { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) - { - projectile.penetrate--; - if (projectile.penetrate <= 0) - { - projectile.Kill(); - } - else - { - if (projectile.velocity.X != oldVelocity.X) - { - projectile.velocity.X = -oldVelocity.X; - } - if (projectile.velocity.Y != oldVelocity.Y) - { - projectile.velocity.Y = -oldVelocity.Y; - } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); - } - } - else - { - projectile.Kill(); - } + public override bool OnTileCollide(Vector2 oldVelocity) + { + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + { + projectile.penetrate--; + if (projectile.penetrate <= 0) + { + projectile.Kill(); + } + else + { + if (projectile.velocity.X != oldVelocity.X) + { + projectile.velocity.X = -oldVelocity.X; + } + if (projectile.velocity.Y != oldVelocity.Y) + { + projectile.velocity.Y = -oldVelocity.Y; + } + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + } + } + else + { + projectile.Kill(); + } - return false; - } + return false; + } - public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) - { - if (Main.rand.Next(1, 101) <= Main.player[projectile.owner].GetModPlayer(mod).alchemistCrit) - { - crit = true; - } - } + public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) + { + if (Main.rand.Next(1, 101) <= Main.player[projectile.owner].GetModPlayer(mod).alchemistCrit) + { + crit = true; + } + } - public override void AI() - { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) - { - int[] array = new int[20]; - int num428 = 0; - float num429 = 495f; - bool flag14 = false; - for (int num430 = 0; num430 < 200; num430++) - { - if (Main.npc[num430].CanBeChasedBy(projectile, false)) - { - float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2); - float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2); - float num433 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num431) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num432); - if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1)) - { - if (num428 < 20) - { - array[num428] = num430; - num428++; - } - flag14 = true; - } - } - } - if (flag14) - { - int num434 = Main.rand.Next(num428); - num434 = array[num434]; - float num435 = Main.npc[num434].position.X + (float)(Main.npc[num434].width / 2); - float num436 = Main.npc[num434].position.Y + (float)(Main.npc[num434].height / 2); - projectile.localAI[0] += 1f; - if (projectile.localAI[0] > 8f) - { - projectile.localAI[0] = 0f; - float num437 = 6f; - Vector2 value10 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - value10 += projectile.velocity * 4f; - float num438 = num435 - value10.X; - float num439 = num436 - value10.Y; - float num440 = (float)Math.Sqrt((double)(num438 * num438 + num439 * num439)); - num440 = num437 / num440; - num438 *= num440; - num439 *= num440; - if (Main.rand.Next(2) == 0) - { - Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); - } - return; - } - } - } - } + public override void AI() + { + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("TheCadenceBuff"))) + { + int[] array = new int[20]; + int num428 = 0; + float num429 = 495f; + bool flag14 = false; + for (int num430 = 0; num430 < 200; num430++) + { + if (Main.npc[num430].CanBeChasedBy(projectile, false)) + { + float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2); + float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2); + float num433 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num431) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num432); + if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1)) + { + if (num428 < 20) + { + array[num428] = num430; + num428++; + } + flag14 = true; + } + } + } + if (flag14) + { + int num434 = Main.rand.Next(num428); + num434 = array[num434]; + float num435 = Main.npc[num434].position.X + (float)(Main.npc[num434].width / 2); + float num436 = Main.npc[num434].position.Y + (float)(Main.npc[num434].height / 2); + projectile.localAI[0] += 1f; + if (projectile.localAI[0] > 8f) + { + projectile.localAI[0] = 0f; + float num437 = 6f; + Vector2 value10 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + value10 += projectile.velocity * 4f; + float num438 = num435 - value10.X; + float num439 = num436 - value10.Y; + float num440 = (float)Math.Sqrt((double)(num438 * num438 + num439 * num439)); + num440 = num437 / num440; + num438 *= num440; + num439 *= num440; + if (Main.rand.Next(2) == 0) + { + Projectile.NewProjectile(value10.X, value10.Y, num438, num439, mod.ProjectileType("TheCadenceProj"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + } + return; + } + } + } + } - public override void Kill(int timeLeft) - { - Player player = Main.player[projectile.owner]; - MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 107); - Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 704, 1f); - Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 705, 1f); - Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 705, 1f); - if (projectile.owner == Main.myPlayer) - { - int num220 = Main.rand.Next(2, 3); - for (int num221 = 0; num221 < num220; num221++) - { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - int k = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("NovaFlask_ProjBall"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); - Main.projectile[k].friendly = true; - } - } + public override void Kill(int timeLeft) + { + Player player = Main.player[projectile.owner]; + MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 107); + Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 704, 1f); + Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 705, 1f); + Gore.NewGore(projectile.position, -projectile.oldVelocity * 0.2f, 705, 1f); + if (projectile.owner == Main.myPlayer) + { + int num220 = Main.rand.Next(2, 3); + for (int num221 = 0; num221 < num220; num221++) + { + Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value17.Normalize(); + value17 *= (float)Main.rand.Next(10, 201) * 0.01f; + int k = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("NovaFlask_ProjBall"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + Main.projectile[k].friendly = true; + } + } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) - { - for (int i = 0; i < 5; i++) - { - Vector2 vector2 = new Vector2(player.position.X + 75f * (float)Math.Cos(12), player.position.Y + 1075f * (float)Math.Sin(12)); - Vector2 Velocity = Helper.VelocityToPoint(vector2, Helper.RandomPointInArea(new Vector2(projectile.Center.X - 10, projectile.Center.Y - 10), new Vector2(projectile.Center.X + 20, projectile.Center.Y + 20)), 24); - int a = Projectile.NewProjectile(vector2.X, vector2.Y, Velocity.X, Velocity.Y, 134, projectile.damage, 1f); - Main.projectile[a].friendly = true; - } - } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) - { - int num220 = Main.rand.Next(3, 6); - for (int num221 = 0; num221 < num220; num221++) - { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); - } - } - } + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BrassChipBuff"))) + { + for (int i = 0; i < 5; i++) + { + Vector2 vector2 = new Vector2(player.position.X + 75f * (float)Math.Cos(12), player.position.Y + 1075f * (float)Math.Sin(12)); + Vector2 Velocity = Helper.VelocityToPoint(vector2, Helper.RandomPointInArea(new Vector2(projectile.Center.X - 10, projectile.Center.Y - 10), new Vector2(projectile.Center.X + 20, projectile.Center.Y + 20)), 24); + int a = Projectile.NewProjectile(vector2.X, vector2.Y, Velocity.X, Velocity.Y, 134, projectile.damage, 1f); + Main.projectile[a].friendly = true; + } + } + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChaosElementBuff"))) + { + int num220 = Main.rand.Next(3, 6); + for (int num221 = 0; num221 < num220; num221++) + { + Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value17.Normalize(); + value17 *= (float)Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("Shatter1"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + } + } + } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Vector2 drawOrigin = new Vector2(Main.projectileTexture[projectile.type].Width * 0.5f, projectile.height * 0.5f); - for (int k = 0; k < projectile.oldPos.Length; k++) - { - Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); - spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, Color.White, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); - } - return true; - } - } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Vector2 drawOrigin = new Vector2(Main.projectileTexture[projectile.type].Width * 0.5f, projectile.height * 0.5f); + for (int k = 0; k < projectile.oldPos.Length; k++) + { + Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); + spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, Color.White, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); + } + return true; + } + } } \ No newline at end of file diff --git a/NovaPillar/NovaFlask_ProjBall.cs b/NovaPillar/NovaFlask_ProjBall.cs index ce40b21c..f1b33308 100644 --- a/NovaPillar/NovaFlask_ProjBall.cs +++ b/NovaPillar/NovaFlask_ProjBall.cs @@ -7,401 +7,401 @@ namespace Tremor.NovaPillar { - public class NovaFlask_ProjBall : ModProjectile - { - public override void SetDefaults() - { - projectile.CloneDefaults(ProjectileID.SpikyBall); - projectile.friendly = true; - projectile.hostile = false; - projectile.timeLeft = 180; - projectile.width = 20; - Main.projFrames[projectile.type] = 3; - projectile.height = 20; - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) - { - projectile.scale = 3f; - } - else - projectile.scale = 1f; - } + public class NovaFlask_ProjBall : ModProjectile + { + public override void SetDefaults() + { + projectile.CloneDefaults(ProjectileID.SpikyBall); + projectile.friendly = true; + projectile.hostile = false; + projectile.timeLeft = 180; + projectile.width = 20; + Main.projFrames[projectile.type] = 3; + projectile.height = 20; + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("BouncingCasingBuff"))) + { + projectile.scale = 3f; + } + else + projectile.scale = 1f; + } - public override Color? GetAlpha(Color lightColor) - { - return Color.White; - } + public override Color? GetAlpha(Color lightColor) + { + return Color.White; + } - public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) - { - if (Main.rand.Next(1, 101) <= Main.player[projectile.owner].GetModPlayer(mod).alchemistCrit) - { - crit = true; - } - } + public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) + { + if (Main.rand.Next(1, 101) <= Main.player[projectile.owner].GetModPlayer(mod).alchemistCrit) + { + crit = true; + } + } - public override void AI() - { - projectile.frameCounter++; - if (projectile.frameCounter > 3) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame >= 3) - { - projectile.frame = 0; - } - for (int i = 0; i < Main.dust.Length; i++) - { - if ((Main.dust[i].type == DustID.Fire || Main.dust[i].type == 31 || Main.dust[i].type == 6) && projectile.Distance(Main.dust[i].position) < 150f) - { - Main.dust[i].scale /= 1000000f; - Main.dust[i].active = false; - } - } - } + public override void AI() + { + projectile.frameCounter++; + if (projectile.frameCounter > 3) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame >= 3) + { + projectile.frame = 0; + } + for (int i = 0; i < Main.dust.Length; i++) + { + if ((Main.dust[i].type == DustID.Fire || Main.dust[i].type == 31 || Main.dust[i].type == 6) && projectile.Distance(Main.dust[i].position) < 150f) + { + Main.dust[i].scale /= 1000000f; + Main.dust[i].active = false; + } + } + } - public override void Kill(int timeLeft) - { - Player player = Main.player[projectile.owner]; - MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0, 0, mod.ProjectileType("NovaFlask_ProjFire"), (int)(projectile.damage - 30), 0, Main.myPlayer); - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0, 0, mod.ProjectileType("NovaFlask_ProjFire"), (int)(projectile.damage - 30), 0, Main.myPlayer); + public override void Kill(int timeLeft) + { + Player player = Main.player[projectile.owner]; + MPlayer modPlayer = (MPlayer)player.GetModPlayer(mod, "MPlayer"); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0, 0, mod.ProjectileType("NovaFlask_ProjFire"), (int)(projectile.damage - 30), 0, Main.myPlayer); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0, 0, mod.ProjectileType("NovaFlask_ProjFire"), (int)(projectile.damage - 30), 0, Main.myPlayer); - if (projectile.owner == Main.myPlayer) - { - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); - int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1.5f, projectile.owner); - Main.projectile[a].scale = 1.5f; - } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); - int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1.25f, projectile.owner); - Main.projectile[a].scale = 1.25f; - int b = Projectile.NewProjectile(projectile.position.X + 32, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); - int c = Projectile.NewProjectile(projectile.position.X - 32, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); - int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 32, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); - int e = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 32, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); - } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); - int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1.25f, projectile.owner); - Main.projectile[a].scale = 1.25f; - int b = Projectile.NewProjectile(projectile.position.X + 30, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); - int c = Projectile.NewProjectile(projectile.position.X - 30, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); - int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 30, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); - int e = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 30, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); - int f = Projectile.NewProjectile(projectile.position.X + 50, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 0.7f, projectile.owner); - Main.projectile[f].scale = 0.7f; - int g = Projectile.NewProjectile(projectile.position.X - 50, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 0.7f, projectile.owner); - Main.projectile[g].scale = 0.7f; - int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 50, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 0.7f, projectile.owner); - Main.projectile[h].scale = 0.7f; - int i = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 50, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 0.7f, projectile.owner); - Main.projectile[i].scale = 0.7f; - int j = Projectile.NewProjectile(projectile.position.X + 70, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 0.5f, projectile.owner); - Main.projectile[j].scale = 0.8f; - int k = Projectile.NewProjectile(projectile.position.X - 70, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 0.5f, projectile.owner); - Main.projectile[k].scale = 0.8f; - int l = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 70, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 0.5f, projectile.owner); - Main.projectile[l].scale = 0.8f; - int m = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 70, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 0.5f, projectile.owner); - Main.projectile[m].scale = 0.8f; - } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); - int a = Projectile.NewProjectile(projectile.position.X + 60, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); - int b = Projectile.NewProjectile(projectile.position.X - 60, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); - int c = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 60, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); - int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 60, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); - int e = Projectile.NewProjectile(projectile.position.X + 40, projectile.position.Y + 40, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); - int f = Projectile.NewProjectile(projectile.position.X - 40, projectile.position.Y + 40, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); - int g = Projectile.NewProjectile(projectile.position.X + 40, projectile.position.Y - 40, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); - int h = Projectile.NewProjectile(projectile.position.X - 40, projectile.position.Y - 40, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); - } + if (projectile.owner == Main.myPlayer) + { + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff")) && !modPlayer.nitro) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); + int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1.5f, projectile.owner); + Main.projectile[a].scale = 1.5f; + } + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff")) && !modPlayer.nitro) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); + int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1.25f, projectile.owner); + Main.projectile[a].scale = 1.25f; + int b = Projectile.NewProjectile(projectile.position.X + 32, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); + int c = Projectile.NewProjectile(projectile.position.X - 32, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); + int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 32, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); + int e = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 32, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); + } + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && !modPlayer.nitro) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); + int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1.25f, projectile.owner); + Main.projectile[a].scale = 1.25f; + int b = Projectile.NewProjectile(projectile.position.X + 30, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); + int c = Projectile.NewProjectile(projectile.position.X - 30, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); + int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 30, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); + int e = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 30, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); + int f = Projectile.NewProjectile(projectile.position.X + 50, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 0.7f, projectile.owner); + Main.projectile[f].scale = 0.7f; + int g = Projectile.NewProjectile(projectile.position.X - 50, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 0.7f, projectile.owner); + Main.projectile[g].scale = 0.7f; + int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 50, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 0.7f, projectile.owner); + Main.projectile[h].scale = 0.7f; + int i = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 50, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 0.7f, projectile.owner); + Main.projectile[i].scale = 0.7f; + int j = Projectile.NewProjectile(projectile.position.X + 70, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 0.5f, projectile.owner); + Main.projectile[j].scale = 0.8f; + int k = Projectile.NewProjectile(projectile.position.X - 70, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 0.5f, projectile.owner); + Main.projectile[k].scale = 0.8f; + int l = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 70, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 0.5f, projectile.owner); + Main.projectile[l].scale = 0.8f; + int m = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 70, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 0.5f, projectile.owner); + Main.projectile[m].scale = 0.8f; + } + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && !modPlayer.nitro) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); + int a = Projectile.NewProjectile(projectile.position.X + 60, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); + int b = Projectile.NewProjectile(projectile.position.X - 60, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); + int c = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 60, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); + int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 60, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); + int e = Projectile.NewProjectile(projectile.position.X + 40, projectile.position.Y + 40, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); + int f = Projectile.NewProjectile(projectile.position.X - 40, projectile.position.Y + 40, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); + int g = Projectile.NewProjectile(projectile.position.X + 40, projectile.position.Y - 40, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); + int h = Projectile.NewProjectile(projectile.position.X - 40, projectile.position.Y - 40, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); + } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); - int a = Projectile.NewProjectile(projectile.position.X + 70, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); - int b = Projectile.NewProjectile(projectile.position.X - 70, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); - int c = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 70, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); - int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 70, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); - int e = Projectile.NewProjectile(projectile.position.X + 70, projectile.position.Y + 70, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); - int f = Projectile.NewProjectile(projectile.position.X - 70, projectile.position.Y + 70, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); - int g = Projectile.NewProjectile(projectile.position.X + 70, projectile.position.Y - 70, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); - int h = Projectile.NewProjectile(projectile.position.X - 70, projectile.position.Y - 70, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); - } + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && !modPlayer.nitro) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); + int a = Projectile.NewProjectile(projectile.position.X + 70, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); + int b = Projectile.NewProjectile(projectile.position.X - 70, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); + int c = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 70, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); + int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 70, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); + int e = Projectile.NewProjectile(projectile.position.X + 70, projectile.position.Y + 70, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); + int f = Projectile.NewProjectile(projectile.position.X - 70, projectile.position.Y + 70, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); + int g = Projectile.NewProjectile(projectile.position.X + 70, projectile.position.Y - 70, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); + int h = Projectile.NewProjectile(projectile.position.X - 70, projectile.position.Y - 70, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); + } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); - int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); - } + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && !modPlayer.pyro) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); + int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); + } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); - int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); - int b = Projectile.NewProjectile(projectile.position.X + 50, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); - int c = Projectile.NewProjectile(projectile.position.X - 50, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); - } + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && !modPlayer.pyro) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); + int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); + int b = Projectile.NewProjectile(projectile.position.X + 50, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); + int c = Projectile.NewProjectile(projectile.position.X - 50, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); + } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); - int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); - int b = Projectile.NewProjectile(projectile.position.X + 50, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); - int c = Projectile.NewProjectile(projectile.position.X - 50, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); - int d = Projectile.NewProjectile(projectile.position.X + 100, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); - int e = Projectile.NewProjectile(projectile.position.X - 100, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); - } + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && !modPlayer.pyro) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); + int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); + int b = Projectile.NewProjectile(projectile.position.X + 50, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); + int c = Projectile.NewProjectile(projectile.position.X - 50, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); + int d = Projectile.NewProjectile(projectile.position.X + 100, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); + int e = Projectile.NewProjectile(projectile.position.X - 100, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); + } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); - int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1.5f, projectile.owner); - Main.projectile[a].scale = 1.5f; - int b = Projectile.NewProjectile(projectile.position.X + 20, projectile.position.Y, +5, 0, mod.ProjectileType("NovaSkull"), projectile.damage, 1f, projectile.owner); - int c = Projectile.NewProjectile(projectile.position.X - 20, projectile.position.Y, -5, 0, mod.ProjectileType("NovaSkull"), projectile.damage, 1f, projectile.owner); - } + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); + int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1.5f, projectile.owner); + Main.projectile[a].scale = 1.5f; + int b = Projectile.NewProjectile(projectile.position.X + 20, projectile.position.Y, +5, 0, mod.ProjectileType("NovaSkull"), projectile.damage, 1f, projectile.owner); + int c = Projectile.NewProjectile(projectile.position.X - 20, projectile.position.Y, -5, 0, mod.ProjectileType("NovaSkull"), projectile.damage, 1f, projectile.owner); + } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); - int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1.5f, projectile.owner); - Main.projectile[a].scale = 1.5f; - int b = Projectile.NewProjectile(projectile.position.X + 10, projectile.position.Y - 10, +6, 0, mod.ProjectileType("NovaSkull"), projectile.damage, 1f, projectile.owner); - int c = Projectile.NewProjectile(projectile.position.X - 10, projectile.position.Y - 10, -6, 0, mod.ProjectileType("NovaSkull"), projectile.damage, 1f, projectile.owner); - int d = Projectile.NewProjectile(projectile.position.X + 40, projectile.position.Y + 10, +4, 0, mod.ProjectileType("NovaSkull"), projectile.damage, 1f, projectile.owner); - int e = Projectile.NewProjectile(projectile.position.X - 40, projectile.position.Y + 10, -4, 0, mod.ProjectileType("NovaSkull"), projectile.damage, 1f, projectile.owner); - } + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); + int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1.5f, projectile.owner); + Main.projectile[a].scale = 1.5f; + int b = Projectile.NewProjectile(projectile.position.X + 10, projectile.position.Y - 10, +6, 0, mod.ProjectileType("NovaSkull"), projectile.damage, 1f, projectile.owner); + int c = Projectile.NewProjectile(projectile.position.X - 10, projectile.position.Y - 10, -6, 0, mod.ProjectileType("NovaSkull"), projectile.damage, 1f, projectile.owner); + int d = Projectile.NewProjectile(projectile.position.X + 40, projectile.position.Y + 10, +4, 0, mod.ProjectileType("NovaSkull"), projectile.damage, 1f, projectile.owner); + int e = Projectile.NewProjectile(projectile.position.X - 40, projectile.position.Y + 10, -4, 0, mod.ProjectileType("NovaSkull"), projectile.damage, 1f, projectile.owner); + } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); - int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1.5f, projectile.owner); - Main.projectile[a].scale = 1.5f; - int b = Projectile.NewProjectile(projectile.position.X + 10, projectile.position.Y - 15, +6, 0, mod.ProjectileType("NovaSkull"), projectile.damage, 1f, projectile.owner); - int c = Projectile.NewProjectile(projectile.position.X - 10, projectile.position.Y - 15, -6, 0, mod.ProjectileType("NovaSkull"), projectile.damage, 1f, projectile.owner); - int d = Projectile.NewProjectile(projectile.position.X + 40, projectile.position.Y, +5, 0, mod.ProjectileType("NovaSkull"), projectile.damage, 1f, projectile.owner); - int e = Projectile.NewProjectile(projectile.position.X - 40, projectile.position.Y, -5, 0, mod.ProjectileType("NovaSkull"), projectile.damage, 1f, projectile.owner); - int f = Projectile.NewProjectile(projectile.position.X + 70, projectile.position.Y + 15, +4, 0, mod.ProjectileType("NovaSkull"), projectile.damage, 1f, projectile.owner); - int g = Projectile.NewProjectile(projectile.position.X - 70, projectile.position.Y + 15, -4, 0, mod.ProjectileType("NovaSkull"), projectile.damage, 1f, projectile.owner); - } + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("PyroBuff"))) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 42); + int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1.5f, projectile.owner); + Main.projectile[a].scale = 1.5f; + int b = Projectile.NewProjectile(projectile.position.X + 10, projectile.position.Y - 15, +6, 0, mod.ProjectileType("NovaSkull"), projectile.damage, 1f, projectile.owner); + int c = Projectile.NewProjectile(projectile.position.X - 10, projectile.position.Y - 15, -6, 0, mod.ProjectileType("NovaSkull"), projectile.damage, 1f, projectile.owner); + int d = Projectile.NewProjectile(projectile.position.X + 40, projectile.position.Y, +5, 0, mod.ProjectileType("NovaSkull"), projectile.damage, 1f, projectile.owner); + int e = Projectile.NewProjectile(projectile.position.X - 40, projectile.position.Y, -5, 0, mod.ProjectileType("NovaSkull"), projectile.damage, 1f, projectile.owner); + int f = Projectile.NewProjectile(projectile.position.X + 70, projectile.position.Y + 15, +4, 0, mod.ProjectileType("NovaSkull"), projectile.damage, 1f, projectile.owner); + int g = Projectile.NewProjectile(projectile.position.X - 70, projectile.position.Y + 15, -4, 0, mod.ProjectileType("NovaSkull"), projectile.damage, 1f, projectile.owner); + } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); - int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1.5f, projectile.owner); - Main.projectile[z].scale = 1.25f; - int a = Projectile.NewProjectile(projectile.position.X + 25, projectile.position.Y, 4, 0, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); - int b = Projectile.NewProjectile(projectile.position.X - 25, projectile.position.Y, -4, 0, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); - int c = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 25, 0, 4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); - int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 25, 0, -4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); - int e = Projectile.NewProjectile(projectile.position.X + 20, projectile.position.Y + 20, 4, 4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); - Main.projectile[e].scale = 0.8f; - int f = Projectile.NewProjectile(projectile.position.X - 20, projectile.position.Y + 20, -4, 4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); - Main.projectile[f].scale = 0.8f; - int g = Projectile.NewProjectile(projectile.position.X + 20, projectile.position.Y - 20, 4, -4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); - Main.projectile[g].scale = 0.8f; - int h = Projectile.NewProjectile(projectile.position.X - 20, projectile.position.Y - 20, -4, -4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); - Main.projectile[h].scale = 0.8f; - } + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); + int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1.5f, projectile.owner); + Main.projectile[z].scale = 1.25f; + int a = Projectile.NewProjectile(projectile.position.X + 25, projectile.position.Y, 4, 0, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); + int b = Projectile.NewProjectile(projectile.position.X - 25, projectile.position.Y, -4, 0, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); + int c = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 25, 0, 4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); + int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 25, 0, -4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); + int e = Projectile.NewProjectile(projectile.position.X + 20, projectile.position.Y + 20, 4, 4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); + Main.projectile[e].scale = 0.8f; + int f = Projectile.NewProjectile(projectile.position.X - 20, projectile.position.Y + 20, -4, 4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); + Main.projectile[f].scale = 0.8f; + int g = Projectile.NewProjectile(projectile.position.X + 20, projectile.position.Y - 20, 4, -4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); + Main.projectile[g].scale = 0.8f; + int h = Projectile.NewProjectile(projectile.position.X - 20, projectile.position.Y - 20, -4, -4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); + Main.projectile[h].scale = 0.8f; + } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); - int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1.5f, projectile.owner); - Main.projectile[z].scale = 1.25f; - int a = Projectile.NewProjectile(projectile.position.X + 65, projectile.position.Y, 3, 0, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); - int b = Projectile.NewProjectile(projectile.position.X - 65, projectile.position.Y, -3, 0, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); - int c = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 35, 0, 4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); - int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 35, 0, -4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); - int e = Projectile.NewProjectile(projectile.position.X + 50, projectile.position.Y + 20, 0, 4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); - Main.projectile[e].scale = 1.2f; - int f = Projectile.NewProjectile(projectile.position.X - 50, projectile.position.Y + 20, 0, 4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); - Main.projectile[f].scale = 1.2f; - int g = Projectile.NewProjectile(projectile.position.X + 50, projectile.position.Y - 20, 0, -4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); - Main.projectile[g].scale = 1.2f; - int h = Projectile.NewProjectile(projectile.position.X - 50, projectile.position.Y - 20, 0, -4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); - Main.projectile[h].scale = 1.2f; - } + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); + int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1.5f, projectile.owner); + Main.projectile[z].scale = 1.25f; + int a = Projectile.NewProjectile(projectile.position.X + 65, projectile.position.Y, 3, 0, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); + int b = Projectile.NewProjectile(projectile.position.X - 65, projectile.position.Y, -3, 0, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); + int c = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 35, 0, 4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); + int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 35, 0, -4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); + int e = Projectile.NewProjectile(projectile.position.X + 50, projectile.position.Y + 20, 0, 4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); + Main.projectile[e].scale = 1.2f; + int f = Projectile.NewProjectile(projectile.position.X - 50, projectile.position.Y + 20, 0, 4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); + Main.projectile[f].scale = 1.2f; + int g = Projectile.NewProjectile(projectile.position.X + 50, projectile.position.Y - 20, 0, -4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); + Main.projectile[g].scale = 1.2f; + int h = Projectile.NewProjectile(projectile.position.X - 50, projectile.position.Y - 20, 0, -4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); + Main.projectile[h].scale = 1.2f; + } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); - int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1.5f, projectile.owner); - Main.projectile[z].scale = 1.25f; - int a = Projectile.NewProjectile(projectile.position.X + 65, projectile.position.Y, 3, 0, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); - int b = Projectile.NewProjectile(projectile.position.X - 65, projectile.position.Y, -3, 0, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); - int c = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 35, 0, 4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); - int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 35, 0, -4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); - int e = Projectile.NewProjectile(projectile.position.X + 50, projectile.position.Y + 20, 0, 4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); - Main.projectile[e].scale = 0.8f; - int f = Projectile.NewProjectile(projectile.position.X - 50, projectile.position.Y + 20, 0, 4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); - Main.projectile[f].scale = 0.8f; - int g = Projectile.NewProjectile(projectile.position.X + 50, projectile.position.Y - 20, 0, -4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); - Main.projectile[g].scale = 0.8f; - int h = Projectile.NewProjectile(projectile.position.X - 50, projectile.position.Y - 20, 0, -4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); - Main.projectile[h].scale = 0.8f; - int i = Projectile.NewProjectile(projectile.position.X + 80, projectile.position.Y + 20, 0, 4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); - Main.projectile[i].scale = 0.6f; - int k = Projectile.NewProjectile(projectile.position.X - 80, projectile.position.Y + 20, 0, 4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); - Main.projectile[k].scale = 0.6f; - int l = Projectile.NewProjectile(projectile.position.X + 80, projectile.position.Y - 20, 0, -4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); - Main.projectile[l].scale = 0.6f; - int m = Projectile.NewProjectile(projectile.position.X - 80, projectile.position.Y - 20, 0, -4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); - Main.projectile[m].scale = 0.6f; - } + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("RoundBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); + int z = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1.5f, projectile.owner); + Main.projectile[z].scale = 1.25f; + int a = Projectile.NewProjectile(projectile.position.X + 65, projectile.position.Y, 3, 0, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); + int b = Projectile.NewProjectile(projectile.position.X - 65, projectile.position.Y, -3, 0, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); + int c = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 35, 0, 4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); + int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 35, 0, -4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); + int e = Projectile.NewProjectile(projectile.position.X + 50, projectile.position.Y + 20, 0, 4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); + Main.projectile[e].scale = 0.8f; + int f = Projectile.NewProjectile(projectile.position.X - 50, projectile.position.Y + 20, 0, 4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); + Main.projectile[f].scale = 0.8f; + int g = Projectile.NewProjectile(projectile.position.X + 50, projectile.position.Y - 20, 0, -4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); + Main.projectile[g].scale = 0.8f; + int h = Projectile.NewProjectile(projectile.position.X - 50, projectile.position.Y - 20, 0, -4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); + Main.projectile[h].scale = 0.8f; + int i = Projectile.NewProjectile(projectile.position.X + 80, projectile.position.Y + 20, 0, 4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); + Main.projectile[i].scale = 0.6f; + int k = Projectile.NewProjectile(projectile.position.X - 80, projectile.position.Y + 20, 0, 4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); + Main.projectile[k].scale = 0.6f; + int l = Projectile.NewProjectile(projectile.position.X + 80, projectile.position.Y - 20, 0, -4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); + Main.projectile[l].scale = 0.6f; + int m = Projectile.NewProjectile(projectile.position.X - 80, projectile.position.Y - 20, 0, -4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 2, 1f, projectile.owner); + Main.projectile[m].scale = 0.6f; + } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); - int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); - Main.projectile[d].scale = 1.5f; - int e = Projectile.NewProjectile(projectile.position.X + 30, projectile.position.Y + 30, 3, 3, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); - int f = Projectile.NewProjectile(projectile.position.X - 30, projectile.position.Y + 30, -3, 3, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); - int g = Projectile.NewProjectile(projectile.position.X + 30, projectile.position.Y - 30, 3, -3, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); - int h = Projectile.NewProjectile(projectile.position.X - 30, projectile.position.Y - 30, -3, -3, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); - } + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); + int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); + Main.projectile[d].scale = 1.5f; + int e = Projectile.NewProjectile(projectile.position.X + 30, projectile.position.Y + 30, 3, 3, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); + int f = Projectile.NewProjectile(projectile.position.X - 30, projectile.position.Y + 30, -3, 3, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); + int g = Projectile.NewProjectile(projectile.position.X + 30, projectile.position.Y - 30, 3, -3, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); + int h = Projectile.NewProjectile(projectile.position.X - 30, projectile.position.Y - 30, -3, -3, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); + } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); - int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); - Main.projectile[d].scale = 1.5f; - int e = Projectile.NewProjectile(projectile.position.X + 30, projectile.position.Y + 30, 2, 3, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); - Main.projectile[e].scale = 0.75f; - int f = Projectile.NewProjectile(projectile.position.X - 30, projectile.position.Y + 30, -2, 3, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); - Main.projectile[f].scale = 0.75f; - int g = Projectile.NewProjectile(projectile.position.X + 30, projectile.position.Y - 30, 2, -3, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); - Main.projectile[g].scale = 0.75f; - int h = Projectile.NewProjectile(projectile.position.X - 30, projectile.position.Y - 30, -2, -3, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); - Main.projectile[h].scale = 0.75f; - int i = Projectile.NewProjectile(projectile.position.X + 30, projectile.position.Y + 30, 3, 2, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); - Main.projectile[i].scale = 0.75f; - int j = Projectile.NewProjectile(projectile.position.X - 30, projectile.position.Y + 30, -3, 2, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); - Main.projectile[j].scale = 0.75f; - int k = Projectile.NewProjectile(projectile.position.X + 30, projectile.position.Y - 30, 3, -2, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); - Main.projectile[k].scale = 0.75f; - int l = Projectile.NewProjectile(projectile.position.X - 30, projectile.position.Y - 30, -3, -2, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); - Main.projectile[l].scale = 0.75f; - } + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); + int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); + Main.projectile[d].scale = 1.5f; + int e = Projectile.NewProjectile(projectile.position.X + 30, projectile.position.Y + 30, 2, 3, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); + Main.projectile[e].scale = 0.75f; + int f = Projectile.NewProjectile(projectile.position.X - 30, projectile.position.Y + 30, -2, 3, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); + Main.projectile[f].scale = 0.75f; + int g = Projectile.NewProjectile(projectile.position.X + 30, projectile.position.Y - 30, 2, -3, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); + Main.projectile[g].scale = 0.75f; + int h = Projectile.NewProjectile(projectile.position.X - 30, projectile.position.Y - 30, -2, -3, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); + Main.projectile[h].scale = 0.75f; + int i = Projectile.NewProjectile(projectile.position.X + 30, projectile.position.Y + 30, 3, 2, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); + Main.projectile[i].scale = 0.75f; + int j = Projectile.NewProjectile(projectile.position.X - 30, projectile.position.Y + 30, -3, 2, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); + Main.projectile[j].scale = 0.75f; + int k = Projectile.NewProjectile(projectile.position.X + 30, projectile.position.Y - 30, 3, -2, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); + Main.projectile[k].scale = 0.75f; + int l = Projectile.NewProjectile(projectile.position.X - 30, projectile.position.Y - 30, -3, -2, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); + Main.projectile[l].scale = 0.75f; + } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); - int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); - Main.projectile[d].scale = 1.5f; - int e = Projectile.NewProjectile(projectile.position.X + 30, projectile.position.Y + 30, 2, 4, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); - Main.projectile[e].scale = 0.65f; - int f = Projectile.NewProjectile(projectile.position.X - 30, projectile.position.Y + 30, -2, 4, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); - Main.projectile[f].scale = 0.65f; - int g = Projectile.NewProjectile(projectile.position.X + 30, projectile.position.Y - 30, 2, -4, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); - Main.projectile[g].scale = 0.65f; - int h = Projectile.NewProjectile(projectile.position.X - 30, projectile.position.Y - 30, -2, -4, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); - Main.projectile[h].scale = 0.65f; - int i = Projectile.NewProjectile(projectile.position.X + 30, projectile.position.Y + 30, 4, 2, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); - Main.projectile[i].scale = 0.65f; - int j = Projectile.NewProjectile(projectile.position.X - 30, projectile.position.Y + 30, -4, 2, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); - Main.projectile[j].scale = 0.65f; - int k = Projectile.NewProjectile(projectile.position.X + 30, projectile.position.Y - 30, 4, -2, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); - Main.projectile[k].scale = 0.65f; - int l = Projectile.NewProjectile(projectile.position.X - 30, projectile.position.Y - 30, -4, -2, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); - Main.projectile[l].scale = 0.65f; - int m = Projectile.NewProjectile(projectile.position.X + 30, projectile.position.Y + 30, 3, 3, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); - Main.projectile[m].scale = 0.7f; - int n = Projectile.NewProjectile(projectile.position.X - 30, projectile.position.Y + 30, -3, 3, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); - Main.projectile[n].scale = 0.7f; - int o = Projectile.NewProjectile(projectile.position.X + 30, projectile.position.Y - 30, 3, -3, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); - Main.projectile[o].scale = 0.7f; - int p = Projectile.NewProjectile(projectile.position.X - 30, projectile.position.Y - 30, -3, -3, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); - Main.projectile[p].scale = 0.7f; - } + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("SquareBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); + int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("NovaBlast"), projectile.damage * 2, 1f, projectile.owner); + Main.projectile[d].scale = 1.5f; + int e = Projectile.NewProjectile(projectile.position.X + 30, projectile.position.Y + 30, 2, 4, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); + Main.projectile[e].scale = 0.65f; + int f = Projectile.NewProjectile(projectile.position.X - 30, projectile.position.Y + 30, -2, 4, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); + Main.projectile[f].scale = 0.65f; + int g = Projectile.NewProjectile(projectile.position.X + 30, projectile.position.Y - 30, 2, -4, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); + Main.projectile[g].scale = 0.65f; + int h = Projectile.NewProjectile(projectile.position.X - 30, projectile.position.Y - 30, -2, -4, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); + Main.projectile[h].scale = 0.65f; + int i = Projectile.NewProjectile(projectile.position.X + 30, projectile.position.Y + 30, 4, 2, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); + Main.projectile[i].scale = 0.65f; + int j = Projectile.NewProjectile(projectile.position.X - 30, projectile.position.Y + 30, -4, 2, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); + Main.projectile[j].scale = 0.65f; + int k = Projectile.NewProjectile(projectile.position.X + 30, projectile.position.Y - 30, 4, -2, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); + Main.projectile[k].scale = 0.65f; + int l = Projectile.NewProjectile(projectile.position.X - 30, projectile.position.Y - 30, -4, -2, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); + Main.projectile[l].scale = 0.65f; + int m = Projectile.NewProjectile(projectile.position.X + 30, projectile.position.Y + 30, 3, 3, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); + Main.projectile[m].scale = 0.7f; + int n = Projectile.NewProjectile(projectile.position.X - 30, projectile.position.Y + 30, -3, 3, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); + Main.projectile[n].scale = 0.7f; + int o = Projectile.NewProjectile(projectile.position.X + 30, projectile.position.Y - 30, 3, -3, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); + Main.projectile[o].scale = 0.7f; + int p = Projectile.NewProjectile(projectile.position.X - 30, projectile.position.Y - 30, -3, -3, mod.ProjectileType("NovaSkull"), projectile.damage * 2, 1f, projectile.owner); + Main.projectile[p].scale = 0.7f; + } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); - Projectile.NewProjectile(projectile.position.X - 30, projectile.position.Y, -2, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); - Projectile.NewProjectile(projectile.position.X + 30, projectile.position.Y, +2, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); - } + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); + Projectile.NewProjectile(projectile.position.X - 30, projectile.position.Y, -2, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); + Projectile.NewProjectile(projectile.position.X + 30, projectile.position.Y, +2, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); + } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); - Projectile.NewProjectile(projectile.position.X - 40, projectile.position.Y, -2, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); - Projectile.NewProjectile(projectile.position.X + 40, projectile.position.Y, +2, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); - Projectile.NewProjectile(projectile.position.X - 60, projectile.position.Y, -3, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); - Projectile.NewProjectile(projectile.position.X + 60, projectile.position.Y, +3, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); - } + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); + Projectile.NewProjectile(projectile.position.X - 40, projectile.position.Y, -2, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); + Projectile.NewProjectile(projectile.position.X + 40, projectile.position.Y, +2, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); + Projectile.NewProjectile(projectile.position.X - 60, projectile.position.Y, -3, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); + Projectile.NewProjectile(projectile.position.X + 60, projectile.position.Y, +3, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); + } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); - Projectile.NewProjectile(projectile.position.X - 40, projectile.position.Y, -2, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); - Projectile.NewProjectile(projectile.position.X + 40, projectile.position.Y, +2, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); - Projectile.NewProjectile(projectile.position.X - 60, projectile.position.Y, -3, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); - Projectile.NewProjectile(projectile.position.X + 60, projectile.position.Y, +3, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); - Projectile.NewProjectile(projectile.position.X - 80, projectile.position.Y, -4, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); - Projectile.NewProjectile(projectile.position.X + 80, projectile.position.Y, +4, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); - } + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ChemikazeBuff"))) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 100); + Projectile.NewProjectile(projectile.position.X - 40, projectile.position.Y, -2, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); + Projectile.NewProjectile(projectile.position.X + 40, projectile.position.Y, +2, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); + Projectile.NewProjectile(projectile.position.X - 60, projectile.position.Y, -3, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); + Projectile.NewProjectile(projectile.position.X + 60, projectile.position.Y, +3, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); + Projectile.NewProjectile(projectile.position.X - 80, projectile.position.Y, -4, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); + Projectile.NewProjectile(projectile.position.X + 80, projectile.position.Y, +4, 0, mod.ProjectileType("NovaBurst"), projectile.damage, 1f, projectile.owner); + } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); - int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 4, 0, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); - int b = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, -4, 0, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); - int c = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); - int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, -4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); - int e = Projectile.NewProjectile(projectile.position.X + 60, projectile.position.Y, -4, 0, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); - int f = Projectile.NewProjectile(projectile.position.X - 60, projectile.position.Y, 4, 0, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); - int g = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 60, 0, -4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); - int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 60, 0, 4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); - } + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("NitroBuff"))) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); + int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 4, 0, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); + int b = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, -4, 0, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); + int c = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); + int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, -4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); + int e = Projectile.NewProjectile(projectile.position.X + 60, projectile.position.Y, -4, 0, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); + int f = Projectile.NewProjectile(projectile.position.X - 60, projectile.position.Y, 4, 0, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); + int g = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 60, 0, -4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); + int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 60, 0, 4, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); + } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); - int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 6, 0, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); - int b = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, -6, 0, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); - int c = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 6, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); - int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, -6, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); - int e = Projectile.NewProjectile(projectile.position.X + 60, projectile.position.Y, -6, 0, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); - int f = Projectile.NewProjectile(projectile.position.X - 60, projectile.position.Y, 6, 0, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); - int g = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 60, 0, -6, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); - int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 60, 0, 6, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); - } + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("ReinforcedBurstBuff"))) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); + int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 6, 0, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); + int b = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, -6, 0, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); + int c = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 6, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); + int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, -6, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); + int e = Projectile.NewProjectile(projectile.position.X + 60, projectile.position.Y, -6, 0, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); + int f = Projectile.NewProjectile(projectile.position.X - 60, projectile.position.Y, 6, 0, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); + int g = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 60, 0, -6, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); + int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 60, 0, 6, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); + } - if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); - int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 8, 0, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); - int b = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, -8, 0, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); - int c = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 8, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); - int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, -8, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); - int e = Projectile.NewProjectile(projectile.position.X + 60, projectile.position.Y, -8, 0, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); - int f = Projectile.NewProjectile(projectile.position.X - 60, projectile.position.Y, 8, 0, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); - int g = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 60, 0, -8, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); - int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 60, 0, 8, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); - } - } - } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - projectile.Kill(); - } + if (Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("CrossBlastBuff")) && Main.player[Main.myPlayer].buffType.Contains(mod.BuffType("LinearBurstBuff"))) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); + int a = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 8, 0, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); + int b = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, -8, 0, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); + int c = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 8, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); + int d = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, -8, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); + int e = Projectile.NewProjectile(projectile.position.X + 60, projectile.position.Y, -8, 0, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); + int f = Projectile.NewProjectile(projectile.position.X - 60, projectile.position.Y, 8, 0, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); + int g = Projectile.NewProjectile(projectile.position.X, projectile.position.Y + 60, 0, -8, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); + int h = Projectile.NewProjectile(projectile.position.X, projectile.position.Y - 60, 0, 8, mod.ProjectileType("NovaSkullburst"), projectile.damage * 1, 1f, projectile.owner); + } + } + } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + projectile.Kill(); + } - public override void OnHitPlayer(Player target, int damage, bool crit) - { - damage = 0; - } - } + public override void OnHitPlayer(Player target, int damage, bool crit) + { + damage = 0; + } + } } \ No newline at end of file diff --git a/NovaPillar/NovaFlask_ProjFire.cs b/NovaPillar/NovaFlask_ProjFire.cs index 22ec6032..780640cf 100644 --- a/NovaPillar/NovaFlask_ProjFire.cs +++ b/NovaPillar/NovaFlask_ProjFire.cs @@ -19,31 +19,31 @@ public override void SetDefaults() projectile.friendly = true; } - public override Color? GetAlpha(Color lightColor) - { - return Color.White; - } + public override Color? GetAlpha(Color lightColor) + { + return Color.White; + } - public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) - { - if (Main.rand.Next(1, 101) <= Main.player[projectile.owner].GetModPlayer(mod).alchemistCrit) - { - crit = true; - } - } + public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) + { + if (Main.rand.Next(1, 101) <= Main.player[projectile.owner].GetModPlayer(mod).alchemistCrit) + { + crit = true; + } + } - public override bool PreAI() + public override bool PreAI() { - projectile.frameCounter++; - if (projectile.frameCounter > 3) - { - projectile.frame++; - projectile.frameCounter = 0; - } - if (projectile.frame >= 3) - { - projectile.frame = 0; - } + projectile.frameCounter++; + if (projectile.frameCounter > 3) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame >= 3) + { + projectile.frame = 0; + } float num2 = (float)Math.Sqrt((double)(projectile.velocity.X * projectile.velocity.X + projectile.velocity.Y * projectile.velocity.Y)); float num3 = projectile.localAI[0]; if (num3 == 0f) @@ -142,5 +142,5 @@ public override void Kill(int timeLeft) } }); } - } + } } diff --git a/NovaPillar/NovaFlier.cs b/NovaPillar/NovaFlier.cs index 0518e532..0720bfb3 100644 --- a/NovaPillar/NovaFlier.cs +++ b/NovaPillar/NovaFlier.cs @@ -14,106 +14,106 @@ public override void SetStaticDefaults() DisplayName.SetDefault("Nova Flier"); Main.npcFrameCount[npc.type] = 4; } - - //Int variables - int AnimationRate = 4; - int CountFrame = 0; - int TimeToAnimation = 4; - int Timer = 0; - //Vanilla AI - static int num1461 = 360; - float num1453 = 7f; - float num1463 = 6.28318548f / (float)(num1461 / 2); - int num1450 = 200; - int num1472 = 0; - bool flag128; - static float scaleFactor10 = 8.5f; - float num1451 = 0.55f; - public override void SetDefaults() + //Int variables + int AnimationRate = 4; + int CountFrame = 0; + int TimeToAnimation = 4; + int Timer = 0; + + //Vanilla AI + static int num1461 = 360; + float num1453 = 7f; + float num1463 = 6.28318548f / (float)(num1461 / 2); + int num1450 = 200; + int num1472 = 0; + bool flag128; + static float scaleFactor10 = 8.5f; + float num1451 = 0.55f; + public override void SetDefaults() { npc.lifeMax = 2150; npc.damage = 67; npc.defense = 15; - npc.knockBackResist = 0.2f; + npc.knockBackResist = 0.2f; npc.width = 44; npc.height = 56; - npc.HitSound = SoundID.NPCHit55; - npc.DeathSound = SoundID.NPCDeath51; - npc.buffImmune[31] = false; + npc.HitSound = SoundID.NPCHit55; + npc.DeathSound = SoundID.NPCDeath51; + npc.buffImmune[31] = false; npc.npcSlots = 2f; - npc.aiStyle = 14; - npc.noGravity = true; - npc.noTileCollide = false; - } + npc.aiStyle = 14; + npc.noGravity = true; + npc.noTileCollide = false; + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void AI() + public override void AI() { - npc.spriteDirection = npc.direction; - this.NovaAnimation(); - if (Main.time % 200 == 0) - { - Vector2 Velocity = Helper.VelocityToPoint(npc.Center, Helper.RandomPointInArea(new Vector2(Main.player[Main.myPlayer].Center.X - 10, Main.player[Main.myPlayer].Center.Y - 10), new Vector2(Main.player[Main.myPlayer].Center.X + 20, Main.player[Main.myPlayer].Center.Y + 20)), 7); - int i = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, Velocity.X, Velocity.Y, mod.ProjectileType("NovaFlierProj"), 20, 1f); - } - } + npc.spriteDirection = npc.direction; + this.NovaAnimation(); + if (Main.time % 200 == 0) + { + Vector2 Velocity = Helper.VelocityToPoint(npc.Center, Helper.RandomPointInArea(new Vector2(Main.player[Main.myPlayer].Center.X - 10, Main.player[Main.myPlayer].Center.Y - 10), new Vector2(Main.player[Main.myPlayer].Center.X + 20, Main.player[Main.myPlayer].Center.Y + 20)), 7); + int i = Projectile.NewProjectile(npc.Center.X, npc.Center.Y, Velocity.X, Velocity.Y, mod.ProjectileType("NovaFlierProj"), 20, 1f); + } + } - public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) - { - TremorUtils.DrawNPCGlowMask(spriteBatch, npc, mod.GetTexture("NovaPillar/NovaFlier_GlowMask")); - } + public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) + { + TremorUtils.DrawNPCGlowMask(spriteBatch, npc, mod.GetTexture("NovaPillar/NovaFlier_GlowMask")); + } - public override void HitEffect(int hitDirection, double damage) - { - if (npc.life <= 0) - { - if (NovaHandler.ShieldStrength > 0) - { - NPC parent = Main.npc[NPC.FindFirstNPC(mod.NPCType("NovaPillar"))]; - Vector2 Velocity = Helper.VelocityToPoint(npc.Center, parent.Center, 20); - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, Velocity.X, Velocity.Y, mod.ProjectileType("CogLordLaser"), 1, 1f); - } - for (int i = 0; i < 5; i++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 57, Main.rand.NextFloat(-3f, 3f), Main.rand.NextFloat(-3f, 3f)); - } - for (int i = 0; i < 2; i++) - { - Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/NovaFlierGore1")); - Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/NovaFlierGore2")); - } - Gore.NewGore(npc.Top, npc.velocity * hitDirection, mod.GetGoreSlot("Gores/NovaFlierGore3")); - Gore.NewGore(npc.Top, npc.velocity * hitDirection, mod.GetGoreSlot("Gores/NovaFlierGore3")); - } - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + if (NovaHandler.ShieldStrength > 0) + { + NPC parent = Main.npc[NPC.FindFirstNPC(mod.NPCType("NovaPillar"))]; + Vector2 Velocity = Helper.VelocityToPoint(npc.Center, parent.Center, 20); + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, Velocity.X, Velocity.Y, mod.ProjectileType("CogLordLaser"), 1, 1f); + } + for (int i = 0; i < 5; i++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 57, Main.rand.NextFloat(-3f, 3f), Main.rand.NextFloat(-3f, 3f)); + } + for (int i = 0; i < 2; i++) + { + Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/NovaFlierGore1")); + Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/NovaFlierGore2")); + } + Gore.NewGore(npc.Top, npc.velocity * hitDirection, mod.GetGoreSlot("Gores/NovaFlierGore3")); + Gore.NewGore(npc.Top, npc.velocity * hitDirection, mod.GetGoreSlot("Gores/NovaFlierGore3")); + } + } - void NovaAnimation() - { - if (--this.TimeToAnimation <= 0) - { - if (++this.CountFrame > 4) - this.CountFrame = 1; - this.TimeToAnimation = this.AnimationRate; - npc.frame = this.GetFrame(this.CountFrame + 0); - } - } + void NovaAnimation() + { + if (--this.TimeToAnimation <= 0) + { + if (++this.CountFrame > 4) + this.CountFrame = 1; + this.TimeToAnimation = this.AnimationRate; + npc.frame = this.GetFrame(this.CountFrame + 0); + } + } - Rectangle GetFrame(int Number) - { - return new Rectangle(0, npc.frame.Height * (Number - 1), npc.frame.Width, npc.frame.Height); - } + Rectangle GetFrame(int Number) + { + return new Rectangle(0, npc.frame.Height * (Number - 1), npc.frame.Width, npc.frame.Height); + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - if (spawnInfo.player.GetModPlayer(mod).ZoneTowerNova) - return 1f; - return 0; - } - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + if (spawnInfo.player.GetModPlayer(mod).ZoneTowerNova) + return 1f; + return 0; + } + } } diff --git a/NovaPillar/NovaFlierProj.cs b/NovaPillar/NovaFlierProj.cs index 77d387ca..1ac99da0 100644 --- a/NovaPillar/NovaFlierProj.cs +++ b/NovaPillar/NovaFlierProj.cs @@ -7,56 +7,56 @@ namespace Tremor.NovaPillar { - public class NovaFlierProj : ModProjectile - { + public class NovaFlierProj : ModProjectile + { public override void SetStaticDefaults() { DisplayName.SetDefault("Nova Stinger"); } - public override void SetDefaults() - { - projectile.CloneDefaults(348); - projectile.timeLeft = 500; - aiType = 348; - projectile.friendly = false; - projectile.tileCollide = true; - } + public override void SetDefaults() + { + projectile.CloneDefaults(348); + projectile.timeLeft = 500; + aiType = 348; + projectile.friendly = false; + projectile.tileCollide = true; + } - public override Color? GetAlpha(Color lightColor) - { - return Color.White; - } + public override Color? GetAlpha(Color lightColor) + { + return Color.White; + } - public override void AI() - { - projectile.rotation = (float)System.Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; - } + public override void AI() + { + projectile.rotation = (float)System.Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + } - public override void Kill(int timeLeft) - { - for (int i = 0; i < 5; i++) - { - Dust.NewDust(projectile.position, projectile.width, projectile.height, 57, Main.rand.NextFloat(-3f, 3f), Main.rand.NextFloat(-3f, 3f)); - } - for (int k = 0; k < 5; k++) - { - Vector2 Vector = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - Vector.Normalize(); - Vector *= (float)Main.rand.Next(10, 201) * 0.01f; - int i = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, Vector.X, Vector.Y, mod.ProjectileType("NovaAlchemistCloud"), 14, 1f, Main.myPlayer, 0f, (float)Main.rand.Next(-45, 1)); - Main.projectile[i].friendly = false; - } - } + public override void Kill(int timeLeft) + { + for (int i = 0; i < 5; i++) + { + Dust.NewDust(projectile.position, projectile.width, projectile.height, 57, Main.rand.NextFloat(-3f, 3f), Main.rand.NextFloat(-3f, 3f)); + } + for (int k = 0; k < 5; k++) + { + Vector2 Vector = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector.Normalize(); + Vector *= (float)Main.rand.Next(10, 201) * 0.01f; + int i = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, Vector.X, Vector.Y, mod.ProjectileType("NovaAlchemistCloud"), 14, 1f, Main.myPlayer, 0f, (float)Main.rand.Next(-45, 1)); + Main.projectile[i].friendly = false; + } + } - public override void OnHitPlayer(Player player, int damage, bool crit) - { - projectile.Kill(); - } + public override void OnHitPlayer(Player player, int damage, bool crit) + { + projectile.Kill(); + } - public override bool CanHitPlayer(Player target) - { - return true; - } - } + public override bool CanHitPlayer(Player target) + { + return true; + } + } } \ No newline at end of file diff --git a/NovaPillar/NovaFragment.cs b/NovaPillar/NovaFragment.cs index bb5bd20c..167f6c7b 100644 --- a/NovaPillar/NovaFragment.cs +++ b/NovaPillar/NovaFragment.cs @@ -1,51 +1,53 @@ -using System; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; +using System; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NovaPillar { -public class NovaFragment : ModItem +namespace Tremor.NovaPillar { - public override void SetDefaults() - { - - item.width = 48; - item.height = 48; - item.value = 2000; - item.rare = 9; - item.maxStack = 999; - - ItemID.Sets.ItemIconPulse[item.type] = true; - ItemID.Sets.ItemNoGravity[item.type] = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nova Fragment"); - Tooltip.SetDefault("'The constituents of stars are contained in this fragment'"); - } - - - public override void PostUpdate() - { - Lighting.AddLight(item.Center, new Vector3(0.8f, 0.7f, 0.3f) * Main.essScale); - } - - public override Color? GetAlpha(Color lightColor) - { - return Color.White; - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(3456, 1); - recipe.AddIngredient(3457, 1); - recipe.AddIngredient(3458, 1); - recipe.AddIngredient(3459, 1); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } -}} + public class NovaFragment : ModItem + { + public override void SetDefaults() + { + + item.width = 48; + item.height = 48; + item.value = 2000; + item.rare = 9; + item.maxStack = 999; + + ItemID.Sets.ItemIconPulse[item.type] = true; + ItemID.Sets.ItemNoGravity[item.type] = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nova Fragment"); + Tooltip.SetDefault("'The constituents of stars are contained in this fragment'"); + } + + + public override void PostUpdate() + { + Lighting.AddLight(item.Center, new Vector3(0.8f, 0.7f, 0.3f) * Main.essScale); + } + + public override Color? GetAlpha(Color lightColor) + { + return Color.White; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(3456, 1); + recipe.AddIngredient(3457, 1); + recipe.AddIngredient(3458, 1); + recipe.AddIngredient(3459, 1); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } +} diff --git a/NovaPillar/NovaFragmentBlock.cs b/NovaPillar/NovaFragmentBlock.cs index 3dc8a113..7247f75e 100644 --- a/NovaPillar/NovaFragmentBlock.cs +++ b/NovaPillar/NovaFragmentBlock.cs @@ -17,18 +17,18 @@ public override void SetDefaults() item.useAnimation = 15; item.useTime = 10; item.useStyle = 1; - item.rare = 0; + item.rare = 0; item.consumable = true; item.createTile = mod.TileType("NovaBlock"); } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nova Fragment Block"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nova Fragment Block"); + Tooltip.SetDefault(""); + } + - public override void AddRecipes() { var recipe = new ModRecipe(mod); diff --git a/NovaPillar/NovaHamaxe.cs b/NovaPillar/NovaHamaxe.cs index 95d3abbe..9ec74e06 100644 --- a/NovaPillar/NovaHamaxe.cs +++ b/NovaPillar/NovaHamaxe.cs @@ -4,45 +4,47 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NovaPillar { -public class NovaHamaxe : ModItem +namespace Tremor.NovaPillar { - public override void SetDefaults() - { + public class NovaHamaxe : ModItem + { + public override void SetDefaults() + { - item.damage = 60; - item.melee = true; - item.width = 38; - item.height = 38; - item.useTime = 9; - item.useAnimation = 27; - item.axe = 20; - item.hammer = 150; - item.useStyle = 1; - item.knockBack = 5; - item.value = 50000; - item.rare = 10; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.tileBoost += 4; - item.glowMask = TremorGlowMask.NovaHamaxe; - item.useTurn = true; - } + item.damage = 60; + item.melee = true; + item.width = 38; + item.height = 38; + item.useTime = 9; + item.useAnimation = 27; + item.axe = 20; + item.hammer = 150; + item.useStyle = 1; + item.knockBack = 5; + item.value = 50000; + item.rare = 10; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.tileBoost += 4; + item.glowMask = TremorGlowMask.NovaHamaxe; + item.useTurn = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nova Hamaxe"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nova Hamaxe"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "NovaFragment", 14); - recipe.AddIngredient(3467, 12); - recipe.AddTile(412); - recipe.SetResult(this); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "NovaFragment", 14); + recipe.AddIngredient(3467, 12); + recipe.AddTile(412); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } -}} diff --git a/NovaPillar/NovaHandler.cs b/NovaPillar/NovaHandler.cs index 92a23b0b..320f7375 100644 --- a/NovaPillar/NovaHandler.cs +++ b/NovaPillar/NovaHandler.cs @@ -15,77 +15,77 @@ public class NovaHandler : ModWorld public static int TowerY = -1; public static bool TowerActive; public static int ShieldStrength; - + public static bool LunarApocalypseLastTick; - + public override void Initialize() { LunarApocalypseLastTick = NPC.LunarApocalypseIsUp; ShieldStrength = NPC.ShieldStrengthTowerMax; - TowerX = -1; - TowerY = -1; - } - + TowerX = -1; + TowerY = -1; + } + public override void PreUpdate() { TowerActive = NPC.AnyNPCs(mod.NPCType("NovaPillar")); } - + public override TagCompound Save() { var tag = new TagCompound { {"NovaActive", TowerActive} }; - if(TowerX != -1) + if (TowerX != -1) { tag.Add("NovaX", TowerX); tag.Add("NovaY", TowerY); } return tag; } - + public override void Load(TagCompound tag) { TowerActive = tag.GetBool("NovaActive"); - if(tag.ContainsKey("NovaX")) + if (tag.ContainsKey("NovaX")) { TowerX = tag.GetInt("NovaX"); TowerY = tag.GetInt("NovaY"); NPC.NewNPC(TowerX, TowerY, mod.NPCType("NovaPillar")); } } - + public override void PostUpdate() { - if(NPC.LunarApocalypseIsUp && !LunarApocalypseLastTick) + if (NPC.LunarApocalypseIsUp && !LunarApocalypseLastTick) { - Tremor.Log("Moving pillars..."); - var towers = new int[5]; - - foreach(var npc in Main.npc) + Tremor.Log("Moving pillars..."); + var towers = new int[5]; + + foreach (var npc in Main.npc) { - if(npc == null) continue; - if(npc.type == NPCID.LunarTowerNebula) towers[0] = npc.whoAmI; - if(npc.type == NPCID.LunarTowerSolar) towers[1] = npc.whoAmI; - if(npc.type == NPCID.LunarTowerStardust) towers[2] = npc.whoAmI; - if(npc.type == NPCID.LunarTowerVortex) towers[3] = npc.whoAmI; + if (npc == null) continue; + if (npc.type == NPCID.LunarTowerNebula) towers[0] = npc.whoAmI; + if (npc.type == NPCID.LunarTowerSolar) towers[1] = npc.whoAmI; + if (npc.type == NPCID.LunarTowerStardust) towers[2] = npc.whoAmI; + if (npc.type == NPCID.LunarTowerVortex) towers[3] = npc.whoAmI; } towers[4] = -1; towers = towers.OrderBy(x => Main.rand.Next()).ToArray(); - - for(int i = 0; i < 5; i++) + + for (int i = 0; i < 5; i++) { MovePillar(i, towers[i]); } } - else if(!NPC.LunarApocalypseIsUp && LunarApocalypseLastTick && TowerActive) + else if (!NPC.LunarApocalypseIsUp && LunarApocalypseLastTick && TowerActive) { - for(int i = Main.chatLine.Length - 1; i >= 0; i--) + for (int i = Main.chatLine.Length - 1; i >= 0; i--) { - if(Main.chatLine[i].text.StartsWith("Impending doom")) + if (Main.chatLine[i].text.StartsWith("Impending doom")) { - Main.chatLine[i].parsedText = new [] + Main.chatLine[i].parsedText = new[] { new TextSnippet("Your hands are shaking...", new Color(175, 75, 255)) }; @@ -94,24 +94,24 @@ public override void PostUpdate() } NPC.MoonLordCountdown = 0; } - + LunarApocalypseLastTick = NPC.LunarApocalypseIsUp; } - + void MovePillar(int position, int whoAmI) { - if (whoAmI == -1) - { - Tremor.Log("Spawning Nova Pillar"); - } - //else - //{ - //Tremor.Log("Moving " + Main.npc[whoAmI].displayName); - // } - - int x = Main.maxTilesX / 6 * (1 + position); + if (whoAmI == -1) + { + Tremor.Log("Spawning Nova Pillar"); + } + //else + //{ + //Tremor.Log("Moving " + Main.npc[whoAmI].displayName); + // } + + int x = Main.maxTilesX / 6 * (1 + position); var spawnPos = new Vector2(x * 16, (float)(Main.worldSurface - 40) * 16); - + bool success = false; for (int attempts = 0; attempts < 30; attempts++) { @@ -130,13 +130,13 @@ void MovePillar(int position, int whoAmI) break; } } - - if(whoAmI == -1) + + if (whoAmI == -1) { whoAmI = NPC.NewNPC((int)spawnPos.X, (int)spawnPos.Y, mod.NPCType("NovaPillar")); - NovaHandler.TowerX = (int)spawnPos.X; - NovaHandler.TowerY = (int)spawnPos.Y; - } + NovaHandler.TowerX = (int)spawnPos.X; + NovaHandler.TowerY = (int)spawnPos.Y; + } else { Main.npc[whoAmI].Center = spawnPos; @@ -148,26 +148,26 @@ void MovePillar(int position, int whoAmI) NetMessage.SendData(MessageID.SyncNPC, number: whoAmI); } } - + static readonly string[] NovaNPCs = { "NovaAlchemist", - "Varki", - "Youwarkee", - "Deadling", - "NovaFlier" + "Varki", + "Youwarkee", + "Deadling", + "NovaFlier" }; - + public class AuroraGlobalNPC : GlobalNPC { - public override void EditSpawnRate(Player player, ref int spawnRate, ref int maxSpawns) - { - if (player.GetModPlayer(mod).ZoneTowerNova) - { - spawnRate = (int)(spawnRate * 0.14f); - maxSpawns = (int)(maxSpawns * 5f); - } - } - } + public override void EditSpawnRate(Player player, ref int spawnRate, ref int maxSpawns) + { + if (player.GetModPlayer(mod).ZoneTowerNova) + { + spawnRate = (int)(spawnRate * 0.14f); + maxSpawns = (int)(maxSpawns * 5f); + } + } + } } } diff --git a/NovaPillar/NovaHelmet.cs b/NovaPillar/NovaHelmet.cs index 2b1a05b1..a20577d7 100644 --- a/NovaPillar/NovaHelmet.cs +++ b/NovaPillar/NovaHelmet.cs @@ -7,7 +7,7 @@ namespace Tremor.NovaPillar { -[AutoloadEquip(EquipType.Head)] + [AutoloadEquip(EquipType.Head)] public class NovaHelmet : ModItem { @@ -22,20 +22,20 @@ public override void SetDefaults() item.defense = 14; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nova Helmet"); - Tooltip.SetDefault("Increases alchemic damage by 12%\nIncreases alchemic critical strike chance by 12\nEnemies are more likely to target you"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nova Helmet"); + Tooltip.SetDefault("Increases alchemic damage by 12%\nIncreases alchemic critical strike chance by 12\nEnemies are more likely to target you"); + } + - public override void UpdateEquip(Player player) { - player.GetModPlayer(mod).alchemistCrit += 12; - player.GetModPlayer(mod).alchemistDamage += 0.12f; - player.aggro += 10; - Lighting.AddLight((int)((player.position.X + (float)(player.width / 2)) / 16f), (int)((player.position.Y + (float)(player.height / 2)) / 16f), 0.8f, 0.7f, 0.3f); - } + player.GetModPlayer(mod).alchemistCrit += 12; + player.GetModPlayer(mod).alchemistDamage += 0.12f; + player.aggro += 10; + Lighting.AddLight((int)((player.position.X + (float)(player.width / 2)) / 16f), (int)((player.position.Y + (float)(player.height / 2)) / 16f), 0.8f, 0.7f, 0.3f); + } public override bool IsArmorSet(Item head, Item body, Item legs) { @@ -44,14 +44,14 @@ public override bool IsArmorSet(Item head, Item body, Item legs) public override void UpdateArmorSet(Player player) { - player.setBonus = "Increases alchemic damage by 15% and summons alchemical cauldron to protect you"; - player.GetModPlayer(mod).alchemistDamage += 0.15f; - player.GetModPlayer(mod).novaSet = true; - if (player.ownedProjectileCounts[mod.ProjectileType("NovaCauldron")] < 1) - { - Projectile.NewProjectile(player.position, Vector2.Zero, mod.ProjectileType("NovaCauldron"), 50, 0, player.whoAmI); - } - } + player.setBonus = "Increases alchemic damage by 15% and summons alchemical cauldron to protect you"; + player.GetModPlayer(mod).alchemistDamage += 0.15f; + player.GetModPlayer(mod).novaSet = true; + if (player.ownedProjectileCounts[mod.ProjectileType("NovaCauldron")] < 1) + { + Projectile.NewProjectile(player.position, Vector2.Zero, mod.ProjectileType("NovaCauldron"), 50, 0, player.whoAmI); + } + } public override void ArmorSetShadows(Player player) { diff --git a/NovaPillar/NovaLeggings.cs b/NovaPillar/NovaLeggings.cs index f4fab48b..985d6da3 100644 --- a/NovaPillar/NovaLeggings.cs +++ b/NovaPillar/NovaLeggings.cs @@ -8,49 +8,49 @@ namespace Tremor.NovaPillar { -[AutoloadEquip(EquipType.Legs)] - public class NovaLeggings : ModItem - { - - public override void SetDefaults() - { - - item.width = 26; - item.height = 16; - - - item.rare = 10; - item.defense = 16; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nova Leggings"); - Tooltip.SetDefault("Increases alchemic damage by 18%\nIncreases alchemic critical strike chance by 12\nIncreases movement speed by 14%"); - } - - - public override Color? GetAlpha(Color lightColor) - { - return Color.White; - } - - public override void UpdateEquip(Player player) - { - player.GetModPlayer(mod).alchemistDamage += 0.18f; - player.GetModPlayer(mod).alchemistCrit += 12; - player.moveSpeed += 0.14f; - Lighting.AddLight((int)((player.position.X + (float)(player.width / 2)) / 16f), (int)((player.position.Y + (float)(player.height / 2)) / 16f), 0.8f, 0.7f, 0.3f); - } - - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(3467, 12); - recipe.AddIngredient(null, "NovaFragment", 15); - recipe.AddTile(412); - recipe.SetResult(this, 1); - recipe.AddRecipe(); - } - } + [AutoloadEquip(EquipType.Legs)] + public class NovaLeggings : ModItem + { + + public override void SetDefaults() + { + + item.width = 26; + item.height = 16; + + + item.rare = 10; + item.defense = 16; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nova Leggings"); + Tooltip.SetDefault("Increases alchemic damage by 18%\nIncreases alchemic critical strike chance by 12\nIncreases movement speed by 14%"); + } + + + public override Color? GetAlpha(Color lightColor) + { + return Color.White; + } + + public override void UpdateEquip(Player player) + { + player.GetModPlayer(mod).alchemistDamage += 0.18f; + player.GetModPlayer(mod).alchemistCrit += 12; + player.moveSpeed += 0.14f; + Lighting.AddLight((int)((player.position.X + (float)(player.width / 2)) / 16f), (int)((player.position.Y + (float)(player.height / 2)) / 16f), 0.8f, 0.7f, 0.3f); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(3467, 12); + recipe.AddIngredient(null, "NovaFragment", 15); + recipe.AddTile(412); + recipe.SetResult(this, 1); + recipe.AddRecipe(); + } + } } diff --git a/NovaPillar/NovaMonolith.cs b/NovaPillar/NovaMonolith.cs index b5d79eef..06205968 100644 --- a/NovaPillar/NovaMonolith.cs +++ b/NovaPillar/NovaMonolith.cs @@ -27,13 +27,13 @@ public override void SetStaticDefaults() DisplayName.SetDefault("Nova Monolith"); } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "NovaFragment", 15); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "NovaFragment", 15); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } } } \ No newline at end of file diff --git a/NovaPillar/NovaMonolith_Tile.cs b/NovaPillar/NovaMonolith_Tile.cs index 3344fd3c..03d419c9 100644 --- a/NovaPillar/NovaMonolith_Tile.cs +++ b/NovaPillar/NovaMonolith_Tile.cs @@ -16,13 +16,13 @@ public override void SetDefaults() TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX); TileObjectData.newTile.Height = 3; TileObjectData.newTile.Origin = new Point16(1, 2); - TileObjectData.newTile.CoordinateHeights = new int[]{ 16, 16, 18 }; + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 18 }; TileObjectData.addTile(Type); AddMapEntry(new Color(75, 139, 166)); dustType = 1; animationFrameHeight = 56; disableSmartCursor = true; - adjTiles = new int[]{ TileID.LunarMonolith }; + adjTiles = new int[] { TileID.LunarMonolith }; } public override void KillMultiTile(int i, int j, int frameX, int frameY) diff --git a/NovaPillar/NovaPickaxe.cs b/NovaPillar/NovaPickaxe.cs index dac904ad..acb75596 100644 --- a/NovaPillar/NovaPickaxe.cs +++ b/NovaPillar/NovaPickaxe.cs @@ -4,44 +4,46 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.NovaPillar { -public class NovaPickaxe : ModItem +namespace Tremor.NovaPillar { - public override void SetDefaults() - { + public class NovaPickaxe : ModItem + { + public override void SetDefaults() + { - item.damage = 80; - item.melee = true; - item.width = 38; - item.height = 38; - item.useTime = 7; - item.useAnimation = 11; - item.pick = 225; - item.useStyle = 1; - item.knockBack = 5; - item.value = 50000; - item.rare = 10; - item.UseSound = SoundID.Item1; - item.autoReuse = true; - item.tileBoost += 4; - item.glowMask = TremorGlowMask.NovaPick; - item.useTurn = true; - } + item.damage = 80; + item.melee = true; + item.width = 38; + item.height = 38; + item.useTime = 7; + item.useAnimation = 11; + item.pick = 225; + item.useStyle = 1; + item.knockBack = 5; + item.value = 50000; + item.rare = 10; + item.UseSound = SoundID.Item1; + item.autoReuse = true; + item.tileBoost += 4; + item.glowMask = TremorGlowMask.NovaPick; + item.useTurn = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nova Pickaxe"); - Tooltip.SetDefault(""); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nova Pickaxe"); + Tooltip.SetDefault(""); + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "NovaFragment", 12); - recipe.AddIngredient(3467, 10); - recipe.AddTile(412); - recipe.SetResult(this); - recipe.AddRecipe(); + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "NovaFragment", 12); + recipe.AddIngredient(3467, 10); + recipe.AddTile(412); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } } -}} diff --git a/NovaPillar/NovaPillar.cs b/NovaPillar/NovaPillar.cs index fe957487..2955b794 100644 --- a/NovaPillar/NovaPillar.cs +++ b/NovaPillar/NovaPillar.cs @@ -33,78 +33,78 @@ public override void SetDefaults() npc.noGravity = true; npc.npcSlots = 0; npc.noTileCollide = true; - npc.alpha = 0; + npc.alpha = 0; NPCID.Sets.MustAlwaysDraw[npc.type] = true; music = MusicID.TheTowers; } - int Timer = 0; + int Timer = 0; public override void AI() { - this.Timer++; - if (this.Timer % 150 == 0) - { - if (Main.player[npc.target].GetModPlayer(mod).ZoneTowerNova) - { - var ShootPos = Main.player[npc.target].position + new Vector2(Main.rand.Next(-1000, 1000), -1000); - var ShootVel = new Vector2(Main.rand.NextFloat(-3f, 3f), Main.rand.NextFloat(15f, 20f)); - int i = Projectile.NewProjectile(ShootPos, ShootVel, mod.ProjectileType("NovaBottle"), 34, 1f); - Main.projectile[i].friendly = false; - } - } - if(NovaHandler.ShieldStrength > 0) + this.Timer++; + if (this.Timer % 150 == 0) + { + if (Main.player[npc.target].GetModPlayer(mod).ZoneTowerNova) + { + var ShootPos = Main.player[npc.target].position + new Vector2(Main.rand.Next(-1000, 1000), -1000); + var ShootVel = new Vector2(Main.rand.NextFloat(-3f, 3f), Main.rand.NextFloat(15f, 20f)); + int i = Projectile.NewProjectile(ShootPos, ShootVel, mod.ProjectileType("NovaBottle"), 34, 1f); + Main.projectile[i].friendly = false; + } + } + if (NovaHandler.ShieldStrength > 0) { npc.dontTakeDamage = true; } - else if(npc.dontTakeDamage) + else if (npc.dontTakeDamage) { npc.ai[3] = 30f; npc.dontTakeDamage = false; } - if (npc.ai[3] > 0) + if (npc.ai[3] > 0) { npc.ai[3]--; } - if (Main.rand.Next(5) == 0) - { - Dust dust21 = Main.dust[Dust.NewDust(npc.Left, npc.width, npc.height / 2, 241, 0f, 0f, 0, default(Color), 1f)]; - dust21.position = npc.Center + Vector2.UnitY.RotatedByRandom(2.0943951606750488) * new Vector2((float)(npc.width / 2), (float)(npc.height / 2)) * (0.8f + Main.rand.NextFloat() * 0.2f); - dust21.velocity.X = 0f; - dust21.velocity.Y = Math.Abs(dust21.velocity.Y) * 0.25f; - } - for (int num1940 = 0; num1940 < 3; num1940++) - { - if (Main.rand.Next(5) == 0) - { - Dust dust22 = Main.dust[Dust.NewDust(npc.Top + new Vector2((float)(-(float)npc.width) * (0.33f - 0.11f * (float)num1940), -20f), (int)((float)npc.width * (0.66f - 0.22f * (float)num1940)), 20, 135, 0f, 0f, 0, default(Color), 1f)]; - dust22.velocity.X = 0f; - dust22.velocity.Y = -Math.Abs(dust22.velocity.Y - (float)num1940 + npc.velocity.Y - 4f) * 1f; - dust22.noGravity = true; - dust22.fadeIn = 1f; - dust22.scale = 1f + Main.rand.NextFloat() + (float)num1940 * 0.3f; - } - } - if (npc.ai[2] == 1f) + if (Main.rand.Next(5) == 0) + { + Dust dust21 = Main.dust[Dust.NewDust(npc.Left, npc.width, npc.height / 2, 241, 0f, 0f, 0, default(Color), 1f)]; + dust21.position = npc.Center + Vector2.UnitY.RotatedByRandom(2.0943951606750488) * new Vector2((float)(npc.width / 2), (float)(npc.height / 2)) * (0.8f + Main.rand.NextFloat() * 0.2f); + dust21.velocity.X = 0f; + dust21.velocity.Y = Math.Abs(dust21.velocity.Y) * 0.25f; + } + for (int num1940 = 0; num1940 < 3; num1940++) + { + if (Main.rand.Next(5) == 0) + { + Dust dust22 = Main.dust[Dust.NewDust(npc.Top + new Vector2((float)(-(float)npc.width) * (0.33f - 0.11f * (float)num1940), -20f), (int)((float)npc.width * (0.66f - 0.22f * (float)num1940)), 20, 135, 0f, 0f, 0, default(Color), 1f)]; + dust22.velocity.X = 0f; + dust22.velocity.Y = -Math.Abs(dust22.velocity.Y - (float)num1940 + npc.velocity.Y - 4f) * 1f; + dust22.noGravity = true; + dust22.fadeIn = 1f; + dust22.scale = 1f + Main.rand.NextFloat() + (float)num1940 * 0.3f; + } + } + if (npc.ai[2] == 1f) { npc.velocity = Vector2.UnitY * npc.velocity.Length(); - if(npc.velocity.Y < 0.25f) + if (npc.velocity.Y < 0.25f) { npc.velocity.Y = npc.velocity.Y + 0.02f; } - if(npc.velocity.Y > 0.25f) + if (npc.velocity.Y > 0.25f) { npc.velocity.Y = npc.velocity.Y - 0.02f; } npc.dontTakeDamage = true; npc.ai[1] += 1f; - if(npc.ai[1] > 120f) + if (npc.ai[1] > 120f) { npc.Opacity = 1f - (npc.ai[1] - 120f) / 60f; } int dustID = 59; - if(Main.rand.Next(5) == 0 && npc.ai[1] < 120f) + if (Main.rand.Next(5) == 0 && npc.ai[1] < 120f) { - for(int i = 0; i < 3; i++) + for (int i = 0; i < 3; i++) { Dust dust4 = Main.dust[Dust.NewDust(npc.Left, npc.width, npc.height / 2, dustID)]; dust4.position = npc.Center + Vector2.UnitY.RotatedByRandom(4.1887903213500977) * new Vector2((float)npc.width * 1.5f, (float)npc.height * 1.1f) * 0.8f * (0.8f + Main.rand.NextFloat() * 0.2f); @@ -115,11 +115,11 @@ public override void AI() dust4.scale = 1f + Main.rand.NextFloat() + (float)i * 0.3f; } } - if(npc.ai[1] < 150f) + if (npc.ai[1] < 150f) { - for(int num1362 = 0; num1362 < 3; num1362++) + for (int num1362 = 0; num1362 < 3; num1362++) { - if(Main.rand.Next(4) == 0) + if (Main.rand.Next(4) == 0) { Dust dust5 = Main.dust[Dust.NewDust(npc.Top + new Vector2((float)(-(float)npc.width) * (0.33f - 0.11f * (float)num1362), -20f), (int)((float)npc.width * (0.66f - 0.22f * (float)num1362)), 20, dustID)]; dust5.velocity.X = 0f; @@ -130,13 +130,13 @@ public override void AI() } } } - if(Main.rand.Next(5) == 0 && npc.ai[1] < 150f) + if (Main.rand.Next(5) == 0 && npc.ai[1] < 150f) { - for(int i = 0; i < 3; i++) + for (int i = 0; i < 3; i++) { Vector2 position6 = npc.Center + Vector2.UnitY.RotatedByRandom(4.1887903213500977) * new Vector2((float)npc.width, (float)npc.height) * 0.7f * Main.rand.NextFloat(); float num1364 = 1f + Main.rand.NextFloat() * 2f + npc.ai[1] / 180f * 4f; - for(int num1365 = 0; num1365 < 6; num1365++) + for (int num1365 = 0; num1365 < 6; num1365++) { Dust dust6 = Main.dust[Dust.NewDust(position6, 4, 4, dustID, newColor: Color.Yellow)]; dust6.position = position6; @@ -147,42 +147,42 @@ public override void AI() dust6.fadeIn = 1f; dust6.scale = 1.5f + Main.rand.NextFloat() + (float)num1365 * 0.13f; } - Main.PlaySound(3, position6, Utils.SelectRandom(Main.rand, new [] { 1, 18 })); + Main.PlaySound(3, position6, Utils.SelectRandom(Main.rand, new[] { 1, 18 })); } } - if(Main.rand.Next(3) != 0 && npc.ai[1] < 150f) + if (Main.rand.Next(3) != 0 && npc.ai[1] < 150f) { Dust dust7 = Main.dust[Dust.NewDust(npc.Left, npc.width, npc.height / 2, DustID.MarblePot)]; dust7.position = npc.Center + Vector2.UnitY.RotatedByRandom(4.1887903213500977) * new Vector2((float)(npc.width / 2), (float)(npc.height / 2)) * (0.8f + Main.rand.NextFloat() * 0.2f); dust7.velocity.X = 0f; dust7.velocity.Y = Math.Abs(dust7.velocity.Y) * 0.25f; } - if (npc.ai[1] % 60 == 1) + if (npc.ai[1] % 60 == 1) { Main.PlaySound(SoundID.NPCDeath22, npc.Center); } - if(npc.ai[1] >= 180f) + if (npc.ai[1] >= 180f) { - npc.alpha++; - if (npc.alpha >= 255) - { - npc.life = 0; - npc.HitEffect(0, 1337); - npc.checkDead(); - } + npc.alpha++; + if (npc.alpha >= 255) + { + npc.life = 0; + npc.HitEffect(0, 1337); + npc.checkDead(); + } } return; } - } - + } + public override bool CheckActive() { - return false; + return false; } - + public override bool CheckDead() { - if(npc.ai[2] != 1 && npc.ai[1] < 180) + if (npc.ai[2] != 1 && npc.ai[1] < 180) { npc.ai[2] = 1; npc.ai[1] = 0; @@ -193,23 +193,23 @@ public override bool CheckDead() } return base.CheckDead(); } - + public override void NPCLoot() { int stacks = Main.rand.Next(25, 41) / 2; - if(Main.expertMode) + if (Main.expertMode) { stacks = (int)(stacks * 1.5f); } - for(int i = 0; i < stacks; i++) + for (int i = 0; i < stacks; i++) { Item.NewItem((int)npc.position.X + Main.rand.Next(npc.width), (int)npc.position.Y + Main.rand.Next(npc.height), 2, 2, mod.ItemType("NovaFragment"), Main.rand.Next(1, 4)); } - + TremorWorld.DownedNovaPillar = true; NovaHandler.TowerX = -1; - NovaHandler.TowerY = -1; - if(NPC.LunarApocalypseIsUp) + NovaHandler.TowerY = -1; + if (NPC.LunarApocalypseIsUp) { Main.NewText("Your hands are shaking...", 175, 75, 255); } @@ -218,40 +218,40 @@ public override void NPCLoot() WorldGen.StartImpendingDoom(); } } - + public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor) { var effects = npc.direction == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; spriteBatch.Draw(Main.npcTexture[npc.type], npc.Center - Main.screenPosition + new Vector2(0, npc.gfxOffY), npc.frame, - Color.White, npc.rotation, npc.frame.Size() / 2, npc.scale, effects, 0); + Color.White, npc.rotation, npc.frame.Size() / 2, npc.scale, effects, 0); return false; } - + public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) { - TremorUtils.DrawNPCGlowMask(spriteBatch, npc, mod.GetTexture("NovaPillar/NovaPillar_GlowMask")); + TremorUtils.DrawNPCGlowMask(spriteBatch, npc, mod.GetTexture("NovaPillar/NovaPillar_GlowMask")); float num88 = (float)NovaHandler.ShieldStrength / (float)NPC.ShieldStrengthTowerMax; - if(NovaHandler.ShieldStrength > 0) + if (NovaHandler.ShieldStrength > 0) { Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointWrap, DepthStencilState.Default, RasterizerState.CullNone); - + var center = npc.Center - Main.screenPosition; float num89 = 0f; - if(npc.ai[3] > 0f && npc.ai[3] <= 30f) + if (npc.ai[3] > 0f && npc.ai[3] <= 30f) { num89 = 1f - npc.ai[3] / 30f; } Filters.Scene["Tremor:Nova"].GetShader().UseIntensity(1f + num89).UseProgress(0f); - DrawData drawData = new DrawData(TextureManager.Load("Images/Misc/Perlin"), center - new Vector2(0, 10), new Rectangle(0, 0, 600, 600), Color.White * (num88 * 0.8f + 0.2f), npc.rotation, new Vector2(300f, 300f), npc.scale * (1f + num89 * 0.05f), SpriteEffects.None, 0); - GameShaders.Misc["ForceField"].UseColor(new Vector3(1f + num89 * 0.5f)); - GameShaders.Misc["ForceField"].Apply(new DrawData?(drawData)); - drawData.Draw(Main.spriteBatch); + DrawData drawData = new DrawData(TextureManager.Load("Images/Misc/Perlin"), center - new Vector2(0, 10), new Rectangle(0, 0, 600, 600), Color.White * (num88 * 0.8f + 0.2f), npc.rotation, new Vector2(300f, 300f), npc.scale * (1f + num89 * 0.05f), SpriteEffects.None, 0); + GameShaders.Misc["ForceField"].UseColor(new Vector3(1f + num89 * 0.5f)); + GameShaders.Misc["ForceField"].Apply(new DrawData?(drawData)); + drawData.Draw(Main.spriteBatch); Main.spriteBatch.End(); Main.spriteBatch.Begin(); return; } - if(npc.ai[3] > 0f) + if (npc.ai[3] > 0f) { Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointWrap, DepthStencilState.Default, RasterizerState.CullNone); @@ -259,7 +259,7 @@ public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) float num90 = npc.ai[3] / 120f; float num91 = Math.Min(npc.ai[3] / 30f, 1f); Filters.Scene["Tremor:Nova"].GetShader().UseIntensity(Math.Min(5f, 15f * num90) + 1f).UseProgress(num90); - DrawData drawData = new DrawData(TextureManager.Load("Images/Misc/Perlin"), center - new Vector2(0, 10), new Rectangle(0, 0, 600, 600), new Color(new Vector4(1f - (float)Math.Sqrt((double)num91))), npc.rotation, new Vector2(300f, 300f), npc.scale * (1f + num91), SpriteEffects.None, 0); + DrawData drawData = new DrawData(TextureManager.Load("Images/Misc/Perlin"), center - new Vector2(0, 10), new Rectangle(0, 0, 600, 600), new Color(new Vector4(1f - (float)Math.Sqrt((double)num91))), npc.rotation, new Vector2(300f, 300f), npc.scale * (1f + num91), SpriteEffects.None, 0); GameShaders.Misc["ForceField"].UseColor(new Vector3(2f)); GameShaders.Misc["ForceField"].Apply(new DrawData?(drawData)); drawData.Draw(Main.spriteBatch); @@ -268,6 +268,6 @@ public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) return; } Filters.Scene["Tremor:Nova"].GetShader().UseIntensity(0f).UseProgress(0f); - } + } } } diff --git a/NovaPillar/NovaSky.cs b/NovaPillar/NovaSky.cs index c594c5e7..6bf8a40d 100644 --- a/NovaPillar/NovaSky.cs +++ b/NovaPillar/NovaSky.cs @@ -12,97 +12,97 @@ namespace Tremor.NovaPillar { public class NovaSky : CustomSky { - private struct Star - { - public Vector2 Position; - public float Depth; - public int TextureIndex; - public float SinOffset; - public float AlphaFrequency; - public float AlphaAmplitude; - } - private NovaSky.Star[] _stars; - private Random _random = new Random(); - public static Texture2D PlanetTexture; - private Texture2D[] _starTextures; - public static Texture2D BGTexture; - bool Active = false; + private struct Star + { + public Vector2 Position; + public float Depth; + public int TextureIndex; + public float SinOffset; + public float AlphaFrequency; + public float AlphaAmplitude; + } + private NovaSky.Star[] _stars; + private Random _random = new Random(); + public static Texture2D PlanetTexture; + private Texture2D[] _starTextures; + public static Texture2D BGTexture; + bool Active = false; float Intensity = 0f; - public override void Update(GameTime gameTime) + public override void Update(GameTime gameTime) { - if (Active) - { - Intensity = Math.Min(1f, 0.01f + Intensity); - return; - } - Intensity = Math.Max(0f, Intensity - 0.01f); - } + if (Active) + { + Intensity = Math.Min(1f, 0.01f + Intensity); + return; + } + Intensity = Math.Max(0f, Intensity - 0.01f); + } - public override void OnLoad() - { - this._starTextures = new Texture2D[3]; - for (int i = 0; i < this._starTextures.Length; i++) - { - this._starTextures[i] = ModLoader.GetMod("Tremor").GetTexture("NovaPillar/NovaSoul " + i); - } - } + public override void OnLoad() + { + this._starTextures = new Texture2D[3]; + for (int i = 0; i < this._starTextures.Length; i++) + { + this._starTextures[i] = ModLoader.GetMod("Tremor").GetTexture("NovaPillar/NovaSoul " + i); + } + } - public override Color OnTileColor(Color inColor) - { - Vector4 value = inColor.ToVector4(); - return new Color(Vector4.Lerp(value, Vector4.One, Intensity * 0.5f)); - } + public override Color OnTileColor(Color inColor) + { + Vector4 value = inColor.ToVector4(); + return new Color(Vector4.Lerp(value, Vector4.One, Intensity * 0.5f)); + } - public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth) + public override void Draw(SpriteBatch spriteBatch, float minDepth, float maxDepth) { - if (maxDepth >= 3.40282347E+38f && minDepth < 3.40282347E+38f) - { - for (int i = 0; i < 200; i++) - { - var rect = new Rectangle(0, (int)Math.Ceiling(Main.screenHeight / 200f) * i, Main.screenWidth, (int)Math.Ceiling(Main.screenHeight / 200f)); - var color = Color.Lerp(Color.Black, Color.Yellow, i / 200f) * Intensity; - spriteBatch.Draw(Main.blackTileTexture, rect, color); - } - var planetPos = new Vector2(Main.screenWidth * 0.3f, Main.screenHeight * 0.3f); - spriteBatch.Draw(PlanetTexture, planetPos, null, Color.White * 0.9f * Intensity, 0f, PlanetTexture.Size() / 2, 0.4f, 0, 0); + if (maxDepth >= 3.40282347E+38f && minDepth < 3.40282347E+38f) + { + for (int i = 0; i < 200; i++) + { + var rect = new Rectangle(0, (int)Math.Ceiling(Main.screenHeight / 200f) * i, Main.screenWidth, (int)Math.Ceiling(Main.screenHeight / 200f)); + var color = Color.Lerp(Color.Black, Color.Yellow, i / 200f) * Intensity; + spriteBatch.Draw(Main.blackTileTexture, rect, color); + } + var planetPos = new Vector2(Main.screenWidth * 0.3f, Main.screenHeight * 0.3f); + spriteBatch.Draw(PlanetTexture, planetPos, null, Color.White * 0.9f * Intensity, 0f, PlanetTexture.Size() / 2, 0.4f, 0, 0); + } + int num = -1; + int num2 = 0; + for (int i = 0; i < this._stars.Length; i++) + { + float depth = this._stars[i].Depth; + if (num == -1 && depth < maxDepth) + { + num = i; + } + if (depth <= minDepth) + { + break; + } + num2 = i; + } + if (num == -1) + { + return; + } + float scale = Math.Min(1f, (Main.screenPosition.Y - 1000f) / 1000f); + Vector2 value3 = Main.screenPosition + new Vector2((float)(Main.screenWidth >> 1), (float)(Main.screenHeight >> 1)); + Rectangle rectangle = new Rectangle(-1000, -1000, 4000, 4000); + for (int j = num; j < num2; j++) + { + Vector2 value4 = new Vector2(1f / this._stars[j].Depth, 1.1f / this._stars[j].Depth); + Vector2 position = (this._stars[j].Position - value3) * value4 + value3 - Main.screenPosition; + if (rectangle.Contains((int)position.X, (int)position.Y)) + { + float num3 = (float)Math.Sin((double)(this._stars[j].AlphaFrequency * Main.GlobalTime + this._stars[j].SinOffset)) * this._stars[j].AlphaAmplitude + this._stars[j].AlphaAmplitude; + float num4 = (float)Math.Sin((double)(this._stars[j].AlphaFrequency * Main.GlobalTime * 5f + this._stars[j].SinOffset)) * 0.1f - 0.1f; + num3 = MathHelper.Clamp(num3, 0f, 1f); + Texture2D texture2D = this._starTextures[this._stars[j].TextureIndex]; + spriteBatch.Draw(texture2D, position, null, Color.White * scale * num3 * 0.8f * (1f - num4) * Intensity, 0f, new Vector2((float)(texture2D.Width >> 1), (float)(texture2D.Height >> 1)), (value4.X * 0.5f + 0.5f) * (num3 * 0.3f + 0.7f), SpriteEffects.None, 0f); + } } - int num = -1; - int num2 = 0; - for (int i = 0; i < this._stars.Length; i++) - { - float depth = this._stars[i].Depth; - if (num == -1 && depth < maxDepth) - { - num = i; - } - if (depth <= minDepth) - { - break; - } - num2 = i; - } - if (num == -1) - { - return; - } - float scale = Math.Min(1f, (Main.screenPosition.Y - 1000f) / 1000f); - Vector2 value3 = Main.screenPosition + new Vector2((float)(Main.screenWidth >> 1), (float)(Main.screenHeight >> 1)); - Rectangle rectangle = new Rectangle(-1000, -1000, 4000, 4000); - for (int j = num; j < num2; j++) - { - Vector2 value4 = new Vector2(1f / this._stars[j].Depth, 1.1f / this._stars[j].Depth); - Vector2 position = (this._stars[j].Position - value3) * value4 + value3 - Main.screenPosition; - if (rectangle.Contains((int)position.X, (int)position.Y)) - { - float num3 = (float)Math.Sin((double)(this._stars[j].AlphaFrequency * Main.GlobalTime + this._stars[j].SinOffset)) * this._stars[j].AlphaAmplitude + this._stars[j].AlphaAmplitude; - float num4 = (float)Math.Sin((double)(this._stars[j].AlphaFrequency * Main.GlobalTime * 5f + this._stars[j].SinOffset)) * 0.1f - 0.1f; - num3 = MathHelper.Clamp(num3, 0f, 1f); - Texture2D texture2D = this._starTextures[this._stars[j].TextureIndex]; - spriteBatch.Draw(texture2D, position, null, Color.White * scale * num3 * 0.8f * (1f - num4) * Intensity, 0f, new Vector2((float)(texture2D.Width >> 1), (float)(texture2D.Height >> 1)), (value4.X * 0.5f + 0.5f) * (num3 * 0.3f + 0.7f), SpriteEffects.None, 0f); - } - } - } + } public override float GetCloudAlpha() { @@ -111,37 +111,37 @@ public override float GetCloudAlpha() public override void Activate(Vector2 position, params object[] args) { - int num = 200; - int num2 = 10; - this._stars = new NovaSky.Star[num * num2]; - int num3 = 0; - for (int i = 0; i < num; i++) - { - float num4 = (float)i / (float)num; - for (int j = 0; j < num2; j++) - { - float num5 = (float)j / (float)num2; - this._stars[num3].Position.X = num4 * (float)Main.maxTilesX * 16f; - this._stars[num3].Position.Y = num5 * ((float)Main.worldSurface * 16f + 2000f) - 1000f; - this._stars[num3].Depth = Main.rand.NextFloat() * 8f + 1.5f; - this._stars[num3].TextureIndex = Main.rand.Next(this._starTextures.Length); - this._stars[num3].SinOffset = Main.rand.NextFloat() * 6.28f; - this._stars[num3].AlphaAmplitude = Main.rand.NextFloat() * 5f; - this._stars[num3].AlphaFrequency = Main.rand.NextFloat() + 1f; - num3++; - } - } - Array.Sort(this._stars, new Comparison(this.SortMethod)); + int num = 200; + int num2 = 10; + this._stars = new NovaSky.Star[num * num2]; + int num3 = 0; + for (int i = 0; i < num; i++) + { + float num4 = (float)i / (float)num; + for (int j = 0; j < num2; j++) + { + float num5 = (float)j / (float)num2; + this._stars[num3].Position.X = num4 * (float)Main.maxTilesX * 16f; + this._stars[num3].Position.Y = num5 * ((float)Main.worldSurface * 16f + 2000f) - 1000f; + this._stars[num3].Depth = Main.rand.NextFloat() * 8f + 1.5f; + this._stars[num3].TextureIndex = Main.rand.Next(this._starTextures.Length); + this._stars[num3].SinOffset = Main.rand.NextFloat() * 6.28f; + this._stars[num3].AlphaAmplitude = Main.rand.NextFloat() * 5f; + this._stars[num3].AlphaFrequency = Main.rand.NextFloat() + 1f; + num3++; + } + } + Array.Sort(this._stars, new Comparison(this.SortMethod)); - Active = true; + Active = true; } - private int SortMethod(NovaSky.Star meteor1, NovaSky.Star meteor2) - { - return meteor2.Depth.CompareTo(meteor1.Depth); - } + private int SortMethod(NovaSky.Star meteor1, NovaSky.Star meteor2) + { + return meteor2.Depth.CompareTo(meteor1.Depth); + } - public override void Deactivate(params object[] args) + public override void Deactivate(params object[] args) { Active = false; } diff --git a/NovaPillar/NovaSprayer.cs b/NovaPillar/NovaSprayer.cs index 0e09fdc5..1eef757a 100644 --- a/NovaPillar/NovaSprayer.cs +++ b/NovaPillar/NovaSprayer.cs @@ -7,120 +7,120 @@ namespace Tremor.NovaPillar { - public class NovaSprayer : AlchemistItem - { - public override void SetDefaults() - { + public class NovaSprayer : AlchemistItem + { + public override void SetDefaults() + { - item.damage = 84; - item.width = 62; - item.height = 32; - item.useTime = 6; - item.useAnimation = 30; - item.useStyle = 5; - item.noMelee = true; - item.knockBack = 5; - item.value = 100000; - item.rare = 10; - item.UseSound = SoundID.Item11; - item.autoReuse = false; - item.shoot = mod.ProjectileType("NovaFlask_ProjBall"); - item.shootSpeed = 15f; - item.crit = 12; - item.reuseDelay = 60; - } + item.damage = 84; + item.width = 62; + item.height = 32; + item.useTime = 6; + item.useAnimation = 30; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 5; + item.value = 100000; + item.rare = 10; + item.UseSound = SoundID.Item11; + item.autoReuse = false; + item.shoot = mod.ProjectileType("NovaFlask_ProjBall"); + item.shootSpeed = 15f; + item.crit = 12; + item.reuseDelay = 60; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nova Sprayer"); - Tooltip.SetDefault("Shoots a burst of nova balls which explode into flames when hit enemy or after some time,\n flames explode into damaging bursts when hit enemy or after some time."); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nova Sprayer"); + Tooltip.SetDefault("Shoots a burst of nova balls which explode into flames when hit enemy or after some time,\n flames explode into damaging bursts when hit enemy or after some time."); + } - public override Vector2? HoldoutOffset() - { - return new Vector2(-15, 0); - } + public override Vector2? HoldoutOffset() + { + return new Vector2(-15, 0); + } - public override Color? GetAlpha(Color lightColor) - { - return Color.White; - } + public override Color? GetAlpha(Color lightColor) + { + return Color.White; + } - public override void UpdateInventory(Player player) - { - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) - { - item.autoReuse = true; - } - if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) - { - item.autoReuse = false; - } - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) - { - item.shootSpeed = 21f; - } - if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) - { - item.shootSpeed = 15f; - } - } + public override void UpdateInventory(Player player) + { + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) != -1) + { + item.autoReuse = true; + } + if (player.FindBuffIndex(mod.BuffType("FlaskCoreBuff")) < 1) + { + item.autoReuse = false; + } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) != -1) + { + item.shootSpeed = 21f; + } + if (player.FindBuffIndex(mod.BuffType("LongFuseBuff")) < 1) + { + item.shootSpeed = 15f; + } + } - public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) - { - MPlayer modPlayer = player.GetModPlayer(mod); - if (modPlayer.glove) - { - for (int i = 0; i < 1; ++i) - { - if (player.FindBuffIndex(mod.BuffType("BottledSpirit")) != -1) - { - Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 297, damage, knockBack, Main.myPlayer); - } - if (player.FindBuffIndex(mod.BuffType("BigBottledSpirit")) != -1) - { - Projectile.NewProjectile(position.X, position.Y, speedX + 3, speedY + 3, 297, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 297, damage, knockBack, Main.myPlayer); - } - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); - int k = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Main.projectile[k].friendly = true; - } - return false; - } - if (player.FindBuffIndex(mod.BuffType("BottledSpirit")) != -1 && !modPlayer.glove) - { - for (int i = 0; i < 1; ++i) - { - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, 297, damage, knockBack, Main.myPlayer); - int k = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Main.projectile[k].friendly = true; - } - return false; - } - if (player.FindBuffIndex(mod.BuffType("BigBottledSpirit")) != -1 && !modPlayer.glove) - { - for (int i = 0; i < 1; ++i) - { - Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 297, damage, knockBack, Main.myPlayer); - Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, 297, damage, knockBack, Main.myPlayer); - int k = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); - Main.projectile[k].friendly = true; - } - return false; - } - return true; - } + public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + MPlayer modPlayer = player.GetModPlayer(mod); + if (modPlayer.glove) + { + for (int i = 0; i < 1; ++i) + { + if (player.FindBuffIndex(mod.BuffType("BottledSpirit")) != -1) + { + Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 297, damage, knockBack, Main.myPlayer); + } + if (player.FindBuffIndex(mod.BuffType("BigBottledSpirit")) != -1) + { + Projectile.NewProjectile(position.X, position.Y, speedX + 3, speedY + 3, 297, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 297, damage, knockBack, Main.myPlayer); + } + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, type, damage, knockBack, Main.myPlayer); + int k = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Main.projectile[k].friendly = true; + } + return false; + } + if (player.FindBuffIndex(mod.BuffType("BottledSpirit")) != -1 && !modPlayer.glove) + { + for (int i = 0; i < 1; ++i) + { + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, 297, damage, knockBack, Main.myPlayer); + int k = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Main.projectile[k].friendly = true; + } + return false; + } + if (player.FindBuffIndex(mod.BuffType("BigBottledSpirit")) != -1 && !modPlayer.glove) + { + for (int i = 0; i < 1; ++i) + { + Projectile.NewProjectile(position.X, position.Y, speedX + 2, speedY + 2, 297, damage, knockBack, Main.myPlayer); + Projectile.NewProjectile(position.X, position.Y, speedX + 1, speedY + 1, 297, damage, knockBack, Main.myPlayer); + int k = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, Main.myPlayer); + Main.projectile[k].friendly = true; + } + return false; + } + return true; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "NovaFragment", 18); - recipe.SetResult(this); - recipe.AddTile(412); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "NovaFragment", 18); + recipe.SetResult(this); + recipe.AddTile(412); + recipe.AddRecipe(); + } + } } diff --git a/NovaPillar/NovaWings.cs b/NovaPillar/NovaWings.cs index 55154994..d26209d8 100644 --- a/NovaPillar/NovaWings.cs +++ b/NovaPillar/NovaWings.cs @@ -7,58 +7,58 @@ namespace Tremor.NovaPillar { - [AutoloadEquip(EquipType.Wings)] - public class NovaWings : ModItem - { - public override void SetDefaults() - { - item.width = 36; - item.height = 54; - item.rare = 10; - item.accessory = true; - } + [AutoloadEquip(EquipType.Wings)] + public class NovaWings : ModItem + { + public override void SetDefaults() + { + item.width = 36; + item.height = 54; + item.rare = 10; + item.accessory = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Nova Wings"); - Tooltip.SetDefault("Allows flight and slow fall"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nova Wings"); + Tooltip.SetDefault("Allows flight and slow fall"); + } - public override void UpdateAccessory(Player player, bool hideVisual) - { - player.wingTimeMax = 334; - } + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.wingTimeMax = 334; + } - public override void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, - ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend) - { - ascentWhenFalling = 0.85f; - ascentWhenRising = 0.15f; - maxCanAscendMultiplier = 1f; - maxAscentMultiplier = 3f; - constantAscend = 0.135f; - } + public override void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, + ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend) + { + ascentWhenFalling = 0.85f; + ascentWhenRising = 0.15f; + maxCanAscendMultiplier = 1f; + maxAscentMultiplier = 3f; + constantAscend = 0.135f; + } - public override void DrawArmorColor(Player drawPlayer, float shadow, ref Color color, ref int glowMask, ref Color glowMaskColor) - { - color = Color.White; - } + public override void DrawArmorColor(Player drawPlayer, float shadow, ref Color color, ref int glowMask, ref Color glowMaskColor) + { + color = Color.White; + } - public override void HorizontalWingSpeeds(Player player, ref float speed, ref float acceleration) - { - speed = 15f; - acceleration *= 3f; - } + public override void HorizontalWingSpeeds(Player player, ref float speed, ref float acceleration) + { + speed = 15f; + acceleration *= 3f; + } - public override void AddRecipes() - { - ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(null, "NovaFragment", 14); - recipe.AddIngredient(3467, 10); - recipe.AddTile(412); - recipe.SetResult(this, 1); - recipe.AddRecipe(); - } - } + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(null, "NovaFragment", 14); + recipe.AddIngredient(3467, 10); + recipe.AddTile(412); + recipe.SetResult(this, 1); + recipe.AddRecipe(); + } + } } diff --git a/NovaPillar/Varki.cs b/NovaPillar/Varki.cs index 4f421ddb..4865bc09 100644 --- a/NovaPillar/Varki.cs +++ b/NovaPillar/Varki.cs @@ -9,101 +9,101 @@ namespace Tremor.NovaPillar { - public class Varki : ModNPC - { + public class Varki : ModNPC + { public override void SetStaticDefaults() { DisplayName.SetDefault("Warkee"); Main.npcFrameCount[npc.type] = 2; } - - //Int variables - int AnimationRate = 4; - int CountFrame = 0; - int TimeToAnimation = 4; - int Timer = 0; - public override void SetDefaults() - { - npc.lifeMax = 750; - npc.damage = 300; - npc.defense = 25; - npc.knockBackResist = 0.34f; - npc.width = 26; - npc.height = 34; - npc.aiStyle = 14; - npc.noGravity = true; - npc.noTileCollide = true; - npc.HitSound = SoundID.NPCHit55; - npc.DeathSound = SoundID.NPCDeath51; - } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + //Int variables + int AnimationRate = 4; + int CountFrame = 0; + int TimeToAnimation = 4; + int Timer = 0; + public override void SetDefaults() + { + npc.lifeMax = 750; + npc.damage = 300; + npc.defense = 25; + npc.knockBackResist = 0.34f; + npc.width = 26; + npc.height = 34; + npc.aiStyle = 14; + npc.noGravity = true; + npc.noTileCollide = true; + npc.HitSound = SoundID.NPCHit55; + npc.DeathSound = SoundID.NPCDeath51; + } - public override void AI() - { - npc.spriteDirection = npc.direction; - this.Timer++; - if (this.Timer == 2000) - { - npc.Transform(mod.NPCType("Youwarkee2")); - } - this.NovaAnimation(); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) - { - TremorUtils.DrawNPCGlowMask(spriteBatch, npc, mod.GetTexture("NovaPillar/Varki_GlowMask")); - } + public override void AI() + { + npc.spriteDirection = npc.direction; + this.Timer++; + if (this.Timer == 2000) + { + npc.Transform(mod.NPCType("Youwarkee2")); + } + this.NovaAnimation(); + } - public override void HitEffect(int hitDirection, double damage) - { - if (npc.life <= 0) - { - if (NovaHandler.ShieldStrength > 0) - { - NPC parent = Main.npc[NPC.FindFirstNPC(mod.NPCType("NovaPillar"))]; - Vector2 Velocity = Helper.VelocityToPoint(npc.Center, parent.Center, 20); - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, Velocity.X, Velocity.Y, mod.ProjectileType("CogLordLaser"), 1, 1f); - } - for (int i = 0; i < 5; i++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 57, Main.rand.NextFloat(-3f, 3f), Main.rand.NextFloat(-3f, 3f)); - } - for (int i = 0; i < 2; i++) - { - Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/VarkiGore1")); - Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/VarkiGore2")); - } - Gore.NewGore(npc.Top, npc.velocity * hitDirection, mod.GetGoreSlot("Gores/VarkiGore3")); - for (int k = 0; k < 7; k++) - { - Vector2 Vector = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - Vector.Normalize(); - Vector *= (float)Main.rand.Next(10, 201) * 0.01f; - int i = Projectile.NewProjectile(npc.position.X, npc.position.Y, Vector.X, Vector.Y, mod.ProjectileType("NovaAlchemistCloud"), 20, 1f, Main.myPlayer, 0f, (float)Main.rand.Next(-45, 1)); - Main.projectile[i].friendly = false; - } - } - } + public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) + { + TremorUtils.DrawNPCGlowMask(spriteBatch, npc, mod.GetTexture("NovaPillar/Varki_GlowMask")); + } - void NovaAnimation() - { - if (--this.TimeToAnimation <= 0) - { - if (++this.CountFrame > 2) - this.CountFrame = 1; - this.TimeToAnimation = this.AnimationRate; - npc.frame = this.GetFrame(this.CountFrame + 0); - } - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + if (NovaHandler.ShieldStrength > 0) + { + NPC parent = Main.npc[NPC.FindFirstNPC(mod.NPCType("NovaPillar"))]; + Vector2 Velocity = Helper.VelocityToPoint(npc.Center, parent.Center, 20); + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, Velocity.X, Velocity.Y, mod.ProjectileType("CogLordLaser"), 1, 1f); + } + for (int i = 0; i < 5; i++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 57, Main.rand.NextFloat(-3f, 3f), Main.rand.NextFloat(-3f, 3f)); + } + for (int i = 0; i < 2; i++) + { + Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/VarkiGore1")); + Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/VarkiGore2")); + } + Gore.NewGore(npc.Top, npc.velocity * hitDirection, mod.GetGoreSlot("Gores/VarkiGore3")); + for (int k = 0; k < 7; k++) + { + Vector2 Vector = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector.Normalize(); + Vector *= (float)Main.rand.Next(10, 201) * 0.01f; + int i = Projectile.NewProjectile(npc.position.X, npc.position.Y, Vector.X, Vector.Y, mod.ProjectileType("NovaAlchemistCloud"), 20, 1f, Main.myPlayer, 0f, (float)Main.rand.Next(-45, 1)); + Main.projectile[i].friendly = false; + } + } + } - Rectangle GetFrame(int Number) - { - return new Rectangle(0, npc.frame.Height * (Number - 1), npc.frame.Width, npc.frame.Height); - } - } + void NovaAnimation() + { + if (--this.TimeToAnimation <= 0) + { + if (++this.CountFrame > 2) + this.CountFrame = 1; + this.TimeToAnimation = this.AnimationRate; + npc.frame = this.GetFrame(this.CountFrame + 0); + } + } + + Rectangle GetFrame(int Number) + { + return new Rectangle(0, npc.frame.Height * (Number - 1), npc.frame.Width, npc.frame.Height); + } + } } \ No newline at end of file diff --git a/NovaPillar/Youwarkee.cs b/NovaPillar/Youwarkee.cs index f5b6ed02..6ee2ef3b 100644 --- a/NovaPillar/Youwarkee.cs +++ b/NovaPillar/Youwarkee.cs @@ -14,13 +14,13 @@ public override void SetStaticDefaults() DisplayName.SetDefault("Yuwarkee"); Main.npcFrameCount[npc.type] = 4; } - - //Int variables - int AnimationRate = 4; - int CountFrame = 0; - int TimeToAnimation = 4; - int Timer = 0; - public override void SetDefaults() + + //Int variables + int AnimationRate = 4; + int CountFrame = 0; + int TimeToAnimation = 4; + int Timer = 0; + public override void SetDefaults() { npc.lifeMax = 1750; npc.damage = 81; @@ -28,128 +28,128 @@ public override void SetDefaults() npc.knockBackResist = 0.96f; npc.width = 66; npc.height = 68; - npc.HitSound = SoundID.NPCHit55; - npc.DeathSound = SoundID.NPCDeath51; - npc.buffImmune[31] = false; + npc.HitSound = SoundID.NPCHit55; + npc.DeathSound = SoundID.NPCDeath51; + npc.buffImmune[31] = false; npc.npcSlots = 2f; - npc.noGravity = true; - npc.noTileCollide = true; - } + npc.noGravity = true; + npc.noTileCollide = true; + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - const float Speed = 4f; - const float Acceleration = 0.27f; + const float Speed = 4f; + const float Acceleration = 0.27f; - int k = 0; - public override void AI() + int k = 0; + public override void AI() { - Vector2 StartPosition = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float DirectionX = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - StartPosition.X; - float DirectionY = (float)(Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - 120) - StartPosition.Y; - float Length = (float)Math.Sqrt(DirectionX * DirectionX + DirectionY * DirectionY); - float Num = Speed / Length; - DirectionX = DirectionX * Num; - DirectionY = DirectionY * Num; - if (npc.velocity.X < DirectionX) - { - npc.velocity.X = npc.velocity.X + Acceleration; - if (npc.velocity.X < 0 && DirectionX > 0) - npc.velocity.X = npc.velocity.X + Acceleration; - } - else if (npc.velocity.X > DirectionX) - { - npc.velocity.X = npc.velocity.X - Acceleration; - if (npc.velocity.X > 0 && DirectionX < 0) - npc.velocity.X = npc.velocity.X - Acceleration; - } - if (npc.velocity.Y < DirectionY) - { - npc.velocity.Y = npc.velocity.Y + Acceleration; - if (npc.velocity.Y < 0 && DirectionY > 0) - npc.velocity.Y = npc.velocity.Y + Acceleration; - } - else if (npc.velocity.Y > DirectionY) - { - npc.velocity.Y = npc.velocity.Y - Acceleration; - if (npc.velocity.Y > 0 && DirectionY < 0) - npc.velocity.Y = npc.velocity.Y - Acceleration; - } - if (Main.rand.Next(46) == 1) - { - Vector2 StartPosition2 = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height / 2)); - float AndasRotation = (float)Math.Atan2(StartPosition2.Y - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), StartPosition2.X - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); - npc.velocity.X = (float)(Math.Cos(AndasRotation) * 15) * -1; - npc.velocity.Y = (float)(Math.Sin(AndasRotation) * 15) * -1; - npc.netUpdate = true; - } - this.Timer++; - if (this.Timer >= 700) - { - this.Timer = 0; - } - if (NPC.CountNPCS(k) < 3 && this.Timer % 200 == 0) - { - k = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("Varki"), 0, npc.whoAmI, 0, 200); - } + Vector2 StartPosition = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float DirectionX = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - StartPosition.X; + float DirectionY = (float)(Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - 120) - StartPosition.Y; + float Length = (float)Math.Sqrt(DirectionX * DirectionX + DirectionY * DirectionY); + float Num = Speed / Length; + DirectionX = DirectionX * Num; + DirectionY = DirectionY * Num; + if (npc.velocity.X < DirectionX) + { + npc.velocity.X = npc.velocity.X + Acceleration; + if (npc.velocity.X < 0 && DirectionX > 0) + npc.velocity.X = npc.velocity.X + Acceleration; + } + else if (npc.velocity.X > DirectionX) + { + npc.velocity.X = npc.velocity.X - Acceleration; + if (npc.velocity.X > 0 && DirectionX < 0) + npc.velocity.X = npc.velocity.X - Acceleration; + } + if (npc.velocity.Y < DirectionY) + { + npc.velocity.Y = npc.velocity.Y + Acceleration; + if (npc.velocity.Y < 0 && DirectionY > 0) + npc.velocity.Y = npc.velocity.Y + Acceleration; + } + else if (npc.velocity.Y > DirectionY) + { + npc.velocity.Y = npc.velocity.Y - Acceleration; + if (npc.velocity.Y > 0 && DirectionY < 0) + npc.velocity.Y = npc.velocity.Y - Acceleration; + } + if (Main.rand.Next(46) == 1) + { + Vector2 StartPosition2 = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height / 2)); + float AndasRotation = (float)Math.Atan2(StartPosition2.Y - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), StartPosition2.X - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); + npc.velocity.X = (float)(Math.Cos(AndasRotation) * 15) * -1; + npc.velocity.Y = (float)(Math.Sin(AndasRotation) * 15) * -1; + npc.netUpdate = true; + } + this.Timer++; + if (this.Timer >= 700) + { + this.Timer = 0; + } + if (NPC.CountNPCS(k) < 3 && this.Timer % 200 == 0) + { + k = NPC.NewNPC((int)npc.Center.X, (int)npc.Center.Y, mod.NPCType("Varki"), 0, npc.whoAmI, 0, 200); + } npc.rotation = npc.velocity.X * 0.1f; - this.NovaAnimation(); - } + this.NovaAnimation(); + } - public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) - { - TremorUtils.DrawNPCGlowMask(spriteBatch, npc, mod.GetTexture("NovaPillar/Youwarkee_GlowMask")); - } + public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) + { + TremorUtils.DrawNPCGlowMask(spriteBatch, npc, mod.GetTexture("NovaPillar/Youwarkee_GlowMask")); + } - public override void HitEffect(int hitDirection, double damage) - { - if (npc.life <= 0) - { - if (NovaHandler.ShieldStrength > 0) - { - NPC parent = Main.npc[NPC.FindFirstNPC(mod.NPCType("NovaPillar"))]; - Vector2 Velocity = Helper.VelocityToPoint(npc.Center, parent.Center, 20); - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, Velocity.X, Velocity.Y, mod.ProjectileType("CogLordLaser"), 1, 1f); - } - for (int i = 0; i < 5; i++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 57, Main.rand.NextFloat(-3f, 3f), Main.rand.NextFloat(-3f, 3f)); - } - for (int i = 0; i < 2; i++) - { - Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/YouwarkeeGore1")); - Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/YouwarkeeGore2")); - } - Gore.NewGore(npc.Top, npc.velocity * hitDirection, mod.GetGoreSlot("Gores/YouwarkeeGore3")); - Gore.NewGore(npc.Top, npc.velocity * hitDirection, mod.GetGoreSlot("Gores/YouwarkeeGore3")); - } - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + if (NovaHandler.ShieldStrength > 0) + { + NPC parent = Main.npc[NPC.FindFirstNPC(mod.NPCType("NovaPillar"))]; + Vector2 Velocity = Helper.VelocityToPoint(npc.Center, parent.Center, 20); + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, Velocity.X, Velocity.Y, mod.ProjectileType("CogLordLaser"), 1, 1f); + } + for (int i = 0; i < 5; i++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 57, Main.rand.NextFloat(-3f, 3f), Main.rand.NextFloat(-3f, 3f)); + } + for (int i = 0; i < 2; i++) + { + Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/YouwarkeeGore1")); + Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/YouwarkeeGore2")); + } + Gore.NewGore(npc.Top, npc.velocity * hitDirection, mod.GetGoreSlot("Gores/YouwarkeeGore3")); + Gore.NewGore(npc.Top, npc.velocity * hitDirection, mod.GetGoreSlot("Gores/YouwarkeeGore3")); + } + } - void NovaAnimation() - { - if (--this.TimeToAnimation <= 0) - { - if (++this.CountFrame > 4) - this.CountFrame = 1; - this.TimeToAnimation = this.AnimationRate; - npc.frame = this.GetFrame(this.CountFrame + 0); - } - } + void NovaAnimation() + { + if (--this.TimeToAnimation <= 0) + { + if (++this.CountFrame > 4) + this.CountFrame = 1; + this.TimeToAnimation = this.AnimationRate; + npc.frame = this.GetFrame(this.CountFrame + 0); + } + } - Rectangle GetFrame(int Number) - { - return new Rectangle(0, npc.frame.Height * (Number - 1), npc.frame.Width, npc.frame.Height); - } + Rectangle GetFrame(int Number) + { + return new Rectangle(0, npc.frame.Height * (Number - 1), npc.frame.Width, npc.frame.Height); + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - if (spawnInfo.player.GetModPlayer(mod).ZoneTowerNova) - return 1f; - return 0; - } - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + if (spawnInfo.player.GetModPlayer(mod).ZoneTowerNova) + return 1f; + return 0; + } + } } diff --git a/NovaPillar/Youwarkee2.cs b/NovaPillar/Youwarkee2.cs index 5932b4ee..3666399b 100644 --- a/NovaPillar/Youwarkee2.cs +++ b/NovaPillar/Youwarkee2.cs @@ -14,13 +14,13 @@ public override void SetStaticDefaults() DisplayName.SetDefault("Yuwarkee"); Main.npcFrameCount[npc.type] = 4; } - - //Int variables - int AnimationRate = 4; - int CountFrame = 0; - int TimeToAnimation = 4; - int Timer = 0; - public override void SetDefaults() + + //Int variables + int AnimationRate = 4; + int CountFrame = 0; + int TimeToAnimation = 4; + int Timer = 0; + public override void SetDefaults() { npc.lifeMax = 2000; npc.damage = 81; @@ -28,124 +28,124 @@ public override void SetDefaults() npc.knockBackResist = 0.96f; npc.width = 66; npc.height = 68; - npc.HitSound = SoundID.NPCHit55; - npc.DeathSound = SoundID.NPCDeath51; - npc.buffImmune[31] = false; + npc.HitSound = SoundID.NPCHit55; + npc.DeathSound = SoundID.NPCDeath51; + npc.buffImmune[31] = false; npc.npcSlots = 2f; - npc.noGravity = true; - npc.noTileCollide = true; - } + npc.noGravity = true; + npc.noTileCollide = true; + } - public override void ScaleExpertStats(int numPlayers, float bossLifeScale) - { - npc.lifeMax = (int)(npc.lifeMax * 1); - npc.damage = (int)(npc.damage * 1); - } + public override void ScaleExpertStats(int numPlayers, float bossLifeScale) + { + npc.lifeMax = (int)(npc.lifeMax * 1); + npc.damage = (int)(npc.damage * 1); + } - const float Speed = 4f; - const float Acceleration = 0.27f; + const float Speed = 4f; + const float Acceleration = 0.27f; - int k = 0; - public override void AI() + int k = 0; + public override void AI() { - Vector2 StartPosition = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); - float DirectionX = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - StartPosition.X; - float DirectionY = (float)(Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - 120) - StartPosition.Y; - float Length = (float)Math.Sqrt(DirectionX * DirectionX + DirectionY * DirectionY); - float Num = Speed / Length; - DirectionX = DirectionX * Num; - DirectionY = DirectionY * Num; - if (npc.velocity.X < DirectionX) - { - npc.velocity.X = npc.velocity.X + Acceleration; - if (npc.velocity.X < 0 && DirectionX > 0) - npc.velocity.X = npc.velocity.X + Acceleration; - } - else if (npc.velocity.X > DirectionX) - { - npc.velocity.X = npc.velocity.X - Acceleration; - if (npc.velocity.X > 0 && DirectionX < 0) - npc.velocity.X = npc.velocity.X - Acceleration; - } - if (npc.velocity.Y < DirectionY) - { - npc.velocity.Y = npc.velocity.Y + Acceleration; - if (npc.velocity.Y < 0 && DirectionY > 0) - npc.velocity.Y = npc.velocity.Y + Acceleration; - } - else if (npc.velocity.Y > DirectionY) - { - npc.velocity.Y = npc.velocity.Y - Acceleration; - if (npc.velocity.Y > 0 && DirectionY < 0) - npc.velocity.Y = npc.velocity.Y - Acceleration; - } - if (Main.rand.Next(46) == 1) - { - Vector2 StartPosition2 = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height / 2)); - float AndasRotation = (float)Math.Atan2(StartPosition2.Y - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), StartPosition2.X - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); - npc.velocity.X = (float)(Math.Cos(AndasRotation) * 15) * -1; - npc.velocity.Y = (float)(Math.Sin(AndasRotation) * 15) * -1; - npc.netUpdate = true; - } - this.Timer++; - if (this.Timer >= 700) - { - this.Timer = 0; - } + Vector2 StartPosition = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); + float DirectionX = Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - StartPosition.X; + float DirectionY = (float)(Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - 120) - StartPosition.Y; + float Length = (float)Math.Sqrt(DirectionX * DirectionX + DirectionY * DirectionY); + float Num = Speed / Length; + DirectionX = DirectionX * Num; + DirectionY = DirectionY * Num; + if (npc.velocity.X < DirectionX) + { + npc.velocity.X = npc.velocity.X + Acceleration; + if (npc.velocity.X < 0 && DirectionX > 0) + npc.velocity.X = npc.velocity.X + Acceleration; + } + else if (npc.velocity.X > DirectionX) + { + npc.velocity.X = npc.velocity.X - Acceleration; + if (npc.velocity.X > 0 && DirectionX < 0) + npc.velocity.X = npc.velocity.X - Acceleration; + } + if (npc.velocity.Y < DirectionY) + { + npc.velocity.Y = npc.velocity.Y + Acceleration; + if (npc.velocity.Y < 0 && DirectionY > 0) + npc.velocity.Y = npc.velocity.Y + Acceleration; + } + else if (npc.velocity.Y > DirectionY) + { + npc.velocity.Y = npc.velocity.Y - Acceleration; + if (npc.velocity.Y > 0 && DirectionY < 0) + npc.velocity.Y = npc.velocity.Y - Acceleration; + } + if (Main.rand.Next(46) == 1) + { + Vector2 StartPosition2 = new Vector2(npc.position.X + (npc.width * 0.5f), npc.position.Y + (npc.height / 2)); + float AndasRotation = (float)Math.Atan2(StartPosition2.Y - (Main.player[npc.target].position.Y + (Main.player[npc.target].height * 0.5f)), StartPosition2.X - (Main.player[npc.target].position.X + (Main.player[npc.target].width * 0.5f))); + npc.velocity.X = (float)(Math.Cos(AndasRotation) * 15) * -1; + npc.velocity.Y = (float)(Math.Sin(AndasRotation) * 15) * -1; + npc.netUpdate = true; + } + this.Timer++; + if (this.Timer >= 700) + { + this.Timer = 0; + } npc.rotation = npc.velocity.X * 0.1f; - this.NovaAnimation(); - } + this.NovaAnimation(); + } - public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) - { - TremorUtils.DrawNPCGlowMask(spriteBatch, npc, mod.GetTexture("NovaPillar/Youwarkee2_GlowMask")); - } + public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) + { + TremorUtils.DrawNPCGlowMask(spriteBatch, npc, mod.GetTexture("NovaPillar/Youwarkee2_GlowMask")); + } - public override void HitEffect(int hitDirection, double damage) - { - if (npc.life <= 0) - { - if (NovaHandler.ShieldStrength > 0) - { - NPC parent = Main.npc[NPC.FindFirstNPC(mod.NPCType("NovaPillar"))]; - Vector2 Velocity = Helper.VelocityToPoint(npc.Center, parent.Center, 20); - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, Velocity.X, Velocity.Y, mod.ProjectileType("CogLordLaser"), 1, 1f); - } - for (int i = 0; i < 5; i++) - { - Dust.NewDust(npc.position, npc.width, npc.height, 57, Main.rand.NextFloat(-3f, 3f), Main.rand.NextFloat(-3f, 3f)); - } - for (int i = 0; i < 2; i++) - { - Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/YouwarkeeGore1")); - Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/YouwarkeeGore2")); - } - Gore.NewGore(npc.Top, npc.velocity * hitDirection, mod.GetGoreSlot("Gores/YouwarkeeGore3")); - Gore.NewGore(npc.Top, npc.velocity * hitDirection, mod.GetGoreSlot("Gores/YouwarkeeGore3")); - } - } + public override void HitEffect(int hitDirection, double damage) + { + if (npc.life <= 0) + { + if (NovaHandler.ShieldStrength > 0) + { + NPC parent = Main.npc[NPC.FindFirstNPC(mod.NPCType("NovaPillar"))]; + Vector2 Velocity = Helper.VelocityToPoint(npc.Center, parent.Center, 20); + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, Velocity.X, Velocity.Y, mod.ProjectileType("CogLordLaser"), 1, 1f); + } + for (int i = 0; i < 5; i++) + { + Dust.NewDust(npc.position, npc.width, npc.height, 57, Main.rand.NextFloat(-3f, 3f), Main.rand.NextFloat(-3f, 3f)); + } + for (int i = 0; i < 2; i++) + { + Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/YouwarkeeGore1")); + Gore.NewGore(npc.Center, npc.velocity, mod.GetGoreSlot("Gores/YouwarkeeGore2")); + } + Gore.NewGore(npc.Top, npc.velocity * hitDirection, mod.GetGoreSlot("Gores/YouwarkeeGore3")); + Gore.NewGore(npc.Top, npc.velocity * hitDirection, mod.GetGoreSlot("Gores/YouwarkeeGore3")); + } + } - void NovaAnimation() - { - if (--this.TimeToAnimation <= 0) - { - if (++this.CountFrame > 4) - this.CountFrame = 1; - this.TimeToAnimation = this.AnimationRate; - npc.frame = this.GetFrame(this.CountFrame + 0); - } - } + void NovaAnimation() + { + if (--this.TimeToAnimation <= 0) + { + if (++this.CountFrame > 4) + this.CountFrame = 1; + this.TimeToAnimation = this.AnimationRate; + npc.frame = this.GetFrame(this.CountFrame + 0); + } + } - Rectangle GetFrame(int Number) - { - return new Rectangle(0, npc.frame.Height * (Number - 1), npc.frame.Width, npc.frame.Height); - } + Rectangle GetFrame(int Number) + { + return new Rectangle(0, npc.frame.Height * (Number - 1), npc.frame.Width, npc.frame.Height); + } - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - if (spawnInfo.player.GetModPlayer(mod).ZoneTowerNova) - return 1f; - return 0; - } - } + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + if (spawnInfo.player.GetModPlayer(mod).ZoneTowerNova) + return 1f; + return 0; + } + } } diff --git a/Projectiles/AdamantiteBolt.cs b/Projectiles/AdamantiteBolt.cs index b163921f..2db0f2e3 100644 --- a/Projectiles/AdamantiteBolt.cs +++ b/Projectiles/AdamantiteBolt.cs @@ -5,85 +5,87 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class AdamantiteBolt : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { - - projectile.width = 12; - projectile.height = 12; - projectile.friendly = true; - projectile.magic = true; - projectile.aiStyle = 0; - projectile.penetrate = 3; - projectile.timeLeft = 1200; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Adamantite Bolt"); - - } + public class AdamantiteBolt : ModProjectile + { + public override void SetDefaults() + { + projectile.width = 12; + projectile.height = 12; + projectile.friendly = true; + projectile.magic = true; + projectile.aiStyle = 0; + projectile.penetrate = 3; + projectile.timeLeft = 1200; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } - public override void AI() - { - if (projectile.localAI[0] == 0f) + public override void SetStaticDefaults() { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + DisplayName.SetDefault("Adamantite Bolt"); + } - projectile.localAI[0] += 1f; - if (projectile.localAI[0] > 3f) + + + public override void AI() { - int num90 = 1; - if (projectile.localAI[0] > 5f) + if (projectile.localAI[0] == 0f) { - num90 = 2; + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); } - for (int num91 = 0; num91 < num90; num91++) + projectile.localAI[0] += 1f; + if (projectile.localAI[0] > 3f) { - int num92 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 2f), projectile.width, projectile.height, 60, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 2f); - Main.dust[num92].noGravity = true; - Dust expr_46AC_cp_0 = Main.dust[num92]; - expr_46AC_cp_0.velocity.X = expr_46AC_cp_0.velocity.X * 0.3f; - Dust expr_46CA_cp_0 = Main.dust[num92]; - expr_46CA_cp_0.velocity.Y = expr_46CA_cp_0.velocity.Y * 0.3f; - Main.dust[num92].noLight = true; - } - if (projectile.wet && !projectile.lavaWet) - { - projectile.Kill(); - return; + int num90 = 1; + if (projectile.localAI[0] > 5f) + { + num90 = 2; + } + for (int num91 = 0; num91 < num90; num91++) + { + int num92 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 2f), projectile.width, projectile.height, 60, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 2f); + Main.dust[num92].noGravity = true; + Dust expr_46AC_cp_0 = Main.dust[num92]; + expr_46AC_cp_0.velocity.X = expr_46AC_cp_0.velocity.X * 0.3f; + Dust expr_46CA_cp_0 = Main.dust[num92]; + expr_46CA_cp_0.velocity.Y = expr_46CA_cp_0.velocity.Y * 0.3f; + Main.dust[num92].noLight = true; + } + if (projectile.wet && !projectile.lavaWet) + { + projectile.Kill(); + return; + } } } - } - public override void Kill(int timeLeft) - { - for(int k = 0; k < 5; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 60, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); - } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 109); - if (projectile.owner == Main.myPlayer) + public override void Kill(int timeLeft) { - int num220 = Main.rand.Next(3, 6); - for (int num221 = 0; num221 < num220; num221++) + for (int k = 0; k < 5; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 60, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); + } + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 109); + if (projectile.owner == Main.myPlayer) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("AdamantiteCloud"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + int num220 = Main.rand.Next(3, 6); + for (int num221 = 0; num221 < num220; num221++) + { + Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value17.Normalize(); + value17 *= (float)Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("AdamantiteCloud"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + } } } - } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - projectile.ai[0] += 0.1f; - projectile.velocity *= 0.75f; - } -}} + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + projectile.ai[0] += 0.1f; + projectile.velocity *= 0.75f; + } + } +} diff --git a/Projectiles/AdamantiteCloud.cs b/Projectiles/AdamantiteCloud.cs index 4db57326..4da9bdb5 100644 --- a/Projectiles/AdamantiteCloud.cs +++ b/Projectiles/AdamantiteCloud.cs @@ -14,16 +14,16 @@ public override void SetDefaults() projectile.height = 40; projectile.magic = true; projectile.penetrate = 8; - projectile.aiStyle = 92; - projectile.friendly = true; + projectile.aiStyle = 92; + projectile.friendly = true; projectile.timeLeft = 600; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("PurpleCloudPro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("PurpleCloudPro"); + + } diff --git a/Projectiles/AdamantiteDiscPro.cs b/Projectiles/AdamantiteDiscPro.cs index 624d2ca5..f067979b 100644 --- a/Projectiles/AdamantiteDiscPro.cs +++ b/Projectiles/AdamantiteDiscPro.cs @@ -5,21 +5,23 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class AdamantiteDiscPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class AdamantiteDiscPro : ModProjectile + { + public override void SetDefaults() + { projectile.CloneDefaults(106); aiType = 106; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("AdamantiteDiscPro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("AdamantiteDiscPro"); + } -}} + + } +} diff --git a/Projectiles/AlchemasterPoisonCloudPro.cs b/Projectiles/AlchemasterPoisonCloudPro.cs index 80f9fe60..ca2a1c95 100644 --- a/Projectiles/AlchemasterPoisonCloudPro.cs +++ b/Projectiles/AlchemasterPoisonCloudPro.cs @@ -14,27 +14,27 @@ public override void SetDefaults() projectile.height = 40; projectile.magic = true; projectile.penetrate = 8; - projectile.aiStyle = 92; - projectile.hostile = true; + projectile.aiStyle = 92; + projectile.hostile = true; projectile.timeLeft = 600; - projectile.light = 1.0f; + projectile.light = 1.0f; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("PoisonCloudPro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("PoisonCloudPro"); + + } public override void OnHitPlayer(Player target, int damage, bool crit) - { - if(Main.rand.Next(1) == 0) - { - target.AddBuff(20, 180, false); - } - } + { + if (Main.rand.Next(1) == 0) + { + target.AddBuff(20, 180, false); + } + } } } diff --git a/Projectiles/AlchemicBubble.cs b/Projectiles/AlchemicBubble.cs index cf4cff9b..d4f640b4 100644 --- a/Projectiles/AlchemicBubble.cs +++ b/Projectiles/AlchemicBubble.cs @@ -5,60 +5,62 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class AlchemicBubble : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class AlchemicBubble : ModProjectile + { + public override void SetDefaults() + { projectile.CloneDefaults(405); aiType = 405; - projectile.friendly = true; - projectile.timeLeft = 150; - projectile.light = 0.8f; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - } + projectile.friendly = true; + projectile.timeLeft = 150; + projectile.light = 0.8f; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Alchemic Bubble"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Alchemic Bubble"); + + } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Vector2 drawOrigin = new Vector2(Main.projectileTexture[projectile.type].Width * 0.5f, projectile.height * 0.5f); - for(int k = 0; k < projectile.oldPos.Length; k++) - { - Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); - Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); - spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); - } - return true; - } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Vector2 drawOrigin = new Vector2(Main.projectileTexture[projectile.type].Width * 0.5f, projectile.height * 0.5f); + for (int k = 0; k < projectile.oldPos.Length; k++) + { + Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); + Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); + spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); + } + return true; + } public override Color? GetAlpha(Color lightColor) { return Color.White; } - public override void Kill(int timeLeft) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 107); - if (projectile.owner == Main.myPlayer) + public override void Kill(int timeLeft) { - int num220 = Main.rand.Next(1, 3); - for (int num221 = 0; num221 < num220; num221++) + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 107); + if (projectile.owner == Main.myPlayer) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("ShadowCloudPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + int num220 = Main.rand.Next(1, 3); + for (int num221 = 0; num221 < num220; num221++) + { + Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value17.Normalize(); + value17 *= (float)Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("ShadowCloudPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + } } } - } -}} + } +} diff --git a/Projectiles/AlphaKnifePro.cs b/Projectiles/AlphaKnifePro.cs index 2ea9aea8..c594ae25 100644 --- a/Projectiles/AlphaKnifePro.cs +++ b/Projectiles/AlphaKnifePro.cs @@ -4,40 +4,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class AlphaKnifePro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class AlphaKnifePro : ModProjectile + { + public override void SetDefaults() + { - projectile.width = 14; - projectile.height = 32; - projectile.friendly = true; - projectile.aiStyle = 1; - projectile.timeLeft = 1200; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; - ProjectileID.Sets.TrailingMode[projectile.type] = 2; - } + projectile.width = 14; + projectile.height = 32; + projectile.friendly = true; + projectile.aiStyle = 1; + projectile.timeLeft = 1200; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Alpha Knife"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Alpha Knife"); + } - public override void Kill(int timeLeft) - { - for(int k = 0; k < 5; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 1, projectile.oldVelocity.X * 0.1f, projectile.oldVelocity.Y * 0.1f); - } - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); - } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - projectile.ai[0] += 0.1f; - projectile.velocity *= 0.75f; - } -}} + public override void Kill(int timeLeft) + { + for (int k = 0; k < 5; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 1, projectile.oldVelocity.X * 0.1f, projectile.oldVelocity.Y * 0.1f); + } + Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + projectile.ai[0] += 0.1f; + projectile.velocity *= 0.75f; + } + } +} diff --git a/Projectiles/AmethystDrillPro.cs b/Projectiles/AmethystDrillPro.cs index 4e5b0400..fb3dfa64 100644 --- a/Projectiles/AmethystDrillPro.cs +++ b/Projectiles/AmethystDrillPro.cs @@ -4,35 +4,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { - -public class AmethystDrillPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { - - projectile.width = 22; - projectile.height = 22; - projectile.aiStyle = 20; - projectile.friendly = true; - projectile.penetrate = -1; - projectile.tileCollide = false; - projectile.hide = true; - projectile.ownerHitCheck = true; - projectile.melee = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Amethyst Drill"); - - } - - - public override void AI() - { - int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 62, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1.9f); - Main.dust[dust].noGravity = true; - } - -}} + + public class AmethystDrillPro : ModProjectile + { + public override void SetDefaults() + { + + projectile.width = 22; + projectile.height = 22; + projectile.aiStyle = 20; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.hide = true; + projectile.ownerHitCheck = true; + projectile.melee = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Amethyst Drill"); + + } + + + public override void AI() + { + int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 62, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1.9f); + Main.dust[dust].noGravity = true; + } + + } +} diff --git a/Projectiles/AncientClaymorePro.cs b/Projectiles/AncientClaymorePro.cs index 886dd0dc..e6d2a4c1 100644 --- a/Projectiles/AncientClaymorePro.cs +++ b/Projectiles/AncientClaymorePro.cs @@ -5,70 +5,72 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class AncientClaymorePro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class AncientClaymorePro : ModProjectile + { + public override void SetDefaults() + { - projectile.width = 26; - projectile.height = 26; - projectile.aiStyle = 27; - projectile.friendly = true; - projectile.ranged = true; - projectile.penetrate = -1; - projectile.timeLeft = 600; - projectile.light = 0.5f; - projectile.extraUpdates = 1; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - aiType = ProjectileID.Bullet; - } + projectile.width = 26; + projectile.height = 26; + projectile.aiStyle = 27; + projectile.friendly = true; + projectile.ranged = true; + projectile.penetrate = -1; + projectile.timeLeft = 600; + projectile.light = 0.5f; + projectile.extraUpdates = 1; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + aiType = ProjectileID.Bullet; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ancient Claymore Pro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ancient Claymore Pro"); + } - public override void AI() - { - projectile.velocity.Y += projectile.ai[0]; - if(Main.rand.Next(3) == 0) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 64, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); - } - } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - if(Main.rand.Next(1) == 0) - { - target.AddBuff(69, 180, false); - } - } + public override void AI() + { + projectile.velocity.Y += projectile.ai[0]; + if (Main.rand.Next(3) == 0) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 64, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); + } + } - public override void OnHitPvp(Player target, int damage, bool crit) - { - if(Main.rand.Next(1) == 0) - { - target.AddBuff(69, 180, false); - } - } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (Main.rand.Next(1) == 0) + { + target.AddBuff(69, 180, false); + } + } -public override Color? GetAlpha(Color lightColor) -{ -return Color.White; -} + public override void OnHitPvp(Player target, int damage, bool crit) + { + if (Main.rand.Next(1) == 0) + { + target.AddBuff(69, 180, false); + } + } - public override void Kill(int timeLeft) - { - for(int k = 0; k < 40; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 64, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); - } - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); -} + public override Color? GetAlpha(Color lightColor) + { + return Color.White; + } -}} + public override void Kill(int timeLeft) + { + for (int k = 0; k < 40; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 64, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); + } + Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); + } + + } +} diff --git a/Projectiles/AncientDaggerPro.cs b/Projectiles/AncientDaggerPro.cs index ce299426..98c34c05 100644 --- a/Projectiles/AncientDaggerPro.cs +++ b/Projectiles/AncientDaggerPro.cs @@ -4,112 +4,114 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class AncientDaggerPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class AncientDaggerPro : ModProjectile + { + public override void SetDefaults() + { - projectile.friendly = true; - projectile.aiStyle = 1; - projectile.timeLeft = 1200; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; - ProjectileID.Sets.TrailingMode[projectile.type] = 2; - } + projectile.friendly = true; + projectile.aiStyle = 1; + projectile.timeLeft = 1200; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ancient Dagger Pro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ancient Dagger Pro"); - public override void Kill(int timeLeft) -{ - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); - projectile.width = 80; - projectile.height = 80; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - for (int num628 = 0; num628 < 40; num628++) - { - int num629 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); - Main.dust[num629].velocity *= 3f; - if (Main.rand.Next(2) == 0) - { - Main.dust[num629].scale = 0.5f; - Main.dust[num629].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } - for (int num630 = 0; num630 < 70; num630++) - { - int num631 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 3f); - Main.dust[num631].noGravity = true; - Main.dust[num631].velocity *= 5f; - num631 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 2f); - Main.dust[num631].velocity *= 2f; - } - for (int num632 = 0; num632 < 3; num632++) - { - float scaleFactor10 = 0.33f; - if (num632 == 1) - { - scaleFactor10 = 0.66f; - } - if (num632 == 2) - { - scaleFactor10 = 1f; - } - int num633 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); - Main.gore[num633].velocity *= scaleFactor10; - Gore expr_13E6D_cp_0 = Main.gore[num633]; - expr_13E6D_cp_0.velocity.X = expr_13E6D_cp_0.velocity.X + 1f; - Gore expr_13E8D_cp_0 = Main.gore[num633]; - expr_13E8D_cp_0.velocity.Y = expr_13E8D_cp_0.velocity.Y + 1f; - num633 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 2f); - Main.gore[num633].velocity *= scaleFactor10; - Gore expr_13F30_cp_0 = Main.gore[num633]; - expr_13F30_cp_0.velocity.X = expr_13F30_cp_0.velocity.X - 1f; - Gore expr_13F50_cp_0 = Main.gore[num633]; - expr_13F50_cp_0.velocity.Y = expr_13F50_cp_0.velocity.Y + 1f; - num633 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); - Main.gore[num633].velocity *= scaleFactor10; - Gore expr_13FF3_cp_0 = Main.gore[num633]; - expr_13FF3_cp_0.velocity.X = expr_13FF3_cp_0.velocity.X + 1f; - Gore expr_14013_cp_0 = Main.gore[num633]; - expr_14013_cp_0.velocity.Y = expr_14013_cp_0.velocity.Y - 1f; - num633 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); - Main.gore[num633].velocity *= scaleFactor10; - Gore expr_140B6_cp_0 = Main.gore[num633]; - expr_140B6_cp_0.velocity.X = expr_140B6_cp_0.velocity.X - 1f; - Gore expr_140D6_cp_0 = Main.gore[num633]; - expr_140D6_cp_0.velocity.Y = expr_140D6_cp_0.velocity.Y - 1f; - } - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); - projectile.width = 10; - projectile.height = 10; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + } - if (projectile.owner == Main.myPlayer) + public override void Kill(int timeLeft) { - int num220 = Main.rand.Next(3, 8); - for (int num221 = 0; num221 < num220; num221++) + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); + projectile.position.X = projectile.position.X + (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.width = 80; + projectile.height = 80; + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + for (int num628 = 0; num628 < 40; num628++) + { + int num629 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); + Main.dust[num629].velocity *= 3f; + if (Main.rand.Next(2) == 0) + { + Main.dust[num629].scale = 0.5f; + Main.dust[num629].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + } + } + for (int num630 = 0; num630 < 70; num630++) + { + int num631 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 3f); + Main.dust[num631].noGravity = true; + Main.dust[num631].velocity *= 5f; + num631 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 2f); + Main.dust[num631].velocity *= 2f; + } + for (int num632 = 0; num632 < 3; num632++) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("BoomCloudPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + float scaleFactor10 = 0.33f; + if (num632 == 1) + { + scaleFactor10 = 0.66f; + } + if (num632 == 2) + { + scaleFactor10 = 1f; + } + int num633 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num633].velocity *= scaleFactor10; + Gore expr_13E6D_cp_0 = Main.gore[num633]; + expr_13E6D_cp_0.velocity.X = expr_13E6D_cp_0.velocity.X + 1f; + Gore expr_13E8D_cp_0 = Main.gore[num633]; + expr_13E8D_cp_0.velocity.Y = expr_13E8D_cp_0.velocity.Y + 1f; + num633 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 2f); + Main.gore[num633].velocity *= scaleFactor10; + Gore expr_13F30_cp_0 = Main.gore[num633]; + expr_13F30_cp_0.velocity.X = expr_13F30_cp_0.velocity.X - 1f; + Gore expr_13F50_cp_0 = Main.gore[num633]; + expr_13F50_cp_0.velocity.Y = expr_13F50_cp_0.velocity.Y + 1f; + num633 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num633].velocity *= scaleFactor10; + Gore expr_13FF3_cp_0 = Main.gore[num633]; + expr_13FF3_cp_0.velocity.X = expr_13FF3_cp_0.velocity.X + 1f; + Gore expr_14013_cp_0 = Main.gore[num633]; + expr_14013_cp_0.velocity.Y = expr_14013_cp_0.velocity.Y - 1f; + num633 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num633].velocity *= scaleFactor10; + Gore expr_140B6_cp_0 = Main.gore[num633]; + expr_140B6_cp_0.velocity.X = expr_140B6_cp_0.velocity.X - 1f; + Gore expr_140D6_cp_0 = Main.gore[num633]; + expr_140D6_cp_0.velocity.Y = expr_140D6_cp_0.velocity.Y - 1f; + } + projectile.position.X = projectile.position.X + (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.width = 10; + projectile.height = 10; + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + + if (projectile.owner == Main.myPlayer) + { + int num220 = Main.rand.Next(3, 8); + for (int num221 = 0; num221 < num220; num221++) + { + Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value17.Normalize(); + value17 *= (float)Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("BoomCloudPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + } } } -} -public override Color? GetAlpha(Color lightColor) -{ -return Color.White; -} + public override Color? GetAlpha(Color lightColor) + { + return Color.White; + } -}} + } +} diff --git a/Projectiles/AncientDisc.cs b/Projectiles/AncientDisc.cs index e7e050ca..79e73ae6 100644 --- a/Projectiles/AncientDisc.cs +++ b/Projectiles/AncientDisc.cs @@ -5,21 +5,23 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class AncientDisc : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class AncientDisc : ModProjectile + { + public override void SetDefaults() + { projectile.CloneDefaults(106); aiType = 106; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("AncientDisk"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("AncientDisk"); + } -}} + + } +} diff --git a/Projectiles/AncientFlailPro.cs b/Projectiles/AncientFlailPro.cs index d11408a4..3f538752 100644 --- a/Projectiles/AncientFlailPro.cs +++ b/Projectiles/AncientFlailPro.cs @@ -9,70 +9,70 @@ namespace Tremor.Projectiles { - public class AncientFlailPro : ModProjectile - { - public override void SetDefaults() - { + public class AncientFlailPro : ModProjectile + { + public override void SetDefaults() + { - projectile.width = 34; - projectile.height = 34; - projectile.friendly = true; - projectile.penetrate = -1; // Penetrates NPCs infinitely. - projectile.melee = true; // Deals melee dmg. + projectile.width = 34; + projectile.height = 34; + projectile.friendly = true; + projectile.penetrate = -1; // Penetrates NPCs infinitely. + projectile.melee = true; // Deals melee dmg. - projectile.aiStyle = 15; // Set the aiStyle to that of a flail. - } + projectile.aiStyle = 15; // Set the aiStyle to that of a flail. + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ancient Flail"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ancient Flail"); + } - public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Color lightColor) - { - Texture2D texture = ModLoader.GetTexture("Tremor/Projectiles/AncientFlail_Chain"); - Vector2 position = projectile.Center; - Vector2 mountedCenter = Main.player[projectile.owner].MountedCenter; - Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(); - Vector2 origin = new Vector2((float)texture.Width * 0.5f, (float)texture.Height * 0.5f); - float num1 = (float)texture.Height; - Vector2 vector2_4 = mountedCenter - position; - float rotation = (float)Math.Atan2((double)vector2_4.Y, (double)vector2_4.X) - 1.57f; - bool flag = true; - if (float.IsNaN(position.X) && float.IsNaN(position.Y)) - flag = false; - if (float.IsNaN(vector2_4.X) && float.IsNaN(vector2_4.Y)) - flag = false; - while (flag) - { - if ((double)vector2_4.Length() < (double)num1 + 1.0) - { - flag = false; - } - else - { - Vector2 vector2_1 = vector2_4; - vector2_1.Normalize(); - position += vector2_1 * num1; - vector2_4 = mountedCenter - position; - Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)position.X / 16, (int)((double)position.Y / 16.0)); - color2 = projectile.GetAlpha(color2); - Main.spriteBatch.Draw(texture, position - Main.screenPosition, sourceRectangle, color2, rotation, origin, 1f, SpriteEffects.None, 0.0f); - } - } + public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture = ModLoader.GetTexture("Tremor/Projectiles/AncientFlail_Chain"); - return true; - } + Vector2 position = projectile.Center; + Vector2 mountedCenter = Main.player[projectile.owner].MountedCenter; + Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(); + Vector2 origin = new Vector2((float)texture.Width * 0.5f, (float)texture.Height * 0.5f); + float num1 = (float)texture.Height; + Vector2 vector2_4 = mountedCenter - position; + float rotation = (float)Math.Atan2((double)vector2_4.Y, (double)vector2_4.X) - 1.57f; + bool flag = true; + if (float.IsNaN(position.X) && float.IsNaN(position.Y)) + flag = false; + if (float.IsNaN(vector2_4.X) && float.IsNaN(vector2_4.Y)) + flag = false; + while (flag) + { + if ((double)vector2_4.Length() < (double)num1 + 1.0) + { + flag = false; + } + else + { + Vector2 vector2_1 = vector2_4; + vector2_1.Normalize(); + position += vector2_1 * num1; + vector2_4 = mountedCenter - position; + Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)position.X / 16, (int)((double)position.Y / 16.0)); + color2 = projectile.GetAlpha(color2); + Main.spriteBatch.Draw(texture, position - Main.screenPosition, sourceRectangle, color2, rotation, origin, 1f, SpriteEffects.None, 0.0f); + } + } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - if(Main.rand.Next(5) == 0) - { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("AncientSunExplosionPro"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); - } - } - } + return true; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (Main.rand.Next(5) == 0) + { + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("AncientSunExplosionPro"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + } + } + } } diff --git a/Projectiles/AncientShield.cs b/Projectiles/AncientShield.cs index bda19d70..a18831b0 100644 --- a/Projectiles/AncientShield.cs +++ b/Projectiles/AncientShield.cs @@ -11,116 +11,116 @@ namespace Tremor.Projectiles { - public class AncientShield : ModProjectile - { - public override void SetDefaults() - { + public class AncientShield : ModProjectile + { + public override void SetDefaults() + { - projectile.width = 28; - projectile.height = 36; - projectile.friendly = true; - projectile.magic = true; - projectile.penetrate = 2; - projectile.tileCollide = false; - projectile.timeLeft = 660; - projectile.light = 0; - projectile.extraUpdates = 1; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 9; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - Main.projFrames[projectile.type] = 3; - } + projectile.width = 28; + projectile.height = 36; + projectile.friendly = true; + projectile.magic = true; + projectile.penetrate = 2; + projectile.tileCollide = false; + projectile.timeLeft = 660; + projectile.light = 0; + projectile.extraUpdates = 1; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 9; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + Main.projFrames[projectile.type] = 3; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("AncientShield"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("AncientShield"); + } - public override bool PreAI() - { - float Num = 4f; - float Num2 = 1.1f; - int Num3 = 1; - if (projectile.position.X + (float)(projectile.width / 2) < Main.player[projectile.owner].position.X + (float)Main.player[projectile.owner].width) - { - Num3 = -1; - } - Vector2 Vector1 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float Num4 = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) + (float)(Num3 * 180) - Vector1.X; - float Num5 = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - Vector1.Y; - float Num6 = (float)Math.Sqrt((double)(Num4 * Num4 + Num5 * Num5)); - float Num7 = projectile.position.X + (float)(projectile.width / 2) - Main.player[projectile.owner].position.X - (float)(Main.player[projectile.owner].width / 2); - float Num8 = projectile.position.Y + (float)projectile.height - 59f - Main.player[projectile.owner].position.Y - (float)(Main.player[projectile.owner].height / 2); - float Num9 = (float)Math.Atan2((double)Num8, (double)Num7) + 1.57f; - if (Num9 < 0f) - { - Num9 += 6.283f; - } - else if ((double)Num9 > 6.283) - { - Num9 -= 6.283f; - } - float Num10 = 0.15f; - if (projectile.rotation < Num9) - { - if ((double)(Num9 - projectile.rotation) > 3.1415) - { - projectile.rotation -= Num10; - } - else - { - projectile.rotation += Num10; - } - } - else if (projectile.rotation > Num9) - { - if ((double)(projectile.rotation - Num9) > 3.1415) - { - projectile.rotation += Num10; - } - else - { - projectile.rotation -= Num10; - } - } - if (projectile.rotation > Num9 - Num10 && projectile.rotation < Num9 + Num10) - { - projectile.rotation = Num9; - } - if (projectile.rotation < 0f) - { - projectile.rotation += 6.283f; - } - else if ((double)projectile.rotation > 6.283) - { - projectile.rotation -= 6.283f; - } - if (projectile.rotation > Num9 - Num10 && projectile.rotation < Num9 + Num10) - { - projectile.rotation = Num9; - } - projectile.frameCounter++; - if (projectile.frameCounter >= 16) - { - projectile.frame++; - projectile.frameCounter = 0; - if (projectile.frame >= 3) - { - projectile.frame = 0; - } - } - Vector2 direction = Main.player[projectile.owner].Center - projectile.Center; - direction.Normalize(); - direction *= 9f; - Player player = Main.player[projectile.owner]; - double deg = (double)projectile.ai[1] / 2; - double rad = deg * (Math.PI / 180); - double dist = 100; - projectile.position.X = player.Center.X - (int)(Math.Cos(rad) * dist) - projectile.width / 2; - projectile.position.Y = player.Center.Y - (int)(Math.Sin(rad) * dist) - projectile.height / 2; - projectile.ai[1] += 2f; - return false; - } - } + + public override bool PreAI() + { + float Num = 4f; + float Num2 = 1.1f; + int Num3 = 1; + if (projectile.position.X + (float)(projectile.width / 2) < Main.player[projectile.owner].position.X + (float)Main.player[projectile.owner].width) + { + Num3 = -1; + } + Vector2 Vector1 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float Num4 = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) + (float)(Num3 * 180) - Vector1.X; + float Num5 = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - Vector1.Y; + float Num6 = (float)Math.Sqrt((double)(Num4 * Num4 + Num5 * Num5)); + float Num7 = projectile.position.X + (float)(projectile.width / 2) - Main.player[projectile.owner].position.X - (float)(Main.player[projectile.owner].width / 2); + float Num8 = projectile.position.Y + (float)projectile.height - 59f - Main.player[projectile.owner].position.Y - (float)(Main.player[projectile.owner].height / 2); + float Num9 = (float)Math.Atan2((double)Num8, (double)Num7) + 1.57f; + if (Num9 < 0f) + { + Num9 += 6.283f; + } + else if ((double)Num9 > 6.283) + { + Num9 -= 6.283f; + } + float Num10 = 0.15f; + if (projectile.rotation < Num9) + { + if ((double)(Num9 - projectile.rotation) > 3.1415) + { + projectile.rotation -= Num10; + } + else + { + projectile.rotation += Num10; + } + } + else if (projectile.rotation > Num9) + { + if ((double)(projectile.rotation - Num9) > 3.1415) + { + projectile.rotation += Num10; + } + else + { + projectile.rotation -= Num10; + } + } + if (projectile.rotation > Num9 - Num10 && projectile.rotation < Num9 + Num10) + { + projectile.rotation = Num9; + } + if (projectile.rotation < 0f) + { + projectile.rotation += 6.283f; + } + else if ((double)projectile.rotation > 6.283) + { + projectile.rotation -= 6.283f; + } + if (projectile.rotation > Num9 - Num10 && projectile.rotation < Num9 + Num10) + { + projectile.rotation = Num9; + } + projectile.frameCounter++; + if (projectile.frameCounter >= 16) + { + projectile.frame++; + projectile.frameCounter = 0; + if (projectile.frame >= 3) + { + projectile.frame = 0; + } + } + Vector2 direction = Main.player[projectile.owner].Center - projectile.Center; + direction.Normalize(); + direction *= 9f; + Player player = Main.player[projectile.owner]; + double deg = (double)projectile.ai[1] / 2; + double rad = deg * (Math.PI / 180); + double dist = 100; + projectile.position.X = player.Center.X - (int)(Math.Cos(rad) * dist) - projectile.width / 2; + projectile.position.Y = player.Center.Y - (int)(Math.Sin(rad) * dist) - projectile.height / 2; + projectile.ai[1] += 2f; + return false; + } + } } diff --git a/Projectiles/AncientSolarWindPro.cs b/Projectiles/AncientSolarWindPro.cs index ee7e291c..ae7c2441 100644 --- a/Projectiles/AncientSolarWindPro.cs +++ b/Projectiles/AncientSolarWindPro.cs @@ -5,27 +5,28 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class AncientSolarWindPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class AncientSolarWindPro : ModProjectile + { + public override void SetDefaults() + { projectile.CloneDefaults(66); aiType = 66; - projectile.tileCollide = false; - projectile.light = 0.8f; - projectile.penetrate = -1; - } + projectile.tileCollide = false; + projectile.light = 0.8f; + projectile.penetrate = -1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ancient Solar Wind"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ancient Solar Wind"); - public override void AI() - { + } + + public override void AI() + { projectile.light = 0.9f; int DustID = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 2f), projectile.width, projectile.height, 6, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 0.5f); Main.player[projectile.owner].direction = projectile.direction; @@ -47,7 +48,7 @@ public override void AI() projectile.localAI[0] = 1f; if (Collision.CanHit(Main.player[projectile.owner].position, Main.player[projectile.owner].width, Main.player[projectile.owner].height, new Vector2(projectile.Center.X + projectile.velocity.X * projectile.ai[0], projectile.Center.Y + projectile.velocity.Y * projectile.ai[0]), projectile.width, projectile.height)) { - Projectile.NewProjectile(projectile.Center.X + projectile.velocity.X , projectile.Center.Y + projectile.velocity.Y , projectile.velocity.X * 1.5f, projectile.velocity.Y * 1.5f, 85, projectile.damage , projectile.knockBack * 0.85f, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X + projectile.velocity.X, projectile.Center.Y + projectile.velocity.Y, projectile.velocity.X * 1.5f, projectile.velocity.Y * 1.5f, 85, projectile.damage, projectile.knockBack * 0.85f, projectile.owner, 0f, 0f); } } } @@ -55,31 +56,32 @@ public override void AI() { projectile.ai[0] += 0.65f; //How far it goes } - + //Kills projectile once item is done animating if (Main.player[projectile.owner].itemAnimation == 0) { projectile.Kill(); } - + //Rotate spear projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 2.355f; if (projectile.spriteDirection == -1) { projectile.rotation -= 1.57f; } - } + } -public override Color? GetAlpha(Color lightColor) -{ -return Color.White; -} + public override Color? GetAlpha(Color lightColor) + { + return Color.White; + } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - if(Main.rand.Next(2) == 0) - { - target.AddBuff(24, 180, false); - } - } -}} + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (Main.rand.Next(2) == 0) + { + target.AddBuff(24, 180, false); + } + } + } +} diff --git a/Projectiles/AncientSunExplosionPro.cs b/Projectiles/AncientSunExplosionPro.cs index b1706798..33d900bc 100644 --- a/Projectiles/AncientSunExplosionPro.cs +++ b/Projectiles/AncientSunExplosionPro.cs @@ -7,35 +7,35 @@ namespace Tremor.Projectiles { - public class AncientSunExplosionPro : ModProjectile - { - public override void SetDefaults() - { + public class AncientSunExplosionPro : ModProjectile + { + public override void SetDefaults() + { - projectile.width = 250; - projectile.height = 250; - projectile.friendly = true; - projectile.ignoreWater = false; - projectile.tileCollide = false; - projectile.penetrate = -1; - projectile.timeLeft = 150; - projectile.magic = true; - } + projectile.width = 250; + projectile.height = 250; + projectile.friendly = true; + projectile.ignoreWater = false; + projectile.tileCollide = false; + projectile.penetrate = -1; + projectile.timeLeft = 150; + projectile.magic = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("AncientSunExplosionPro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("AncientSunExplosionPro"); + } - public override void AI() - { - Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.75f) / 255f, ((255 - projectile.alpha) * 0.5f) / 255f, ((255 - projectile.alpha) * 0.01f) / 255f); - if (projectile.wet && !projectile.lavaWet) - { - projectile.Kill(); - } + + public override void AI() + { + Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.75f) / 255f, ((255 - projectile.alpha) * 0.5f) / 255f, ((255 - projectile.alpha) * 0.01f) / 255f); + if (projectile.wet && !projectile.lavaWet) + { + projectile.Kill(); + } if (projectile.localAI[0] == 0f) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); @@ -98,11 +98,11 @@ public override void AI() num462++; } return; - } + } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(BuffID.OnFire, 750); - } - } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(BuffID.OnFire, 750); + } + } } diff --git a/Projectiles/AncientSunPro.cs b/Projectiles/AncientSunPro.cs index e9ca238d..54a3b0b8 100644 --- a/Projectiles/AncientSunPro.cs +++ b/Projectiles/AncientSunPro.cs @@ -7,33 +7,33 @@ namespace Tremor.Projectiles { - public class AncientSunPro : ModProjectile - { - public override void SetDefaults() - { + public class AncientSunPro : ModProjectile + { + public override void SetDefaults() + { - projectile.width = 26; - projectile.height = 26; - projectile.friendly = true; - projectile.penetrate = 3; - projectile.timeLeft = 600; - projectile.magic = true; - } + projectile.width = 26; + projectile.height = 26; + projectile.friendly = true; + projectile.penetrate = 3; + projectile.timeLeft = 600; + projectile.magic = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ancient Sun Pro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ancient Sun Pro"); + } - public override void AI() - { - Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.25f) / 255f, ((255 - projectile.alpha) * 0.2f) / 255f, ((255 - projectile.alpha) * 0.01f) / 255f); - if (projectile.wet && !projectile.lavaWet) - { - projectile.Kill(); - } + + public override void AI() + { + Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.25f) / 255f, ((255 - projectile.alpha) * 0.2f) / 255f, ((255 - projectile.alpha) * 0.01f) / 255f); + if (projectile.wet && !projectile.lavaWet) + { + projectile.Kill(); + } if (projectile.localAI[0] == 0f) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); @@ -47,38 +47,38 @@ public override void AI() Main.dust[num458].velocity += projectile.velocity * 0.1f; } return; - } - - public override bool OnTileCollide(Vector2 oldVelocity) - { - projectile.penetrate--; - if (projectile.penetrate <= 0) - { - projectile.Kill(); - } - else - { - projectile.ai[0] += 0.1f; - if (projectile.velocity.X != oldVelocity.X) - { - projectile.velocity.X = -oldVelocity.X; - } - if (projectile.velocity.Y != oldVelocity.Y) - { - projectile.velocity.Y = -oldVelocity.Y; - } - } - return false; - } - - public override void Kill(int timeLeft) - { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("AncientSunExplosionPro"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); - } + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + projectile.penetrate--; + if (projectile.penetrate <= 0) + { + projectile.Kill(); + } + else + { + projectile.ai[0] += 0.1f; + if (projectile.velocity.X != oldVelocity.X) + { + projectile.velocity.X = -oldVelocity.X; + } + if (projectile.velocity.Y != oldVelocity.Y) + { + projectile.velocity.Y = -oldVelocity.Y; + } + } + return false; + } + + public override void Kill(int timeLeft) + { + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("AncientSunExplosionPro"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(BuffID.OnFire, 750); - } - } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(BuffID.OnFire, 750); + } + } } diff --git a/Projectiles/AngelTearsPro.cs b/Projectiles/AngelTearsPro.cs index d9e585b1..cdc1d90f 100644 --- a/Projectiles/AngelTearsPro.cs +++ b/Projectiles/AngelTearsPro.cs @@ -7,32 +7,32 @@ namespace Tremor.Projectiles { - public class AngelTearsPro : ModProjectile - { - - public override void SetDefaults() - { + public class AngelTearsPro : ModProjectile + { - projectile.width = 16; - projectile.height = 16; - projectile.friendly = true; - projectile.alpha = 255; - projectile.penetrate = 4; - projectile.timeLeft /= 2; - projectile.magic = true; - } + public override void SetDefaults() + { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Angel Tears"); - - } + projectile.width = 16; + projectile.height = 16; + projectile.friendly = true; + projectile.alpha = 255; + projectile.penetrate = 4; + projectile.timeLeft /= 2; + projectile.magic = true; + } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Angel Tears"); - public override void AI() - { - Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.45f) / 255f, ((255 - projectile.alpha) * 0.2f) / 255f, ((255 - projectile.alpha) * 0.1f) / 255f); - for (int num92 = 0; num92 < 5; num92++) + } + + + public override void AI() + { + Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.45f) / 255f, ((255 - projectile.alpha) * 0.2f) / 255f, ((255 - projectile.alpha) * 0.1f) / 255f); + for (int num92 = 0; num92 < 5; num92++) { float num93 = projectile.velocity.X / 3f * (float)num92; float num94 = projectile.velocity.Y / 3f * (float)num92; @@ -66,39 +66,39 @@ public override void AI() projectile.velocity.Y = 16f; return; } - } - - public override bool OnTileCollide(Vector2 oldVelocity) - { - projectile.penetrate--; - if (projectile.penetrate <= 0) - { - projectile.Kill(); - } - else - { - projectile.ai[0] += 0.1f; - if (projectile.velocity.X != oldVelocity.X) - { - projectile.velocity.X = -oldVelocity.X; - } - if (projectile.velocity.Y != oldVelocity.Y) - { - projectile.velocity.Y = -oldVelocity.Y; - } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); - } - return false; - } + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + projectile.penetrate--; + if (projectile.penetrate <= 0) + { + projectile.Kill(); + } + else + { + projectile.ai[0] += 0.1f; + if (projectile.velocity.X != oldVelocity.X) + { + projectile.velocity.X = -oldVelocity.X; + } + if (projectile.velocity.Y != oldVelocity.Y) + { + projectile.velocity.Y = -oldVelocity.Y; + } + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + } + return false; + } - public override void Kill(int timeLeft) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); - for (int k = 0; k < 5; k++) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 57, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); - } - } + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10); + for (int k = 0; k < 5; k++) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 57, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f); + } + } - } + } } diff --git a/Projectiles/AnnoyingDog.cs b/Projectiles/AnnoyingDog.cs index 597763a2..248e71ec 100644 --- a/Projectiles/AnnoyingDog.cs +++ b/Projectiles/AnnoyingDog.cs @@ -14,16 +14,16 @@ public override void SetDefaults() aiType = ProjectileID.Bunny; Main.projFrames[projectile.type] = 8; - projectile.width = 46; - projectile.height = 38; + projectile.width = 46; + projectile.height = 38; Main.projPet[projectile.type] = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Annoying Dog"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Annoying Dog"); + + } public override bool PreAI() diff --git a/Projectiles/ArgiteSpherePro.cs b/Projectiles/ArgiteSpherePro.cs index 8e50983c..9f7e7c80 100644 --- a/Projectiles/ArgiteSpherePro.cs +++ b/Projectiles/ArgiteSpherePro.cs @@ -5,96 +5,98 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class ArgiteSpherePro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { - - projectile.width = 36; - projectile.height = 36; - projectile.aiStyle = 14; - projectile.friendly = true; - projectile.magic = true; - projectile.penetrate = 5; - projectile.timeLeft = 600; - projectile.light = 0.6f; - } + public class ArgiteSpherePro : ModProjectile + { + public override void SetDefaults() + { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Argite Sphere"); - - } + projectile.width = 36; + projectile.height = 36; + projectile.aiStyle = 14; + projectile.friendly = true; + projectile.magic = true; + projectile.penetrate = 5; + projectile.timeLeft = 600; + projectile.light = 0.6f; + } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Argite Sphere"); + } - public override bool OnTileCollide(Vector2 oldVelocity) - { - projectile.penetrate--; - if(projectile.penetrate <= 0) - { - projectile.velocity.Y = -oldVelocity.Y; - } - else - { - projectile.ai[0] += 0.1f; - if(projectile.velocity.X != oldVelocity.X) - { - projectile.velocity.X = -oldVelocity.X; - } - if(projectile.velocity.Y != oldVelocity.Y) - { - projectile.velocity.Y = -oldVelocity.Y; - } - projectile.velocity *= 0.75f; - } - return false; - } - public override void AI() - { - if(Main.rand.Next(3) == 0) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 44, projectile.velocity.X * 0.6f, projectile.velocity.Y * 0.6f); - } - } - public override void Kill(int timeLeft) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 8); - for (int num158 = 0; num158 < 20; num158++) + public override bool OnTileCollide(Vector2 oldVelocity) { - int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 44, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); - if (Main.rand.Next(3) == 0) + projectile.penetrate--; + if (projectile.penetrate <= 0) { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].type++; + projectile.velocity.Y = -oldVelocity.Y; } else { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + projectile.ai[0] += 0.1f; + if (projectile.velocity.X != oldVelocity.X) + { + projectile.velocity.X = -oldVelocity.X; + } + if (projectile.velocity.Y != oldVelocity.Y) + { + projectile.velocity.Y = -oldVelocity.Y; + } + projectile.velocity *= 0.75f; } - Main.dust[num159].noGravity = true; - Main.dust[num159].velocity *= 2.5f; - Main.dust[num159].velocity -= projectile.oldVelocity / 10f; + return false; } - if (Main.myPlayer == projectile.owner) + + public override void AI() { - int num160 = Main.rand.Next(0, 0); - for (int num161 = 0; num161 < num160; num161++) + if (Main.rand.Next(3) == 0) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 44, projectile.velocity.X * 0.6f, projectile.velocity.Y * 0.6f); + } + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 8); + for (int num158 = 0; num158 < 20; num158++) + { + int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 44, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); + if (Main.rand.Next(3) == 0) + { + Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].type++; + } + else + { + Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + } + Main.dust[num159].noGravity = true; + Main.dust[num159].velocity *= 2.5f; + Main.dust[num159].velocity -= projectile.oldVelocity / 10f; + } + if (Main.myPlayer == projectile.owner) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value12.X == 0f && value12.Y == 0f) + int num160 = Main.rand.Next(0, 0); + for (int num161 = 0; num161 < num160; num161++) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + while (value12.X == 0f && value12.Y == 0f) + { + value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + } + value12.Normalize(); + value12 *= (float)Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); } - value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); } } - } -}} + } +} diff --git a/Projectiles/AvengerPro.cs b/Projectiles/AvengerPro.cs index add113d5..a84521b2 100644 --- a/Projectiles/AvengerPro.cs +++ b/Projectiles/AvengerPro.cs @@ -10,19 +10,19 @@ public class AvengerPro : ModProjectile { public override void SetDefaults() { - projectile.CloneDefaults(542); + projectile.CloneDefaults(542); projectile.width = 16; projectile.height = 16; - projectile.timeLeft = 220; + projectile.timeLeft = 220; projectile.friendly = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Avenger Pro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Avenger Pro"); + + } } diff --git a/Projectiles/AxeofExecutionerPro.cs b/Projectiles/AxeofExecutionerPro.cs index 5deddbb7..53373baf 100644 --- a/Projectiles/AxeofExecutionerPro.cs +++ b/Projectiles/AxeofExecutionerPro.cs @@ -5,23 +5,25 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class AxeofExecutionerPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class AxeofExecutionerPro : ModProjectile + { + public override void SetDefaults() + { projectile.CloneDefaults(182); projectile.width = 29; projectile.height = 29; aiType = 182; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("AxeofExecutioner"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("AxeofExecutioner"); + } -}} + + } +} diff --git a/Projectiles/BallChainPro.cs b/Projectiles/BallChainPro.cs index a854f765..e442f5a1 100644 --- a/Projectiles/BallChainPro.cs +++ b/Projectiles/BallChainPro.cs @@ -9,79 +9,80 @@ namespace Tremor.Projectiles { - public class BallChainPro : ModProjectile - { - const float RotationSpeed = 0.05f; - const float Distanse = 320; + public class BallChainPro : ModProjectile + { + const float RotationSpeed = 0.05f; + const float Distanse = 320; - float Rotation = 0; + float Rotation = 0; - public override void SetDefaults() - { + public override void SetDefaults() + { - projectile.width = 48; - projectile.height = 48; - projectile.timeLeft = 6; - projectile.melee = true; - projectile.aiStyle = -1; - projectile.penetrate = -1; - projectile.tileCollide = false; - projectile.ignoreWater = true; - } + projectile.width = 48; + projectile.height = 48; + projectile.timeLeft = 6; + projectile.melee = true; + projectile.aiStyle = -1; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.ignoreWater = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ball n Chain"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ball n Chain"); + } - public override void AI() - { - Rotation += RotationSpeed; - projectile.Center = Helper.PolarPos(Main.LocalPlayer.Center, Distanse, Helper.GradtoRad(Rotation)); - projectile.rotation = Helper.rotateBetween2Points(Main.LocalPlayer.Center, projectile.Center) - Helper.GradtoRad(90); - } - public override bool? CanHitNPC(NPC target) - { - return !target.friendly; - } + public override void AI() + { + Rotation += RotationSpeed; + projectile.Center = Helper.PolarPos(Main.LocalPlayer.Center, Distanse, Helper.GradtoRad(Rotation)); + projectile.rotation = Helper.rotateBetween2Points(Main.LocalPlayer.Center, projectile.Center) - Helper.GradtoRad(90); + } - public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Color lightColor) - { - Texture2D texture = ModLoader.GetTexture("Tremor/Projectiles/BallChain_Chain"); + public override bool? CanHitNPC(NPC target) + { + return !target.friendly; + } - Vector2 position = projectile.Center; - Vector2 mountedCenter = Main.player[projectile.owner].MountedCenter; - Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(); - Vector2 origin = new Vector2((float)texture.Width * 0.5f, (float)texture.Height * 0.5f); - float num1 = (float)texture.Height; - Vector2 vector2_4 = mountedCenter - position; - float rotation = (float)Math.Atan2((double)vector2_4.Y, (double)vector2_4.X) - 1.57f; - bool flag = true; - if (float.IsNaN(position.X) && float.IsNaN(position.Y)) - flag = false; - if (float.IsNaN(vector2_4.X) && float.IsNaN(vector2_4.Y)) - flag = false; - while (flag) - { - if ((double)vector2_4.Length() < (double)num1 + 1.0) - { - flag = false; - } - else - { - Vector2 vector2_1 = vector2_4; - vector2_1.Normalize(); - position += vector2_1 * num1; - vector2_4 = mountedCenter - position; - Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)position.X / 16, (int)((double)position.Y / 16.0)); - color2 = projectile.GetAlpha(color2); - Main.spriteBatch.Draw(texture, position - Main.screenPosition, sourceRectangle, color2, rotation, origin, 1f, SpriteEffects.None, 0.0f); - } - } - return true; - } -}} + public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture = ModLoader.GetTexture("Tremor/Projectiles/BallChain_Chain"); + + Vector2 position = projectile.Center; + Vector2 mountedCenter = Main.player[projectile.owner].MountedCenter; + Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(); + Vector2 origin = new Vector2((float)texture.Width * 0.5f, (float)texture.Height * 0.5f); + float num1 = (float)texture.Height; + Vector2 vector2_4 = mountedCenter - position; + float rotation = (float)Math.Atan2((double)vector2_4.Y, (double)vector2_4.X) - 1.57f; + bool flag = true; + if (float.IsNaN(position.X) && float.IsNaN(position.Y)) + flag = false; + if (float.IsNaN(vector2_4.X) && float.IsNaN(vector2_4.Y)) + flag = false; + while (flag) + { + if ((double)vector2_4.Length() < (double)num1 + 1.0) + { + flag = false; + } + else + { + Vector2 vector2_1 = vector2_4; + vector2_1.Normalize(); + position += vector2_1 * num1; + vector2_4 = mountedCenter - position; + Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)position.X / 16, (int)((double)position.Y / 16.0)); + color2 = projectile.GetAlpha(color2); + Main.spriteBatch.Draw(texture, position - Main.screenPosition, sourceRectangle, color2, rotation, origin, 1f, SpriteEffects.None, 0.0f); + } + } + return true; + } + } +} diff --git a/Projectiles/BerserkerPro.cs b/Projectiles/BerserkerPro.cs index 32094712..a7c462f3 100644 --- a/Projectiles/BerserkerPro.cs +++ b/Projectiles/BerserkerPro.cs @@ -4,43 +4,43 @@ namespace Tremor.Projectiles { - public class BerserkerPro : ModProjectile - { - const float RotationSpeed = 0.05f; - const float Distanse = 48; - - float Rotation = 0; - - public override void SetDefaults() - { - - projectile.width = 18; - projectile.height = 34; - projectile.timeLeft = 6; - projectile.melee = true; - projectile.aiStyle = -1; - projectile.penetrate = -1; - projectile.tileCollide = false; - projectile.ignoreWater = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Berserker Sword"); - - } - - - public override void AI() - { - Rotation += RotationSpeed; - projectile.Center = Helper.PolarPos(Terraria.Main.player[(int)projectile.ai[0]].Center, Distanse, Helper.GradtoRad(Rotation)); - projectile.rotation = Helper.rotateBetween2Points(Terraria.Main.player[(int)projectile.ai[0]].Center, projectile.Center) - Helper.GradtoRad(90); - } - - public override bool? CanHitNPC(NPC target) - { - return !target.friendly; - } - } + public class BerserkerPro : ModProjectile + { + const float RotationSpeed = 0.05f; + const float Distanse = 48; + + float Rotation = 0; + + public override void SetDefaults() + { + + projectile.width = 18; + projectile.height = 34; + projectile.timeLeft = 6; + projectile.melee = true; + projectile.aiStyle = -1; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.ignoreWater = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Berserker Sword"); + + } + + + public override void AI() + { + Rotation += RotationSpeed; + projectile.Center = Helper.PolarPos(Terraria.Main.player[(int)projectile.ai[0]].Center, Distanse, Helper.GradtoRad(Rotation)); + projectile.rotation = Helper.rotateBetween2Points(Terraria.Main.player[(int)projectile.ai[0]].Center, projectile.Center) - Helper.GradtoRad(90); + } + + public override bool? CanHitNPC(NPC target) + { + return !target.friendly; + } + } } diff --git a/Projectiles/BestNightmarePro.cs b/Projectiles/BestNightmarePro.cs index 7ea1be43..3f0a3e67 100644 --- a/Projectiles/BestNightmarePro.cs +++ b/Projectiles/BestNightmarePro.cs @@ -5,98 +5,100 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class BestNightmarePro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class BestNightmarePro : ModProjectile + { + public override void SetDefaults() + { projectile.CloneDefaults(106); aiType = 106; - projectile.width = 54; - projectile.height = 54; - } + projectile.width = 54; + projectile.height = 54; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("BestNightmarePro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("BestNightmarePro"); + } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Vector2 drawOrigin = new Vector2(Main.projectileTexture[projectile.type].Width * 0.5f, projectile.height * 0.5f); - for(int k = 0; k < projectile.oldPos.Length; k++) - { - Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); - Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); - spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); - } - return true; - } - public override void AI() - { - projectile.rotation = (float)System.Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; - if(Main.rand.Next(1) == 0) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 62, projectile.velocity.X * 0.9f, projectile.velocity.Y * 0.9f); - } - if(Main.rand.Next(2) == 0) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 59, projectile.velocity.X * 0.9f, projectile.velocity.Y * 0.9f); - } - if(Main.rand.Next(2) == 0) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 61, projectile.velocity.X * 0.9f, projectile.velocity.Y * 0.9f); - } - Vector2 vector63 = Main.player[projectile.owner].Center - projectile.Center; - if (Main.player[projectile.owner].dead) + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Vector2 drawOrigin = new Vector2(Main.projectileTexture[projectile.type].Width * 0.5f, projectile.height * 0.5f); + for (int k = 0; k < projectile.oldPos.Length; k++) + { + Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); + Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); + spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); + } + return true; + } + + public override void AI() + { + projectile.rotation = (float)System.Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + if (Main.rand.Next(1) == 0) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 62, projectile.velocity.X * 0.9f, projectile.velocity.Y * 0.9f); + } + if (Main.rand.Next(2) == 0) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 59, projectile.velocity.X * 0.9f, projectile.velocity.Y * 0.9f); + } + if (Main.rand.Next(2) == 0) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 61, projectile.velocity.X * 0.9f, projectile.velocity.Y * 0.9f); + } + Vector2 vector63 = Main.player[projectile.owner].Center - projectile.Center; + if (Main.player[projectile.owner].dead) + { + projectile.Kill(); + return; + } + if (projectile.ai[0] == 0f && vector63.Length() > 400f) + { + projectile.ai[0] = 1f; + } + if (projectile.ai[0] == 1f || projectile.ai[0] == 2f) + { + float num810 = vector63.Length(); + if (num810 > 1500f) { projectile.Kill(); return; } - if (projectile.ai[0] == 0f && vector63.Length() > 400f) + if (num810 > 600f) { - projectile.ai[0] = 1f; + projectile.ai[0] = 2f; } - if (projectile.ai[0] == 1f || projectile.ai[0] == 2f) + float num811 = 20f; + if (projectile.ai[0] == 2f) { - float num810 = vector63.Length(); - if (num810 > 1500f) - { - projectile.Kill(); - return; - } - if (num810 > 600f) - { - projectile.ai[0] = 2f; - } - float num811 = 20f; - if (projectile.ai[0] == 2f) - { - num811 = 40f; - } - if (vector63.Length() < num811) - { - projectile.Kill(); - return; - } + num811 = 40f; } - projectile.ai[1] += 1f; - if (projectile.ai[1] > 5f) + if (vector63.Length() < num811) { - projectile.alpha = 0; + projectile.Kill(); + return; } - if ((int)projectile.ai[1] % 3 == 0 && projectile.owner == Main.myPlayer) - { - Vector2 vector64 = vector63 * -1f; - vector64.Normalize(); - vector64 *= (float)Main.rand.Next(5, 25) * 0.9f; + } + projectile.ai[1] += 1f; + if (projectile.ai[1] > 5f) + { + projectile.alpha = 0; + } + if ((int)projectile.ai[1] % 3 == 0 && projectile.owner == Main.myPlayer) + { + Vector2 vector64 = vector63 * -1f; + vector64.Normalize(); + vector64 *= (float)Main.rand.Next(5, 25) * 0.9f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vector64.X, vector64.Y, mod.ProjectileType("ChaosStarPro"), projectile.damage/3, projectile.knockBack, projectile.owner, -10f, 0f); - } - } -}} + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vector64.X, vector64.Y, mod.ProjectileType("ChaosStarPro"), projectile.damage / 3, projectile.knockBack, projectile.owner, -10f, 0f); + } + } + } +} diff --git a/Projectiles/BicholmereSpearPro.cs b/Projectiles/BicholmereSpearPro.cs index 427850b3..d356920a 100644 --- a/Projectiles/BicholmereSpearPro.cs +++ b/Projectiles/BicholmereSpearPro.cs @@ -5,40 +5,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class BicholmereSpearPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class BicholmereSpearPro : ModProjectile + { + public override void SetDefaults() + { - projectile.width = 3; - projectile.height = 11; - projectile.friendly = true; - projectile.aiStyle = 1; - projectile.timeLeft = 1200; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; - ProjectileID.Sets.TrailingMode[projectile.type] = 2; - } + projectile.width = 3; + projectile.height = 11; + projectile.friendly = true; + projectile.aiStyle = 1; + projectile.timeLeft = 1200; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bicholmere Spear"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bicholmere Spear"); + } - public override void Kill(int timeLeft) - { - for(int k = 0; k < 5; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 37, projectile.oldVelocity.X * 0.1f, projectile.oldVelocity.Y * 0.1f); - } - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); - } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - projectile.ai[0] += 0.1f; - projectile.velocity *= 0.75f; - } -}} + public override void Kill(int timeLeft) + { + for (int k = 0; k < 5; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 37, projectile.oldVelocity.X * 0.1f, projectile.oldVelocity.Y * 0.1f); + } + Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + projectile.ai[0] += 0.1f; + projectile.velocity *= 0.75f; + } + } +} diff --git a/Projectiles/BigPlague.cs b/Projectiles/BigPlague.cs index 76af423e..56afff95 100644 --- a/Projectiles/BigPlague.cs +++ b/Projectiles/BigPlague.cs @@ -5,25 +5,26 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class BigPlague : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class BigPlague : ModProjectile + { + public override void SetDefaults() + { projectile.CloneDefaults(566); aiType = 566; - projectile.tileCollide = false; - Main.projFrames[projectile.type] = 4; - projectile.width = 40; - projectile.height = 32; - } + projectile.tileCollide = false; + Main.projFrames[projectile.type] = 4; + projectile.width = 40; + projectile.height = 32; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("BigPlague"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("BigPlague"); + + } public override Color? GetAlpha(Color lightColor) @@ -31,13 +32,13 @@ public override void SetStaticDefaults() return Color.White; } - public override void Kill(int timeLeft) - { - int ses=Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PlagueBlast"), projectile.damage * 2, 0.7f, projectile.owner); - Main.projectile[ses].scale = projectile.scale; - } - public override void AI() - { + public override void Kill(int timeLeft) + { + int ses = Projectile.NewProjectile(projectile.position.X, projectile.position.Y, 0, 0, mod.ProjectileType("PlagueBlast"), projectile.damage * 2, 0.7f, projectile.owner); + Main.projectile[ses].scale = projectile.scale; + } + public override void AI() + { projectile.frameCounter++; if (projectile.frameCounter > 2) { @@ -45,9 +46,10 @@ public override void AI() projectile.frameCounter = 0; } if (projectile.frame >= 4) - {projectile.frame = 0;} + { projectile.frame = 0; } - } -}} + } + } +} diff --git a/Projectiles/BlackRosePro.cs b/Projectiles/BlackRosePro.cs index 6ce549e1..8a584332 100644 --- a/Projectiles/BlackRosePro.cs +++ b/Projectiles/BlackRosePro.cs @@ -4,48 +4,50 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -//ported from my tAPI mod because I don't want to make artwork -public class BlackRosePro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { - - projectile.width = 22; - projectile.height = 22; - projectile.aiStyle = 6; - projectile.friendly = true; - projectile.penetrate = -1; - projectile.tileCollide = true; - projectile.magic = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Black Rose Pro"); - - } - - - public override void AI() - { - int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 54, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1.9f); - Main.dust[dust].noGravity = true; - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - if(Main.rand.Next(10) == 0) - { - target.AddBuff(BuffID.OnFire, 180, false); - } - } - - public override void OnHitPvp(Player target, int damage, bool crit) - { - if(Main.rand.Next(10) == 0) - { - target.AddBuff(BuffID.OnFire, 180, false); - } - } -}} + //ported from my tAPI mod because I don't want to make artwork + public class BlackRosePro : ModProjectile + { + public override void SetDefaults() + { + + projectile.width = 22; + projectile.height = 22; + projectile.aiStyle = 6; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.tileCollide = true; + projectile.magic = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Black Rose Pro"); + + } + + + public override void AI() + { + int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 54, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1.9f); + Main.dust[dust].noGravity = true; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (Main.rand.Next(10) == 0) + { + target.AddBuff(BuffID.OnFire, 180, false); + } + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + if (Main.rand.Next(10) == 0) + { + target.AddBuff(BuffID.OnFire, 180, false); + } + } + } +} diff --git a/Projectiles/BloodyArrow.cs b/Projectiles/BloodyArrow.cs index 8fadfc3b..cbd5549e 100644 --- a/Projectiles/BloodyArrow.cs +++ b/Projectiles/BloodyArrow.cs @@ -22,82 +22,82 @@ public override void SetDefaults() aiType = 36; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("BloodyArrow"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("BloodyArrow"); + + } + - public override Color? GetAlpha(Color lightColor) { return Color.White; } - - public override void Kill(int timeLeft) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 64); - for (int num158 = 0; num158 < 20; num158++) + + public override void Kill(int timeLeft) { - int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); - if (Main.rand.Next(3) == 0) + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 64); + for (int num158 = 0; num158 < 20; num158++) { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].type++; - } - else - { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); + if (Main.rand.Next(3) == 0) + { + Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].type++; + } + else + { + Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + } + Main.dust[num159].noGravity = true; + Main.dust[num159].velocity *= 2.5f; + Main.dust[num159].velocity -= projectile.oldVelocity / 10f; } - Main.dust[num159].noGravity = true; - Main.dust[num159].velocity *= 2.5f; - Main.dust[num159].velocity -= projectile.oldVelocity / 10f; - } - if (Main.myPlayer == projectile.owner) - { - int num160 = Main.rand.Next(0, 0); - for (int num161 = 0; num161 < num160; num161++) + if (Main.myPlayer == projectile.owner) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value12.X == 0f && value12.Y == 0f) + int num160 = Main.rand.Next(0, 0); + for (int num161 = 0; num161 < num160; num161++) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + while (value12.X == 0f && value12.Y == 0f) + { + value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + } + value12.Normalize(); + value12 *= (float)Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); } - value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); } } - } - public override void AI() - { - if (projectile.localAI[0] == 0f) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); - } - projectile.localAI[0] += 1f; - if (projectile.localAI[0] > 3f) + public override void AI() { - int num90 = 1; - if (projectile.localAI[0] > 5f) + if (projectile.localAI[0] == 0f) { - num90 = 2; + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); } - for (int num91 = 0; num91 < num90; num91++) + projectile.localAI[0] += 1f; + if (projectile.localAI[0] > 3f) { - int num92 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 2f), projectile.width, projectile.height, 5, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.1f, 100, default(Color), 0.4f); - Main.dust[num92].noGravity = true; - Dust expr_46AC_cp_0 = Main.dust[num92]; - expr_46AC_cp_0.velocity.X = expr_46AC_cp_0.velocity.X * 0.3f; - Dust expr_46CA_cp_0 = Main.dust[num92]; - expr_46CA_cp_0.velocity.Y = expr_46CA_cp_0.velocity.Y * 0.3f; - Main.dust[num92].noLight = true; + int num90 = 1; + if (projectile.localAI[0] > 5f) + { + num90 = 2; + } + for (int num91 = 0; num91 < num90; num91++) + { + int num92 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 2f), projectile.width, projectile.height, 5, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.1f, 100, default(Color), 0.4f); + Main.dust[num92].noGravity = true; + Dust expr_46AC_cp_0 = Main.dust[num92]; + expr_46AC_cp_0.velocity.X = expr_46AC_cp_0.velocity.X * 0.3f; + Dust expr_46CA_cp_0 = Main.dust[num92]; + expr_46CA_cp_0.velocity.Y = expr_46CA_cp_0.velocity.Y * 0.3f; + Main.dust[num92].noLight = true; + } } } - } } } diff --git a/Projectiles/BoneBoltPro.cs b/Projectiles/BoneBoltPro.cs index 6df3a616..83ca9954 100644 --- a/Projectiles/BoneBoltPro.cs +++ b/Projectiles/BoneBoltPro.cs @@ -5,40 +5,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class BoneBoltPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class BoneBoltPro : ModProjectile + { + public override void SetDefaults() + { - projectile.width = 6; - projectile.height = 6; - projectile.friendly = true; - projectile.aiStyle = 1; - projectile.timeLeft = 1200; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 3; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - } + projectile.width = 6; + projectile.height = 6; + projectile.friendly = true; + projectile.aiStyle = 1; + projectile.timeLeft = 1200; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 3; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bone Bolt"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bone Bolt"); + } - public override void Kill(int timeLeft) - { - for(int k = 0; k < 5; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 26, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); - } - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); - } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - projectile.ai[0] += 0.1f; - projectile.velocity *= 0.75f; - } -}} + public override void Kill(int timeLeft) + { + for (int k = 0; k < 5; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 26, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); + } + Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + projectile.ai[0] += 0.1f; + projectile.velocity *= 0.75f; + } + } +} diff --git a/Projectiles/BoneKnifePro.cs b/Projectiles/BoneKnifePro.cs index 127c48a4..5c15c587 100644 --- a/Projectiles/BoneKnifePro.cs +++ b/Projectiles/BoneKnifePro.cs @@ -5,40 +5,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class BoneKnifePro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class BoneKnifePro : ModProjectile + { + public override void SetDefaults() + { - projectile.width = 14; - projectile.height = 32; - projectile.friendly = true; - projectile.aiStyle = 1; - projectile.timeLeft = 1200; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; - ProjectileID.Sets.TrailingMode[projectile.type] = 2; - } + projectile.width = 14; + projectile.height = 32; + projectile.friendly = true; + projectile.aiStyle = 1; + projectile.timeLeft = 1200; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bone Knife"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bone Knife"); + } - public override void Kill(int timeLeft) - { - for(int k = 0; k < 5; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 1, projectile.oldVelocity.X * 0.1f, projectile.oldVelocity.Y * 0.1f); - } - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); - } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - projectile.ai[0] += 0.1f; - projectile.velocity *= 0.75f; - } -}} + public override void Kill(int timeLeft) + { + for (int k = 0; k < 5; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 1, projectile.oldVelocity.X * 0.1f, projectile.oldVelocity.Y * 0.1f); + } + Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + projectile.ai[0] += 0.1f; + projectile.velocity *= 0.75f; + } + } +} diff --git a/Projectiles/BoneSpike.cs b/Projectiles/BoneSpike.cs index 68a990bf..4598de49 100644 --- a/Projectiles/BoneSpike.cs +++ b/Projectiles/BoneSpike.cs @@ -5,35 +5,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class BoneSpike : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class BoneSpike : ModProjectile + { + public override void SetDefaults() + { - projectile.width = 22; - projectile.height = 22; - projectile.aiStyle = 14; - projectile.friendly = true; - projectile.ranged = true; - projectile.penetrate = 5; - projectile.timeLeft = 1500; - projectile.extraUpdates = 1; - } + projectile.width = 22; + projectile.height = 22; + projectile.aiStyle = 14; + projectile.friendly = true; + projectile.ranged = true; + projectile.penetrate = 5; + projectile.timeLeft = 1500; + projectile.extraUpdates = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bone Spike"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bone Spike"); + } - public override void Kill(int timeLeft) - { - for(int k = 0; k < 40; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 26, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); - } - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); + + public override void Kill(int timeLeft) + { + for (int k = 0; k < 40; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 26, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); + } + Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); + } + } } -}} diff --git a/Projectiles/BonecrusherPro.cs b/Projectiles/BonecrusherPro.cs index a4b526e5..8c467e4d 100644 --- a/Projectiles/BonecrusherPro.cs +++ b/Projectiles/BonecrusherPro.cs @@ -5,23 +5,25 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class BonecrusherPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class BonecrusherPro : ModProjectile + { + public override void SetDefaults() + { projectile.CloneDefaults(182); projectile.width = 29; projectile.height = 29; aiType = 182; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("BonecrusherPro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("BonecrusherPro"); + } -}} + + } +} diff --git a/Projectiles/BoonerangPro.cs b/Projectiles/BoonerangPro.cs index 2a794bea..abf90e12 100644 --- a/Projectiles/BoonerangPro.cs +++ b/Projectiles/BoonerangPro.cs @@ -5,21 +5,23 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class BoonerangPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class BoonerangPro : ModProjectile + { + public override void SetDefaults() + { projectile.CloneDefaults(106); aiType = 106; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("BoonerangPro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("BoonerangPro"); + } -}} + + } +} diff --git a/Projectiles/Bounce.cs b/Projectiles/Bounce.cs index 6a73947a..6250274b 100644 --- a/Projectiles/Bounce.cs +++ b/Projectiles/Bounce.cs @@ -5,31 +5,31 @@ namespace Tremor.Projectiles { - public class Bounce : ModProjectile - { - public override void SetDefaults() - { + public class Bounce : ModProjectile + { + public override void SetDefaults() + { - projectile.width = 16; - projectile.height = 16; - projectile.friendly = true; - projectile.magic = true; - projectile.penetrate = 5; - projectile.timeLeft = 99999; - projectile.aiStyle = 1; - projectile.tileCollide = true; - projectile.ignoreWater = true; - } + projectile.width = 16; + projectile.height = 16; + projectile.friendly = true; + projectile.magic = true; + projectile.penetrate = 5; + projectile.timeLeft = 99999; + projectile.aiStyle = 1; + projectile.tileCollide = true; + projectile.ignoreWater = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bounce"); + + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Bounce"); - - } - float smooth = 2f; - + public override bool OnTileCollide(Vector2 oldVelocity) { projectile.penetrate--; @@ -51,12 +51,12 @@ public override bool OnTileCollide(Vector2 oldVelocity) } return false; } - + public override void AI() { - CreateDust(); + CreateDust(); } - + public void CreateDust() { if (Main.rand.Next(2) == 1) diff --git a/Projectiles/BrainSmasherPro.cs b/Projectiles/BrainSmasherPro.cs index 88bb126d..b7f250df 100644 --- a/Projectiles/BrainSmasherPro.cs +++ b/Projectiles/BrainSmasherPro.cs @@ -9,78 +9,79 @@ namespace Tremor.Projectiles { - public class BrainSmasherPro : ModProjectile - { - const float RotationSpeed = 0.05f; - const float Distanse = 300; + public class BrainSmasherPro : ModProjectile + { + const float RotationSpeed = 0.05f; + const float Distanse = 300; - float Rotation = 0; + float Rotation = 0; - public override void SetDefaults() - { + public override void SetDefaults() + { - projectile.width = 48; - projectile.height = 48; - projectile.timeLeft = 6; - projectile.melee = true; - projectile.aiStyle = -1; - projectile.penetrate = -1; - projectile.tileCollide = false; - projectile.ignoreWater = true; - } + projectile.width = 48; + projectile.height = 48; + projectile.timeLeft = 6; + projectile.melee = true; + projectile.aiStyle = -1; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.ignoreWater = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("BrainSmasher"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("BrainSmasher"); + } - public override void AI() - { - Rotation += RotationSpeed; - projectile.Center = Helper.PolarPos(Terraria.Main.player[(int)projectile.ai[0]].Center, Distanse, Helper.GradtoRad(Rotation)); - projectile.rotation = Helper.rotateBetween2Points(Terraria.Main.player[(int)projectile.ai[0]].Center, projectile.Center) - Helper.GradtoRad(90); - } - public override bool? CanHitNPC(NPC target) - { - return !target.friendly; - } + public override void AI() + { + Rotation += RotationSpeed; + projectile.Center = Helper.PolarPos(Terraria.Main.player[(int)projectile.ai[0]].Center, Distanse, Helper.GradtoRad(Rotation)); + projectile.rotation = Helper.rotateBetween2Points(Terraria.Main.player[(int)projectile.ai[0]].Center, projectile.Center) - Helper.GradtoRad(90); + } - public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Color lightColor) - { - Texture2D texture = ModLoader.GetTexture("Tremor/Projectiles/BrainSmasher_Chain"); + public override bool? CanHitNPC(NPC target) + { + return !target.friendly; + } - Vector2 position = projectile.Center; - Vector2 mountedCenter = Main.player[projectile.owner].MountedCenter; - Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(); - Vector2 origin = new Vector2((float)texture.Width * 0.5f, (float)texture.Height * 0.5f); - float num1 = (float)texture.Height; - Vector2 vector2_4 = mountedCenter - position; - float rotation = (float)Math.Atan2((double)vector2_4.Y, (double)vector2_4.X) - 1.57f; - bool flag = true; - if (float.IsNaN(position.X) && float.IsNaN(position.Y)) - flag = false; - if (float.IsNaN(vector2_4.X) && float.IsNaN(vector2_4.Y)) - flag = false; - while (flag) - { - if ((double)vector2_4.Length() < (double)num1 + 1.0) - { - flag = false; - } - else - { - Vector2 vector2_1 = vector2_4; - vector2_1.Normalize(); - position += vector2_1 * num1; - vector2_4 = mountedCenter - position; - Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)position.X / 16, (int)((double)position.Y / 16.0)); - color2 = projectile.GetAlpha(color2); - Main.spriteBatch.Draw(texture, position - Main.screenPosition, sourceRectangle, color2, rotation, origin, 1f, SpriteEffects.None, 0.0f); - } - } - return true; - } -}} + public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture = ModLoader.GetTexture("Tremor/Projectiles/BrainSmasher_Chain"); + + Vector2 position = projectile.Center; + Vector2 mountedCenter = Main.player[projectile.owner].MountedCenter; + Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(); + Vector2 origin = new Vector2((float)texture.Width * 0.5f, (float)texture.Height * 0.5f); + float num1 = (float)texture.Height; + Vector2 vector2_4 = mountedCenter - position; + float rotation = (float)Math.Atan2((double)vector2_4.Y, (double)vector2_4.X) - 1.57f; + bool flag = true; + if (float.IsNaN(position.X) && float.IsNaN(position.Y)) + flag = false; + if (float.IsNaN(vector2_4.X) && float.IsNaN(vector2_4.Y)) + flag = false; + while (flag) + { + if ((double)vector2_4.Length() < (double)num1 + 1.0) + { + flag = false; + } + else + { + Vector2 vector2_1 = vector2_4; + vector2_1.Normalize(); + position += vector2_1 * num1; + vector2_4 = mountedCenter - position; + Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)position.X / 16, (int)((double)position.Y / 16.0)); + color2 = projectile.GetAlpha(color2); + Main.spriteBatch.Draw(texture, position - Main.screenPosition, sourceRectangle, color2, rotation, origin, 1f, SpriteEffects.None, 0.0f); + } + } + return true; + } + } +} diff --git a/Projectiles/BrainiacWavePro.cs b/Projectiles/BrainiacWavePro.cs index ff726d82..ca99b719 100644 --- a/Projectiles/BrainiacWavePro.cs +++ b/Projectiles/BrainiacWavePro.cs @@ -5,86 +5,88 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class BrainiacWavePro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class BrainiacWavePro : ModProjectile + { + public override void SetDefaults() + { projectile.CloneDefaults(348); - projectile.timeLeft = 120; + projectile.timeLeft = 120; aiType = 348; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("BrainiacWavePro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("BrainiacWavePro"); + } - public override void AI() - { - projectile.rotation = (float)System.Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; - if(Main.rand.Next(1) == 0) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 60, projectile.velocity.X * 0.9f, projectile.velocity.Y * 0.9f); - } - } + public override void AI() + { + projectile.rotation = (float)System.Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + if (Main.rand.Next(1) == 0) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 60, projectile.velocity.X * 0.9f, projectile.velocity.Y * 0.9f); + } + } - public override bool OnTileCollide(Vector2 oldVelocity) - { - for (int i = 0; i < 3; i++) - Dust.NewDust(projectile.position, projectile.width, projectile.height, 60, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f); - return true; - } - public override bool CanHitPlayer(Player target) - { - return false; - } + public override bool OnTileCollide(Vector2 oldVelocity) + { + for (int i = 0; i < 3; i++) + Dust.NewDust(projectile.position, projectile.width, projectile.height, 60, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f); + return true; + } - public override bool? CanHitNPC(NPC target) - { - return (target.friendly) ? false : true; - } + public override bool CanHitPlayer(Player target) + { + return false; + } - public override void Kill(int timeLeft) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 8); - for (int num158 = 0; num158 < 20; num158++) + public override bool? CanHitNPC(NPC target) { - int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); - if (Main.rand.Next(3) == 0) - { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].type++; - } - else - { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; - } - Main.dust[num159].noGravity = true; - Main.dust[num159].velocity *= 2.5f; - Main.dust[num159].velocity -= projectile.oldVelocity / 10f; + return (target.friendly) ? false : true; } - if (Main.myPlayer == projectile.owner) + + public override void Kill(int timeLeft) { - int num160 = Main.rand.Next(0, 0); - for (int num161 = 0; num161 < num160; num161++) + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 8); + for (int num158 = 0; num158 < 20; num158++) + { + int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); + if (Main.rand.Next(3) == 0) + { + Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].type++; + } + else + { + Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + } + Main.dust[num159].noGravity = true; + Main.dust[num159].velocity *= 2.5f; + Main.dust[num159].velocity -= projectile.oldVelocity / 10f; + } + if (Main.myPlayer == projectile.owner) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value12.X == 0f && value12.Y == 0f) + int num160 = Main.rand.Next(0, 0); + for (int num161 = 0; num161 < num160; num161++) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + while (value12.X == 0f && value12.Y == 0f) + { + value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + } + value12.Normalize(); + value12 *= (float)Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); } - value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); } } - } -}} + } +} diff --git a/Projectiles/BrassCog.cs b/Projectiles/BrassCog.cs index 57346cc9..cf9e69c5 100644 --- a/Projectiles/BrassCog.cs +++ b/Projectiles/BrassCog.cs @@ -5,21 +5,23 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class BrassCog : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class BrassCog : ModProjectile + { + public override void SetDefaults() + { projectile.CloneDefaults(24); aiType = 24; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("BrassCog"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("BrassCog"); + } -}} + + } +} diff --git a/Projectiles/BrassGlaive.cs b/Projectiles/BrassGlaive.cs index 3f5eb123..fbe25a89 100644 --- a/Projectiles/BrassGlaive.cs +++ b/Projectiles/BrassGlaive.cs @@ -5,21 +5,23 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class BrassGlaive : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class BrassGlaive : ModProjectile + { + public override void SetDefaults() + { projectile.CloneDefaults(66); aiType = 66; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("BrassGlaive"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("BrassGlaive"); + } -}} + + } +} diff --git a/Projectiles/BrilliantBehemothPro.cs b/Projectiles/BrilliantBehemothPro.cs index 38726601..fbc1267e 100644 --- a/Projectiles/BrilliantBehemothPro.cs +++ b/Projectiles/BrilliantBehemothPro.cs @@ -10,53 +10,54 @@ public class BrilliantBehemothPro : ModProjectile public override void SetDefaults() { - projectile.width = 40; - projectile.height = 40; - projectile.aiStyle = 14; - projectile.friendly = true; - projectile.ranged = true; - projectile.penetrate =5; - projectile.timeLeft = 9000; - projectile.extraUpdates = 1; - } + projectile.width = 40; + projectile.height = 40; + projectile.aiStyle = 14; + projectile.friendly = true; + projectile.ranged = true; + projectile.penetrate = 5; + projectile.timeLeft = 9000; + projectile.extraUpdates = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Brilliant Behemoth"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Brilliant Behemoth"); + + } - public override bool OnTileCollide(Vector2 oldVelocity) - { - projectile.penetrate--; - if(projectile.penetrate <= 0) - { - projectile.velocity.Y = -oldVelocity.Y; - } - else - { - projectile.ai[0] += 0.1f; - if(projectile.velocity.X != oldVelocity.X) - { - projectile.velocity.X = -oldVelocity.X; - } - if(projectile.velocity.Y != oldVelocity.Y) - { - projectile.velocity.Y = -oldVelocity.Y; - } - projectile.velocity *= 0.75f; - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); - } - return false; - } + public override bool OnTileCollide(Vector2 oldVelocity) + { + projectile.penetrate--; + if (projectile.penetrate <= 0) + { + projectile.velocity.Y = -oldVelocity.Y; + } + else + { + projectile.ai[0] += 0.1f; + if (projectile.velocity.X != oldVelocity.X) + { + projectile.velocity.X = -oldVelocity.X; + } + if (projectile.velocity.Y != oldVelocity.Y) + { + projectile.velocity.Y = -oldVelocity.Y; + } + projectile.velocity *= 0.75f; + Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); + } + return false; + } - public override void Kill(int timeLeft) - { - for(int k = 0; k < 30; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 62, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); - } - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); + public override void Kill(int timeLeft) + { + for (int k = 0; k < 30; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 62, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); + } + Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); + } + } } -}} diff --git a/Projectiles/Brutty.cs b/Projectiles/Brutty.cs index a471099f..0303cdc0 100644 --- a/Projectiles/Brutty.cs +++ b/Projectiles/Brutty.cs @@ -14,16 +14,16 @@ public override void SetDefaults() aiType = 269; Main.projFrames[projectile.type] = 7; - projectile.width = 32; - projectile.height = 28; + projectile.width = 32; + projectile.height = 28; Main.projPet[projectile.type] = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Brutty"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Brutty"); + + } public override bool PreAI() diff --git a/Projectiles/BurningFist.cs b/Projectiles/BurningFist.cs index e1ebc715..5e36f698 100644 --- a/Projectiles/BurningFist.cs +++ b/Projectiles/BurningFist.cs @@ -7,121 +7,121 @@ namespace Tremor.Projectiles { public class BurningFist : ModProjectile { - public override void SetDefaults() - { + public override void SetDefaults() + { - projectile.CloneDefaults(668); + projectile.CloneDefaults(668); projectile.width = 28; - projectile.height = 38; + projectile.height = 38; aiType = 668; - projectile.timeLeft = 400; + projectile.timeLeft = 400; projectile.penetrate = 1; projectile.friendly = true; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Burning Fist"); - - } - - public override void Kill(int timeLeft) - { - Player player = Main.player[projectile.owner]; - if (projectile.owner == Main.myPlayer) - { - int num220 = Main.rand.Next(3, 6); - for (int num221 = 0; num221 < num220; num221++) - { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, 15, projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); - } - } - - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); - projectile.width = 80; - projectile.height = 80; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - for (int num628 = 0; num628 < 40; num628++) - { - int num629 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); - Main.dust[num629].velocity *= 3f; - if (Main.rand.Next(2) == 0) - { - Main.dust[num629].scale = 0.5f; - Main.dust[num629].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } - for (int num630 = 0; num630 < 70; num630++) - { - int num631 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 3f); - Main.dust[num631].noGravity = true; - Main.dust[num631].velocity *= 5f; - num631 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 2f); - Main.dust[num631].velocity *= 2f; - } - for (int num632 = 0; num632 < 3; num632++) - { - float scaleFactor10 = 0.33f; - if (num632 == 1) - { - scaleFactor10 = 0.66f; - } - if (num632 == 2) - { - scaleFactor10 = 1f; - } - int num633 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); - Main.gore[num633].velocity *= scaleFactor10; - Gore expr_13E6D_cp_0 = Main.gore[num633]; - expr_13E6D_cp_0.velocity.X = expr_13E6D_cp_0.velocity.X + 1f; - Gore expr_13E8D_cp_0 = Main.gore[num633]; - expr_13E8D_cp_0.velocity.Y = expr_13E8D_cp_0.velocity.Y + 1f; - num633 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 2f); - Main.gore[num633].velocity *= scaleFactor10; - Gore expr_13F30_cp_0 = Main.gore[num633]; - expr_13F30_cp_0.velocity.X = expr_13F30_cp_0.velocity.X - 1f; - Gore expr_13F50_cp_0 = Main.gore[num633]; - expr_13F50_cp_0.velocity.Y = expr_13F50_cp_0.velocity.Y + 1f; - num633 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); - Main.gore[num633].velocity *= scaleFactor10; - Gore expr_13FF3_cp_0 = Main.gore[num633]; - expr_13FF3_cp_0.velocity.X = expr_13FF3_cp_0.velocity.X + 1f; - Gore expr_14013_cp_0 = Main.gore[num633]; - expr_14013_cp_0.velocity.Y = expr_14013_cp_0.velocity.Y - 1f; - num633 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); - Main.gore[num633].velocity *= scaleFactor10; - Gore expr_140B6_cp_0 = Main.gore[num633]; - expr_140B6_cp_0.velocity.X = expr_140B6_cp_0.velocity.X - 1f; - Gore expr_140D6_cp_0 = Main.gore[num633]; - expr_140D6_cp_0.velocity.Y = expr_140D6_cp_0.velocity.Y - 1f; - } - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); - projectile.width = 10; - projectile.height = 10; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Burning Fist"); } + public override void Kill(int timeLeft) + { + Player player = Main.player[projectile.owner]; + if (projectile.owner == Main.myPlayer) + { + int num220 = Main.rand.Next(3, 6); + for (int num221 = 0; num221 < num220; num221++) + { + Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value17.Normalize(); + value17 *= (float)Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, 15, projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + } + } - public override bool CanHitPlayer(Player target) - { - return false; - } + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); + projectile.position.X = projectile.position.X + (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.width = 80; + projectile.height = 80; + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + for (int num628 = 0; num628 < 40; num628++) + { + int num629 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); + Main.dust[num629].velocity *= 3f; + if (Main.rand.Next(2) == 0) + { + Main.dust[num629].scale = 0.5f; + Main.dust[num629].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + } + } + for (int num630 = 0; num630 < 70; num630++) + { + int num631 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 3f); + Main.dust[num631].noGravity = true; + Main.dust[num631].velocity *= 5f; + num631 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 2f); + Main.dust[num631].velocity *= 2f; + } + for (int num632 = 0; num632 < 3; num632++) + { + float scaleFactor10 = 0.33f; + if (num632 == 1) + { + scaleFactor10 = 0.66f; + } + if (num632 == 2) + { + scaleFactor10 = 1f; + } + int num633 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num633].velocity *= scaleFactor10; + Gore expr_13E6D_cp_0 = Main.gore[num633]; + expr_13E6D_cp_0.velocity.X = expr_13E6D_cp_0.velocity.X + 1f; + Gore expr_13E8D_cp_0 = Main.gore[num633]; + expr_13E8D_cp_0.velocity.Y = expr_13E8D_cp_0.velocity.Y + 1f; + num633 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 2f); + Main.gore[num633].velocity *= scaleFactor10; + Gore expr_13F30_cp_0 = Main.gore[num633]; + expr_13F30_cp_0.velocity.X = expr_13F30_cp_0.velocity.X - 1f; + Gore expr_13F50_cp_0 = Main.gore[num633]; + expr_13F50_cp_0.velocity.Y = expr_13F50_cp_0.velocity.Y + 1f; + num633 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num633].velocity *= scaleFactor10; + Gore expr_13FF3_cp_0 = Main.gore[num633]; + expr_13FF3_cp_0.velocity.X = expr_13FF3_cp_0.velocity.X + 1f; + Gore expr_14013_cp_0 = Main.gore[num633]; + expr_14013_cp_0.velocity.Y = expr_14013_cp_0.velocity.Y - 1f; + num633 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num633].velocity *= scaleFactor10; + Gore expr_140B6_cp_0 = Main.gore[num633]; + expr_140B6_cp_0.velocity.X = expr_140B6_cp_0.velocity.X - 1f; + Gore expr_140D6_cp_0 = Main.gore[num633]; + expr_140D6_cp_0.velocity.Y = expr_140D6_cp_0.velocity.Y - 1f; + } + projectile.position.X = projectile.position.X + (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.width = 10; + projectile.height = 10; + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - public override bool? CanHitNPC(NPC target) - { - return (target.friendly) ? false : true; - } + } - -} + public override bool CanHitPlayer(Player target) + { + return false; + } + + public override bool? CanHitNPC(NPC target) + { + return (target.friendly) ? false : true; + } + + + + } } diff --git a/Projectiles/BurningHammerPro.cs b/Projectiles/BurningHammerPro.cs index 44cdb9a0..3e78b0fb 100644 --- a/Projectiles/BurningHammerPro.cs +++ b/Projectiles/BurningHammerPro.cs @@ -5,40 +5,41 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class BurningHammerPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class BurningHammerPro : ModProjectile + { + public override void SetDefaults() + { projectile.CloneDefaults(3); projectile.width = 26; projectile.height = 36; aiType = 3; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("BurningHammerPro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("BurningHammerPro"); + } - public override bool CanHitPlayer(Player target) - { - return false; - } - public override bool? CanHitNPC(NPC target) - { - return (target.friendly) ? false : true; - } + public override bool CanHitPlayer(Player target) + { + return false; + } - public override void AI() - { - int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 136, default(Color), 2.9f); - Main.dust[dust].noGravity = true; - } + public override bool? CanHitNPC(NPC target) + { + return (target.friendly) ? false : true; + } + + public override void AI() + { + int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 136, default(Color), 2.9f); + Main.dust[dust].noGravity = true; + } public override void Kill(int timeLeft) { @@ -49,4 +50,5 @@ public override void Kill(int timeLeft) Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); } -}} + } +} diff --git a/Projectiles/Carrot.cs b/Projectiles/Carrot.cs index 9106857a..4fd725fa 100644 --- a/Projectiles/Carrot.cs +++ b/Projectiles/Carrot.cs @@ -15,25 +15,25 @@ public override void SetDefaults() projectile.friendly = true; projectile.magic = true; projectile.penetrate = 6; - projectile.aiStyle = 1; + projectile.aiStyle = 1; projectile.timeLeft = 600; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Carrot"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Carrot"); + + } - public override void Kill(int timeLeft) - { - for(int k = 0; k < 5; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 50, projectile.oldVelocity.X * 0.1f, projectile.oldVelocity.Y * 0.1f); - } - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); - } + public override void Kill(int timeLeft) + { + for (int k = 0; k < 5; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 50, projectile.oldVelocity.X * 0.1f, projectile.oldVelocity.Y * 0.1f); + } + Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); + } } } diff --git a/Projectiles/ChainedRocketPro.cs b/Projectiles/ChainedRocketPro.cs index 1d3e718d..804d8fb1 100644 --- a/Projectiles/ChainedRocketPro.cs +++ b/Projectiles/ChainedRocketPro.cs @@ -9,132 +9,132 @@ namespace Tremor.Projectiles { - public class ChainedRocketPro : ModProjectile - { - public override void SetDefaults() - { + public class ChainedRocketPro : ModProjectile + { + public override void SetDefaults() + { - projectile.width = 22; - projectile.height = 34; - projectile.friendly = true; - projectile.penetrate = -5; // Penetrates NPCs infinitely. - projectile.melee = true; // Deals melee dmg. + projectile.width = 22; + projectile.height = 34; + projectile.friendly = true; + projectile.penetrate = -5; // Penetrates NPCs infinitely. + projectile.melee = true; // Deals melee dmg. - projectile.aiStyle = 15; // Set the aiStyle to that of a flail. - projectile.timeLeft = 500; - } + projectile.aiStyle = 15; // Set the aiStyle to that of a flail. + projectile.timeLeft = 500; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Chained Rocket"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Chained Rocket"); + } - public override void AI() - { - int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 136, default(Color), 0.9f); - Main.dust[dust].noGravity = true; - Vector2 vector63 = Main.player[projectile.owner].Center - projectile.Center; - projectile.rotation = vector63.ToRotation() - 1.57f; - if (Main.player[projectile.owner].dead) + + public override void AI() + { + int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 136, default(Color), 0.9f); + Main.dust[dust].noGravity = true; + Vector2 vector63 = Main.player[projectile.owner].Center - projectile.Center; + projectile.rotation = vector63.ToRotation() - 1.57f; + if (Main.player[projectile.owner].dead) + { + projectile.Kill(); + return; + } + Main.player[projectile.owner].itemAnimation = 10; + Main.player[projectile.owner].itemTime = 10; + if (vector63.X < 0f) + { + Main.player[projectile.owner].ChangeDir(1); + projectile.direction = 1; + } + else + { + Main.player[projectile.owner].ChangeDir(-1); + projectile.direction = -1; + } + Main.player[projectile.owner].itemRotation = (vector63 * -1f * (float)projectile.direction).ToRotation(); + projectile.spriteDirection = ((vector63.X > 0f) ? -1 : 1); + if (projectile.ai[0] == 0f && vector63.Length() > 800f) + { + projectile.ai[0] = 1f; + } + if (projectile.ai[0] == 1f || projectile.ai[0] == 2f) + { + float num810 = vector63.Length(); + if (num810 > 3000f) { projectile.Kill(); return; } - Main.player[projectile.owner].itemAnimation = 10; - Main.player[projectile.owner].itemTime = 10; - if (vector63.X < 0f) - { - Main.player[projectile.owner].ChangeDir(1); - projectile.direction = 1; - } - else + if (num810 > 1200f) { - Main.player[projectile.owner].ChangeDir(-1); - projectile.direction = -1; + projectile.ai[0] = 2f; } - Main.player[projectile.owner].itemRotation = (vector63 * -1f * (float)projectile.direction).ToRotation(); - projectile.spriteDirection = ((vector63.X > 0f) ? -1 : 1); - if (projectile.ai[0] == 0f && vector63.Length() > 800f) + projectile.tileCollide = false; + float num811 = 20f; + if (projectile.ai[0] == 2f) { - projectile.ai[0] = 1f; + num811 = 40f; } - if (projectile.ai[0] == 1f || projectile.ai[0] == 2f) + projectile.velocity = Vector2.Normalize(vector63) * num811; + if (vector63.Length() < num811) { - float num810 = vector63.Length(); - if (num810 > 3000f) - { - projectile.Kill(); - return; - } - if (num810 > 1200f) - { - projectile.ai[0] = 2f; - } - projectile.tileCollide = false; - float num811 = 20f; - if (projectile.ai[0] == 2f) - { - num811 = 40f; - } - projectile.velocity = Vector2.Normalize(vector63) * num811; - if (vector63.Length() < num811) - { - projectile.Kill(); - return; - } + projectile.Kill(); + return; } - projectile.ai[1] += 1f; - if (projectile.ai[1] > 5f) + } + projectile.ai[1] += 1f; + if (projectile.ai[1] > 5f) + { + projectile.alpha = 0; + } + if ((int)projectile.ai[1] % 3 == 0 && projectile.owner == Main.myPlayer) + { + Vector2 vector64 = vector63 * -1f; + vector64.Normalize(); + vector64 *= (float)Main.rand.Next(45, 65) * 0.1f; + vector64 = vector64.RotatedBy((Main.rand.NextDouble() - 0.5) * 1.5707963705062866, default(Vector2)); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vector64.X, vector64.Y, mod.ProjectileType("nichego"), projectile.damage, projectile.knockBack, projectile.owner, -10f, 0f); + } + } + + public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture = ModLoader.GetTexture("Tremor/Projectiles/ChainedRocket_Chain"); + + Vector2 position = projectile.Center; + Vector2 mountedCenter = Main.player[projectile.owner].MountedCenter; + Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(); + Vector2 origin = new Vector2((float)texture.Width * 0.5f, (float)texture.Height * 0.5f); + float num1 = (float)texture.Height; + Vector2 vector2_4 = mountedCenter - position; + float rotation = (float)Math.Atan2((double)vector2_4.Y, (double)vector2_4.X) - 1.57f; + bool flag = true; + if (float.IsNaN(position.X) && float.IsNaN(position.Y)) + flag = false; + if (float.IsNaN(vector2_4.X) && float.IsNaN(vector2_4.Y)) + flag = false; + while (flag) + { + if ((double)vector2_4.Length() < (double)num1 + 1.0) { - projectile.alpha = 0; + flag = false; } - if ((int)projectile.ai[1] % 3 == 0 && projectile.owner == Main.myPlayer) + else { - Vector2 vector64 = vector63 * -1f; - vector64.Normalize(); - vector64 *= (float)Main.rand.Next(45, 65) * 0.1f; - vector64 = vector64.RotatedBy((Main.rand.NextDouble() - 0.5) * 1.5707963705062866, default(Vector2)); - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vector64.X, vector64.Y, mod.ProjectileType("nichego"), projectile.damage, projectile.knockBack, projectile.owner, -10f, 0f); + Vector2 vector2_1 = vector2_4; + vector2_1.Normalize(); + position += vector2_1 * num1; + vector2_4 = mountedCenter - position; + Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)position.X / 16, (int)((double)position.Y / 16.0)); + color2 = projectile.GetAlpha(color2); + Main.spriteBatch.Draw(texture, position - Main.screenPosition, sourceRectangle, color2, rotation, origin, 1f, SpriteEffects.None, 0.0f); } - } - - public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Color lightColor) - { - Texture2D texture = ModLoader.GetTexture("Tremor/Projectiles/ChainedRocket_Chain"); - - Vector2 position = projectile.Center; - Vector2 mountedCenter = Main.player[projectile.owner].MountedCenter; - Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(); - Vector2 origin = new Vector2((float)texture.Width * 0.5f, (float)texture.Height * 0.5f); - float num1 = (float)texture.Height; - Vector2 vector2_4 = mountedCenter - position; - float rotation = (float)Math.Atan2((double)vector2_4.Y, (double)vector2_4.X) - 1.57f; - bool flag = true; - if (float.IsNaN(position.X) && float.IsNaN(position.Y)) - flag = false; - if (float.IsNaN(vector2_4.X) && float.IsNaN(vector2_4.Y)) - flag = false; - while (flag) - { - if ((double)vector2_4.Length() < (double)num1 + 1.0) - { - flag = false; - } - else - { - Vector2 vector2_1 = vector2_4; - vector2_1.Normalize(); - position += vector2_1 * num1; - vector2_4 = mountedCenter - position; - Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)position.X / 16, (int)((double)position.Y / 16.0)); - color2 = projectile.GetAlpha(color2); - Main.spriteBatch.Draw(texture, position - Main.screenPosition, sourceRectangle, color2, rotation, origin, 1f, SpriteEffects.None, 0.0f); - } - } + } - return true; - } - } + return true; + } + } } diff --git a/Projectiles/ChainjawPro.cs b/Projectiles/ChainjawPro.cs index 75835a93..aa14000e 100644 --- a/Projectiles/ChainjawPro.cs +++ b/Projectiles/ChainjawPro.cs @@ -4,28 +4,30 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { - -public class ChainjawPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { - projectile.width = 22; - projectile.height = 22; - projectile.aiStyle = 20; - projectile.friendly = true; - projectile.penetrate = -1; - projectile.tileCollide = false; - projectile.hide = true; - projectile.ownerHitCheck = true; - projectile.melee = true; - } + public class ChainjawPro : ModProjectile + { + public override void SetDefaults() + { + + projectile.width = 22; + projectile.height = 22; + projectile.aiStyle = 20; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.hide = true; + projectile.ownerHitCheck = true; + projectile.melee = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Chainjaw"); - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Chainjaw"); - - } + } -}} + } +} diff --git a/Projectiles/ChaosStarPro.cs b/Projectiles/ChaosStarPro.cs index 6a15b208..d2598112 100644 --- a/Projectiles/ChaosStarPro.cs +++ b/Projectiles/ChaosStarPro.cs @@ -5,75 +5,77 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class ChaosStarPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class ChaosStarPro : ModProjectile + { + public override void SetDefaults() + { projectile.CloneDefaults(405); aiType = 405; - projectile.friendly = true; - projectile.timeLeft = 150; - projectile.light = 0.8f; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - } + projectile.friendly = true; + projectile.timeLeft = 150; + projectile.light = 0.8f; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("ChaosStarPro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("ChaosStarPro"); + } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Vector2 drawOrigin = new Vector2(Main.projectileTexture[projectile.type].Width * 0.5f, projectile.height * 0.5f); - for(int k = 0; k < projectile.oldPos.Length; k++) - { - Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); - Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); - spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); - } - return true; - } - public override void Kill(int timeLeft) - { - for (int num158 = 0; num158 < 20; num158++) + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 68, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.3f); - if (Main.rand.Next(3) == 0) + Vector2 drawOrigin = new Vector2(Main.projectileTexture[projectile.type].Width * 0.5f, projectile.height * 0.5f); + for (int k = 0; k < projectile.oldPos.Length; k++) { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].type++; + Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); + Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); + spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); } - else - { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; - } - Main.dust[num159].noGravity = true; - Main.dust[num159].velocity *= 2.5f; - Main.dust[num159].velocity -= projectile.oldVelocity / 10f; + return true; } - if (Main.myPlayer == projectile.owner) + + public override void Kill(int timeLeft) { - int num160 = Main.rand.Next(0, 0); - for (int num161 = 0; num161 < num160; num161++) + for (int num158 = 0; num158 < 20; num158++) + { + int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 68, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.3f); + if (Main.rand.Next(3) == 0) + { + Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].type++; + } + else + { + Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + } + Main.dust[num159].noGravity = true; + Main.dust[num159].velocity *= 2.5f; + Main.dust[num159].velocity -= projectile.oldVelocity / 10f; + } + if (Main.myPlayer == projectile.owner) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value12.X == 0f && value12.Y == 0f) + int num160 = Main.rand.Next(0, 0); + for (int num161 = 0; num161 < num160; num161++) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + while (value12.X == 0f && value12.Y == 0f) + { + value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + } + value12.Normalize(); + value12 *= (float)Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 2.8f, projectile.owner, 0f, 0f); } - value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 2.8f, projectile.owner, 0f, 0f); } } - } -}} + } +} diff --git a/Projectiles/ChargedArrow.cs b/Projectiles/ChargedArrow.cs index 005a9f54..cb684588 100644 --- a/Projectiles/ChargedArrow.cs +++ b/Projectiles/ChargedArrow.cs @@ -4,34 +4,36 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -//ported from my tAPI mod because I don't want to make artwork -public class ChargedArrow : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + //ported from my tAPI mod because I don't want to make artwork + public class ChargedArrow : ModProjectile + { + public override void SetDefaults() + { - projectile.width = 16; - projectile.height = 40; - projectile.aiStyle = 1; - projectile.friendly = true; - projectile.penetrate = -2; - projectile.tileCollide = true; - projectile.melee = true; - } + projectile.width = 16; + projectile.height = 40; + projectile.aiStyle = 1; + projectile.friendly = true; + projectile.penetrate = -2; + projectile.tileCollide = true; + projectile.melee = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Charged Arrow"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Charged Arrow"); + } - public override void Kill(int timeLeft) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 93); - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("ChargedArrowBoom"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); - } -}} + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 93); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("ChargedArrowBoom"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + } + + } +} diff --git a/Projectiles/ChargedArrowBoom.cs b/Projectiles/ChargedArrowBoom.cs index 1c94736e..bc2b833a 100644 --- a/Projectiles/ChargedArrowBoom.cs +++ b/Projectiles/ChargedArrowBoom.cs @@ -7,35 +7,35 @@ namespace Tremor.Projectiles { - public class ChargedArrowBoom : ModProjectile - { - public override void SetDefaults() - { + public class ChargedArrowBoom : ModProjectile + { + public override void SetDefaults() + { - projectile.width = 250; - projectile.height = 250; - projectile.friendly = true; - projectile.ignoreWater = false; - projectile.tileCollide = false; - projectile.penetrate = -1; - projectile.timeLeft = 150; - projectile.magic = true; - } + projectile.width = 250; + projectile.height = 250; + projectile.friendly = true; + projectile.ignoreWater = false; + projectile.tileCollide = false; + projectile.penetrate = -1; + projectile.timeLeft = 150; + projectile.magic = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("ChargedArrowBoom"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("ChargedArrowBoom"); + } - public override void AI() - { - Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.75f) / 255f, ((255 - projectile.alpha) * 0.5f) / 255f, ((255 - projectile.alpha) * 0.01f) / 255f); - if (projectile.wet && !projectile.lavaWet) - { - projectile.Kill(); - } + + public override void AI() + { + Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.75f) / 255f, ((255 - projectile.alpha) * 0.5f) / 255f, ((255 - projectile.alpha) * 0.01f) / 255f); + if (projectile.wet && !projectile.lavaWet) + { + projectile.Kill(); + } if (projectile.localAI[0] == 0f) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); @@ -98,7 +98,7 @@ public override void AI() num462++; } return; - } + } - } + } } diff --git a/Projectiles/ClusterSpearPro.cs b/Projectiles/ClusterSpearPro.cs index 724a5102..71446916 100644 --- a/Projectiles/ClusterSpearPro.cs +++ b/Projectiles/ClusterSpearPro.cs @@ -5,27 +5,29 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class ClusterSpearPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class ClusterSpearPro : ModProjectile + { + public override void SetDefaults() + { projectile.CloneDefaults(218); aiType = 218; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("ClusterSpearPro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("ClusterSpearPro"); + } - public override void AI() - { - int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, mod.DustType("ClusterFlame"), projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 136, default(Color), 2.9f); - Main.dust[dust].noGravity = true; - } -}} + public override void AI() + { + int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, mod.DustType("ClusterFlame"), projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 136, default(Color), 2.9f); + Main.dust[dust].noGravity = true; + } + + } +} diff --git a/Projectiles/CobaltBolt.cs b/Projectiles/CobaltBolt.cs index 203871f0..7e0d8abc 100644 --- a/Projectiles/CobaltBolt.cs +++ b/Projectiles/CobaltBolt.cs @@ -5,74 +5,76 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class CobaltBolt : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { - - projectile.width = 12; - projectile.height = 12; - projectile.friendly = true; - projectile.magic = true; - projectile.aiStyle = 0; - projectile.penetrate = 3; - projectile.timeLeft = 1200; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cobalt Bolt"); - - } + public class CobaltBolt : ModProjectile + { + public override void SetDefaults() + { + projectile.width = 12; + projectile.height = 12; + projectile.friendly = true; + projectile.magic = true; + projectile.aiStyle = 0; + projectile.penetrate = 3; + projectile.timeLeft = 1200; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } - public override void AI() - { - if (projectile.localAI[0] == 0f) + public override void SetStaticDefaults() { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + DisplayName.SetDefault("Cobalt Bolt"); + } - projectile.localAI[0] += 1f; - if (projectile.localAI[0] > 3f) + + + public override void AI() { - int num90 = 1; - if (projectile.localAI[0] > 5f) + if (projectile.localAI[0] == 0f) { - num90 = 2; + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); } - for (int num91 = 0; num91 < num90; num91++) + projectile.localAI[0] += 1f; + if (projectile.localAI[0] > 3f) { - int num92 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 2f), projectile.width, projectile.height, 59, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 3f); - Main.dust[num92].noGravity = true; - Dust expr_46AC_cp_0 = Main.dust[num92]; - expr_46AC_cp_0.velocity.X = expr_46AC_cp_0.velocity.X * 0.3f; - Dust expr_46CA_cp_0 = Main.dust[num92]; - expr_46CA_cp_0.velocity.Y = expr_46CA_cp_0.velocity.Y * 0.3f; - Main.dust[num92].noLight = true; + int num90 = 1; + if (projectile.localAI[0] > 5f) + { + num90 = 2; + } + for (int num91 = 0; num91 < num90; num91++) + { + int num92 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 2f), projectile.width, projectile.height, 59, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 3f); + Main.dust[num92].noGravity = true; + Dust expr_46AC_cp_0 = Main.dust[num92]; + expr_46AC_cp_0.velocity.X = expr_46AC_cp_0.velocity.X * 0.3f; + Dust expr_46CA_cp_0 = Main.dust[num92]; + expr_46CA_cp_0.velocity.Y = expr_46CA_cp_0.velocity.Y * 0.3f; + Main.dust[num92].noLight = true; + } + if (projectile.wet && !projectile.lavaWet) + { + projectile.Kill(); + return; + } } - if (projectile.wet && !projectile.lavaWet) + } + + public override void Kill(int timeLeft) + { + for (int k = 0; k < 5; k++) { - projectile.Kill(); - return; + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 59, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); } + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 78); } - } - public override void Kill(int timeLeft) - { - for(int k = 0; k < 5; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 59, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); - } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 78); - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - projectile.ai[0] += 0.1f; - projectile.velocity *= 0.75f; - } -}} + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + projectile.ai[0] += 0.1f; + projectile.velocity *= 0.75f; + } + } +} diff --git a/Projectiles/CobaltDiscPro.cs b/Projectiles/CobaltDiscPro.cs index b474b781..05b95b80 100644 --- a/Projectiles/CobaltDiscPro.cs +++ b/Projectiles/CobaltDiscPro.cs @@ -5,21 +5,23 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class CobaltDiscPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class CobaltDiscPro : ModProjectile + { + public override void SetDefaults() + { projectile.CloneDefaults(106); aiType = 106; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("CobaltDiscPro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("CobaltDiscPro"); + } -}} + + } +} diff --git a/Projectiles/CogLordLaser.cs b/Projectiles/CogLordLaser.cs index 3832df1d..1005db96 100644 --- a/Projectiles/CogLordLaser.cs +++ b/Projectiles/CogLordLaser.cs @@ -26,54 +26,54 @@ public override void SetDefaults() cooldownSlot = 1; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cog Lord Laser"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cog Lord Laser"); + + } public override void AI() { - projectile.localAI[0] += 1f; - if (projectile.localAI[0] > 3f) - { - for (int num449 = 0; num449 < 4; num449++) - { - Vector2 vector34 = projectile.position; - vector34 -= projectile.velocity * ((float)num449 * 0.25f); - projectile.alpha = 255; - int num450 = Dust.NewDust(vector34, 1, 1, 162, 0f, 0f, 0, default(Color), 1f); - Main.dust[num450].position = vector34; - Dust expr_13F6C_cp_0 = Main.dust[num450]; - expr_13F6C_cp_0.position.X = expr_13F6C_cp_0.position.X + (float)(projectile.width / 2); - Dust expr_13F90_cp_0 = Main.dust[num450]; - expr_13F90_cp_0.position.Y = expr_13F90_cp_0.position.Y + (float)(projectile.height / 2); - Main.dust[num450].scale = (float)Main.rand.Next(70, 110) * 0.013f; - Main.dust[num450].velocity *= 0.2f; - } - } - for (int k = 0; k < 200; k++) - { - if (NovaHandler.ShieldStrength > 0) - { - if (Main.npc[k].Hitbox.Intersects(projectile.Hitbox)) - { - if (Main.npc[k].type == mod.NPCType("NovaPillar")) - { - NovaHandler.ShieldStrength--; - projectile.Kill(); - } - } - } - if (Main.npc[k].Hitbox.Intersects(projectile.Hitbox)) - { - if (Main.npc[k].type == mod.NPCType("CogLord")) - { - projectile.Kill(); - } - } - } - } - } + projectile.localAI[0] += 1f; + if (projectile.localAI[0] > 3f) + { + for (int num449 = 0; num449 < 4; num449++) + { + Vector2 vector34 = projectile.position; + vector34 -= projectile.velocity * ((float)num449 * 0.25f); + projectile.alpha = 255; + int num450 = Dust.NewDust(vector34, 1, 1, 162, 0f, 0f, 0, default(Color), 1f); + Main.dust[num450].position = vector34; + Dust expr_13F6C_cp_0 = Main.dust[num450]; + expr_13F6C_cp_0.position.X = expr_13F6C_cp_0.position.X + (float)(projectile.width / 2); + Dust expr_13F90_cp_0 = Main.dust[num450]; + expr_13F90_cp_0.position.Y = expr_13F90_cp_0.position.Y + (float)(projectile.height / 2); + Main.dust[num450].scale = (float)Main.rand.Next(70, 110) * 0.013f; + Main.dust[num450].velocity *= 0.2f; + } + } + for (int k = 0; k < 200; k++) + { + if (NovaHandler.ShieldStrength > 0) + { + if (Main.npc[k].Hitbox.Intersects(projectile.Hitbox)) + { + if (Main.npc[k].type == mod.NPCType("NovaPillar")) + { + NovaHandler.ShieldStrength--; + projectile.Kill(); + } + } + } + if (Main.npc[k].Hitbox.Intersects(projectile.Hitbox)) + { + if (Main.npc[k].type == mod.NPCType("CogLord")) + { + projectile.Kill(); + } + } + } + } + } } diff --git a/Projectiles/CopperSpearPro.cs b/Projectiles/CopperSpearPro.cs index a36ba03c..78d33f00 100644 --- a/Projectiles/CopperSpearPro.cs +++ b/Projectiles/CopperSpearPro.cs @@ -5,21 +5,23 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class CopperSpearPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class CopperSpearPro : ModProjectile + { + public override void SetDefaults() + { projectile.CloneDefaults(66); aiType = 66; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("CopperSpearPro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("CopperSpearPro"); + } -}} + + } +} diff --git a/Projectiles/CorfirePro.cs b/Projectiles/CorfirePro.cs index 897777fe..1cc7aa02 100644 --- a/Projectiles/CorfirePro.cs +++ b/Projectiles/CorfirePro.cs @@ -10,42 +10,42 @@ public class CorfirePro : ModProjectile { public override void SetDefaults() { - projectile.CloneDefaults(553); + projectile.CloneDefaults(553); projectile.width = 16; projectile.height = 16; projectile.friendly = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("CorfirePro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("CorfirePro"); + } - public override void AI() - { - projectile.rotation = (float)System.Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; - if(Main.rand.Next(1) == 0) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 74, projectile.velocity.X * 0.9f, projectile.velocity.Y * 0.9f); - } - } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - if(Main.rand.Next(2) == 0) - { - target.AddBuff(39, 280, false); - } - } - public override void OnHitPvp(Player target, int damage, bool crit) - { - if(Main.rand.Next(2) == 0) - { - target.AddBuff(39, 280, false); - } - } + public override void AI() + { + projectile.rotation = (float)System.Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + if (Main.rand.Next(1) == 0) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 74, projectile.velocity.X * 0.9f, projectile.velocity.Y * 0.9f); + } + } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (Main.rand.Next(2) == 0) + { + target.AddBuff(39, 280, false); + } + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + if (Main.rand.Next(2) == 0) + { + target.AddBuff(39, 280, false); + } + } } } diff --git a/Projectiles/CornJavelinPro.cs b/Projectiles/CornJavelinPro.cs index e9e1c589..dc5d7a36 100644 --- a/Projectiles/CornJavelinPro.cs +++ b/Projectiles/CornJavelinPro.cs @@ -5,26 +5,27 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class CornJavelinPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class CornJavelinPro : ModProjectile + { + public override void SetDefaults() + { + + projectile.width = 4; + projectile.height = 4; + projectile.friendly = true; + projectile.aiStyle = 1; + projectile.timeLeft = 1200; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + } - projectile.width = 4; - projectile.height = 4; - projectile.friendly = true; - projectile.aiStyle = 1; - projectile.timeLeft = 1200; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; - ProjectileID.Sets.TrailingMode[projectile.type] = 2; - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Corn Javelin Pro"); - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Corn Javelin Pro"); - - } + } public override void Kill(int timeLeft) @@ -33,17 +34,18 @@ public override void Kill(int timeLeft) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 1, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 2f, 100, default(Color), 2f); } - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); + Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); - if(Main.rand.Next(5) == 0) - { - Item.NewItem((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height, mod.ItemType("CornJavelin")); - }; + if (Main.rand.Next(5) == 0) + { + Item.NewItem((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height, mod.ItemType("CornJavelin")); + }; } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - projectile.ai[0] += 0.1f; - projectile.velocity *= 0.75f; - } -}} + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + projectile.ai[0] += 0.1f; + projectile.velocity *= 0.75f; + } + } +} diff --git a/Projectiles/CrSpear.cs b/Projectiles/CrSpear.cs index 3665fe31..c93201aa 100644 --- a/Projectiles/CrSpear.cs +++ b/Projectiles/CrSpear.cs @@ -5,44 +5,44 @@ namespace Tremor.Projectiles { - public class CrSpear : ModProjectile - { - public override void SetDefaults() - { - projectile.CloneDefaults(507); - - projectile.width = 14; - projectile.height = 14; - projectile.friendly = true; - projectile.magic = true; - projectile.penetrate = 1; - projectile.timeLeft = 99999; - projectile.tileCollide = true; - projectile.ignoreWater = true; + public class CrSpear : ModProjectile + { + public override void SetDefaults() + { + projectile.CloneDefaults(507); + + projectile.width = 14; + projectile.height = 14; + projectile.friendly = true; + projectile.magic = true; + projectile.penetrate = 1; + projectile.timeLeft = 99999; + projectile.tileCollide = true; + projectile.ignoreWater = true; projectile.aiStyle = 1; - } + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crystal Spear"); + + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crystal Spear"); - - } - public override void AI() { - CreateDust(); + CreateDust(); } - - public override void Kill(int timeLeft) - { - for (int k = 0; k < 10; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 16, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); - } - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); - } - + + public override void Kill(int timeLeft) + { + for (int k = 0; k < 10; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 16, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); + } + Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); + } + public void CreateDust() { if (Main.rand.Next(2) == 1) diff --git a/Projectiles/CrystalChainmer.cs b/Projectiles/CrystalChainmer.cs index 234a2f1b..47a9b423 100644 --- a/Projectiles/CrystalChainmer.cs +++ b/Projectiles/CrystalChainmer.cs @@ -4,50 +4,52 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { - -public class CrystalChainmer : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { - - projectile.width = 22; - projectile.height = 22; - projectile.aiStyle = 20; - projectile.friendly = true; - projectile.penetrate = -1; - projectile.tileCollide = false; - projectile.hide = true; - projectile.ownerHitCheck = true; - projectile.melee = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crystal Chainmer"); - - } - - - public override void AI() - { - int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 71, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1.9f); - Main.dust[dust].noGravity = true; - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - if(Main.rand.Next(10) == 0) - { - target.AddBuff(31, 60, false); - } - } - - public override void OnHitPvp(Player target, int damage, bool crit) - { - if(Main.rand.Next(10) == 0) - { - target.AddBuff(31, 60, false); - } - } -}} + + public class CrystalChainmer : ModProjectile + { + public override void SetDefaults() + { + + projectile.width = 22; + projectile.height = 22; + projectile.aiStyle = 20; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.hide = true; + projectile.ownerHitCheck = true; + projectile.melee = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crystal Chainmer"); + + } + + + public override void AI() + { + int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 71, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1.9f); + Main.dust[dust].noGravity = true; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (Main.rand.Next(10) == 0) + { + target.AddBuff(31, 60, false); + } + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + if (Main.rand.Next(10) == 0) + { + target.AddBuff(31, 60, false); + } + } + } +} diff --git a/Projectiles/CrystalDagger.cs b/Projectiles/CrystalDagger.cs index b0dbadac..8112a28e 100644 --- a/Projectiles/CrystalDagger.cs +++ b/Projectiles/CrystalDagger.cs @@ -5,40 +5,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class CrystalDagger : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class CrystalDagger : ModProjectile + { + public override void SetDefaults() + { - projectile.width = 6; - projectile.height = 6; - projectile.friendly = true; - projectile.aiStyle = 1; - projectile.timeLeft = 1200; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - } + projectile.width = 6; + projectile.height = 6; + projectile.friendly = true; + projectile.aiStyle = 1; + projectile.timeLeft = 1200; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crystal Dagger"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crystal Dagger"); + } - public override void Kill(int timeLeft) - { - for(int k = 0; k < 5; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 73, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); - } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); - } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - projectile.ai[0] += 0.1f; - projectile.velocity *= 0.75f; - } -}} + public override void Kill(int timeLeft) + { + for (int k = 0; k < 5; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 73, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); + } + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + projectile.ai[0] += 0.1f; + projectile.velocity *= 0.75f; + } + } +} diff --git a/Projectiles/CrystalDrill.cs b/Projectiles/CrystalDrill.cs index 228ebd23..a8f4e2f6 100644 --- a/Projectiles/CrystalDrill.cs +++ b/Projectiles/CrystalDrill.cs @@ -4,50 +4,52 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { - -public class CrystalDrill : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { - - projectile.width = 22; - projectile.height = 22; - projectile.aiStyle = 20; - projectile.friendly = true; - projectile.penetrate = -1; - projectile.tileCollide = false; - projectile.hide = true; - projectile.ownerHitCheck = true; - projectile.melee = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Crystal Drill"); - - } - - - public override void AI() - { - int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 71, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1.9f); - Main.dust[dust].noGravity = true; - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - if(Main.rand.Next(10) == 0) - { - target.AddBuff(31, 60, false); - } - } - - public override void OnHitPvp(Player target, int damage, bool crit) - { - if(Main.rand.Next(10) == 0) - { - target.AddBuff(31, 60, false); - } - } -}} + + public class CrystalDrill : ModProjectile + { + public override void SetDefaults() + { + + projectile.width = 22; + projectile.height = 22; + projectile.aiStyle = 20; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.hide = true; + projectile.ownerHitCheck = true; + projectile.melee = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Crystal Drill"); + + } + + + public override void AI() + { + int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 71, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1.9f); + Main.dust[dust].noGravity = true; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (Main.rand.Next(10) == 0) + { + target.AddBuff(31, 60, false); + } + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + if (Main.rand.Next(10) == 0) + { + target.AddBuff(31, 60, false); + } + } + } +} diff --git a/Projectiles/CthulhunadoPro.cs b/Projectiles/CthulhunadoPro.cs index a5ee0ffc..5f6248f1 100644 --- a/Projectiles/CthulhunadoPro.cs +++ b/Projectiles/CthulhunadoPro.cs @@ -6,41 +6,41 @@ namespace Tremor.Projectiles { - public class CthulhunadoPro : ModProjectile - { - - public override void SetDefaults() - { + public class CthulhunadoPro : ModProjectile + { - projectile.width = 150; - projectile.height = 42; - projectile.friendly = true; - projectile.tileCollide = false; - projectile.ignoreWater = true; - projectile.penetrate = -1; - projectile.alpha = 255; - projectile.timeLeft = 420; - Main.projFrames[projectile.type] = 6; - } + public override void SetDefaults() + { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cthulhunado"); - - } + projectile.width = 150; + projectile.height = 42; + projectile.friendly = true; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.penetrate = -1; + projectile.alpha = 255; + projectile.timeLeft = 420; + Main.projFrames[projectile.type] = 6; + } - - public override void AI() - { - int num613 = 10; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cthulhunado"); + + } + + + public override void AI() + { + int num613 = 10; int num614 = 15; float num615 = 1f; int num616 = 150; int num617 = 42; if (Main.rand.Next(15) == 0) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 172, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); - } + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 172, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); + } if (projectile.velocity.X != 0f) { projectile.direction = (projectile.spriteDirection = -Math.Sign(projectile.velocity.X)); @@ -114,6 +114,6 @@ public override void AI() projectile.position.X = projectile.position.X + num624 * (float)(-(float)projectile.direction); return; } - } - } + } + } } diff --git a/Projectiles/CursedBreathPro.cs b/Projectiles/CursedBreathPro.cs index 0ababbd2..852e36f7 100644 --- a/Projectiles/CursedBreathPro.cs +++ b/Projectiles/CursedBreathPro.cs @@ -4,48 +4,50 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { - -public class CursedBreathPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { - - projectile.width = 22; - projectile.height = 22; - projectile.aiStyle = 6; - projectile.friendly = true; - projectile.penetrate = -1; - projectile.tileCollide = true; - projectile.magic = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cursed Breath Pro"); - - } - - - public override void AI() - { - int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 75, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1.9f); - Main.dust[dust].noGravity = true; - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - if(Main.rand.Next(5) == 0) - { - target.AddBuff(39, 60); - } - } - - public override void OnHitPvp(Player target, int damage, bool crit) - { - if(Main.rand.Next(5) == 0) - { - target.AddBuff(39, 60); - } - } -}} + + public class CursedBreathPro : ModProjectile + { + public override void SetDefaults() + { + + projectile.width = 22; + projectile.height = 22; + projectile.aiStyle = 6; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.tileCollide = true; + projectile.magic = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cursed Breath Pro"); + + } + + + public override void AI() + { + int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 75, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1.9f); + Main.dust[dust].noGravity = true; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (Main.rand.Next(5) == 0) + { + target.AddBuff(39, 60); + } + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + if (Main.rand.Next(5) == 0) + { + target.AddBuff(39, 60); + } + } + } +} diff --git a/Projectiles/CursedTwisterPro.cs b/Projectiles/CursedTwisterPro.cs index 1f870020..9290f437 100644 --- a/Projectiles/CursedTwisterPro.cs +++ b/Projectiles/CursedTwisterPro.cs @@ -9,13 +9,13 @@ namespace Tremor.Projectiles public class CursedTwisterPro : ModProjectile { - public override void Kill(int timeLeft) - { - for(int k = 0; k < 5; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 74, projectile.oldVelocity.X * 0.1f, projectile.oldVelocity.Y * 0.1f); - } - } + public override void Kill(int timeLeft) + { + for (int k = 0; k < 5; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 74, projectile.oldVelocity.X * 0.1f, projectile.oldVelocity.Y * 0.1f); + } + } public override void SetDefaults() { @@ -28,11 +28,11 @@ public override void SetDefaults() projectile.ignoreWater = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("CursedTwisterPro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("CursedTwisterPro"); + + } public override void AI() @@ -78,14 +78,14 @@ public override void AI() projectile.ai[0] += 1f; } projectile.rotation += 0.3f * (float)projectile.direction; - } + } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - if(Main.rand.Next(10) == 0) - { - target.AddBuff(39, 500, false); - } - } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (Main.rand.Next(10) == 0) + { + target.AddBuff(39, 500, false); + } + } } } diff --git a/Projectiles/CyberCutterPro.cs b/Projectiles/CyberCutterPro.cs index 0ee8c65b..371c8c5a 100644 --- a/Projectiles/CyberCutterPro.cs +++ b/Projectiles/CyberCutterPro.cs @@ -6,7 +6,7 @@ using Terraria.ModLoader; namespace Tremor.Projectiles -{ +{ public class CyberCutterPro : ModProjectile { public override void SetDefaults() @@ -24,14 +24,14 @@ public override void SetDefaults() projectile.penetrate = 50; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("CyberCutterPro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("CyberCutterPro"); + + } public override void AI() - { + { projectile.light = 0.9f; int DustID1 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 120, default(Color), 1.75f); int DustID2 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 120, default(Color), 1.75f); @@ -164,18 +164,18 @@ public override void AI() projectile.velocity.Y = 16f; projectile.rotation += (float)projectile.direction * 0.8f; } - if(projectile.timeLeft % 60 == 0) + if (projectile.timeLeft % 60 == 0) Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 23); } - public override bool OnTileCollide(Vector2 velocityChange) + public override bool OnTileCollide(Vector2 velocityChange) { - if (projectile.velocity.X != velocityChange.X) + if (projectile.velocity.X != velocityChange.X) { - projectile.velocity.X = -velocityChange.X; + projectile.velocity.X = -velocityChange.X; } - if (projectile.velocity.Y != velocityChange.Y) - { - projectile.velocity.Y = -velocityChange.Y; + if (projectile.velocity.Y != velocityChange.Y) + { + projectile.velocity.Y = -velocityChange.Y; } projectile.penetrate -= 1; return false; diff --git a/Projectiles/CyberRingPro.cs b/Projectiles/CyberRingPro.cs index b0901dc7..c8187121 100644 --- a/Projectiles/CyberRingPro.cs +++ b/Projectiles/CyberRingPro.cs @@ -5,42 +5,44 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class CyberRingPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class CyberRingPro : ModProjectile + { + public override void SetDefaults() + { projectile.CloneDefaults(348); projectile.width = 90; projectile.height = 90; aiType = 348; - projectile.hostile = true; - projectile.timeLeft = 500; - projectile.light = 0.8f; - } + projectile.hostile = true; + projectile.timeLeft = 500; + projectile.light = 0.8f; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("CyberRingPro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("CyberRingPro"); + } - public override void AI() - { - if (projectile.ai[1] == 0f) - { - projectile.ai[1] = 1f; - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 67); - } - projectile.rotation = (float)System.Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; - if(Main.rand.Next(1) == 0) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 60, projectile.velocity.X * 0.9f, projectile.velocity.Y * 0.9f); - } - } + public override void AI() + { + if (projectile.ai[1] == 0f) + { + projectile.ai[1] = 1f; + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 67); + } + projectile.rotation = (float)System.Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + if (Main.rand.Next(1) == 0) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 60, projectile.velocity.X * 0.9f, projectile.velocity.Y * 0.9f); + } + } -}} + + } +} diff --git a/Projectiles/CyclonePro.cs b/Projectiles/CyclonePro.cs index 48eed282..29abd79e 100644 --- a/Projectiles/CyclonePro.cs +++ b/Projectiles/CyclonePro.cs @@ -5,21 +5,22 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class CyclonePro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class CyclonePro : ModProjectile + { + public override void SetDefaults() + { projectile.CloneDefaults(409); - projectile.tileCollide = false; - } + projectile.tileCollide = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cyclone"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cyclone"); + + } public override Color? GetAlpha(Color lightColor) @@ -27,106 +28,107 @@ public override void SetStaticDefaults() return Color.White; } - public override void AI() - { - projectile.localAI[1] += 1f; - if (projectile.localAI[1] > 10f && Main.rand.Next(3) == 0) + public override void AI() + { + projectile.localAI[1] += 1f; + if (projectile.localAI[1] > 10f && Main.rand.Next(3) == 0) + { + int num816 = 6; + for (int num817 = 0; num817 < num816; num817++) { - int num816 = 6; - for (int num817 = 0; num817 < num816; num817++) - { - Vector2 vector65 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width, (float)projectile.height) / 2f; - vector65 = vector65.RotatedBy((double)(num817 - (num816 / 2 - 1)) * 3.1415926535897931 / (double)((float)num816), default(Vector2)) + projectile.Center; - Vector2 value24 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); - int num818 = Dust.NewDust(vector65 + value24, 0, 0, 61, value24.X * 2f, value24.Y * 2f, 100, default(Color), 1.4f); - Main.dust[num818].noGravity = true; - Main.dust[num818].noLight = true; - Main.dust[num818].velocity /= 4f; - Main.dust[num818].velocity -= projectile.velocity; - } - projectile.alpha -= 5; - if (projectile.alpha < 50) - { - projectile.alpha = 50; - } - projectile.rotation += projectile.velocity.X * 0.1f; - projectile.frame = (int)(projectile.localAI[1] / 3f) % 3; - Lighting.AddLight((int)projectile.Center.X / 16, (int)projectile.Center.Y / 16, 0.1f, 0.4f, 0.6f); + Vector2 vector65 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width, (float)projectile.height) / 2f; + vector65 = vector65.RotatedBy((double)(num817 - (num816 / 2 - 1)) * 3.1415926535897931 / (double)((float)num816), default(Vector2)) + projectile.Center; + Vector2 value24 = ((float)(Main.rand.NextDouble() * 3.1415927410125732) - 1.57079637f).ToRotationVector2() * (float)Main.rand.Next(3, 8); + int num818 = Dust.NewDust(vector65 + value24, 0, 0, 61, value24.X * 2f, value24.Y * 2f, 100, default(Color), 1.4f); + Main.dust[num818].noGravity = true; + Main.dust[num818].noLight = true; + Main.dust[num818].velocity /= 4f; + Main.dust[num818].velocity -= projectile.velocity; } - int num819 = -1; - Vector2 vector66 = projectile.Center; - float num820 = 500f; - if (projectile.localAI[0] > 0f) + projectile.alpha -= 5; + if (projectile.alpha < 50) { - projectile.localAI[0] -= 1f; + projectile.alpha = 50; } - if (projectile.ai[0] == 0f && projectile.localAI[0] == 0f) + projectile.rotation += projectile.velocity.X * 0.1f; + projectile.frame = (int)(projectile.localAI[1] / 3f) % 3; + Lighting.AddLight((int)projectile.Center.X / 16, (int)projectile.Center.Y / 16, 0.1f, 0.4f, 0.6f); + } + int num819 = -1; + Vector2 vector66 = projectile.Center; + float num820 = 500f; + if (projectile.localAI[0] > 0f) + { + projectile.localAI[0] -= 1f; + } + if (projectile.ai[0] == 0f && projectile.localAI[0] == 0f) + { + for (int num821 = 0; num821 < 200; num821++) { - for (int num821 = 0; num821 < 200; num821++) + NPC nPC8 = Main.npc[num821]; + if (nPC8.active && !nPC8.dontTakeDamage && !nPC8.friendly && nPC8.lifeMax > 5 && (projectile.ai[0] == 0f || projectile.ai[0] == (float)(num821 + 1))) { - NPC nPC8 = Main.npc[num821]; - if (nPC8.active && !nPC8.dontTakeDamage && !nPC8.friendly && nPC8.lifeMax > 5 && (projectile.ai[0] == 0f || projectile.ai[0] == (float)(num821 + 1))) + Vector2 vector67 = nPC8.Center; + float num822 = Vector2.Distance(vector67, vector66); + if (num822 < num820 && Collision.CanHit(projectile.position, projectile.width, projectile.height, nPC8.position, nPC8.width, nPC8.height)) { - Vector2 vector67 = nPC8.Center; - float num822 = Vector2.Distance(vector67, vector66); - if (num822 < num820 && Collision.CanHit(projectile.position, projectile.width, projectile.height, nPC8.position, nPC8.width, nPC8.height)) - { - num820 = num822; - vector66 = vector67; - num819 = num821; - } + num820 = num822; + vector66 = vector67; + num819 = num821; } } - if (num819 >= 0) - { - projectile.ai[0] = (float)(num819 + 1); - projectile.netUpdate = true; - } } - if (projectile.localAI[0] == 0f && projectile.ai[0] == 0f) + if (num819 >= 0) { - projectile.localAI[0] = 30f; + projectile.ai[0] = (float)(num819 + 1); + projectile.netUpdate = true; } - bool flag33 = false; - if (projectile.ai[0] != 0f) + } + if (projectile.localAI[0] == 0f && projectile.ai[0] == 0f) + { + projectile.localAI[0] = 30f; + } + bool flag33 = false; + if (projectile.ai[0] != 0f) + { + int num823 = (int)(projectile.ai[0] - 1f); + if (Main.npc[num823].active && !Main.npc[num823].dontTakeDamage && Main.npc[num823].immune[projectile.owner] == 0) { - int num823 = (int)(projectile.ai[0] - 1f); - if (Main.npc[num823].active && !Main.npc[num823].dontTakeDamage && Main.npc[num823].immune[projectile.owner] == 0) + float num824 = Main.npc[num823].position.X + (float)(Main.npc[num823].width / 2); + float num825 = Main.npc[num823].position.Y + (float)(Main.npc[num823].height / 2); + float num826 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num824) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num825); + if (num826 < 1000f) { - float num824 = Main.npc[num823].position.X + (float)(Main.npc[num823].width / 2); - float num825 = Main.npc[num823].position.Y + (float)(Main.npc[num823].height / 2); - float num826 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num824) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num825); - if (num826 < 1000f) - { - flag33 = true; - vector66 = Main.npc[num823].Center; - } - } - else - { - projectile.ai[0] = 0f; - flag33 = false; - projectile.netUpdate = true; + flag33 = true; + vector66 = Main.npc[num823].Center; } } - if (flag33) + else { - Vector2 v = vector66 - projectile.Center; - float num827 = projectile.velocity.ToRotation(); - float num828 = v.ToRotation(); - double num829 = (double)(num828 - num827); - if (num829 > 3.1415926535897931) - { - num829 -= 6.2831853071795862; - } - if (num829 < -3.1415926535897931) - { - num829 += 6.2831853071795862; - } - projectile.velocity = projectile.velocity.RotatedBy(num829 * 0.10000000149011612, default(Vector2)); + projectile.ai[0] = 0f; + flag33 = false; + projectile.netUpdate = true; + } + } + if (flag33) + { + Vector2 v = vector66 - projectile.Center; + float num827 = projectile.velocity.ToRotation(); + float num828 = v.ToRotation(); + double num829 = (double)(num828 - num827); + if (num829 > 3.1415926535897931) + { + num829 -= 6.2831853071795862; } - float num830 = projectile.velocity.Length(); - projectile.velocity.Normalize(); - projectile.velocity *= num830 + 0.0025f; - } -}} + if (num829 < -3.1415926535897931) + { + num829 += 6.2831853071795862; + } + projectile.velocity = projectile.velocity.RotatedBy(num829 * 0.10000000149011612, default(Vector2)); + } + float num830 = projectile.velocity.Length(); + projectile.velocity.Normalize(); + projectile.velocity *= num830 + 0.0025f; + } + } +} diff --git a/Projectiles/DangerBladePro.cs b/Projectiles/DangerBladePro.cs index 918d1fa0..2c2f9380 100644 --- a/Projectiles/DangerBladePro.cs +++ b/Projectiles/DangerBladePro.cs @@ -4,71 +4,73 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -//ported from my tAPI mod because I don't want to make artwork -public class DangerBladePro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + //ported from my tAPI mod because I don't want to make artwork + public class DangerBladePro : ModProjectile + { + public override void SetDefaults() + { + + projectile.width = 14; + projectile.height = 42; + projectile.aiStyle = 1; + projectile.friendly = true; + projectile.penetrate = -2; + projectile.tileCollide = true; + projectile.light = 0.8f; + projectile.melee = true; + } - projectile.width = 14; - projectile.height = 42; - projectile.aiStyle = 1; - projectile.friendly = true; - projectile.penetrate = -2; - projectile.tileCollide = true; - projectile.light = 0.8f; - projectile.melee = true; - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Danger Blade Pro"); - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Danger Blade Pro"); - - } + } public override Color? GetAlpha(Color lightColor) { return Color.White; } - - public override void Kill(int timeLeft) - { - - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 64); - for (int num158 = 0; num158 < 20; num158++) + + public override void Kill(int timeLeft) { - int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); - if (Main.rand.Next(3) == 0) - { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].type++; - } - else + + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 64); + for (int num158 = 0; num158 < 20; num158++) { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 60, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); + if (Main.rand.Next(3) == 0) + { + Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].type++; + } + else + { + Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + } + Main.dust[num159].noGravity = true; + Main.dust[num159].velocity *= 2.5f; + Main.dust[num159].velocity -= projectile.oldVelocity / 10f; } - Main.dust[num159].noGravity = true; - Main.dust[num159].velocity *= 2.5f; - Main.dust[num159].velocity -= projectile.oldVelocity / 10f; - } - if (Main.myPlayer == projectile.owner) - { - int num160 = Main.rand.Next(0, 0); - for (int num161 = 0; num161 < num160; num161++) + if (Main.myPlayer == projectile.owner) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value12.X == 0f && value12.Y == 0f) + int num160 = Main.rand.Next(0, 0); + for (int num161 = 0; num161 < num160; num161++) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + while (value12.X == 0f && value12.Y == 0f) + { + value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + } + value12.Normalize(); + value12 *= (float)Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); } - value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); } } - } -}} + } +} diff --git a/Projectiles/DarkBubblePro.cs b/Projectiles/DarkBubblePro.cs index ed800c0b..3491a5d5 100644 --- a/Projectiles/DarkBubblePro.cs +++ b/Projectiles/DarkBubblePro.cs @@ -5,77 +5,79 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class DarkBubblePro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class DarkBubblePro : ModProjectile + { + public override void SetDefaults() + { - projectile.aiStyle = 1; - projectile.hostile = true; - projectile.timeLeft = 150; - projectile.light = 0.8f; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - Main.projFrames[projectile.type] = 4; - } + projectile.aiStyle = 1; + projectile.hostile = true; + projectile.timeLeft = 150; + projectile.light = 0.8f; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + Main.projFrames[projectile.type] = 4; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dark Bubble"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dark Bubble"); + + } public override void AI() { - if(projectile.frameCounter < 5) + if (projectile.frameCounter < 5) projectile.frame = 0; - else if(projectile.frameCounter >= 5 && projectile.frameCounter < 10) + else if (projectile.frameCounter >= 5 && projectile.frameCounter < 10) projectile.frame = 1; - else if(projectile.frameCounter >= 10 && projectile.frameCounter < 15) + else if (projectile.frameCounter >= 10 && projectile.frameCounter < 15) projectile.frame = 2; - else if(projectile.frameCounter >= 15 && projectile.frameCounter < 20) + else if (projectile.frameCounter >= 15 && projectile.frameCounter < 20) projectile.frame = 3; else projectile.frameCounter = 0; projectile.frameCounter++; } - public override void Kill(int timeLeft) - { - for (int num158 = 0; num158 < 20; num158++) + public override void Kill(int timeLeft) { - int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 54, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.3f); - if (Main.rand.Next(3) == 0) - { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].type++; - } - else + for (int num158 = 0; num158 < 20; num158++) { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 54, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.3f); + if (Main.rand.Next(3) == 0) + { + Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].type++; + } + else + { + Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + } + Main.dust[num159].noGravity = true; + Main.dust[num159].velocity *= 2.5f; + Main.dust[num159].velocity -= projectile.oldVelocity / 10f; } - Main.dust[num159].noGravity = true; - Main.dust[num159].velocity *= 2.5f; - Main.dust[num159].velocity -= projectile.oldVelocity / 10f; - } - if (Main.myPlayer == projectile.owner) - { - int num160 = Main.rand.Next(0, 0); - for (int num161 = 0; num161 < num160; num161++) + if (Main.myPlayer == projectile.owner) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value12.X == 0f && value12.Y == 0f) + int num160 = Main.rand.Next(0, 0); + for (int num161 = 0; num161 < num160; num161++) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + while (value12.X == 0f && value12.Y == 0f) + { + value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + } + value12.Normalize(); + value12 *= (float)Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 2.8f, projectile.owner, 0f, 0f); } - value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 2.8f, projectile.owner, 0f, 0f); } } - } -}} + } +} diff --git a/Projectiles/DarkhalisPro.cs b/Projectiles/DarkhalisPro.cs index 02a9f1dc..010542d6 100644 --- a/Projectiles/DarkhalisPro.cs +++ b/Projectiles/DarkhalisPro.cs @@ -5,22 +5,24 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class DarkhalisPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class DarkhalisPro : ModProjectile + { + public override void SetDefaults() + { projectile.CloneDefaults(595); aiType = 595; - Main.projFrames[projectile.type] = 28; - } + Main.projFrames[projectile.type] = 28; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("DarkhalisPro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("DarkhalisPro"); + } -}} + + } +} diff --git a/Projectiles/DeadFlowerPro.cs b/Projectiles/DeadFlowerPro.cs index 860bdc76..1007bde4 100644 --- a/Projectiles/DeadFlowerPro.cs +++ b/Projectiles/DeadFlowerPro.cs @@ -5,91 +5,93 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class DeadFlowerPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { - projectile.width = 4; - projectile.height = 4; + public class DeadFlowerPro : ModProjectile + { + public override void SetDefaults() + { + projectile.width = 4; + projectile.height = 4; aiType = 295; - projectile.friendly = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dead Flower"); - - } - + projectile.friendly = true; + } - public override void AI() - { - if (projectile.localAI[0] == 0f) + public override void SetStaticDefaults() { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + DisplayName.SetDefault("Dead Flower"); + } - projectile.localAI[0] += 1f; - if (projectile.localAI[0] > 3f) + + + public override void AI() { - int num90 = 1; - if (projectile.localAI[0] > 5f) - { - num90 = 2; - } - for (int num91 = 0; num91 < num90; num91++) + if (projectile.localAI[0] == 0f) { - int num92 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 2f), projectile.width, projectile.height, 27, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 2f); - Main.dust[num92].noGravity = true; - Dust expr_46AC_cp_0 = Main.dust[num92]; - expr_46AC_cp_0.velocity.X = expr_46AC_cp_0.velocity.X * 0.3f; - Dust expr_46CA_cp_0 = Main.dust[num92]; - expr_46CA_cp_0.velocity.Y = expr_46CA_cp_0.velocity.Y * 0.3f; - Main.dust[num92].noLight = true; + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); } - if (projectile.wet && !projectile.lavaWet) + projectile.localAI[0] += 1f; + if (projectile.localAI[0] > 3f) { - projectile.Kill(); - return; + int num90 = 1; + if (projectile.localAI[0] > 5f) + { + num90 = 2; + } + for (int num91 = 0; num91 < num90; num91++) + { + int num92 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 2f), projectile.width, projectile.height, 27, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 2f); + Main.dust[num92].noGravity = true; + Dust expr_46AC_cp_0 = Main.dust[num92]; + expr_46AC_cp_0.velocity.X = expr_46AC_cp_0.velocity.X * 0.3f; + Dust expr_46CA_cp_0 = Main.dust[num92]; + expr_46CA_cp_0.velocity.Y = expr_46CA_cp_0.velocity.Y * 0.3f; + Main.dust[num92].noLight = true; + } + if (projectile.wet && !projectile.lavaWet) + { + projectile.Kill(); + return; + } } } - } - public override void Kill(int timeLeft) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 110); - for (int num158 = 0; num158 < 20; num158++) + public override void Kill(int timeLeft) { - int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 27, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); - if (Main.rand.Next(3) == 0) + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 110); + for (int num158 = 0; num158 < 20; num158++) { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].type++; - } - else - { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 27, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); + if (Main.rand.Next(3) == 0) + { + Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].type++; + } + else + { + Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + } + Main.dust[num159].noGravity = true; + Main.dust[num159].velocity *= 2.5f; + Main.dust[num159].velocity -= projectile.oldVelocity / 10f; } - Main.dust[num159].noGravity = true; - Main.dust[num159].velocity *= 2.5f; - Main.dust[num159].velocity -= projectile.oldVelocity / 10f; - } - if (Main.myPlayer == projectile.owner) - { - int num160 = Main.rand.Next(0, 0); - for (int num161 = 0; num161 < num160; num161++) + if (Main.myPlayer == projectile.owner) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value12.X == 0f && value12.Y == 0f) + int num160 = Main.rand.Next(0, 0); + for (int num161 = 0; num161 < num160; num161++) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + while (value12.X == 0f && value12.Y == 0f) + { + value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + } + value12.Normalize(); + value12 *= (float)Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); } - value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); } } - } -}} + } +} diff --git a/Projectiles/DeathHooksPro.cs b/Projectiles/DeathHooksPro.cs index ed8b1bc9..ee64cd35 100644 --- a/Projectiles/DeathHooksPro.cs +++ b/Projectiles/DeathHooksPro.cs @@ -5,68 +5,69 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class DeathHooksPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class DeathHooksPro : ModProjectile + { + public override void SetDefaults() + { projectile.CloneDefaults(481); projectile.width = 18; projectile.height = 32; aiType = 481; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("DeathHooksPro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("DeathHooksPro"); + } - public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Color lightColor) - { - Texture2D texture = ModLoader.GetTexture("Tremor/Projectiles/DeathHooks_Chain"); - Vector2 position = projectile.Center; - Vector2 mountedCenter = Main.player[projectile.owner].MountedCenter; - Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(); - Vector2 origin = new Vector2((float)texture.Width * 0.5f, (float)texture.Height * 0.5f); - float num1 = (float)texture.Height; - Vector2 vector2_4 = mountedCenter - position; - float rotation = (float)Math.Atan2((double)vector2_4.Y, (double)vector2_4.X) - 1.57f; - bool flag = true; - if (float.IsNaN(position.X) && float.IsNaN(position.Y)) - flag = false; - if (float.IsNaN(vector2_4.X) && float.IsNaN(vector2_4.Y)) - flag = false; - while (flag) - { - if ((double)vector2_4.Length() < (double)num1 + 1.0) - { - flag = false; - } - else - { - Vector2 vector2_1 = vector2_4; - vector2_1.Normalize(); - position += vector2_1 * num1; - vector2_4 = mountedCenter - position; - Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)position.X / 16, (int)((double)position.Y / 16.0)); - color2 = projectile.GetAlpha(color2); - Main.spriteBatch.Draw(texture, position - Main.screenPosition, sourceRectangle, color2, rotation, origin, 1f, SpriteEffects.None, 0.0f); - } - } - return true; - } + public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture = ModLoader.GetTexture("Tremor/Projectiles/DeathHooks_Chain"); - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - if(Main.rand.Next(2) == 0) - { - target.AddBuff(mod.BuffType("DeathFear"), 480, false); - } - } + Vector2 position = projectile.Center; + Vector2 mountedCenter = Main.player[projectile.owner].MountedCenter; + Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(); + Vector2 origin = new Vector2((float)texture.Width * 0.5f, (float)texture.Height * 0.5f); + float num1 = (float)texture.Height; + Vector2 vector2_4 = mountedCenter - position; + float rotation = (float)Math.Atan2((double)vector2_4.Y, (double)vector2_4.X) - 1.57f; + bool flag = true; + if (float.IsNaN(position.X) && float.IsNaN(position.Y)) + flag = false; + if (float.IsNaN(vector2_4.X) && float.IsNaN(vector2_4.Y)) + flag = false; + while (flag) + { + if ((double)vector2_4.Length() < (double)num1 + 1.0) + { + flag = false; + } + else + { + Vector2 vector2_1 = vector2_4; + vector2_1.Normalize(); + position += vector2_1 * num1; + vector2_4 = mountedCenter - position; + Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)position.X / 16, (int)((double)position.Y / 16.0)); + color2 = projectile.GetAlpha(color2); + Main.spriteBatch.Draw(texture, position - Main.screenPosition, sourceRectangle, color2, rotation, origin, 1f, SpriteEffects.None, 0.0f); + } + } + return true; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (Main.rand.Next(2) == 0) + { + target.AddBuff(mod.BuffType("DeathFear"), 480, false); + } + } public override void Kill(int timeLeft) { @@ -74,15 +75,16 @@ public override void Kill(int timeLeft) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, mod.DustType("NightmareFlame"), projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 2f, 100, default(Color), 2f); } - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); + Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); } - public override void OnHitPvp(Player target, int damage, bool crit) - { - if(Main.rand.Next(2) == 0) - { - target.AddBuff(mod.BuffType("DeathFear"), 480, false); - } - } + public override void OnHitPvp(Player target, int damage, bool crit) + { + if (Main.rand.Next(2) == 0) + { + target.AddBuff(mod.BuffType("DeathFear"), 480, false); + } + } -}} + } +} diff --git a/Projectiles/DemonEyePro.cs b/Projectiles/DemonEyePro.cs index 0377dfbb..177d4f9a 100644 --- a/Projectiles/DemonEyePro.cs +++ b/Projectiles/DemonEyePro.cs @@ -4,43 +4,45 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class DemonEyePro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class DemonEyePro : ModProjectile + { + public override void SetDefaults() + { - projectile.width = 16; - projectile.height = 28; - projectile.friendly = true; - projectile.aiStyle = 1; - Main.projFrames[projectile.type] = 2; - projectile.timeLeft = 1200; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; - ProjectileID.Sets.TrailingMode[projectile.type] = 2; - } + projectile.width = 16; + projectile.height = 28; + projectile.friendly = true; + projectile.aiStyle = 1; + Main.projFrames[projectile.type] = 2; + projectile.timeLeft = 1200; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("DemonEyePro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("DemonEyePro"); + } - public override void Kill(int timeLeft) - { - for(int k = 0; k < 5; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 1, projectile.oldVelocity.X * 0.1f, projectile.oldVelocity.Y * 0.1f); - } - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); - Gore.NewGore(projectile.position, projectile.velocity, 1, 1f); - Gore.NewGore(projectile.position, projectile.velocity, 2, 1f); - } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - projectile.ai[0] += 0.1f; - projectile.velocity *= 0.75f; - } -}} + public override void Kill(int timeLeft) + { + for (int k = 0; k < 5; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 1, projectile.oldVelocity.X * 0.1f, projectile.oldVelocity.Y * 0.1f); + } + Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); + Gore.NewGore(projectile.position, projectile.velocity, 1, 1f); + Gore.NewGore(projectile.position, projectile.velocity, 2, 1f); + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + projectile.ai[0] += 0.1f; + projectile.velocity *= 0.75f; + } + } +} diff --git a/Projectiles/DesertClaymorePro.cs b/Projectiles/DesertClaymorePro.cs index 5bb03f8d..baeb63e6 100644 --- a/Projectiles/DesertClaymorePro.cs +++ b/Projectiles/DesertClaymorePro.cs @@ -3,72 +3,72 @@ namespace Tremor.Projectiles { - public class DesertClaymorePro : ModProjectile - { - const int MaxYOffset = 5; - const int SpeedMulti = 2; - const int XOffset = 24; // Ðа Ñколько блоков от игрока будет поÑвлÑÑ‚ÑÑ Ð¼ÐµÑ‡. (16ед. == 1 блок.) + public class DesertClaymorePro : ModProjectile + { + const int MaxYOffset = 5; + const int SpeedMulti = 2; + const int XOffset = 24; // Ðа Ñколько блоков от игрока будет поÑвлÑÑ‚ÑÑ Ð¼ÐµÑ‡. (16ед. == 1 блок.) - int YOffset = 0; - int YOffsetStep = -1; - bool UP = true; - float YPos = 0; + int YOffset = 0; + int YOffsetStep = -1; + bool UP = true; + float YPos = 0; - public override void SetDefaults() - { + public override void SetDefaults() + { - projectile.width = 30; - projectile.tileCollide = false; - projectile.height = 60; - projectile.aiStyle = 0; - projectile.friendly = true; - projectile.melee = true; - projectile.penetrate = -1; - projectile.timeLeft = 1080; // Ð’Ñ€ÐµÐ¼Ñ ÐºÐ¾Ñ‚Ð¾Ñ€Ð¾Ðµ он будет ÑтоÑÑ‚ÑŒ на меÑте (60ед. == 1Ñек.) - } + projectile.width = 30; + projectile.tileCollide = false; + projectile.height = 60; + projectile.aiStyle = 0; + projectile.friendly = true; + projectile.melee = true; + projectile.penetrate = -1; + projectile.timeLeft = 1080; // Ð’Ñ€ÐµÐ¼Ñ ÐºÐ¾Ñ‚Ð¾Ñ€Ð¾Ðµ он будет ÑтоÑÑ‚ÑŒ на меÑте (60ед. == 1Ñек.) + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Desert Claymore"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Desert Claymore"); + } - bool FirstAI = true; - public override void AI() - { - if (FirstAI) - { - YPos = projectile.position.Y; - if (projectile.ai[0] == -1) - projectile.position.X -= XOffset; - else - projectile.position.X += XOffset; - FirstAI = false; - } - if (projectile.aiStyle == 0) - { - if (UP) - { - YOffset += YOffsetStep; - if (YOffset <= -MaxYOffset) - UP = false; - } - else - { - YOffset -= YOffsetStep; - if (YOffset >= MaxYOffset) - UP = true; - } - projectile.position = new Vector2(projectile.position.X, YPos + YOffset); - } - if (projectile.timeLeft == 2) - { - ++projectile.timeLeft; - projectile.aiStyle = 3; - } - if (projectile.aiStyle == 3) - projectile.position += projectile.velocity * (SpeedMulti - 1); - } - } + + bool FirstAI = true; + public override void AI() + { + if (FirstAI) + { + YPos = projectile.position.Y; + if (projectile.ai[0] == -1) + projectile.position.X -= XOffset; + else + projectile.position.X += XOffset; + FirstAI = false; + } + if (projectile.aiStyle == 0) + { + if (UP) + { + YOffset += YOffsetStep; + if (YOffset <= -MaxYOffset) + UP = false; + } + else + { + YOffset -= YOffsetStep; + if (YOffset >= MaxYOffset) + UP = true; + } + projectile.position = new Vector2(projectile.position.X, YPos + YOffset); + } + if (projectile.timeLeft == 2) + { + ++projectile.timeLeft; + projectile.aiStyle = 3; + } + if (projectile.aiStyle == 3) + projectile.position += projectile.velocity * (SpeedMulti - 1); + } + } } diff --git a/Projectiles/DesertSigil.cs b/Projectiles/DesertSigil.cs index 58001e8e..b9183366 100644 --- a/Projectiles/DesertSigil.cs +++ b/Projectiles/DesertSigil.cs @@ -7,95 +7,95 @@ namespace Tremor.Projectiles { - public class DesertSigil : ModProjectile - { - const int ShootRate = 22; // ����� ����५� (1 ᥪ㭤� = 60��.) - const float ShootDistance = 300f; // ���쭮��� ��५�� - const float ShootSpeed = 25f; // ������� ᭠�鸞 - const int ShootDamage = 38; // �஭ ᭠�鸞 - const float ShootKnockback = 10; // ���� ᭠�鸞 - int ShootType = 122; // ��� ����५� (�᫨ �� �����쭮� �ન) - int TimeToShoot = ShootRate; + public class DesertSigil : ModProjectile + { + const int ShootRate = 22; // ����� ����५� (1 ᥪ㭤� = 60��.) + const float ShootDistance = 300f; // ���쭮��� ��५�� + const float ShootSpeed = 25f; // ������� ᭠�鸞 + const int ShootDamage = 38; // �஭ ᭠�鸞 + const float ShootKnockback = 10; // ���� ᭠�鸞 + int ShootType = 122; // ��� ����५� (�᫨ �� �����쭮� �ન) + int TimeToShoot = ShootRate; - public override void SetDefaults() - { + public override void SetDefaults() + { projectile.CloneDefaults(226); - projectile.width = 34; + projectile.width = 34; Main.projFrames[projectile.type] = 1; - projectile.height = 34; - projectile.timeLeft = 5; - projectile.aiStyle = 62; - aiType = 226; - projectile.penetrate = -1; - projectile.tileCollide = false; - projectile.ignoreWater = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Desert Sigil"); - - } - + projectile.height = 34; + projectile.timeLeft = 5; + projectile.aiStyle = 62; + aiType = 226; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.ignoreWater = true; + } - public override bool OnTileCollide(Vector2 oldVelocity) - { - return false; - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Desert Sigil"); - void Shoot() - { - if (--TimeToShoot <= 0) - { - TimeToShoot = ShootRate; + } - float NearestNPCDist = ShootDistance; - int NearestNPC = -1; - foreach (NPC npc in Main.npc) - { - if (!npc.active) - continue; - if (npc.friendly || npc.lifeMax <= 5) - continue; - if (NearestNPCDist == -1 || npc.Distance(projectile.Center) < NearestNPCDist && Collision.CanHitLine(projectile.Center, 16, 16, npc.Center, 16, 16)) - { - NearestNPCDist = npc.Distance(projectile.Center); - NearestNPC = npc.whoAmI; - } - } - if (NearestNPC == -1) - return; - Vector2 Velocity = Helper.VelocityToPoint(projectile.Center, Main.npc[NearestNPC].Center, ShootSpeed); - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, Velocity.X, Velocity.Y, ShootType, ShootDamage, ShootKnockback, projectile.owner); - } - } + public override bool OnTileCollide(Vector2 oldVelocity) + { + return false; + } - public override void AI() - { - Shoot(); - projectile.ai[1] = 1; - base.AI(); - if (projectile.localAI[0] == 0f) + void Shoot() { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); + if (--TimeToShoot <= 0) + { + TimeToShoot = ShootRate; + + float NearestNPCDist = ShootDistance; + int NearestNPC = -1; + foreach (NPC npc in Main.npc) + { + if (!npc.active) + continue; + if (npc.friendly || npc.lifeMax <= 5) + continue; + if (NearestNPCDist == -1 || npc.Distance(projectile.Center) < NearestNPCDist && Collision.CanHitLine(projectile.Center, 16, 16, npc.Center, 16, 16)) + { + NearestNPCDist = npc.Distance(projectile.Center); + NearestNPC = npc.whoAmI; + } + } + if (NearestNPC == -1) + return; + Vector2 Velocity = Helper.VelocityToPoint(projectile.Center, Main.npc[NearestNPC].Center, ShootSpeed); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, Velocity.X, Velocity.Y, ShootType, ShootDamage, ShootKnockback, projectile.owner); + } } - projectile.localAI[0] += 1f; - if (projectile.localAI[0] > 3f) + + + public override void AI() { - int num90 = 1; - if (projectile.localAI[0] > 5f) + Shoot(); + projectile.ai[1] = 1; + base.AI(); + if (projectile.localAI[0] == 0f) { - num90 = 2; + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); } - if (projectile.wet && !projectile.lavaWet) + projectile.localAI[0] += 1f; + if (projectile.localAI[0] > 3f) { - projectile.Kill(); - return; + int num90 = 1; + if (projectile.localAI[0] > 5f) + { + num90 = 2; + } + if (projectile.wet && !projectile.lavaWet) + { + projectile.Kill(); + return; + } } } - } - } + } } diff --git a/Projectiles/DevastatorPro.cs b/Projectiles/DevastatorPro.cs index 6ccdd048..dc59e925 100644 --- a/Projectiles/DevastatorPro.cs +++ b/Projectiles/DevastatorPro.cs @@ -10,57 +10,58 @@ public class DevastatorPro : ModProjectile public override void SetDefaults() { - projectile.width = 46; - projectile.height = 46; - projectile.aiStyle = 14; - projectile.friendly = true; - projectile.ranged = true; - projectile.penetrate =3; - projectile.timeLeft = 9000; - projectile.extraUpdates = 1; - } + projectile.width = 46; + projectile.height = 46; + projectile.aiStyle = 14; + projectile.friendly = true; + projectile.ranged = true; + projectile.penetrate = 3; + projectile.timeLeft = 9000; + projectile.extraUpdates = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Devastator Pro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Devastator Pro"); + + } - public override bool OnTileCollide(Vector2 oldVelocity) - { - projectile.penetrate--; - if(projectile.penetrate <= 0) - { - projectile.velocity.Y = -oldVelocity.Y; - } - else - { - projectile.ai[0] += 0.1f; - if(projectile.velocity.X != oldVelocity.X) - { - projectile.velocity.X = -oldVelocity.X; - } - if(projectile.velocity.Y != oldVelocity.Y) - { - projectile.velocity.Y = -oldVelocity.Y; - } - projectile.velocity *= 0.75f; - for(int k = 0; k < 30; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 1, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); - } - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); - } - return false; - } + public override bool OnTileCollide(Vector2 oldVelocity) + { + projectile.penetrate--; + if (projectile.penetrate <= 0) + { + projectile.velocity.Y = -oldVelocity.Y; + } + else + { + projectile.ai[0] += 0.1f; + if (projectile.velocity.X != oldVelocity.X) + { + projectile.velocity.X = -oldVelocity.X; + } + if (projectile.velocity.Y != oldVelocity.Y) + { + projectile.velocity.Y = -oldVelocity.Y; + } + projectile.velocity *= 0.75f; + for (int k = 0; k < 30; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 1, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); + } + Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); + } + return false; + } - public override void Kill(int timeLeft) - { - for(int k = 0; k < 30; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 1, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 1.5f); - } - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); + public override void Kill(int timeLeft) + { + for (int k = 0; k < 30; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 1, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 1.5f); + } + Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); + } + } } -}} diff --git a/Projectiles/DiamondBeamPro.cs b/Projectiles/DiamondBeamPro.cs index aaf51c35..b909a4e9 100644 --- a/Projectiles/DiamondBeamPro.cs +++ b/Projectiles/DiamondBeamPro.cs @@ -38,11 +38,11 @@ public override void SetDefaults() projectile.hide = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Diamond Beam"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Diamond Beam"); + + } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) @@ -50,8 +50,8 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) if (Charge == MAX_CHARGE) { Vector2 unit = projectile.velocity; - DrawLaser(spriteBatch, Main.projectileTexture[projectile.type], - Main.player[projectile.owner].Center, unit, 10, projectile.damage, + DrawLaser(spriteBatch, Main.projectileTexture[projectile.type], + Main.player[projectile.owner].Center, unit, 10, projectile.damage, -1.57f, 1f, 1000f, Color.White, (int)MOVE_DISTANCE); } return false; diff --git a/Projectiles/DiamondDrillPro.cs b/Projectiles/DiamondDrillPro.cs index 1a7fbe59..6dd1dd3f 100644 --- a/Projectiles/DiamondDrillPro.cs +++ b/Projectiles/DiamondDrillPro.cs @@ -4,35 +4,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { - -public class DiamondDrillPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { - - projectile.width = 22; - projectile.height = 22; - projectile.aiStyle = 20; - projectile.friendly = true; - projectile.penetrate = -1; - projectile.tileCollide = false; - projectile.hide = true; - projectile.ownerHitCheck = true; - projectile.melee = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Diamond Drill"); - - } - - - public override void AI() - { - int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 63, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1.9f); - Main.dust[dust].noGravity = true; - } - -}} + + public class DiamondDrillPro : ModProjectile + { + public override void SetDefaults() + { + + projectile.width = 22; + projectile.height = 22; + projectile.aiStyle = 20; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.hide = true; + projectile.ownerHitCheck = true; + projectile.melee = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Diamond Drill"); + + } + + + public override void AI() + { + int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 63, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1.9f); + Main.dust[dust].noGravity = true; + } + + } +} diff --git a/Projectiles/DissolverPro.cs b/Projectiles/DissolverPro.cs index 0fbcd296..6f1cc99d 100644 --- a/Projectiles/DissolverPro.cs +++ b/Projectiles/DissolverPro.cs @@ -10,42 +10,42 @@ public class DissolverPro : ModProjectile { public override void SetDefaults() { - projectile.CloneDefaults(553); + projectile.CloneDefaults(553); projectile.width = 16; projectile.height = 16; projectile.friendly = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("DissolverPro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("DissolverPro"); - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - if(Main.rand.Next(2) == 0) - { - target.AddBuff(69, 280, false); - } - } + } - public override void AI() - { - projectile.rotation = (float)System.Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; - if(Main.rand.Next(1) == 0) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 57, projectile.velocity.X * 0.9f, projectile.velocity.Y * 0.9f); - } - } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (Main.rand.Next(2) == 0) + { + target.AddBuff(69, 280, false); + } + } - public override void OnHitPvp(Player target, int damage, bool crit) - { - if(Main.rand.Next(2) == 0) - { - target.AddBuff(69, 280, false); - } - } + public override void AI() + { + projectile.rotation = (float)System.Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + if (Main.rand.Next(1) == 0) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 57, projectile.velocity.X * 0.9f, projectile.velocity.Y * 0.9f); + } + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + if (Main.rand.Next(2) == 0) + { + target.AddBuff(69, 280, false); + } + } } } diff --git a/Projectiles/DivineClaymorePro.cs b/Projectiles/DivineClaymorePro.cs index 0d01a65a..ac408e10 100644 --- a/Projectiles/DivineClaymorePro.cs +++ b/Projectiles/DivineClaymorePro.cs @@ -5,31 +5,32 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class DivineClaymorePro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class DivineClaymorePro : ModProjectile + { + public override void SetDefaults() + { + + projectile.width = 45; + projectile.height = 45; + projectile.aiStyle = 27; + projectile.friendly = true; + projectile.ranged = true; + projectile.penetrate = 5; + projectile.timeLeft = 600; + projectile.light = 0.9f; + projectile.extraUpdates = 1; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + aiType = ProjectileID.Bullet; + } - projectile.width = 45; - projectile.height = 45; - projectile.aiStyle = 27; - projectile.friendly = true; - projectile.ranged = true; - projectile.penetrate = 5; - projectile.timeLeft = 600; - projectile.light = 0.9f; - projectile.extraUpdates = 1; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - aiType = ProjectileID.Bullet; - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("DivineClaymorePro"); - public override void SetStaticDefaults() - { - DisplayName.SetDefault("DivineClaymorePro"); - - } + } public override Color? GetAlpha(Color lightColor) @@ -37,105 +38,106 @@ public override void SetStaticDefaults() return Color.White; } - public override void Kill(int timeLeft) - { - for (int num158 = 0; num158 < 20; num158++) + public override void Kill(int timeLeft) { - int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 226, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 1.5f); - if (Main.rand.Next(3) == 0) + for (int num158 = 0; num158 < 20; num158++) { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].type++; - } - else - { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 226, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 1.5f); + if (Main.rand.Next(3) == 0) + { + Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].type++; + } + else + { + Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + } + Main.dust[num159].noGravity = true; + Main.dust[num159].velocity *= 2.5f; + Main.dust[num159].velocity -= projectile.oldVelocity / 10f; } - Main.dust[num159].noGravity = true; - Main.dust[num159].velocity *= 2.5f; - Main.dust[num159].velocity -= projectile.oldVelocity / 10f; - } - if (Main.myPlayer == projectile.owner) - { - int num160 = Main.rand.Next(0, 0); - for (int num161 = 0; num161 < num160; num161++) + if (Main.myPlayer == projectile.owner) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value12.X == 0f && value12.Y == 0f) + int num160 = Main.rand.Next(0, 0); + for (int num161 = 0; num161 < num160; num161++) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + while (value12.X == 0f && value12.Y == 0f) + { + value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + } + value12.Normalize(); + value12 *= (float)Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 2.8f, projectile.owner, 0f, 0f); } - value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 2.8f, projectile.owner, 0f, 0f); } } - } - public override void AI() - { - if (projectile.scale > 1f) - projectile.scale = 1f; - Vector2 vector63 = Main.player[projectile.owner].Center - projectile.Center; - if (Main.player[projectile.owner].dead) + public override void AI() + { + if (projectile.scale > 1f) + projectile.scale = 1f; + Vector2 vector63 = Main.player[projectile.owner].Center - projectile.Center; + if (Main.player[projectile.owner].dead) + { + projectile.Kill(); + return; + } + if (projectile.ai[0] == 0f && vector63.Length() > 400f) + { + projectile.ai[0] = 1f; + } + if (projectile.ai[0] == 1f || projectile.ai[0] == 2f) + { + float num810 = vector63.Length(); + if (num810 > 1500f) { projectile.Kill(); return; } - if (projectile.ai[0] == 0f && vector63.Length() > 400f) + if (num810 > 600f) { - projectile.ai[0] = 1f; + projectile.ai[0] = 2f; } - if (projectile.ai[0] == 1f || projectile.ai[0] == 2f) + float num811 = 20f; + if (projectile.ai[0] == 2f) { - float num810 = vector63.Length(); - if (num810 > 1500f) - { - projectile.Kill(); - return; - } - if (num810 > 600f) - { - projectile.ai[0] = 2f; - } - float num811 = 20f; - if (projectile.ai[0] == 2f) - { - num811 = 40f; - } - if (vector63.Length() < num811) - { - projectile.Kill(); - return; - } + num811 = 40f; } - projectile.ai[1] += 1f; - if (projectile.ai[1] > 5f) + if (vector63.Length() < num811) { - projectile.alpha = 0; + projectile.Kill(); + return; } - if ((int)projectile.ai[1] % 3 == 0 && projectile.owner == Main.myPlayer) - { - Vector2 vector64 = vector63 * -1f; - vector64.Normalize(); - vector64 *= (float)Main.rand.Next(5, 25) * 0.9f; + } + projectile.ai[1] += 1f; + if (projectile.ai[1] > 5f) + { + projectile.alpha = 0; + } + if ((int)projectile.ai[1] % 3 == 0 && projectile.owner == Main.myPlayer) + { + Vector2 vector64 = vector63 * -1f; + vector64.Normalize(); + vector64 *= (float)Main.rand.Next(5, 25) * 0.9f; - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vector64.X, vector64.Y, mod.ProjectileType("DivineRingPro"), projectile.damage/4, projectile.knockBack, projectile.owner, -10f, 0f); - } - } + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vector64.X, vector64.Y, mod.ProjectileType("DivineRingPro"), projectile.damage / 4, projectile.knockBack, projectile.owner, -10f, 0f); + } + } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Vector2 drawOrigin = new Vector2(Main.projectileTexture[projectile.type].Width * 0.5f, projectile.height * 0.5f); - for(int k = 0; k < projectile.oldPos.Length; k++) - { - Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); - Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); - spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); - } - return true; - } -}} + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Vector2 drawOrigin = new Vector2(Main.projectileTexture[projectile.type].Width * 0.5f, projectile.height * 0.5f); + for (int k = 0; k < projectile.oldPos.Length; k++) + { + Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); + Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); + spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); + } + return true; + } + } +} diff --git a/Projectiles/DivineRingPro.cs b/Projectiles/DivineRingPro.cs index 55ed456b..a455629f 100644 --- a/Projectiles/DivineRingPro.cs +++ b/Projectiles/DivineRingPro.cs @@ -5,28 +5,29 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class DivineRingPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class DivineRingPro : ModProjectile + { + public override void SetDefaults() + { projectile.CloneDefaults(405); aiType = 405; - projectile.width = 36; - projectile.height = 34; - projectile.friendly = true; - projectile.timeLeft = 150; - projectile.light = 0.8f; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - } + projectile.width = 36; + projectile.height = 34; + projectile.friendly = true; + projectile.timeLeft = 150; + projectile.light = 0.8f; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("DivineRingPro"); - public override void SetStaticDefaults() - { - DisplayName.SetDefault("DivineRingPro"); - - } + } public override Color? GetAlpha(Color lightColor) @@ -35,51 +36,52 @@ public override void SetStaticDefaults() } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Vector2 drawOrigin = new Vector2(Main.projectileTexture[projectile.type].Width * 0.5f, projectile.height * 0.5f); - for(int k = 0; k < projectile.oldPos.Length; k++) - { - Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); - Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); - spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); - } - return true; - } - - public override void Kill(int timeLeft) - { - for (int num158 = 0; num158 < 20; num158++) + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 226, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.3f); - if (Main.rand.Next(3) == 0) - { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].type++; - } - else + Vector2 drawOrigin = new Vector2(Main.projectileTexture[projectile.type].Width * 0.5f, projectile.height * 0.5f); + for (int k = 0; k < projectile.oldPos.Length; k++) { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); + Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); + spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); } - Main.dust[num159].noGravity = true; - Main.dust[num159].velocity *= 2.5f; - Main.dust[num159].velocity -= projectile.oldVelocity / 10f; + return true; } - if (Main.myPlayer == projectile.owner) + + public override void Kill(int timeLeft) { - int num160 = Main.rand.Next(0, 0); - for (int num161 = 0; num161 < num160; num161++) + for (int num158 = 0; num158 < 20; num158++) + { + int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 226, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.3f); + if (Main.rand.Next(3) == 0) + { + Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].type++; + } + else + { + Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + } + Main.dust[num159].noGravity = true; + Main.dust[num159].velocity *= 2.5f; + Main.dust[num159].velocity -= projectile.oldVelocity / 10f; + } + if (Main.myPlayer == projectile.owner) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value12.X == 0f && value12.Y == 0f) + int num160 = Main.rand.Next(0, 0); + for (int num161 = 0; num161 < num160; num161++) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + while (value12.X == 0f && value12.Y == 0f) + { + value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + } + value12.Normalize(); + value12 *= (float)Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 2.8f, projectile.owner, 0f, 0f); } - value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 2.8f, projectile.owner, 0f, 0f); } } - } -}} + } +} diff --git a/Projectiles/DragonBreathPro.cs b/Projectiles/DragonBreathPro.cs index 398973f3..4055c8d7 100644 --- a/Projectiles/DragonBreathPro.cs +++ b/Projectiles/DragonBreathPro.cs @@ -4,48 +4,50 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { - -public class DragonBreathPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { - - projectile.width = 22; - projectile.height = 22; - projectile.aiStyle = 6; - projectile.friendly = true; - projectile.penetrate = -1; - projectile.tileCollide = true; - projectile.magic = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dragon Breath Pro"); - - } - - - public override void AI() - { - int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1.9f); - Main.dust[dust].noGravity = true; - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - if(Main.rand.Next(5) == 0) - { - target.AddBuff(BuffID.OnFire, 80, false); - } - } - - public override void OnHitPvp(Player target, int damage, bool crit) - { - if(Main.rand.Next(5) == 0) - { - target.AddBuff(BuffID.OnFire, 80, false); - } - } -}} + + public class DragonBreathPro : ModProjectile + { + public override void SetDefaults() + { + + projectile.width = 22; + projectile.height = 22; + projectile.aiStyle = 6; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.tileCollide = true; + projectile.magic = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dragon Breath Pro"); + + } + + + public override void AI() + { + int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1.9f); + Main.dust[dust].noGravity = true; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (Main.rand.Next(5) == 0) + { + target.AddBuff(BuffID.OnFire, 80, false); + } + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + if (Main.rand.Next(5) == 0) + { + target.AddBuff(BuffID.OnFire, 80, false); + } + } + } +} diff --git a/Projectiles/DragonGrenade.cs b/Projectiles/DragonGrenade.cs index 476bdb3a..009f32a2 100644 --- a/Projectiles/DragonGrenade.cs +++ b/Projectiles/DragonGrenade.cs @@ -5,21 +5,23 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class DragonGrenade : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class DragonGrenade : ModProjectile + { + public override void SetDefaults() + { projectile.CloneDefaults(139); aiType = 139; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("DragonGrenade"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("DragonGrenade"); + } -}} + + } +} diff --git a/Projectiles/DragonHead.cs b/Projectiles/DragonHead.cs index adaa668f..de0d2bf0 100644 --- a/Projectiles/DragonHead.cs +++ b/Projectiles/DragonHead.cs @@ -9,70 +9,70 @@ namespace Tremor.Projectiles { - public class DragonHead : ModProjectile - { - public override void SetDefaults() - { + public class DragonHead : ModProjectile + { + public override void SetDefaults() + { - projectile.width = 36; - projectile.height = 24; - projectile.friendly = true; - projectile.penetrate = -1; // Penetrates NPCs infinitely. - projectile.melee = true; // Deals melee dmg. + projectile.width = 36; + projectile.height = 24; + projectile.friendly = true; + projectile.penetrate = -1; // Penetrates NPCs infinitely. + projectile.melee = true; // Deals melee dmg. - projectile.aiStyle = 15; // Set the aiStyle to that of a flail. - } + projectile.aiStyle = 15; // Set the aiStyle to that of a flail. + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ancient Flail"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ancient Flail"); + } - public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Color lightColor) - { - Texture2D texture = ModLoader.GetTexture("Tremor/Projectiles/DragonHead_Chain"); - Vector2 position = projectile.Center; - Vector2 mountedCenter = Main.player[projectile.owner].MountedCenter; - Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(); - Vector2 origin = new Vector2((float)texture.Width * 0.5f, (float)texture.Height * 0.5f); - float num1 = (float)texture.Height; - Vector2 vector2_4 = mountedCenter - position; - float rotation = (float)Math.Atan2((double)vector2_4.Y, (double)vector2_4.X) - 1.57f; - bool flag = true; - if (float.IsNaN(position.X) && float.IsNaN(position.Y)) - flag = false; - if (float.IsNaN(vector2_4.X) && float.IsNaN(vector2_4.Y)) - flag = false; - while (flag) - { - if ((double)vector2_4.Length() < (double)num1 + 1.0) - { - flag = false; - } - else - { - Vector2 vector2_1 = vector2_4; - vector2_1.Normalize(); - position += vector2_1 * num1; - vector2_4 = mountedCenter - position; - Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)position.X / 16, (int)((double)position.Y / 16.0)); - color2 = projectile.GetAlpha(color2); - Main.spriteBatch.Draw(texture, position - Main.screenPosition, sourceRectangle, color2, rotation, origin, 1f, SpriteEffects.None, 0.0f); - } - } + public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture = ModLoader.GetTexture("Tremor/Projectiles/DragonHead_Chain"); - return true; - } + Vector2 position = projectile.Center; + Vector2 mountedCenter = Main.player[projectile.owner].MountedCenter; + Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(); + Vector2 origin = new Vector2((float)texture.Width * 0.5f, (float)texture.Height * 0.5f); + float num1 = (float)texture.Height; + Vector2 vector2_4 = mountedCenter - position; + float rotation = (float)Math.Atan2((double)vector2_4.Y, (double)vector2_4.X) - 1.57f; + bool flag = true; + if (float.IsNaN(position.X) && float.IsNaN(position.Y)) + flag = false; + if (float.IsNaN(vector2_4.X) && float.IsNaN(vector2_4.Y)) + flag = false; + while (flag) + { + if ((double)vector2_4.Length() < (double)num1 + 1.0) + { + flag = false; + } + else + { + Vector2 vector2_1 = vector2_4; + vector2_1.Normalize(); + position += vector2_1 * num1; + vector2_4 = mountedCenter - position; + Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)position.X / 16, (int)((double)position.Y / 16.0)); + color2 = projectile.GetAlpha(color2); + Main.spriteBatch.Draw(texture, position - Main.screenPosition, sourceRectangle, color2, rotation, origin, 1f, SpriteEffects.None, 0.0f); + } + } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - if(Main.rand.Next(3) == 0) - { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, 400, projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); - } - } - } + return true; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (Main.rand.Next(3) == 0) + { + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, 400, projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + } + } + } } diff --git a/Projectiles/DragonSpearPro.cs b/Projectiles/DragonSpearPro.cs index 10522519..e55ca6ea 100644 --- a/Projectiles/DragonSpearPro.cs +++ b/Projectiles/DragonSpearPro.cs @@ -5,26 +5,28 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class DragonSpearPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class DragonSpearPro : ModProjectile + { + public override void SetDefaults() + { projectile.CloneDefaults(218); aiType = 218; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("DragonSpearPro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("DragonSpearPro"); + } - public override void AI() - { - int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 61, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 136, default(Color), 2.9f); - Main.dust[dust].noGravity = true; - } -}} + + public override void AI() + { + int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 61, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 136, default(Color), 2.9f); + Main.dust[dust].noGravity = true; + } + } +} diff --git a/Projectiles/DreadGun.cs b/Projectiles/DreadGun.cs index 2bbc49b2..d44f4048 100644 --- a/Projectiles/DreadGun.cs +++ b/Projectiles/DreadGun.cs @@ -5,48 +5,50 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class DreadGun : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class DreadGun : ModProjectile + { + public override void SetDefaults() + { - projectile.width = 8; - projectile.height = 18; - projectile.aiStyle = 0; - projectile.friendly = true; - projectile.ranged = true; - projectile.penetrate = 5; - projectile.timeLeft = 600; - projectile.light = 0.5f; - projectile.extraUpdates = 1; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - aiType = ProjectileID.Bullet; - } + projectile.width = 8; + projectile.height = 18; + projectile.aiStyle = 0; + projectile.friendly = true; + projectile.ranged = true; + projectile.penetrate = 5; + projectile.timeLeft = 600; + projectile.light = 0.5f; + projectile.extraUpdates = 1; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + aiType = ProjectileID.Bullet; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dread Gun"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dread Gun"); + } - public override void AI() - { - projectile.velocity.Y += projectile.ai[0]; - if(Main.rand.Next(3) == 0) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 15, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); - } - } - public override void Kill(int timeLeft) - { - for(int k = 0; k < 40; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 15, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); - } - //Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); + public override void AI() + { + projectile.velocity.Y += projectile.ai[0]; + if (Main.rand.Next(3) == 0) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 15, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); + } + } + + public override void Kill(int timeLeft) + { + for (int k = 0; k < 40; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 15, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); + } + //Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); + } + } } -}} diff --git a/Projectiles/DrippingKnifePro.cs b/Projectiles/DrippingKnifePro.cs index 7977cdd2..e700dd1f 100644 --- a/Projectiles/DrippingKnifePro.cs +++ b/Projectiles/DrippingKnifePro.cs @@ -4,40 +4,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class DrippingKnifePro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class DrippingKnifePro : ModProjectile + { + public override void SetDefaults() + { - projectile.width = 14; - projectile.height = 32; - projectile.friendly = true; - projectile.aiStyle = 1; - projectile.timeLeft = 1200; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; - ProjectileID.Sets.TrailingMode[projectile.type] = 2; - } + projectile.width = 14; + projectile.height = 32; + projectile.friendly = true; + projectile.aiStyle = 1; + projectile.timeLeft = 1200; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("DrippingKnifePro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("DrippingKnifePro"); + } - public override void Kill(int timeLeft) - { - for(int k = 0; k < 5; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 5, projectile.oldVelocity.X * 0.1f, projectile.oldVelocity.Y * 0.1f); - } - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); - } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - projectile.ai[0] += 0.1f; - projectile.velocity *= 0.75f; - } -}} + public override void Kill(int timeLeft) + { + for (int k = 0; k < 5; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 5, projectile.oldVelocity.X * 0.1f, projectile.oldVelocity.Y * 0.1f); + } + Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + projectile.ai[0] += 0.1f; + projectile.velocity *= 0.75f; + } + } +} diff --git a/Projectiles/Dukado.cs b/Projectiles/Dukado.cs index a5f3386a..924d7c35 100644 --- a/Projectiles/Dukado.cs +++ b/Projectiles/Dukado.cs @@ -6,41 +6,41 @@ namespace Tremor.Projectiles { - public class Dukado : ModProjectile - { - public override void SetDefaults() - { + public class Dukado : ModProjectile + { + public override void SetDefaults() + { - projectile.width = 158; - projectile.height = 42; - projectile.scale = 0.98f; - projectile.friendly = true; - projectile.tileCollide = false; - projectile.ignoreWater = true; - projectile.penetrate = -1; - projectile.alpha = 255; - projectile.timeLeft = 120; - Main.projFrames[projectile.type] = 6; - } + projectile.width = 158; + projectile.height = 42; + projectile.scale = 0.98f; + projectile.friendly = true; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.penetrate = -1; + projectile.alpha = 255; + projectile.timeLeft = 120; + Main.projFrames[projectile.type] = 6; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Dukado"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Dukado"); + } - public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) - { - if (Main.rand.Next(1, 101) <= Main.player[projectile.owner].GetModPlayer(mod).alchemistCrit) - { - crit = true; - } - } - public override void AI() - { - int num613 = 10; + public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) + { + if (Main.rand.Next(1, 101) <= Main.player[projectile.owner].GetModPlayer(mod).alchemistCrit) + { + crit = true; + } + } + + public override void AI() + { + int num613 = 10; int num614 = 15; float num615 = 1f; int num616 = 150; @@ -118,6 +118,6 @@ public override void AI() projectile.position.X = projectile.position.X + num624 * (float)(-(float)projectile.direction); return; } - } - } + } + } } diff --git a/Projectiles/DukesCannonBall.cs b/Projectiles/DukesCannonBall.cs index d8cde523..e67f982c 100644 --- a/Projectiles/DukesCannonBall.cs +++ b/Projectiles/DukesCannonBall.cs @@ -7,36 +7,36 @@ namespace Tremor.Projectiles { - public class DukesCannonBall : ModProjectile - { - const int LifePerHit = 10; - int Life = 0; - int Hits = 5; - bool NeedAddLife = true; - public override void SetDefaults() - { + public class DukesCannonBall : ModProjectile + { + const int LifePerHit = 10; + int Life = 0; + int Hits = 5; + bool NeedAddLife = true; + public override void SetDefaults() + { - projectile.width = 12; - projectile.height = 12; - projectile.friendly = true; - projectile.magic = true; - projectile.penetrate = 25; - projectile.timeLeft = 99999999; - projectile.aiStyle = -1; - projectile.tileCollide = true; - projectile.ignoreWater = false; - } + projectile.width = 12; + projectile.height = 12; + projectile.friendly = true; + projectile.magic = true; + projectile.penetrate = 25; + projectile.timeLeft = 99999999; + projectile.aiStyle = -1; + projectile.tileCollide = true; + projectile.ignoreWater = false; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Cannon Ball"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Cannon Ball"); + } - int time = 45; //Сам Ñчетчик, впринципе проÑто целочиÑÐ»ÐµÐ½Ð½Ð°Ñ Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ, 60 = 1 Ñек, то еÑÑ‚ÑŒ тут 0.75 Ñек - /*public override void AI() Этот ИИ направлÑет прожектайл к игроку через 0.75 Ñек поÑле выÑтрела + int time = 45; //Сам Ñчетчик, впринципе проÑто целочиÑÐ»ÐµÐ½Ð½Ð°Ñ Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ, 60 = 1 Ñек, то еÑÑ‚ÑŒ тут 0.75 Ñек + + /*public override void AI() Этот ИИ направлÑет прожектайл к игроку через 0.75 Ñек поÑле выÑтрела //if(time != -1) //Main.player[projectile.owner].position = Main.MouseWorld; //Телепортирует игрока к курÑору @@ -58,51 +58,51 @@ public override void SetStaticDefaults() }*/ int time2 = 4; - - public override void AI() //Этот ИИ направлÑет прожектайл к ближайшим монÑтрам - { - float max_dist = 300f; //Ðа каком макÑимальном раÑÑтоÑнии прожектайл будет наводитьÑÑ Ð½Ð° монÑтра - int ID = -1; - float min_dist = float.MaxValue; //Ðа каком минимальном раÑÑтоÑнии прожектайл будет наводитьÑÑ Ð½Ð° монÑтра - for (int k = 0; k < Main.npc.Length; k++) - { - if (!Main.npc[k].friendly && Main.npc[k].active && Vector2.Distance(projectile.position, Main.npc[k].position) < min_dist) //ЕÑли монÑÑ‚Ñ€ не дружелюбный и жив, а также на раÑÑтоÑнии меньше макÑимального Ð´Ð»Ñ ÑÐ°Ð¼Ð¾Ð½Ð°Ð²ÐµÐ´ÐµÐ½Ð¸Ñ - { - min_dist = Vector2.Distance(projectile.position, Main.npc[k].position); - ID = k; - } - } + + public override void AI() //Этот ИИ направлÑет прожектайл к ближайшим монÑтрам + { + float max_dist = 300f; //Ðа каком макÑимальном раÑÑтоÑнии прожектайл будет наводитьÑÑ Ð½Ð° монÑтра + int ID = -1; + float min_dist = float.MaxValue; //Ðа каком минимальном раÑÑтоÑнии прожектайл будет наводитьÑÑ Ð½Ð° монÑтра + for (int k = 0; k < Main.npc.Length; k++) + { + if (!Main.npc[k].friendly && Main.npc[k].active && Vector2.Distance(projectile.position, Main.npc[k].position) < min_dist) //ЕÑли монÑÑ‚Ñ€ не дружелюбный и жив, а также на раÑÑтоÑнии меньше макÑимального Ð´Ð»Ñ ÑÐ°Ð¼Ð¾Ð½Ð°Ð²ÐµÐ´ÐµÐ½Ð¸Ñ + { + min_dist = Vector2.Distance(projectile.position, Main.npc[k].position); + ID = k; + } + } float smooth = 12f; // ПлавноÑÑ‚ÑŒ Ñмены ÑкороÑти - if (ID != -1 && min_dist <= max_dist) - { - NPC npc = Main.npc[ID]; - Vector2 From = projectile.position; //Сам код Ð½Ð°Ð²ÐµÐ´ÐµÐ½Ð¸Ñ Ðº монÑтру //Откуда будет двигатьÑÑ Ð¿Ñ€Ð¾Ð¶ÐµÐºÑ‚Ð°Ð¹Ð», здеÑÑŒ от Ñвоего ÑобÑтвенного раÑÐ¿Ð¾Ð»Ð¾Ð¶ÐµÐ½Ð¸Ñ - Vector2 To = npc.position; //Куда будет двигатьÑÑ Ð¿Ñ€Ð¾Ð¶ÐµÐºÑ‚Ð°Ð¹Ð», здеÑÑŒ к раÑположению монÑтров - float Speed = 15f; //С какой ÑкороÑтью он будет двигатьÑÑ Ðº монÑтру - Vector2 Move = (To - From); + if (ID != -1 && min_dist <= max_dist) + { + NPC npc = Main.npc[ID]; + Vector2 From = projectile.position; //Сам код Ð½Ð°Ð²ÐµÐ´ÐµÐ½Ð¸Ñ Ðº монÑтру //Откуда будет двигатьÑÑ Ð¿Ñ€Ð¾Ð¶ÐµÐºÑ‚Ð°Ð¹Ð», здеÑÑŒ от Ñвоего ÑобÑтвенного раÑÐ¿Ð¾Ð»Ð¾Ð¶ÐµÐ½Ð¸Ñ + Vector2 To = npc.position; //Куда будет двигатьÑÑ Ð¿Ñ€Ð¾Ð¶ÐµÐºÑ‚Ð°Ð¹Ð», здеÑÑŒ к раÑположению монÑтров + float Speed = 15f; //С какой ÑкороÑтью он будет двигатьÑÑ Ðº монÑтру + Vector2 Move = (To - From); Vector2 Vel = Move * (Speed / (float)Math.Sqrt(Move.X * Move.X + Move.Y * Move.Y)); - projectile.velocity = projectile.velocity + ((Vel - projectile.velocity) / smooth); - if (Vector2.Distance(projectile.position, Main.npc[ID].position) < 30f && time2 > 0) //Когда прожектайл попадет по монÑтру, ему даÑÑ‚ÑÑ 2 милиÑекунды чтобы нанеÑти урон + projectile.velocity = projectile.velocity + ((Vel - projectile.velocity) / smooth); + if (Vector2.Distance(projectile.position, Main.npc[ID].position) < 30f && time2 > 0) //Когда прожектайл попадет по монÑтру, ему даÑÑ‚ÑÑ 2 милиÑекунды чтобы нанеÑти урон time2--; - else if(Vector2.Distance(projectile.position, Main.npc[ID].position) < 30f) //ЕÑли прожектайл попал по монÑтру, то он иÑчезает - { - projectile.Kill(); - } - } + else if (Vector2.Distance(projectile.position, Main.npc[ID].position) < 30f) //ЕÑли прожектайл попал по монÑтру, то он иÑчезает + { + projectile.Kill(); + } + } else { projectile.velocity -= projectile.velocity / smooth; } } - public override void Kill(int timeLeft) - { - for (int k = 0; k < 10; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, mod.DustType("Ball"), projectile.oldVelocity.X * 0.9f, projectile.oldVelocity.Y * 0.9f); - } - } - + public override void Kill(int timeLeft) + { + for (int k = 0; k < 10; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, mod.DustType("Ball"), projectile.oldVelocity.X * 0.9f, projectile.oldVelocity.Y * 0.9f); + } + } + public override bool OnTileCollide(Vector2 oldVelocity) { projectile.penetrate--; @@ -124,5 +124,5 @@ public override bool OnTileCollide(Vector2 oldVelocity) } return false; } - } + } } diff --git a/Projectiles/DungeonGuardianPro.cs b/Projectiles/DungeonGuardianPro.cs index b72b4ec5..bac9a827 100644 --- a/Projectiles/DungeonGuardianPro.cs +++ b/Projectiles/DungeonGuardianPro.cs @@ -10,19 +10,19 @@ public class DungeonGuardianPro : ModProjectile { public override void SetDefaults() { - projectile.CloneDefaults(555); + projectile.CloneDefaults(555); projectile.width = 20; projectile.height = 20; - projectile.timeLeft = 420; + projectile.timeLeft = 420; projectile.friendly = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("DungeonGuardianPro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("DungeonGuardianPro"); + + } } diff --git a/Projectiles/EarthquakePro.cs b/Projectiles/EarthquakePro.cs index 245d43a3..0d87f87f 100644 --- a/Projectiles/EarthquakePro.cs +++ b/Projectiles/EarthquakePro.cs @@ -5,40 +5,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class EarthquakePro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class EarthquakePro : ModProjectile + { + public override void SetDefaults() + { - projectile.width = 3; - projectile.height = 11; - projectile.friendly = true; - projectile.aiStyle = 1; - projectile.timeLeft = 1200; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; - ProjectileID.Sets.TrailingMode[projectile.type] = 2; - } + projectile.width = 3; + projectile.height = 11; + projectile.friendly = true; + projectile.aiStyle = 1; + projectile.timeLeft = 1200; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Earthquake Pro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Earthquake Pro"); + } - public override void Kill(int timeLeft) - { - for(int k = 0; k < 5; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 1, projectile.oldVelocity.X * 0.1f, projectile.oldVelocity.Y * 0.1f); - } - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); - } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - projectile.ai[0] += 0.1f; - projectile.velocity *= 0.75f; - } -}} + public override void Kill(int timeLeft) + { + for (int k = 0; k < 5; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 1, projectile.oldVelocity.X * 0.1f, projectile.oldVelocity.Y * 0.1f); + } + Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + projectile.ai[0] += 0.1f; + projectile.velocity *= 0.75f; + } + } +} diff --git a/Projectiles/EaterofDreamsPro.cs b/Projectiles/EaterofDreamsPro.cs index 93599f4f..d17b2daa 100644 --- a/Projectiles/EaterofDreamsPro.cs +++ b/Projectiles/EaterofDreamsPro.cs @@ -7,30 +7,30 @@ namespace Tremor.Projectiles { - public class EaterofDreamsPro : ModProjectile - { - public override void SetDefaults() - { + public class EaterofDreamsPro : ModProjectile + { + public override void SetDefaults() + { - projectile.width = 6; - projectile.height = 6; - projectile.friendly = true; - projectile.ignoreWater = true; - projectile.penetrate = -1; - projectile.extraUpdates = 3; - projectile.timeLeft = 90; - } + projectile.width = 6; + projectile.height = 6; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.penetrate = -1; + projectile.extraUpdates = 3; + projectile.timeLeft = 90; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("EaterofDreams Pro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("EaterofDreams Pro"); + } - public override void AI() - { - Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.25f) / 255f, ((255 - projectile.alpha) * 0.05f) / 255f, ((255 - projectile.alpha) * 0.05f) / 255f); + + public override void AI() + { + Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.25f) / 255f, ((255 - projectile.alpha) * 0.05f) / 255f, ((255 - projectile.alpha) * 0.05f) / 255f); if (projectile.timeLeft > 90) { projectile.timeLeft = 90; @@ -91,34 +91,34 @@ public override void AI() projectile.ai[0] += 1f; } projectile.rotation += 0.3f * (float)projectile.direction; - return; - } - public override bool OnTileCollide(Vector2 oldVelocity) - { - projectile.penetrate--; - if (projectile.penetrate <= 0) - { - projectile.Kill(); - } - else - { - projectile.ai[0] += 0.1f; - if (projectile.velocity.X != oldVelocity.X) - { - projectile.velocity.X = -oldVelocity.X; - } - if (projectile.velocity.Y != oldVelocity.Y) - { - projectile.velocity.Y = -oldVelocity.Y; - } - projectile.velocity *= 0.75f; - } - return false; - } + return; + } + public override bool OnTileCollide(Vector2 oldVelocity) + { + projectile.penetrate--; + if (projectile.penetrate <= 0) + { + projectile.Kill(); + } + else + { + projectile.ai[0] += 0.1f; + if (projectile.velocity.X != oldVelocity.X) + { + projectile.velocity.X = -oldVelocity.X; + } + if (projectile.velocity.Y != oldVelocity.Y) + { + projectile.velocity.Y = -oldVelocity.Y; + } + projectile.velocity *= 0.75f; + } + return false; + } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(153, 500); - } - } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(153, 500); + } + } } diff --git a/Projectiles/ElectricBolt.cs b/Projectiles/ElectricBolt.cs index 5f74c484..5678d6c7 100644 --- a/Projectiles/ElectricBolt.cs +++ b/Projectiles/ElectricBolt.cs @@ -5,55 +5,57 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class ElectricBolt : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class ElectricBolt : ModProjectile + { + public override void SetDefaults() + { - projectile.friendly = true; + projectile.friendly = true; projectile.width = 36; projectile.height = 16; - projectile.aiStyle = 0; - Main.projFrames[projectile.type] = 4; - projectile.timeLeft = 1200; - } + projectile.aiStyle = 0; + Main.projFrames[projectile.type] = 4; + projectile.timeLeft = 1200; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Electric Bolt"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; - ProjectileID.Sets.TrailingMode[projectile.type] = 2; - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Electric Bolt"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + } - public override void AI() - { - int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 136, default(Color), 0.9f); - Main.dust[dust].noGravity = true; + public override void AI() + { + int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 136, default(Color), 0.9f); + Main.dust[dust].noGravity = true; - if(projectile.frameCounter < 5) + if (projectile.frameCounter < 5) projectile.frame = 0; - else if(projectile.frameCounter >= 5 && projectile.frameCounter < 10) + else if (projectile.frameCounter >= 5 && projectile.frameCounter < 10) projectile.frame = 1; - else if(projectile.frameCounter >= 10 && projectile.frameCounter < 15) + else if (projectile.frameCounter >= 10 && projectile.frameCounter < 15) projectile.frame = 2; - else if(projectile.frameCounter >= 15 && projectile.frameCounter < 20) + else if (projectile.frameCounter >= 15 && projectile.frameCounter < 20) projectile.frame = 3; else projectile.frameCounter = 0; projectile.frameCounter++; - } + } - public override void Kill(int timeLeft) -{ - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); -} + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); + } -public override Color? GetAlpha(Color lightColor) -{ -return Color.White; -} + public override Color? GetAlpha(Color lightColor) + { + return Color.White; + } -}} + } +} diff --git a/Projectiles/ElectricSpearPro.cs b/Projectiles/ElectricSpearPro.cs index e3b130b9..abe43ff8 100644 --- a/Projectiles/ElectricSpearPro.cs +++ b/Projectiles/ElectricSpearPro.cs @@ -5,27 +5,29 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class ElectricSpearPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class ElectricSpearPro : ModProjectile + { + public override void SetDefaults() + { projectile.CloneDefaults(47); aiType = 47; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("ElectricSpearPro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("ElectricSpearPro"); + } - public override void AI() - { - int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 226, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 136, default(Color), 0.9f); - Main.dust[dust].noGravity = true; - } -}} + public override void AI() + { + int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 226, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 136, default(Color), 0.9f); + Main.dust[dust].noGravity = true; + } + + } +} diff --git a/Projectiles/EmeraldDrillPro.cs b/Projectiles/EmeraldDrillPro.cs index 7d80fede..5b1a9446 100644 --- a/Projectiles/EmeraldDrillPro.cs +++ b/Projectiles/EmeraldDrillPro.cs @@ -4,35 +4,37 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { - -public class EmeraldDrillPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { - - projectile.width = 22; - projectile.height = 22; - projectile.aiStyle = 20; - projectile.friendly = true; - projectile.penetrate = -1; - projectile.tileCollide = false; - projectile.hide = true; - projectile.ownerHitCheck = true; - projectile.melee = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Emerald Drill"); - - } - - - public override void AI() - { - int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 61, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1.9f); - Main.dust[dust].noGravity = true; - } - -}} + + public class EmeraldDrillPro : ModProjectile + { + public override void SetDefaults() + { + + projectile.width = 22; + projectile.height = 22; + projectile.aiStyle = 20; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.hide = true; + projectile.ownerHitCheck = true; + projectile.melee = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Emerald Drill"); + + } + + + public override void AI() + { + int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 61, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1.9f); + Main.dust[dust].noGravity = true; + } + + } +} diff --git a/Projectiles/Emeraldy.cs b/Projectiles/Emeraldy.cs index dcd40d9d..a4ec8b84 100644 --- a/Projectiles/Emeraldy.cs +++ b/Projectiles/Emeraldy.cs @@ -16,26 +16,26 @@ public class Emeraldy : ModProjectile public override void SetDefaults() { //Player player = new Player(); - projectile.aiStyle = 26; + projectile.aiStyle = 26; - projectile.width = 24; - projectile.height = 20; + projectile.width = 24; + projectile.height = 20; projectile.netImportant = true; projectile.friendly = true; projectile.ignoreWater = true; - aiType = 380; - ProjectileID.Sets.TrailingMode[projectile.type] = 2; - ProjectileID.Sets.Homing[projectile.type] = true; - Main.projFrames[projectile.type] = 1; - ProjectileID.Sets.LightPet[projectile.type] = true; - Main.projPet[projectile.type] = true; - } + aiType = 380; + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + ProjectileID.Sets.Homing[projectile.type] = true; + Main.projFrames[projectile.type] = 1; + ProjectileID.Sets.LightPet[projectile.type] = true; + Main.projPet[projectile.type] = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Emeraldy"); - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Emeraldy"); - - } + } public override bool PreAI() @@ -44,13 +44,13 @@ public override bool PreAI() player.zephyrfish = false; return true; } - + public override void AI() { - if (Main.rand.Next(5) == 0) - { - Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 61, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 1f); - } + if (Main.rand.Next(5) == 0) + { + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 61, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 1f); + } Player player = Main.player[projectile.owner]; TremorPlayer modPlayer = (TremorPlayer)player.GetModPlayer(mod, "TremorPlayer"); if (player.dead) @@ -60,8 +60,8 @@ public override void AI() if (modPlayer.emeraldy) { projectile.timeLeft = 2; - } - Lighting.AddLight(projectile.position, 0.0f, 1.27f, 0.64f); + } + Lighting.AddLight(projectile.position, 0.0f, 1.27f, 0.64f); } } } diff --git a/Projectiles/EruptPro.cs b/Projectiles/EruptPro.cs index 1aeb696d..a3f44ce2 100644 --- a/Projectiles/EruptPro.cs +++ b/Projectiles/EruptPro.cs @@ -23,70 +23,70 @@ public override void SetDefaults() aiType = 598; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("EruptPro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("EruptPro"); + + } + - public override Color? GetAlpha(Color lightColor) { return Color.White; } - public override void Kill(int timeLeft) - { - for(int k = 0; k < 5; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 60, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); - } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 109); - if (projectile.owner == Main.myPlayer) + public override void Kill(int timeLeft) { - int num220 = Main.rand.Next(3, 5); - for (int num221 = 0; num221 < num220; num221++) + for (int k = 0; k < 5; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 60, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); + } + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 109); + if (projectile.owner == Main.myPlayer) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, 297, projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + int num220 = Main.rand.Next(3, 5); + for (int num221 = 0; num221 < num220; num221++) + { + Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value17.Normalize(); + value17 *= (float)Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, 297, projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + } } } - } - public override void AI() - { - if (projectile.localAI[0] == 0f) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); - } - projectile.localAI[0] += 1f; - if (projectile.localAI[0] > 3f) + public override void AI() { - int num90 = 1; - if (projectile.localAI[0] > 5f) - { - num90 = 2; - } - for (int num91 = 0; num91 < num90; num91++) + if (projectile.localAI[0] == 0f) { - int num92 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 2f), projectile.width, projectile.height, 27, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.1f, 100, default(Color), 0.4f); - Main.dust[num92].noGravity = true; - Dust expr_46AC_cp_0 = Main.dust[num92]; - expr_46AC_cp_0.velocity.X = expr_46AC_cp_0.velocity.X * 0.3f; - Dust expr_46CA_cp_0 = Main.dust[num92]; - expr_46CA_cp_0.velocity.Y = expr_46CA_cp_0.velocity.Y * 0.3f; - Main.dust[num92].noLight = true; + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); } - if (projectile.wet && !projectile.lavaWet) + projectile.localAI[0] += 1f; + if (projectile.localAI[0] > 3f) { - projectile.Kill(); - return; + int num90 = 1; + if (projectile.localAI[0] > 5f) + { + num90 = 2; + } + for (int num91 = 0; num91 < num90; num91++) + { + int num92 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 2f), projectile.width, projectile.height, 27, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.1f, 100, default(Color), 0.4f); + Main.dust[num92].noGravity = true; + Dust expr_46AC_cp_0 = Main.dust[num92]; + expr_46AC_cp_0.velocity.X = expr_46AC_cp_0.velocity.X * 0.3f; + Dust expr_46CA_cp_0 = Main.dust[num92]; + expr_46CA_cp_0.velocity.Y = expr_46CA_cp_0.velocity.Y * 0.3f; + Main.dust[num92].noLight = true; + } + if (projectile.wet && !projectile.lavaWet) + { + projectile.Kill(); + return; + } } } - } } } diff --git a/Projectiles/EternalAgonyPro.cs b/Projectiles/EternalAgonyPro.cs index f9ce283f..948506b4 100644 --- a/Projectiles/EternalAgonyPro.cs +++ b/Projectiles/EternalAgonyPro.cs @@ -9,78 +9,78 @@ namespace Tremor.Projectiles { - public class EternalAgonyPro : ModProjectile - { - public override void SetDefaults() - { + public class EternalAgonyPro : ModProjectile + { + public override void SetDefaults() + { - projectile.width = 34; - projectile.height = 34; - projectile.friendly = true; - projectile.penetrate = -1; // Penetrates NPCs infinitely. - projectile.melee = true; // Deals melee dmg. + projectile.width = 34; + projectile.height = 34; + projectile.friendly = true; + projectile.penetrate = -1; // Penetrates NPCs infinitely. + projectile.melee = true; // Deals melee dmg. - projectile.aiStyle = 15; // Set the aiStyle to that of a flail. - } + projectile.aiStyle = 15; // Set the aiStyle to that of a flail. + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Eternal Agony"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Eternal Agony"); + } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - if(Main.rand.Next(3) == 0) - { - target.AddBuff(153, 280, false); - } - } - public override void OnHitPvp(Player target, int damage, bool crit) - { - if(Main.rand.Next(3) == 0) - { - target.AddBuff(153, 280, false); - } - } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (Main.rand.Next(3) == 0) + { + target.AddBuff(153, 280, false); + } + } - public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Color lightColor) - { - Texture2D texture = ModLoader.GetTexture("Tremor/Projectiles/EternalAgony_Chain"); + public override void OnHitPvp(Player target, int damage, bool crit) + { + if (Main.rand.Next(3) == 0) + { + target.AddBuff(153, 280, false); + } + } - Vector2 position = projectile.Center; - Vector2 mountedCenter = Main.player[projectile.owner].MountedCenter; - Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(); - Vector2 origin = new Vector2((float)texture.Width * 0.5f, (float)texture.Height * 0.5f); - float num1 = (float)texture.Height; - Vector2 vector2_4 = mountedCenter - position; - float rotation = (float)Math.Atan2((double)vector2_4.Y, (double)vector2_4.X) - 1.57f; - bool flag = true; - if (float.IsNaN(position.X) && float.IsNaN(position.Y)) - flag = false; - if (float.IsNaN(vector2_4.X) && float.IsNaN(vector2_4.Y)) - flag = false; - while (flag) - { - if ((double)vector2_4.Length() < (double)num1 + 1.0) - { - flag = false; - } - else - { - Vector2 vector2_1 = vector2_4; - vector2_1.Normalize(); - position += vector2_1 * num1; - vector2_4 = mountedCenter - position; - Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)position.X / 16, (int)((double)position.Y / 16.0)); - color2 = projectile.GetAlpha(color2); - Main.spriteBatch.Draw(texture, position - Main.screenPosition, sourceRectangle, color2, rotation, origin, 1f, SpriteEffects.None, 0.0f); - } - } + public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture = ModLoader.GetTexture("Tremor/Projectiles/EternalAgony_Chain"); - return true; - } - } + Vector2 position = projectile.Center; + Vector2 mountedCenter = Main.player[projectile.owner].MountedCenter; + Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(); + Vector2 origin = new Vector2((float)texture.Width * 0.5f, (float)texture.Height * 0.5f); + float num1 = (float)texture.Height; + Vector2 vector2_4 = mountedCenter - position; + float rotation = (float)Math.Atan2((double)vector2_4.Y, (double)vector2_4.X) - 1.57f; + bool flag = true; + if (float.IsNaN(position.X) && float.IsNaN(position.Y)) + flag = false; + if (float.IsNaN(vector2_4.X) && float.IsNaN(vector2_4.Y)) + flag = false; + while (flag) + { + if ((double)vector2_4.Length() < (double)num1 + 1.0) + { + flag = false; + } + else + { + Vector2 vector2_1 = vector2_4; + vector2_1.Normalize(); + position += vector2_1 * num1; + vector2_4 = mountedCenter - position; + Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)position.X / 16, (int)((double)position.Y / 16.0)); + color2 = projectile.GetAlpha(color2); + Main.spriteBatch.Draw(texture, position - Main.screenPosition, sourceRectangle, color2, rotation, origin, 1f, SpriteEffects.None, 0.0f); + } + } + + return true; + } + } } diff --git a/Projectiles/ExampleLaser.cs b/Projectiles/ExampleLaser.cs index 1bb95b27..26e5a60d 100644 --- a/Projectiles/ExampleLaser.cs +++ b/Projectiles/ExampleLaser.cs @@ -38,11 +38,11 @@ public override void SetDefaults() projectile.hide = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Example Laser"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Example Laser"); + + } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) @@ -50,8 +50,8 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) if (Charge == MAX_CHARGE) { Vector2 unit = projectile.velocity; - DrawLaser(spriteBatch, Main.projectileTexture[projectile.type], - Main.player[projectile.owner].Center, unit, 10, projectile.damage, + DrawLaser(spriteBatch, Main.projectileTexture[projectile.type], + Main.player[projectile.owner].Center, unit, 10, projectile.damage, -1.57f, 1f, 1000f, Color.White, (int)MOVE_DISTANCE); } return false; diff --git a/Projectiles/FallenSnakePro.cs b/Projectiles/FallenSnakePro.cs index dcd96da4..b304655e 100644 --- a/Projectiles/FallenSnakePro.cs +++ b/Projectiles/FallenSnakePro.cs @@ -10,37 +10,37 @@ public class FallenSnakePro : ModProjectile { public override void SetDefaults() { - projectile.CloneDefaults(ProjectileID.ValkyrieYoyo); + projectile.CloneDefaults(ProjectileID.ValkyrieYoyo); projectile.width = 22; projectile.height = 22; - projectile.timeLeft = 220; + projectile.timeLeft = 220; projectile.friendly = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault(""); - - } - - - public override bool PreAI() - { - if(Main.rand.Next(3) == 0) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 13, projectile.velocity.X * 0.9f, projectile.velocity.Y * 0.9f); - } - - return true; - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - if(Main.rand.Next(1) == 0) - { - target.AddBuff(72, 280, false); - } - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault(""); + + } + + + public override bool PreAI() + { + if (Main.rand.Next(3) == 0) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 13, projectile.velocity.X * 0.9f, projectile.velocity.Y * 0.9f); + } + + return true; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (Main.rand.Next(1) == 0) + { + target.AddBuff(72, 280, false); + } + } } } diff --git a/Projectiles/FallingDarkServant.cs b/Projectiles/FallingDarkServant.cs index 0d7fe4f0..5dd656ca 100644 --- a/Projectiles/FallingDarkServant.cs +++ b/Projectiles/FallingDarkServant.cs @@ -5,47 +5,49 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class FallingDarkServant : ModProjectile +namespace Tremor.Projectiles { + public class FallingDarkServant : ModProjectile + { - public override void SetDefaults() - { + public override void SetDefaults() + { projectile.width = 72; projectile.height = 64; projectile.hostile = true; - projectile.light = 0.8f; + projectile.light = 0.8f; projectile.magic = true; projectile.penetrate = 6; Main.projFrames[projectile.type] = 4; - projectile.aiStyle = 1; + projectile.aiStyle = 1; projectile.timeLeft = 600; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("FallingDarkSlime"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("FallingDarkSlime"); + + } public override void AI() { - if(projectile.frameCounter < 5) + if (projectile.frameCounter < 5) projectile.frame = 0; - else if(projectile.frameCounter >= 5 && projectile.frameCounter < 10) + else if (projectile.frameCounter >= 5 && projectile.frameCounter < 10) projectile.frame = 1; - else if(projectile.frameCounter >= 10 && projectile.frameCounter < 15) + else if (projectile.frameCounter >= 10 && projectile.frameCounter < 15) projectile.frame = 2; - else if(projectile.frameCounter >= 15 && projectile.frameCounter < 20) + else if (projectile.frameCounter >= 15 && projectile.frameCounter < 20) projectile.frame = 3; else projectile.frameCounter = 0; projectile.frameCounter++; } - public override void Kill(int timeLeft) - { - NPC.NewNPC((int)projectile.Center.X, (int)projectile.Center.Y, mod.NPCType("DarkServant")); - } -}} + public override void Kill(int timeLeft) + { + NPC.NewNPC((int)projectile.Center.X, (int)projectile.Center.Y, mod.NPCType("DarkServant")); + } + } +} diff --git a/Projectiles/FallingDarkSlime.cs b/Projectiles/FallingDarkSlime.cs index 073b514f..4bb89fe8 100644 --- a/Projectiles/FallingDarkSlime.cs +++ b/Projectiles/FallingDarkSlime.cs @@ -5,48 +5,50 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class FallingDarkSlime : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class FallingDarkSlime : ModProjectile + { + public override void SetDefaults() + { projectile.width = 36; projectile.height = 32; - projectile.light = 0.8f; + projectile.light = 0.8f; projectile.hostile = true; projectile.magic = true; projectile.penetrate = 6; Main.projFrames[projectile.type] = 4; - projectile.aiStyle = 1; + projectile.aiStyle = 1; projectile.timeLeft = 600; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("FallingDarkSlime"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("FallingDarkSlime"); + + } public override void AI() { - if(projectile.frameCounter < 5) + if (projectile.frameCounter < 5) projectile.frame = 0; - else if(projectile.frameCounter >= 5 && projectile.frameCounter < 10) + else if (projectile.frameCounter >= 5 && projectile.frameCounter < 10) projectile.frame = 1; - else if(projectile.frameCounter >= 10 && projectile.frameCounter < 15) + else if (projectile.frameCounter >= 10 && projectile.frameCounter < 15) projectile.frame = 2; - else if(projectile.frameCounter >= 15 && projectile.frameCounter < 20) + else if (projectile.frameCounter >= 15 && projectile.frameCounter < 20) projectile.frame = 3; else projectile.frameCounter = 0; projectile.frameCounter++; } - public override void Kill(int timeLeft) - { - NPC.NewNPC((int)projectile.Center.X, (int)projectile.Center.Y, mod.NPCType("DarkSlime")); - } -}} + public override void Kill(int timeLeft) + { + NPC.NewNPC((int)projectile.Center.X, (int)projectile.Center.Y, mod.NPCType("DarkSlime")); + } + } +} diff --git a/Projectiles/FieryKunai.cs b/Projectiles/FieryKunai.cs index 76082eaf..2138e8dd 100644 --- a/Projectiles/FieryKunai.cs +++ b/Projectiles/FieryKunai.cs @@ -5,57 +5,59 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class FieryKunai : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { - - projectile.width = 1; - projectile.height = 1; - projectile.friendly = true; - projectile.aiStyle = 1; - projectile.timeLeft = 1200; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Fiery Kunai"); - - } - - - public override void Kill(int timeLeft) - { - for(int k = 0; k < 5; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 73, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); - } - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 27); - } - - public override void AI() - { - int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 136, default(Color), 0.9f); - Main.dust[dust].noGravity = true; - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - if(Main.rand.Next(2) == 0) - { - target.AddBuff(24, 180, false); - } - - projectile.ai[0] += 0.1f; - projectile.velocity *= 0.75f; - } - - public override void OnHitPvp(Player target, int damage, bool crit) - { - if(Main.rand.Next(2) == 0) - { - target.AddBuff(24, 180, false); - } - } -}} + public class FieryKunai : ModProjectile + { + public override void SetDefaults() + { + + projectile.width = 1; + projectile.height = 1; + projectile.friendly = true; + projectile.aiStyle = 1; + projectile.timeLeft = 1200; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Fiery Kunai"); + + } + + + public override void Kill(int timeLeft) + { + for (int k = 0; k < 5; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 73, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); + } + Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 27); + } + + public override void AI() + { + int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 136, default(Color), 0.9f); + Main.dust[dust].noGravity = true; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (Main.rand.Next(2) == 0) + { + target.AddBuff(24, 180, false); + } + + projectile.ai[0] += 0.1f; + projectile.velocity *= 0.75f; + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + if (Main.rand.Next(2) == 0) + { + target.AddBuff(24, 180, false); + } + } + } +} diff --git a/Projectiles/FlamesofDespairPro.cs b/Projectiles/FlamesofDespairPro.cs index bd2a0289..f5066a46 100644 --- a/Projectiles/FlamesofDespairPro.cs +++ b/Projectiles/FlamesofDespairPro.cs @@ -5,119 +5,121 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class FlamesofDespairPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class FlamesofDespairPro : ModProjectile + { + public override void SetDefaults() + { projectile.CloneDefaults(405); aiType = 405; - projectile.friendly = true; - projectile.timeLeft = 150; + projectile.friendly = true; + projectile.timeLeft = 150; projectile.width = 18; projectile.height = 18; - projectile.light = 0.9f; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - } + projectile.light = 0.9f; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("FlamesofDespairPro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("FlamesofDespairPro"); + } - public override void AI() - { - if(Main.rand.Next(3) == 0) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 6, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); - } - } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Vector2 drawOrigin = new Vector2(Main.projectileTexture[projectile.type].Width * 0.5f, projectile.height * 0.5f); - for(int k = 0; k < projectile.oldPos.Length; k++) - { - Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); - Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); - spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); - } - return true; - } + public override void AI() + { + if (Main.rand.Next(3) == 0) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 6, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); + } + } - public override void Kill(int timeLeft) -{ - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); - projectile.width = 80; - projectile.height = 80; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - for (int num628 = 0; num628 < 40; num628++) - { - int num629 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); - Main.dust[num629].velocity *= 3f; - if (Main.rand.Next(2) == 0) - { - Main.dust[num629].scale = 0.5f; - Main.dust[num629].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } - for (int num630 = 0; num630 < 70; num630++) - { - int num631 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 3f); - Main.dust[num631].noGravity = true; - Main.dust[num631].velocity *= 5f; - num631 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 5f); - Main.dust[num631].velocity *= 2f; - } - for (int num632 = 0; num632 < 3; num632++) - { - float scaleFactor10 = 0.33f; - if (num632 == 1) - { - scaleFactor10 = 0.66f; - } - if (num632 == 2) - { - scaleFactor10 = 1f; - } - int num633 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1.5f); - Main.gore[num633].velocity *= scaleFactor10; - Gore expr_13E6D_cp_0 = Main.gore[num633]; - expr_13E6D_cp_0.velocity.X = expr_13E6D_cp_0.velocity.X + 1f; - Gore expr_13E8D_cp_0 = Main.gore[num633]; - expr_13E8D_cp_0.velocity.Y = expr_13E8D_cp_0.velocity.Y + 1f; - num633 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 0.5f); - Main.gore[num633].velocity *= scaleFactor10; - Gore expr_13F30_cp_0 = Main.gore[num633]; - expr_13F30_cp_0.velocity.X = expr_13F30_cp_0.velocity.X - 1f; - Gore expr_13F50_cp_0 = Main.gore[num633]; - expr_13F50_cp_0.velocity.Y = expr_13F50_cp_0.velocity.Y + 1f; - num633 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1.5f); - Main.gore[num633].velocity *= scaleFactor10; - Gore expr_13FF3_cp_0 = Main.gore[num633]; - expr_13FF3_cp_0.velocity.X = expr_13FF3_cp_0.velocity.X + 1f; - Gore expr_14013_cp_0 = Main.gore[num633]; - expr_14013_cp_0.velocity.Y = expr_14013_cp_0.velocity.Y - 1f; - num633 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 0.5f); - Main.gore[num633].velocity *= scaleFactor10; - Gore expr_140B6_cp_0 = Main.gore[num633]; - expr_140B6_cp_0.velocity.X = expr_140B6_cp_0.velocity.X - 1f; - Gore expr_140D6_cp_0 = Main.gore[num633]; - expr_140D6_cp_0.velocity.Y = expr_140D6_cp_0.velocity.Y - 1f; - } - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); - projectile.width = 10; - projectile.height = 10; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Vector2 drawOrigin = new Vector2(Main.projectileTexture[projectile.type].Width * 0.5f, projectile.height * 0.5f); + for (int k = 0; k < projectile.oldPos.Length; k++) + { + Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); + Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); + spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); + } + return true; + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); + projectile.position.X = projectile.position.X + (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.width = 80; + projectile.height = 80; + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + for (int num628 = 0; num628 < 40; num628++) + { + int num629 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); + Main.dust[num629].velocity *= 3f; + if (Main.rand.Next(2) == 0) + { + Main.dust[num629].scale = 0.5f; + Main.dust[num629].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + } + } + for (int num630 = 0; num630 < 70; num630++) + { + int num631 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 3f); + Main.dust[num631].noGravity = true; + Main.dust[num631].velocity *= 5f; + num631 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 5f); + Main.dust[num631].velocity *= 2f; + } + for (int num632 = 0; num632 < 3; num632++) + { + float scaleFactor10 = 0.33f; + if (num632 == 1) + { + scaleFactor10 = 0.66f; + } + if (num632 == 2) + { + scaleFactor10 = 1f; + } + int num633 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1.5f); + Main.gore[num633].velocity *= scaleFactor10; + Gore expr_13E6D_cp_0 = Main.gore[num633]; + expr_13E6D_cp_0.velocity.X = expr_13E6D_cp_0.velocity.X + 1f; + Gore expr_13E8D_cp_0 = Main.gore[num633]; + expr_13E8D_cp_0.velocity.Y = expr_13E8D_cp_0.velocity.Y + 1f; + num633 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 0.5f); + Main.gore[num633].velocity *= scaleFactor10; + Gore expr_13F30_cp_0 = Main.gore[num633]; + expr_13F30_cp_0.velocity.X = expr_13F30_cp_0.velocity.X - 1f; + Gore expr_13F50_cp_0 = Main.gore[num633]; + expr_13F50_cp_0.velocity.Y = expr_13F50_cp_0.velocity.Y + 1f; + num633 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1.5f); + Main.gore[num633].velocity *= scaleFactor10; + Gore expr_13FF3_cp_0 = Main.gore[num633]; + expr_13FF3_cp_0.velocity.X = expr_13FF3_cp_0.velocity.X + 1f; + Gore expr_14013_cp_0 = Main.gore[num633]; + expr_14013_cp_0.velocity.Y = expr_14013_cp_0.velocity.Y - 1f; + num633 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 0.5f); + Main.gore[num633].velocity *= scaleFactor10; + Gore expr_140B6_cp_0 = Main.gore[num633]; + expr_140B6_cp_0.velocity.X = expr_140B6_cp_0.velocity.X - 1f; + Gore expr_140D6_cp_0 = Main.gore[num633]; + expr_140D6_cp_0.velocity.Y = expr_140D6_cp_0.velocity.Y - 1f; + } + projectile.position.X = projectile.position.X + (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.width = 10; + projectile.height = 10; + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + } + } } -}} diff --git a/Projectiles/FlaskWasp.cs b/Projectiles/FlaskWasp.cs index 7cb5d6d5..b10dca17 100644 --- a/Projectiles/FlaskWasp.cs +++ b/Projectiles/FlaskWasp.cs @@ -22,43 +22,43 @@ public override void SetDefaults() projectile.penetrate = 1; projectile.timeLeft = 600; projectile.ignoreWater = true; - projectile.tileCollide = false; + projectile.tileCollide = false; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Flask Wasp"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Flask Wasp"); + } - public override Color? GetAlpha(Color lightColor) - { - return Color.White; - } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - target.AddBuff(BuffID.Poisoned, 80, false); - } + public override Color? GetAlpha(Color lightColor) + { + return Color.White; + } - public override void AI() - { - projectile.spriteDirection = projectile.direction; - projectile.rotation = 0f; - } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(BuffID.Poisoned, 80, false); + } + + public override void AI() + { + projectile.spriteDirection = projectile.direction; + projectile.rotation = 0f; + } public override bool OnTileCollide(Vector2 oldVelocity) { - if (projectile.velocity.X != oldVelocity.X) - { - projectile.velocity.X = oldVelocity.X; - } - if (projectile.velocity.Y != oldVelocity.Y) - { - projectile.velocity.Y = oldVelocity.Y; - } - return false; + if (projectile.velocity.X != oldVelocity.X) + { + projectile.velocity.X = oldVelocity.X; + } + if (projectile.velocity.Y != oldVelocity.Y) + { + projectile.velocity.Y = oldVelocity.Y; + } + return false; } } } diff --git a/Projectiles/FlowerofAntimony.cs b/Projectiles/FlowerofAntimony.cs index c601d638..3da7fe52 100644 --- a/Projectiles/FlowerofAntimony.cs +++ b/Projectiles/FlowerofAntimony.cs @@ -7,33 +7,33 @@ namespace Tremor.Projectiles { - public class FlowerofAntimony : ModProjectile - { - public override void SetDefaults() - { + public class FlowerofAntimony : ModProjectile + { + public override void SetDefaults() + { - projectile.width = 26; - projectile.height = 26; - projectile.friendly = true; - projectile.penetrate = 1; - projectile.timeLeft = 600; - projectile.magic = true; - } + projectile.width = 26; + projectile.height = 26; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.timeLeft = 600; + projectile.magic = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Flower of Antimony"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Flower of Antimony"); + } - public override void AI() - { - Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.25f) / 255f, ((255 - projectile.alpha) * 0.2f) / 255f, ((255 - projectile.alpha) * 0.01f) / 255f); - if (projectile.wet && !projectile.lavaWet) - { - projectile.Kill(); - } + + public override void AI() + { + Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.25f) / 255f, ((255 - projectile.alpha) * 0.2f) / 255f, ((255 - projectile.alpha) * 0.01f) / 255f); + if (projectile.wet && !projectile.lavaWet) + { + projectile.Kill(); + } if (projectile.localAI[0] == 0f) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); @@ -47,34 +47,34 @@ public override void AI() Main.dust[num458].velocity += projectile.velocity * 0.1f; } return; - } - - public override bool OnTileCollide(Vector2 oldVelocity) - { - projectile.penetrate--; - if (projectile.penetrate <= 0) - { - projectile.Kill(); - } - else - { - projectile.ai[0] += 0.1f; - if (projectile.velocity.X != oldVelocity.X) - { - projectile.velocity.X = -oldVelocity.X; - } - if (projectile.velocity.Y != oldVelocity.Y) - { - projectile.velocity.Y = -oldVelocity.Y; - } - } - return false; - } - - public override void Kill(int timeLeft) - { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("GhostlyExplosion"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); - } + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + projectile.penetrate--; + if (projectile.penetrate <= 0) + { + projectile.Kill(); + } + else + { + projectile.ai[0] += 0.1f; + if (projectile.velocity.X != oldVelocity.X) + { + projectile.velocity.X = -oldVelocity.X; + } + if (projectile.velocity.Y != oldVelocity.Y) + { + projectile.velocity.Y = -oldVelocity.Y; + } + } + return false; + } + + public override void Kill(int timeLeft) + { + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("GhostlyExplosion"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + } - } + } } diff --git a/Projectiles/FrostJavelinPro.cs b/Projectiles/FrostJavelinPro.cs index 653e2262..379b6fa5 100644 --- a/Projectiles/FrostJavelinPro.cs +++ b/Projectiles/FrostJavelinPro.cs @@ -5,52 +5,54 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class FrostJavelinPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { - - projectile.width = 3; - projectile.height = 11; - projectile.friendly = true; - projectile.aiStyle = 113; - projectile.timeLeft = 1200; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; - ProjectileID.Sets.TrailingMode[projectile.type] = 2; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Frost Javelin"); - - } - - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - if(Main.rand.Next(3) == 0) - { - target.AddBuff(44, 280, false); - } - } - - public override void OnHitPvp(Player target, int damage, bool crit) - { - if(Main.rand.Next(3) == 0) - { - target.AddBuff(44, 280, false); - } - } - - public override void Kill(int timeLeft) - { - for(int k = 0; k < 5; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 15, projectile.oldVelocity.X * 0.1f, projectile.oldVelocity.Y * 0.1f); - } - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); - } - - -}} + public class FrostJavelinPro : ModProjectile + { + public override void SetDefaults() + { + + projectile.width = 3; + projectile.height = 11; + projectile.friendly = true; + projectile.aiStyle = 113; + projectile.timeLeft = 1200; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Frost Javelin"); + + } + + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (Main.rand.Next(3) == 0) + { + target.AddBuff(44, 280, false); + } + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + if (Main.rand.Next(3) == 0) + { + target.AddBuff(44, 280, false); + } + } + + public override void Kill(int timeLeft) + { + for (int k = 0; k < 5; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 15, projectile.oldVelocity.X * 0.1f, projectile.oldVelocity.Y * 0.1f); + } + Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); + } + + + } +} diff --git a/Projectiles/FrostbittenBallPro.cs b/Projectiles/FrostbittenBallPro.cs index 311e06ce..cae24108 100644 --- a/Projectiles/FrostbittenBallPro.cs +++ b/Projectiles/FrostbittenBallPro.cs @@ -9,84 +9,84 @@ namespace Tremor.Projectiles { - public class FrostbittenBallPro : ModProjectile - { - public override void SetDefaults() - { + public class FrostbittenBallPro : ModProjectile + { + public override void SetDefaults() + { - projectile.width = 34; - projectile.height = 34; - projectile.friendly = true; - projectile.penetrate = -1; // Penetrates NPCs infinitely. - projectile.melee = true; // Deals melee dmg. + projectile.width = 34; + projectile.height = 34; + projectile.friendly = true; + projectile.penetrate = -1; // Penetrates NPCs infinitely. + projectile.melee = true; // Deals melee dmg. - projectile.aiStyle = 15; // Set the aiStyle to that of a flail. - } + projectile.aiStyle = 15; // Set the aiStyle to that of a flail. + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Frostbitten Ball"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Frostbitten Ball"); + } - public override void AI() - { - int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 15, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1.9f); - Main.dust[dust].noGravity = true; - } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - if(Main.rand.Next(3) == 0) - { - target.AddBuff(44, 280, false); - } - } + public override void AI() + { + int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 15, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1.9f); + Main.dust[dust].noGravity = true; + } - public override void OnHitPvp(Player target, int damage, bool crit) - { - if(Main.rand.Next(3) == 0) - { - target.AddBuff(44, 280, false); - } - } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (Main.rand.Next(3) == 0) + { + target.AddBuff(44, 280, false); + } + } - public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Color lightColor) - { - Texture2D texture = ModLoader.GetTexture("Tremor/Projectiles/FrostbittenBall_Chain"); + public override void OnHitPvp(Player target, int damage, bool crit) + { + if (Main.rand.Next(3) == 0) + { + target.AddBuff(44, 280, false); + } + } - Vector2 position = projectile.Center; - Vector2 mountedCenter = Main.player[projectile.owner].MountedCenter; - Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(); - Vector2 origin = new Vector2((float)texture.Width * 0.5f, (float)texture.Height * 0.5f); - float num1 = (float)texture.Height; - Vector2 vector2_4 = mountedCenter - position; - float rotation = (float)Math.Atan2((double)vector2_4.Y, (double)vector2_4.X) - 1.57f; - bool flag = true; - if (float.IsNaN(position.X) && float.IsNaN(position.Y)) - flag = false; - if (float.IsNaN(vector2_4.X) && float.IsNaN(vector2_4.Y)) - flag = false; - while (flag) - { - if ((double)vector2_4.Length() < (double)num1 + 1.0) - { - flag = false; - } - else - { - Vector2 vector2_1 = vector2_4; - vector2_1.Normalize(); - position += vector2_1 * num1; - vector2_4 = mountedCenter - position; - Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)position.X / 16, (int)((double)position.Y / 16.0)); - color2 = projectile.GetAlpha(color2); - Main.spriteBatch.Draw(texture, position - Main.screenPosition, sourceRectangle, color2, rotation, origin, 1f, SpriteEffects.None, 0.0f); - } - } + public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture = ModLoader.GetTexture("Tremor/Projectiles/FrostbittenBall_Chain"); - return true; - } - } + Vector2 position = projectile.Center; + Vector2 mountedCenter = Main.player[projectile.owner].MountedCenter; + Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(); + Vector2 origin = new Vector2((float)texture.Width * 0.5f, (float)texture.Height * 0.5f); + float num1 = (float)texture.Height; + Vector2 vector2_4 = mountedCenter - position; + float rotation = (float)Math.Atan2((double)vector2_4.Y, (double)vector2_4.X) - 1.57f; + bool flag = true; + if (float.IsNaN(position.X) && float.IsNaN(position.Y)) + flag = false; + if (float.IsNaN(vector2_4.X) && float.IsNaN(vector2_4.Y)) + flag = false; + while (flag) + { + if ((double)vector2_4.Length() < (double)num1 + 1.0) + { + flag = false; + } + else + { + Vector2 vector2_1 = vector2_4; + vector2_1.Normalize(); + position += vector2_1 * num1; + vector2_4 = mountedCenter - position; + Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)position.X / 16, (int)((double)position.Y / 16.0)); + color2 = projectile.GetAlpha(color2); + Main.spriteBatch.Draw(texture, position - Main.screenPosition, sourceRectangle, color2, rotation, origin, 1f, SpriteEffects.None, 0.0f); + } + } + + return true; + } + } } diff --git a/Projectiles/FrostwindPro.cs b/Projectiles/FrostwindPro.cs index 9ac31916..81b12736 100644 --- a/Projectiles/FrostwindPro.cs +++ b/Projectiles/FrostwindPro.cs @@ -5,35 +5,36 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class FrostwindPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class FrostwindPro : ModProjectile + { + public override void SetDefaults() + { - projectile.light = 0.8f; - projectile.width = 80; - projectile.height = 46; - projectile.friendly = true; - projectile.tileCollide = false; - projectile.ignoreWater = true; - projectile.penetrate = -1; - projectile.alpha = 255; - projectile.timeLeft = 120; - Main.projFrames[projectile.type] = 6; - } + projectile.light = 0.8f; + projectile.width = 80; + projectile.height = 46; + projectile.friendly = true; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.penetrate = -1; + projectile.alpha = 255; + projectile.timeLeft = 120; + Main.projFrames[projectile.type] = 6; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("FrostwindPro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("FrostwindPro"); + } - public override void AI() - { - int num613 = 10; + + public override void AI() + { + int num613 = 10; int num614 = 15; float num615 = 1f; int num616 = 150; @@ -111,7 +112,8 @@ public override void AI() projectile.position.X = projectile.position.X + num624 * (float)(-(float)projectile.direction); return; } - } + } -}} + } +} diff --git a/Projectiles/FungusBlueSword.cs b/Projectiles/FungusBlueSword.cs index 3d5f6a5f..fbd4a771 100644 --- a/Projectiles/FungusBlueSword.cs +++ b/Projectiles/FungusBlueSword.cs @@ -4,31 +4,31 @@ namespace Tremor.Projectiles { - public class FungusBlueSword : ModProjectile - { - const float RotationSpeed = 0.05f; - const float Distanse = 100; + public class FungusBlueSword : ModProjectile + { + const float RotationSpeed = 0.05f; + const float Distanse = 100; - float Rotation = 0; + float Rotation = 0; - public override void SetDefaults() - { + public override void SetDefaults() + { + + projectile.width = 18; + projectile.height = 44; + projectile.timeLeft = 6; + projectile.melee = true; + projectile.aiStyle = -1; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.ignoreWater = true; + } - projectile.width = 18; - projectile.height = 44; - projectile.timeLeft = 6; - projectile.melee = true; - projectile.aiStyle = -1; - projectile.penetrate = -1; - projectile.tileCollide = false; - projectile.ignoreWater = true; - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Fungus Blue Sword"); - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Fungus Blue Sword"); - - } + } public override Color? GetAlpha(Color lightColor) @@ -37,23 +37,23 @@ public override void SetStaticDefaults() } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - if(Main.rand.Next(3) == 0) - { - target.AddBuff(31, 180, false); - } - } - public override void AI() - { - Rotation += RotationSpeed; - projectile.Center = Helper.PolarPos(Main.LocalPlayer.Center, Distanse, Helper.GradtoRad(Rotation)); - projectile.rotation = Helper.rotateBetween2Points(Main.LocalPlayer.Center, projectile.Center) - Helper.GradtoRad(90); - } - - public override bool? CanHitNPC(NPC target) - { - return !target.friendly; - } - } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (Main.rand.Next(3) == 0) + { + target.AddBuff(31, 180, false); + } + } + public override void AI() + { + Rotation += RotationSpeed; + projectile.Center = Helper.PolarPos(Main.LocalPlayer.Center, Distanse, Helper.GradtoRad(Rotation)); + projectile.rotation = Helper.rotateBetween2Points(Main.LocalPlayer.Center, projectile.Center) - Helper.GradtoRad(90); + } + + public override bool? CanHitNPC(NPC target) + { + return !target.friendly; + } + } } diff --git a/Projectiles/FungusSpear.cs b/Projectiles/FungusSpear.cs index b21809ca..f4ad6f02 100644 --- a/Projectiles/FungusSpear.cs +++ b/Projectiles/FungusSpear.cs @@ -5,29 +5,31 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class FungusSpear : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class FungusSpear : ModProjectile + { + public override void SetDefaults() + { projectile.CloneDefaults(66); aiType = 66; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("FungusSpear"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("FungusSpear"); + } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - if(Main.rand.Next(4) == 0) - { - target.AddBuff(31, 120, false); - } - } -}} + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (Main.rand.Next(4) == 0) + { + target.AddBuff(31, 120, false); + } + } + + } +} diff --git a/Projectiles/FungusYellowSword.cs b/Projectiles/FungusYellowSword.cs index 8ca5bc4c..20e243d1 100644 --- a/Projectiles/FungusYellowSword.cs +++ b/Projectiles/FungusYellowSword.cs @@ -4,52 +4,52 @@ namespace Tremor.Projectiles { - public class FungusYellowSword : ModProjectile - { - const float RotationSpeed = 0.08f; - const float Distanse = 100; + public class FungusYellowSword : ModProjectile + { + const float RotationSpeed = 0.08f; + const float Distanse = 100; - float Rotation = 0; + float Rotation = 0; - public override Color? GetAlpha(Color lightColor) - { - return Color.White; - } - public override void SetDefaults() - { - projectile.width = 18; - projectile.height = 44; - projectile.timeLeft = 6; - projectile.melee = true; - projectile.aiStyle = -1; - projectile.penetrate = -1; - projectile.tileCollide = false; - projectile.ignoreWater = true; - } + public override Color? GetAlpha(Color lightColor) + { + return Color.White; + } + public override void SetDefaults() + { + projectile.width = 18; + projectile.height = 44; + projectile.timeLeft = 6; + projectile.melee = true; + projectile.aiStyle = -1; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.ignoreWater = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Fungus Yellow Sword"); - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Fungus Yellow Sword"); + } - public override void AI() - { - Rotation += RotationSpeed; - projectile.Center = Helper.PolarPos(Main.LocalPlayer.Center, Distanse, Helper.GradtoRad(Rotation)); - projectile.rotation = Helper.rotateBetween2Points(Main.LocalPlayer.Center, projectile.Center) - Helper.GradtoRad(90); - } + public override void AI() + { + Rotation += RotationSpeed; + projectile.Center = Helper.PolarPos(Main.LocalPlayer.Center, Distanse, Helper.GradtoRad(Rotation)); + projectile.rotation = Helper.rotateBetween2Points(Main.LocalPlayer.Center, projectile.Center) - Helper.GradtoRad(90); + } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - if (Main.rand.Next(4) == 0) - { - target.AddBuff(72, 180, false); - } - } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (Main.rand.Next(4) == 0) + { + target.AddBuff(72, 180, false); + } + } - public override bool? CanHitNPC(NPC target) - { - return !target.friendly; - } - } + public override bool? CanHitNPC(NPC target) + { + return !target.friendly; + } + } } diff --git a/Projectiles/GalaxonPro.cs b/Projectiles/GalaxonPro.cs index 23986da3..ee9ac82e 100644 --- a/Projectiles/GalaxonPro.cs +++ b/Projectiles/GalaxonPro.cs @@ -7,32 +7,32 @@ namespace Tremor.Projectiles { - public class GalaxonPro : ModProjectile - { - - public override void SetDefaults() - { + public class GalaxonPro : ModProjectile + { - projectile.width = 10; - projectile.height = 10; - projectile.friendly = true; - projectile.aiStyle = 1; - projectile.penetrate = -1; - projectile.extraUpdates = 5; - projectile.tileCollide = false; - projectile.magic = true; - } + public override void SetDefaults() + { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("GalaxonPro"); - - } + projectile.width = 10; + projectile.height = 10; + projectile.friendly = true; + projectile.aiStyle = 1; + projectile.penetrate = -1; + projectile.extraUpdates = 5; + projectile.tileCollide = false; + projectile.magic = true; + } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("GalaxonPro"); - public override void AI() - { - if (projectile.ai[1] != -1f && projectile.position.Y > projectile.ai[1]) + } + + + public override void AI() + { + if (projectile.ai[1] != -1f && projectile.position.Y > projectile.ai[1]) { projectile.tileCollide = true; } @@ -101,12 +101,12 @@ public override void AI() return; } } - } + } - public override void Kill(int timeLeft) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); - bool flag = WorldGen.SolidTile(Framing.GetTileSafely((int)projectile.position.X / 16, (int)projectile.position.Y / 16)); + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + bool flag = WorldGen.SolidTile(Framing.GetTileSafely((int)projectile.position.X / 16, (int)projectile.position.Y / 16)); for (int m = 0; m < 4; m++) { Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 59, 0f, 0f, 100, default(Color), 1.5f); @@ -128,7 +128,7 @@ public override void Kill(int timeLeft) Main.dust[num10].noLight = true; } } - } + } - } + } } diff --git a/Projectiles/GarnetGlovePro.cs b/Projectiles/GarnetGlovePro.cs index b1a1f59a..87e9509a 100644 --- a/Projectiles/GarnetGlovePro.cs +++ b/Projectiles/GarnetGlovePro.cs @@ -7,34 +7,34 @@ namespace Tremor.Projectiles { public class GarnetGlovePro : ModProjectile { - public override void SetDefaults() - { + public override void SetDefaults() + { - projectile.CloneDefaults(303); + projectile.CloneDefaults(303); projectile.width = 28; - projectile.height = 38; + projectile.height = 38; aiType = 303; - projectile.timeLeft = 400; - } + projectile.timeLeft = 400; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("GarnetGlovePro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("GarnetGlovePro"); + } - public override bool CanHitPlayer(Player target) - { - return false; - } - public override bool? CanHitNPC(NPC target) - { - return (target.friendly) ? false : true; - } + public override bool CanHitPlayer(Player target) + { + return false; + } - + public override bool? CanHitNPC(NPC target) + { + return (target.friendly) ? false : true; + } -} + + + } } diff --git a/Projectiles/GhostlyArrow.cs b/Projectiles/GhostlyArrow.cs index c1643c0f..a43a4def 100644 --- a/Projectiles/GhostlyArrow.cs +++ b/Projectiles/GhostlyArrow.cs @@ -4,34 +4,36 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -//ported from my tAPI mod because I don't want to make artwork -public class GhostlyArrow : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + //ported from my tAPI mod because I don't want to make artwork + public class GhostlyArrow : ModProjectile + { + public override void SetDefaults() + { - projectile.width = 16; - projectile.height = 40; - projectile.aiStyle = 1; - projectile.friendly = true; - projectile.penetrate = -2; - projectile.tileCollide = true; - projectile.melee = true; - } + projectile.width = 16; + projectile.height = 40; + projectile.aiStyle = 1; + projectile.friendly = true; + projectile.penetrate = -2; + projectile.tileCollide = true; + projectile.melee = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ghostly Arrow"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ghostly Arrow"); + } - public override void Kill(int timeLeft) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 93); - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("GhostlyExplosion"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); - } -}} + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 93); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("GhostlyExplosion"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + } + + } +} diff --git a/Projectiles/GhostlyExplosion.cs b/Projectiles/GhostlyExplosion.cs index c69603e4..8b56da9b 100644 --- a/Projectiles/GhostlyExplosion.cs +++ b/Projectiles/GhostlyExplosion.cs @@ -7,35 +7,35 @@ namespace Tremor.Projectiles { - public class GhostlyExplosion : ModProjectile - { - public override void SetDefaults() - { + public class GhostlyExplosion : ModProjectile + { + public override void SetDefaults() + { - projectile.width = 250; - projectile.height = 250; - projectile.friendly = true; - projectile.ignoreWater = false; - projectile.tileCollide = false; - projectile.penetrate = -1; - projectile.timeLeft = 150; - projectile.magic = true; - } + projectile.width = 250; + projectile.height = 250; + projectile.friendly = true; + projectile.ignoreWater = false; + projectile.tileCollide = false; + projectile.penetrate = -1; + projectile.timeLeft = 150; + projectile.magic = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ghostly Explosion"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ghostly Explosion"); + } - public override void AI() - { - Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.75f) / 255f, ((255 - projectile.alpha) * 0.5f) / 255f, ((255 - projectile.alpha) * 0.01f) / 255f); - if (projectile.wet && !projectile.lavaWet) - { - projectile.Kill(); - } + + public override void AI() + { + Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.75f) / 255f, ((255 - projectile.alpha) * 0.5f) / 255f, ((255 - projectile.alpha) * 0.01f) / 255f); + if (projectile.wet && !projectile.lavaWet) + { + projectile.Kill(); + } if (projectile.localAI[0] == 0f) { Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); @@ -98,7 +98,7 @@ public override void AI() num462++; } return; - } + } - } + } } diff --git a/Projectiles/GloomSphere.cs b/Projectiles/GloomSphere.cs index 9d5867b9..92e664e0 100644 --- a/Projectiles/GloomSphere.cs +++ b/Projectiles/GloomSphere.cs @@ -5,38 +5,40 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class GloomSphere : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class GloomSphere : ModProjectile + { + public override void SetDefaults() + { - projectile.width = 32; - projectile.height = 32; - projectile.aiStyle = 91; - projectile.friendly = true; - projectile.ranged = true; - projectile.penetrate = 6; - projectile.timeLeft = 600; - projectile.light = 0.5f; - projectile.extraUpdates = 1; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - } + projectile.width = 32; + projectile.height = 32; + projectile.aiStyle = 91; + projectile.friendly = true; + projectile.ranged = true; + projectile.penetrate = 6; + projectile.timeLeft = 600; + projectile.light = 0.5f; + projectile.extraUpdates = 1; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gloom Sphere"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gloom Sphere"); + } - public override void AI() - { - projectile.velocity.Y += projectile.ai[0]; - if(Main.rand.Next(2) == 0) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 27, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); - } - } -}} + + public override void AI() + { + projectile.velocity.Y += projectile.ai[0]; + if (Main.rand.Next(2) == 0) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 27, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); + } + } + } +} diff --git a/Projectiles/GoldFishPro.cs b/Projectiles/GoldFishPro.cs index 14b99e4a..5d8c3d73 100644 --- a/Projectiles/GoldFishPro.cs +++ b/Projectiles/GoldFishPro.cs @@ -16,55 +16,55 @@ public override void SetDefaults() projectile.magic = true; projectile.penetrate = 6; Main.projFrames[projectile.type] = 4; - projectile.aiStyle = 1; + projectile.aiStyle = 1; projectile.timeLeft = 600; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("GoldFishPro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("GoldFishPro"); + + } - public override void Kill(int timeLeft) - { - Main.PlaySound(4, (int)projectile.position.X, (int)projectile.position.Y, 1); - Gore.NewGore(projectile.position, projectile.velocity, 553, 1f); - Gore.NewGore(projectile.position, projectile.velocity, 554, 1f); - for (int num158 = 0; num158 < 20; num158++) + public override void Kill(int timeLeft) { - int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); - if (Main.rand.Next(3) == 0) + Main.PlaySound(4, (int)projectile.position.X, (int)projectile.position.Y, 1); + Gore.NewGore(projectile.position, projectile.velocity, 553, 1f); + Gore.NewGore(projectile.position, projectile.velocity, 554, 1f); + for (int num158 = 0; num158 < 20; num158++) { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].type++; - } - else - { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); + if (Main.rand.Next(3) == 0) + { + Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].type++; + } + else + { + Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + } + Main.dust[num159].noGravity = true; + Main.dust[num159].velocity *= 2.5f; + Main.dust[num159].velocity -= projectile.oldVelocity / 10f; } - Main.dust[num159].noGravity = true; - Main.dust[num159].velocity *= 2.5f; - Main.dust[num159].velocity -= projectile.oldVelocity / 10f; - } - if (Main.myPlayer == projectile.owner) - { - int num160 = Main.rand.Next(0, 0); - for (int num161 = 0; num161 < num160; num161++) + if (Main.myPlayer == projectile.owner) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value12.X == 0f && value12.Y == 0f) + int num160 = Main.rand.Next(0, 0); + for (int num161 = 0; num161 < num160; num161++) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + while (value12.X == 0f && value12.Y == 0f) + { + value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + } + value12.Normalize(); + value12 *= (float)Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); } - value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); } } - } } } diff --git a/Projectiles/GoldKunai.cs b/Projectiles/GoldKunai.cs index 118340f9..b1670e3d 100644 --- a/Projectiles/GoldKunai.cs +++ b/Projectiles/GoldKunai.cs @@ -5,38 +5,40 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class GoldKunai : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class GoldKunai : ModProjectile + { + public override void SetDefaults() + { - projectile.width = 1; - projectile.height = 1; - projectile.friendly = true; - projectile.aiStyle = 1; - projectile.timeLeft = 1200; - } + projectile.width = 1; + projectile.height = 1; + projectile.friendly = true; + projectile.aiStyle = 1; + projectile.timeLeft = 1200; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gold Kunai"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gold Kunai"); + } - public override void Kill(int timeLeft) - { - for(int k = 0; k < 5; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 73, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); - } - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1); - } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - projectile.ai[0] += 0.1f; - projectile.velocity *= 0.75f; - } -}} + public override void Kill(int timeLeft) + { + for (int k = 0; k < 5; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 73, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); + } + Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1); + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + projectile.ai[0] += 0.1f; + projectile.velocity *= 0.75f; + } + } +} diff --git a/Projectiles/GoldSpearPro.cs b/Projectiles/GoldSpearPro.cs index 182b262e..eaa45697 100644 --- a/Projectiles/GoldSpearPro.cs +++ b/Projectiles/GoldSpearPro.cs @@ -5,21 +5,23 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class GoldSpearPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class GoldSpearPro : ModProjectile + { + public override void SetDefaults() + { projectile.CloneDefaults(66); aiType = 66; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("GoldSpearPro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("GoldSpearPro"); + } -}} + + } +} diff --git a/Projectiles/GoldenMacePro.cs b/Projectiles/GoldenMacePro.cs index 9035371e..e4d643dd 100644 --- a/Projectiles/GoldenMacePro.cs +++ b/Projectiles/GoldenMacePro.cs @@ -9,13 +9,13 @@ namespace Tremor.Projectiles public class GoldenMacePro : ModProjectile { - public override void Kill(int timeLeft) - { - for(int k = 0; k < 5; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 246, projectile.oldVelocity.X * 0.1f, projectile.oldVelocity.Y * 0.1f); - } - } + public override void Kill(int timeLeft) + { + for (int k = 0; k < 5; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 246, projectile.oldVelocity.X * 0.1f, projectile.oldVelocity.Y * 0.1f); + } + } public override void SetDefaults() { @@ -28,11 +28,11 @@ public override void SetDefaults() projectile.ignoreWater = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("GoldenMacePro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("GoldenMacePro"); + + } public override void AI() @@ -78,14 +78,14 @@ public override void AI() projectile.ai[0] += 1f; } projectile.rotation += 0.3f * (float)projectile.direction; - } + } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - if(Main.rand.Next(5) == 0) - { - target.AddBuff(72, 500, false); - } - } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (Main.rand.Next(5) == 0) + { + target.AddBuff(72, 500, false); + } + } } } diff --git a/Projectiles/GoldenThrowingAxePro.cs b/Projectiles/GoldenThrowingAxePro.cs index a8a8b71e..38ceb154 100644 --- a/Projectiles/GoldenThrowingAxePro.cs +++ b/Projectiles/GoldenThrowingAxePro.cs @@ -5,40 +5,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class GoldenThrowingAxePro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class GoldenThrowingAxePro : ModProjectile + { + public override void SetDefaults() + { - projectile.width = 13; - projectile.height = 15; - projectile.friendly = true; - projectile.aiStyle = 2; - projectile.timeLeft = 1200; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - } + projectile.width = 13; + projectile.height = 15; + projectile.friendly = true; + projectile.aiStyle = 2; + projectile.timeLeft = 1200; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Golden Throwing Axe"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Golden Throwing Axe"); + } - public override void Kill(int timeLeft) - { - for(int k = 0; k < 5; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 1, projectile.oldVelocity.X * 0.1f, projectile.oldVelocity.Y * 0.1f); - } - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); - } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - projectile.ai[0] += 0.1f; - projectile.velocity *= 0.75f; - } -}} + public override void Kill(int timeLeft) + { + for (int k = 0; k < 5; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 1, projectile.oldVelocity.X * 0.1f, projectile.oldVelocity.Y * 0.1f); + } + Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + projectile.ai[0] += 0.1f; + projectile.velocity *= 0.75f; + } + } +} diff --git a/Projectiles/GoldenWhalePro.cs b/Projectiles/GoldenWhalePro.cs index 1aa51e84..7c21f59d 100644 --- a/Projectiles/GoldenWhalePro.cs +++ b/Projectiles/GoldenWhalePro.cs @@ -14,17 +14,17 @@ public override void SetDefaults() aiType = ProjectileID.ZephyrFish; Main.projFrames[projectile.type] = 4; - projectile.width = 72; - //projectile.noGravity = true; - projectile.height = 38; + projectile.width = 72; + //projectile.noGravity = true; + projectile.height = 38; Main.projPet[projectile.type] = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Golden Whale"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Golden Whale"); + + } public override bool PreAI() diff --git a/Projectiles/GrassGlaviePro.cs b/Projectiles/GrassGlaviePro.cs index 5ff4754e..b8edc9c4 100644 --- a/Projectiles/GrassGlaviePro.cs +++ b/Projectiles/GrassGlaviePro.cs @@ -5,38 +5,40 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class GrassGlaviePro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class GrassGlaviePro : ModProjectile + { + public override void SetDefaults() + { projectile.CloneDefaults(66); aiType = 66; - projectile.tileCollide = false; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("GrassGlaviePro"); - - } - - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - if(Main.rand.Next(2) == 0) - { - target.AddBuff(20, 180, false); - } - - } - - public override void AI() - { - if(Main.rand.Next(3) == 0) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 44, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); - } - } -}} + projectile.tileCollide = false; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("GrassGlaviePro"); + + } + + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (Main.rand.Next(2) == 0) + { + target.AddBuff(20, 180, false); + } + + } + + public override void AI() + { + if (Main.rand.Next(3) == 0) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 44, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); + } + } + } +} diff --git a/Projectiles/GuardianHammerPro.cs b/Projectiles/GuardianHammerPro.cs index 9e9d0ec2..36948ead 100644 --- a/Projectiles/GuardianHammerPro.cs +++ b/Projectiles/GuardianHammerPro.cs @@ -7,20 +7,20 @@ namespace Tremor.Projectiles { public class GuardianHammerPro : ModProjectile { - public override void SetDefaults() - { + public override void SetDefaults() + { - projectile.CloneDefaults(301); + projectile.CloneDefaults(301); projectile.width = 32; - projectile.height = 32; + projectile.height = 32; aiType = 301; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("GarnetGlovePro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("GarnetGlovePro"); + + } public override Color? GetAlpha(Color lightColor) @@ -28,26 +28,26 @@ public override void SetStaticDefaults() return Color.White; } - public override bool CanHitPlayer(Player target) - { - return false; - } + public override bool CanHitPlayer(Player target) + { + return false; + } + + public override bool? CanHitNPC(NPC target) + { + return (target.friendly) ? false : true; + } - public override bool? CanHitNPC(NPC target) - { - return (target.friendly) ? false : true; - } + public override void AI() + { + projectile.rotation = (float)System.Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + if (Main.rand.Next(1) == 0) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 62, projectile.velocity.X * 0.9f, projectile.velocity.Y * 0.9f); + } + } - public override void AI() - { - projectile.rotation = (float)System.Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; - if(Main.rand.Next(1) == 0) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 62, projectile.velocity.X * 0.9f, projectile.velocity.Y * 0.9f); - } - } - -} + } } diff --git a/Projectiles/GurdPet.cs b/Projectiles/GurdPet.cs index e6853fc1..1a12b468 100644 --- a/Projectiles/GurdPet.cs +++ b/Projectiles/GurdPet.cs @@ -14,16 +14,16 @@ public override void SetDefaults() aiType = ProjectileID.Bunny; Main.projFrames[projectile.type] = 8; - projectile.width = 46; - projectile.height = 38; + projectile.width = 46; + projectile.height = 38; Main.projPet[projectile.type] = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gurd Pet"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gurd Pet"); + + } public override bool PreAI() diff --git a/Projectiles/Gurumaster.cs b/Projectiles/Gurumaster.cs index bbeb1de6..af356d89 100644 --- a/Projectiles/Gurumaster.cs +++ b/Projectiles/Gurumaster.cs @@ -5,136 +5,138 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class Gurumaster : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class Gurumaster : ModProjectile + { + public override void SetDefaults() + { - projectile.friendly = true; + projectile.friendly = true; projectile.width = 4; projectile.height = 4; - projectile.aiStyle = 0; - Main.projFrames[projectile.type] = 4; - projectile.timeLeft = 1200; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; - ProjectileID.Sets.TrailingMode[projectile.type] = 2; - } + projectile.aiStyle = 0; + Main.projFrames[projectile.type] = 4; + projectile.timeLeft = 1200; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gurumaster"); - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Gurumaster"); - - } + } - public override void AI() - { - int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 136, default(Color), 0.9f); - Main.dust[dust].noGravity = true; + public override void AI() + { + int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 136, default(Color), 0.9f); + Main.dust[dust].noGravity = true; - if(projectile.frameCounter < 5) + if (projectile.frameCounter < 5) projectile.frame = 0; - else if(projectile.frameCounter >= 5 && projectile.frameCounter < 10) + else if (projectile.frameCounter >= 5 && projectile.frameCounter < 10) projectile.frame = 1; - else if(projectile.frameCounter >= 10 && projectile.frameCounter < 15) + else if (projectile.frameCounter >= 10 && projectile.frameCounter < 15) projectile.frame = 2; - else if(projectile.frameCounter >= 15 && projectile.frameCounter < 20) + else if (projectile.frameCounter >= 15 && projectile.frameCounter < 20) projectile.frame = 3; else projectile.frameCounter = 0; projectile.frameCounter++; - } + } - public override void Kill(int timeLeft) -{ + public override void Kill(int timeLeft) + { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); - projectile.width = 80; - projectile.height = 80; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - for (int num628 = 0; num628 < 40; num628++) - { - int num629 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); - Main.dust[num629].velocity *= 3f; - if (Main.rand.Next(2) == 0) - { - Main.dust[num629].scale = 0.5f; - Main.dust[num629].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; - } - } - for (int num630 = 0; num630 < 70; num630++) - { - int num631 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 3f); - Main.dust[num631].noGravity = true; - Main.dust[num631].velocity *= 5f; - num631 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 2f); - Main.dust[num631].velocity *= 2f; - } - for (int num632 = 0; num632 < 3; num632++) - { - float scaleFactor10 = 0.33f; - if (num632 == 1) - { - scaleFactor10 = 0.66f; - } - if (num632 == 2) - { - scaleFactor10 = 1f; - } - int num633 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); - Main.gore[num633].velocity *= scaleFactor10; - Gore expr_13E6D_cp_0 = Main.gore[num633]; - expr_13E6D_cp_0.velocity.X = expr_13E6D_cp_0.velocity.X + 1f; - Gore expr_13E8D_cp_0 = Main.gore[num633]; - expr_13E8D_cp_0.velocity.Y = expr_13E8D_cp_0.velocity.Y + 1f; - num633 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 2f); - Main.gore[num633].velocity *= scaleFactor10; - Gore expr_13F30_cp_0 = Main.gore[num633]; - expr_13F30_cp_0.velocity.X = expr_13F30_cp_0.velocity.X - 1f; - Gore expr_13F50_cp_0 = Main.gore[num633]; - expr_13F50_cp_0.velocity.Y = expr_13F50_cp_0.velocity.Y + 1f; - num633 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); - Main.gore[num633].velocity *= scaleFactor10; - Gore expr_13FF3_cp_0 = Main.gore[num633]; - expr_13FF3_cp_0.velocity.X = expr_13FF3_cp_0.velocity.X + 1f; - Gore expr_14013_cp_0 = Main.gore[num633]; - expr_14013_cp_0.velocity.Y = expr_14013_cp_0.velocity.Y - 1f; - num633 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); - Main.gore[num633].velocity *= scaleFactor10; - Gore expr_140B6_cp_0 = Main.gore[num633]; - expr_140B6_cp_0.velocity.X = expr_140B6_cp_0.velocity.X - 1f; - Gore expr_140D6_cp_0 = Main.gore[num633]; - expr_140D6_cp_0.velocity.Y = expr_140D6_cp_0.velocity.Y - 1f; - } - projectile.position.X = projectile.position.X + (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); - projectile.width = 10; - projectile.height = 10; - projectile.position.X = projectile.position.X - (float)(projectile.width / 2); - projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62); + projectile.position.X = projectile.position.X + (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.width = 80; + projectile.height = 80; + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + for (int num628 = 0; num628 < 40; num628++) + { + int num629 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 2f); + Main.dust[num629].velocity *= 3f; + if (Main.rand.Next(2) == 0) + { + Main.dust[num629].scale = 0.5f; + Main.dust[num629].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + } + } + for (int num630 = 0; num630 < 70; num630++) + { + int num631 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 3f); + Main.dust[num631].noGravity = true; + Main.dust[num631].velocity *= 5f; + num631 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 2f); + Main.dust[num631].velocity *= 2f; + } + for (int num632 = 0; num632 < 3; num632++) + { + float scaleFactor10 = 0.33f; + if (num632 == 1) + { + scaleFactor10 = 0.66f; + } + if (num632 == 2) + { + scaleFactor10 = 1f; + } + int num633 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num633].velocity *= scaleFactor10; + Gore expr_13E6D_cp_0 = Main.gore[num633]; + expr_13E6D_cp_0.velocity.X = expr_13E6D_cp_0.velocity.X + 1f; + Gore expr_13E8D_cp_0 = Main.gore[num633]; + expr_13E8D_cp_0.velocity.Y = expr_13E8D_cp_0.velocity.Y + 1f; + num633 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 2f); + Main.gore[num633].velocity *= scaleFactor10; + Gore expr_13F30_cp_0 = Main.gore[num633]; + expr_13F30_cp_0.velocity.X = expr_13F30_cp_0.velocity.X - 1f; + Gore expr_13F50_cp_0 = Main.gore[num633]; + expr_13F50_cp_0.velocity.Y = expr_13F50_cp_0.velocity.Y + 1f; + num633 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num633].velocity *= scaleFactor10; + Gore expr_13FF3_cp_0 = Main.gore[num633]; + expr_13FF3_cp_0.velocity.X = expr_13FF3_cp_0.velocity.X + 1f; + Gore expr_14013_cp_0 = Main.gore[num633]; + expr_14013_cp_0.velocity.Y = expr_14013_cp_0.velocity.Y - 1f; + num633 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default(Vector2), Main.rand.Next(61, 64), 1f); + Main.gore[num633].velocity *= scaleFactor10; + Gore expr_140B6_cp_0 = Main.gore[num633]; + expr_140B6_cp_0.velocity.X = expr_140B6_cp_0.velocity.X - 1f; + Gore expr_140D6_cp_0 = Main.gore[num633]; + expr_140D6_cp_0.velocity.Y = expr_140D6_cp_0.velocity.Y - 1f; + } + projectile.position.X = projectile.position.X + (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.width = 10; + projectile.height = 10; + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); - if (projectile.owner == Main.myPlayer) - { - int num220 = Main.rand.Next(3, 8); - for (int num221 = 0; num221 < num220; num221++) + if (projectile.owner == Main.myPlayer) { - Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - value17.Normalize(); - value17 *= (float)Main.rand.Next(10, 201) * 0.01f; - Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("BoomCloudPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + int num220 = Main.rand.Next(3, 8); + for (int num221 = 0; num221 < num220; num221++) + { + Vector2 value17 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + value17.Normalize(); + value17 *= (float)Main.rand.Next(10, 201) * 0.01f; + Projectile.NewProjectile(projectile.position.X, projectile.position.Y, value17.X, value17.Y, mod.ProjectileType("BoomCloudPro"), projectile.damage, 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1)); + } } } -} -public override Color? GetAlpha(Color lightColor) -{ -return Color.White; -} + public override Color? GetAlpha(Color lightColor) + { + return Color.White; + } -}} + } +} diff --git a/Projectiles/HallowedSprayPro.cs b/Projectiles/HallowedSprayPro.cs index e617f41d..80bf399b 100644 --- a/Projectiles/HallowedSprayPro.cs +++ b/Projectiles/HallowedSprayPro.cs @@ -7,30 +7,30 @@ namespace Tremor.Projectiles { - public class HallowedSprayPro : ModProjectile - { - public override void SetDefaults() - { + public class HallowedSprayPro : ModProjectile + { + public override void SetDefaults() + { - projectile.width = 6; - projectile.height = 6; - projectile.friendly = true; - projectile.ignoreWater = true; - projectile.penetrate = -1; - projectile.extraUpdates = 3; - projectile.timeLeft = 90; - } + projectile.width = 6; + projectile.height = 6; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.penetrate = -1; + projectile.extraUpdates = 3; + projectile.timeLeft = 90; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("HallowedSprayPro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("HallowedSprayPro"); + } - public override void AI() - { - Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.25f) / 255f, ((255 - projectile.alpha) * 0.05f) / 255f, ((255 - projectile.alpha) * 0.05f) / 255f); + + public override void AI() + { + Lighting.AddLight(projectile.Center, ((255 - projectile.alpha) * 0.25f) / 255f, ((255 - projectile.alpha) * 0.05f) / 255f, ((255 - projectile.alpha) * 0.05f) / 255f); if (projectile.timeLeft > 90) { projectile.timeLeft = 90; @@ -91,30 +91,30 @@ public override void AI() projectile.ai[0] += 1f; } projectile.rotation += 0.3f * (float)projectile.direction; - return; - } - public override bool OnTileCollide(Vector2 oldVelocity) - { - projectile.penetrate--; - if (projectile.penetrate <= 0) - { - projectile.Kill(); - } - else - { - projectile.ai[0] += 0.1f; - if (projectile.velocity.X != oldVelocity.X) - { - projectile.velocity.X = -oldVelocity.X; - } - if (projectile.velocity.Y != oldVelocity.Y) - { - projectile.velocity.Y = -oldVelocity.Y; - } - projectile.velocity *= 0.75f; - } - return false; - } + return; + } + public override bool OnTileCollide(Vector2 oldVelocity) + { + projectile.penetrate--; + if (projectile.penetrate <= 0) + { + projectile.Kill(); + } + else + { + projectile.ai[0] += 0.1f; + if (projectile.velocity.X != oldVelocity.X) + { + projectile.velocity.X = -oldVelocity.X; + } + if (projectile.velocity.Y != oldVelocity.Y) + { + projectile.velocity.Y = -oldVelocity.Y; + } + projectile.velocity *= 0.75f; + } + return false; + } - } + } } diff --git a/Projectiles/HarpyFeather.cs b/Projectiles/HarpyFeather.cs index 3dd9ddd3..da723991 100644 --- a/Projectiles/HarpyFeather.cs +++ b/Projectiles/HarpyFeather.cs @@ -15,20 +15,20 @@ public override void SetDefaults() projectile.friendly = true; projectile.magic = true; projectile.penetrate = 6; - projectile.aiStyle = 1; + projectile.aiStyle = 1; projectile.timeLeft = 600; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Harpy"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Harpy"); + + } - public override void Kill(int timeLeft) - { - Main.PlaySound(6, (int)projectile.position.X, (int)projectile.position.Y, 0); - } + public override void Kill(int timeLeft) + { + Main.PlaySound(6, (int)projectile.position.X, (int)projectile.position.Y, 0); + } } } diff --git a/Projectiles/HeavyBeam.cs b/Projectiles/HeavyBeam.cs index 162021a9..d82eec68 100644 --- a/Projectiles/HeavyBeam.cs +++ b/Projectiles/HeavyBeam.cs @@ -5,29 +5,29 @@ namespace Tremor.Projectiles { - public class HeavyBeam : ModProjectile - { - public override void SetDefaults() - { - projectile.CloneDefaults(455); + public class HeavyBeam : ModProjectile + { + public override void SetDefaults() + { + projectile.CloneDefaults(455); - aiType = 455; - projectile.width = 16; - projectile.height = 16; - projectile.timeLeft = 2; - projectile.penetrate = -1; - projectile.friendly = true; - projectile.magic = true; - projectile.tileCollide = false; - projectile.ignoreWater = true; - projectile.alpha = 100; - } + aiType = 455; + projectile.width = 16; + projectile.height = 16; + projectile.timeLeft = 2; + projectile.penetrate = -1; + projectile.friendly = true; + projectile.magic = true; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.alpha = 100; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Heavy Beam"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Heavy Beam"); - } + } + + } } diff --git a/Projectiles/HellStormArrow.cs b/Projectiles/HellStormArrow.cs index 398b87b3..9288ce27 100644 --- a/Projectiles/HellStormArrow.cs +++ b/Projectiles/HellStormArrow.cs @@ -7,54 +7,54 @@ namespace Tremor.Projectiles { - public class HellStormArrow : ModProjectile - { - public override void SetDefaults() - { + public class HellStormArrow : ModProjectile + { + public override void SetDefaults() + { - projectile.width = 18; - projectile.height = 10; - projectile.friendly = true; - projectile.ignoreWater = true; - projectile.penetrate = 1; - projectile.extraUpdates = 1; - projectile.ranged = true; - } + projectile.width = 18; + projectile.height = 10; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.penetrate = 1; + projectile.extraUpdates = 1; + projectile.ranged = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Hell Storm Arrow"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Hell Storm Arrow"); + } - public override Color? GetAlpha(Color lightColor) - { - return Color.White; - } - public override void Kill(int timeLeft) - { - for(int k = 0; k < 5; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 6, projectile.oldVelocity.X * 0.1f, projectile.oldVelocity.Y * 0.1f); - } - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); - } + public override Color? GetAlpha(Color lightColor) + { + return Color.White; + } + public override void Kill(int timeLeft) + { + for (int k = 0; k < 5; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 6, projectile.oldVelocity.X * 0.1f, projectile.oldVelocity.Y * 0.1f); + } + Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); + } - public override void AI() - { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; - projectile.frameCounter++; + + public override void AI() + { + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + projectile.frameCounter++; if (projectile.frameCounter > 4) { - projectile.frame++; - projectile.frameCounter = 0; + projectile.frame++; + projectile.frameCounter = 0; } if (projectile.frame > 3) { - projectile.frame = 0; + projectile.frame = 0; } if (projectile.ai[0] <= 3f) { @@ -62,41 +62,41 @@ public override void AI() return; } projectile.velocity.Y = projectile.velocity.Y + 0.075f; - projectile.localAI[0] += 1f; - float num472 = projectile.Center.X; - float num473 = projectile.Center.Y; - float num474 = 400f; - bool flag17 = false; - for (int num475 = 0; num475 < 200; num475++) - { - if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1)) - { - float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2); - float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2); - float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); - if (num478 < num474) - { - num474 = num478; - num472 = num476; - num473 = num477; - flag17 = true; - } - } - } - if (flag17) - { - float num483 = 10f; - Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num484 = num472 - vector35.X; - float num485 = num473 - vector35.Y; - float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485)); - num486 = num483 / num486; - num484 *= num486; - num485 *= num486; - projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f; - projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f; - return; - } - } - } + projectile.localAI[0] += 1f; + float num472 = projectile.Center.X; + float num473 = projectile.Center.Y; + float num474 = 400f; + bool flag17 = false; + for (int num475 = 0; num475 < 200; num475++) + { + if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1)) + { + float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2); + float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2); + float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477); + if (num478 < num474) + { + num474 = num478; + num472 = num476; + num473 = num477; + flag17 = true; + } + } + } + if (flag17) + { + float num483 = 10f; + Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num484 = num472 - vector35.X; + float num485 = num473 - vector35.Y; + float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485)); + num486 = num483 / num486; + num484 *= num486; + num485 *= num486; + projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f; + projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f; + return; + } + } + } } diff --git a/Projectiles/HellStormProj.cs b/Projectiles/HellStormProj.cs index 2d85663c..cf543f09 100644 --- a/Projectiles/HellStormProj.cs +++ b/Projectiles/HellStormProj.cs @@ -7,35 +7,35 @@ namespace Tremor.Projectiles { - public class HellStormProj : ModProjectile - { - public override void SetDefaults() - { + public class HellStormProj : ModProjectile + { + public override void SetDefaults() + { - projectile.width = 78; - projectile.height = 32; - projectile.friendly = true; - projectile.penetrate = -1; - projectile.tileCollide = false; - projectile.ignoreWater = true; - projectile.ranged = true; - } + projectile.width = 78; + projectile.height = 32; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.ranged = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Hell Storm"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Hell Storm"); + } - public override Color? GetAlpha(Color lightColor) - { - return Color.White; - } - public override void AI() - { - Player player = Main.player[projectile.owner]; + public override Color? GetAlpha(Color lightColor) + { + return Color.White; + } + + public override void AI() + { + Player player = Main.player[projectile.owner]; float num = 1.57079637f; Vector2 vector = player.RotatedRelativePoint(player.MountedCenter, true); if (projectile.type == mod.ProjectileType("HellStormProj")) @@ -131,6 +131,6 @@ public override void AI() player.itemTime = 2; player.itemAnimation = 2; player.itemRotation = (float)Math.Atan2((double)(projectile.velocity.Y * (float)projectile.direction), (double)(projectile.velocity.X * (float)projectile.direction)); - } - } + } + } } diff --git a/Projectiles/HolyJavelinPro.cs b/Projectiles/HolyJavelinPro.cs index 37ec089a..ab6a0fb8 100644 --- a/Projectiles/HolyJavelinPro.cs +++ b/Projectiles/HolyJavelinPro.cs @@ -22,97 +22,97 @@ public override void SetDefaults() aiType = 598; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("HolyJavelinPro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("HolyJavelinPro"); + + } + - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - if(Main.rand.Next(2) == 0) - { - target.AddBuff(20, 320, false); - } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (Main.rand.Next(2) == 0) + { + target.AddBuff(20, 320, false); + } - } + } public override Color? GetAlpha(Color lightColor) { return Color.White; } - - public override void Kill(int timeLeft) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 1); - for (int num158 = 0; num158 < 20; num158++) + + public override void Kill(int timeLeft) { - int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 57, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); - if (Main.rand.Next(3) == 0) - { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].type++; - } - else + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 1); + for (int num158 = 0; num158 < 20; num158++) { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 57, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); + if (Main.rand.Next(3) == 0) + { + Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].type++; + } + else + { + Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + } + Main.dust[num159].noGravity = true; + Main.dust[num159].velocity *= 2.5f; + Main.dust[num159].velocity -= projectile.oldVelocity / 10f; } - Main.dust[num159].noGravity = true; - Main.dust[num159].velocity *= 2.5f; - Main.dust[num159].velocity -= projectile.oldVelocity / 10f; - } - if (Main.myPlayer == projectile.owner) - { - int num160 = Main.rand.Next(0, 0); - for (int num161 = 0; num161 < num160; num161++) + if (Main.myPlayer == projectile.owner) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value12.X == 0f && value12.Y == 0f) + int num160 = Main.rand.Next(0, 0); + for (int num161 = 0; num161 < num160; num161++) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + while (value12.X == 0f && value12.Y == 0f) + { + value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + } + value12.Normalize(); + value12 *= (float)Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); } - value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); } } - } - public override void AI() - { - if (projectile.localAI[0] == 0f) + public override void AI() { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); - } - projectile.localAI[0] += 1f; - if (projectile.localAI[0] > 3f) - { - int num90 = 1; - if (projectile.localAI[0] > 5f) - { - num90 = 2; - } - for (int num91 = 0; num91 < num90; num91++) + if (projectile.localAI[0] == 0f) { - int num92 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 2f), projectile.width, projectile.height, 57, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.1f, 100, default(Color), 0.4f); - Main.dust[num92].noGravity = true; - Dust expr_46AC_cp_0 = Main.dust[num92]; - expr_46AC_cp_0.velocity.X = expr_46AC_cp_0.velocity.X * 0.3f; - Dust expr_46CA_cp_0 = Main.dust[num92]; - expr_46CA_cp_0.velocity.Y = expr_46CA_cp_0.velocity.Y * 0.3f; - Main.dust[num92].noLight = true; + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); } - if (projectile.wet && !projectile.lavaWet) + projectile.localAI[0] += 1f; + if (projectile.localAI[0] > 3f) { - projectile.Kill(); - return; + int num90 = 1; + if (projectile.localAI[0] > 5f) + { + num90 = 2; + } + for (int num91 = 0; num91 < num90; num91++) + { + int num92 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 2f), projectile.width, projectile.height, 57, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.1f, 100, default(Color), 0.4f); + Main.dust[num92].noGravity = true; + Dust expr_46AC_cp_0 = Main.dust[num92]; + expr_46AC_cp_0.velocity.X = expr_46AC_cp_0.velocity.X * 0.3f; + Dust expr_46CA_cp_0 = Main.dust[num92]; + expr_46CA_cp_0.velocity.Y = expr_46CA_cp_0.velocity.Y * 0.3f; + Main.dust[num92].noLight = true; + } + if (projectile.wet && !projectile.lavaWet) + { + projectile.Kill(); + return; + } } } - } } } diff --git a/Projectiles/HornedWarhammerPro.cs b/Projectiles/HornedWarhammerPro.cs index dc2476db..6afc588e 100644 --- a/Projectiles/HornedWarhammerPro.cs +++ b/Projectiles/HornedWarhammerPro.cs @@ -5,25 +5,27 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class HornedWarhammerPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class HornedWarhammerPro : ModProjectile + { + public override void SetDefaults() + { projectile.CloneDefaults(595); aiType = 595; - projectile.width = 70; - projectile.light = 0.8f; - projectile.height = 70; - Main.projFrames[projectile.type] = 28; - } + projectile.width = 70; + projectile.light = 0.8f; + projectile.height = 70; + Main.projFrames[projectile.type] = 28; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("HornedWarhammerPro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("HornedWarhammerPro"); + } -}} + + } +} diff --git a/Projectiles/HorrificKnifePro.cs b/Projectiles/HorrificKnifePro.cs index 38a2356a..2643c6ca 100644 --- a/Projectiles/HorrificKnifePro.cs +++ b/Projectiles/HorrificKnifePro.cs @@ -4,35 +4,36 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class HorrificKnifePro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { - - projectile.width = 14; - projectile.height = 32; - projectile.friendly = true; - projectile.aiStyle = 1; - projectile.timeLeft = 1200; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; - ProjectileID.Sets.TrailingMode[projectile.type] = 2; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Horrific Dagger"); - - } - - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - if(Main.rand.Next(1) == 0) - { - target.AddBuff(mod.BuffType("DeathFear"), 480, false); - } - } + public class HorrificKnifePro : ModProjectile + { + public override void SetDefaults() + { + + projectile.width = 14; + projectile.height = 32; + projectile.friendly = true; + projectile.aiStyle = 1; + projectile.timeLeft = 1200; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Horrific Dagger"); + + } + + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (Main.rand.Next(1) == 0) + { + target.AddBuff(mod.BuffType("DeathFear"), 480, false); + } + } public override void Kill(int timeLeft) { @@ -40,14 +41,15 @@ public override void Kill(int timeLeft) { Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, mod.DustType("NightmareFlame"), projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 2f, 100, default(Color), 2f); } - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); + Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); } - public override void OnHitPvp(Player target, int damage, bool crit) - { - if(Main.rand.Next(3) == 0) - { - target.AddBuff(mod.BuffType("DeathFear"), 480, false); - } - } -}} + public override void OnHitPvp(Player target, int damage, bool crit) + { + if (Main.rand.Next(3) == 0) + { + target.AddBuff(mod.BuffType("DeathFear"), 480, false); + } + } + } +} diff --git a/Projectiles/HuntingSpearPro.cs b/Projectiles/HuntingSpearPro.cs index 4429dcaf..74d1d54d 100644 --- a/Projectiles/HuntingSpearPro.cs +++ b/Projectiles/HuntingSpearPro.cs @@ -5,21 +5,23 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class HuntingSpearPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class HuntingSpearPro : ModProjectile + { + public override void SetDefaults() + { projectile.CloneDefaults(66); aiType = 66; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("HuntingSpearPro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("HuntingSpearPro"); + } -}} + + } +} diff --git a/Projectiles/IceBullet.cs b/Projectiles/IceBullet.cs index c9847df1..4f4859c1 100644 --- a/Projectiles/IceBullet.cs +++ b/Projectiles/IceBullet.cs @@ -14,8 +14,8 @@ public override void SetDefaults() projectile.CloneDefaults(14); projectile.light = 0.5f; - projectile.width = 1; - projectile.height = 1; + projectile.width = 1; + projectile.height = 1; projectile.light = 0.5f; projectile.extraUpdates = 1; projectile.alpha = 255; @@ -26,20 +26,20 @@ public override void SetDefaults() aiType = ProjectileID.Bullet; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ice Bullet"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ice Bullet"); + + } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - if(Main.rand.Next(4) == 0) - { - target.AddBuff(44, 180, false); - } - } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (Main.rand.Next(4) == 0) + { + target.AddBuff(44, 180, false); + } + } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { @@ -52,5 +52,5 @@ public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) } return true; } -} + } } diff --git a/Projectiles/IceDrillPro.cs b/Projectiles/IceDrillPro.cs index 728ded71..7d60a690 100644 --- a/Projectiles/IceDrillPro.cs +++ b/Projectiles/IceDrillPro.cs @@ -4,50 +4,52 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { - -public class IceDrillPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { - - projectile.width = 22; - projectile.height = 22; - projectile.aiStyle = 20; - projectile.friendly = true; - projectile.penetrate = -1; - projectile.tileCollide = false; - projectile.hide = true; - projectile.ownerHitCheck = true; - projectile.melee = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("IceDrillPro"); - - } - - - public override void AI() - { - int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 59, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1.6f); - Main.dust[dust].noGravity = true; - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - if(Main.rand.Next(10) == 0) - { - target.AddBuff(44, 60, false); - } - } - - public override void OnHitPvp(Player target, int damage, bool crit) - { - if(Main.rand.Next(10) == 0) - { - target.AddBuff(44, 60, false); - } - } -}} + + public class IceDrillPro : ModProjectile + { + public override void SetDefaults() + { + + projectile.width = 22; + projectile.height = 22; + projectile.aiStyle = 20; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.hide = true; + projectile.ownerHitCheck = true; + projectile.melee = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("IceDrillPro"); + + } + + + public override void AI() + { + int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 59, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1.6f); + Main.dust[dust].noGravity = true; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (Main.rand.Next(10) == 0) + { + target.AddBuff(44, 60, false); + } + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + if (Main.rand.Next(10) == 0) + { + target.AddBuff(44, 60, false); + } + } + } +} diff --git a/Projectiles/IchorBreathPro.cs b/Projectiles/IchorBreathPro.cs index 54951207..2b3c89d7 100644 --- a/Projectiles/IchorBreathPro.cs +++ b/Projectiles/IchorBreathPro.cs @@ -4,48 +4,50 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { - -public class IchorBreathPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { - - projectile.width = 22; - projectile.height = 22; - projectile.aiStyle = 6; - projectile.friendly = true; - projectile.penetrate = -1; - projectile.tileCollide = true; - projectile.magic = true; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Ichor Breath Pro"); - - } - - - public override void AI() - { - int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 64, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1.9f); - Main.dust[dust].noGravity = true; - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - if(Main.rand.Next(5) == 0) - { - target.AddBuff(69, 60); - } - } - - public override void OnHitPvp(Player target, int damage, bool crit) - { - if(Main.rand.Next(5) == 0) - { - target.AddBuff(69, 60); - } - } -}} + + public class IchorBreathPro : ModProjectile + { + public override void SetDefaults() + { + + projectile.width = 22; + projectile.height = 22; + projectile.aiStyle = 6; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.tileCollide = true; + projectile.magic = true; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ichor Breath Pro"); + + } + + + public override void AI() + { + int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, 64, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 1.9f); + Main.dust[dust].noGravity = true; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (Main.rand.Next(5) == 0) + { + target.AddBuff(69, 60); + } + } + + public override void OnHitPvp(Player target, int damage, bool crit) + { + if (Main.rand.Next(5) == 0) + { + target.AddBuff(69, 60); + } + } + } +} diff --git a/Projectiles/Igniter.cs b/Projectiles/Igniter.cs index 36509ae7..9ef3ec71 100644 --- a/Projectiles/Igniter.cs +++ b/Projectiles/Igniter.cs @@ -5,92 +5,94 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class Igniter : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class Igniter : ModProjectile + { + public override void SetDefaults() + { projectile.CloneDefaults(376); aiType = 376; - projectile.penetrate = 1; - } + projectile.penetrate = 1; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Igniter"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Igniter"); + } - public override void AI() - { - if (projectile.localAI[0] == 0f) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); - } - projectile.localAI[0] += 1f; - if (projectile.localAI[0] > 3f) + + public override void AI() { - int num90 = 1; - if (projectile.localAI[0] > 5f) - { - num90 = 2; - } - for (int num91 = 0; num91 < num90; num91++) + if (projectile.localAI[0] == 0f) { - int num92 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 2f), projectile.width, projectile.height, 6, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 2f); - Main.dust[num92].noGravity = true; - Dust expr_46AC_cp_0 = Main.dust[num92]; - expr_46AC_cp_0.velocity.X = expr_46AC_cp_0.velocity.X * 0.3f; - Dust expr_46CA_cp_0 = Main.dust[num92]; - expr_46CA_cp_0.velocity.Y = expr_46CA_cp_0.velocity.Y * 0.3f; - Main.dust[num92].noLight = true; + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); } - if (projectile.wet && !projectile.lavaWet) + projectile.localAI[0] += 1f; + if (projectile.localAI[0] > 3f) { - projectile.Kill(); - return; + int num90 = 1; + if (projectile.localAI[0] > 5f) + { + num90 = 2; + } + for (int num91 = 0; num91 < num90; num91++) + { + int num92 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 2f), projectile.width, projectile.height, 6, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default(Color), 2f); + Main.dust[num92].noGravity = true; + Dust expr_46AC_cp_0 = Main.dust[num92]; + expr_46AC_cp_0.velocity.X = expr_46AC_cp_0.velocity.X * 0.3f; + Dust expr_46CA_cp_0 = Main.dust[num92]; + expr_46CA_cp_0.velocity.Y = expr_46CA_cp_0.velocity.Y * 0.3f; + Main.dust[num92].noLight = true; + } + if (projectile.wet && !projectile.lavaWet) + { + projectile.Kill(); + return; + } } } - } - public override void Kill(int timeLeft) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 110); - for (int num158 = 0; num158 < 20; num158++) + public override void Kill(int timeLeft) { - int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); - if (Main.rand.Next(3) == 0) + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 110); + for (int num158 = 0; num158 < 20; num158++) { - Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; - Main.dust[num159].type++; - } - else - { - Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + int num159 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.5f); + if (Main.rand.Next(3) == 0) + { + Main.dust[num159].fadeIn = 1.1f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].scale = 0.35f + (float)Main.rand.Next(-10, 11) * 0.01f; + Main.dust[num159].type++; + } + else + { + Main.dust[num159].scale = 1.2f + (float)Main.rand.Next(-10, 11) * 0.01f; + } + Main.dust[num159].noGravity = true; + Main.dust[num159].velocity *= 2.5f; + Main.dust[num159].velocity -= projectile.oldVelocity / 10f; } - Main.dust[num159].noGravity = true; - Main.dust[num159].velocity *= 2.5f; - Main.dust[num159].velocity -= projectile.oldVelocity / 10f; - } - if (Main.myPlayer == projectile.owner) - { - int num160 = Main.rand.Next(3, 6); - for (int num161 = 0; num161 < num160; num161++) + if (Main.myPlayer == projectile.owner) { - Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); - while (value12.X == 0f && value12.Y == 0f) + int num160 = Main.rand.Next(3, 6); + for (int num161 = 0; num161 < num160; num161++) { - value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + Vector2 value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + while (value12.X == 0f && value12.Y == 0f) + { + value12 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + } + value12.Normalize(); + value12 *= (float)Main.rand.Next(70, 101) * 0.1f; + Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); } - value12.Normalize(); - value12 *= (float)Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(projectile.oldPosition.X + (float)(projectile.width / 2), projectile.oldPosition.Y + (float)(projectile.height / 2), value12.X, value12.Y, 400, (int)((double)projectile.damage * 0.8), projectile.knockBack * 0.8f, projectile.owner, 0f, 0f); } } - } -}} + } +} diff --git a/Projectiles/InfernoPro.cs b/Projectiles/InfernoPro.cs index dc99376d..6166f9a0 100644 --- a/Projectiles/InfernoPro.cs +++ b/Projectiles/InfernoPro.cs @@ -28,43 +28,43 @@ public override void SetDefaults() projectile.hide = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Inferno"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Inferno"); + + } public override void AI() - { + { Main.player[projectile.owner].direction = projectile.direction; Main.player[projectile.owner].heldProj = projectile.whoAmI; Main.player[projectile.owner].itemTime = Main.player[projectile.owner].itemAnimation; projectile.position.X = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - (float)(projectile.width / 2); projectile.position.Y = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - (float)(projectile.height / 2); - projectile.position += projectile.velocity * projectile.ai[0];if (projectile.ai[0] == 0f) + projectile.position += projectile.velocity * projectile.ai[0]; if (projectile.ai[0] == 0f) { projectile.ai[0] = 3f; projectile.netUpdate = true; } if (Main.player[projectile.owner].itemAnimation < Main.player[projectile.owner].itemAnimationMax / 3) { - projectile.ai[0] -= 1.1f; + projectile.ai[0] -= 1.1f; if (projectile.localAI[0] == 0f && Main.myPlayer == projectile.owner) { projectile.localAI[0] = 1f; if (Collision.CanHit(Main.player[projectile.owner].position, Main.player[projectile.owner].width, Main.player[projectile.owner].height, new Vector2(projectile.Center.X + projectile.velocity.X * projectile.ai[0], projectile.Center.Y + projectile.velocity.Y * projectile.ai[0]), projectile.width, projectile.height)) { - int z = Projectile.NewProjectile(projectile.Center.X + projectile.velocity.X , projectile.Center.Y + projectile.velocity.Y , projectile.velocity.X * 1.5f, projectile.velocity.Y * 1.5f, 706, projectile.damage , projectile.knockBack * 0.85f, projectile.owner, 0f, 0f); - Main.projectile[z].tileCollide = false; - Main.projectile[z].timeLeft = 240; - } + int z = Projectile.NewProjectile(projectile.Center.X + projectile.velocity.X, projectile.Center.Y + projectile.velocity.Y, projectile.velocity.X * 1.5f, projectile.velocity.Y * 1.5f, 706, projectile.damage, projectile.knockBack * 0.85f, projectile.owner, 0f, 0f); + Main.projectile[z].tileCollide = false; + Main.projectile[z].timeLeft = 240; + } } } else { projectile.ai[0] += 0.75f; } - + if (Main.player[projectile.owner].itemAnimation == 0) { projectile.Kill(); diff --git a/Projectiles/InfernoRift.cs b/Projectiles/InfernoRift.cs index 47e22cce..8120b0c6 100644 --- a/Projectiles/InfernoRift.cs +++ b/Projectiles/InfernoRift.cs @@ -6,17 +6,17 @@ using Terraria.ID; namespace Tremor.Projectiles -{ +{ public class InfernoRift : ModProjectile { - const int ShootRate = 20; // ����� ����५� (1 ᥪ㭤� = 60��.) - const float ShootDistance = 500f; // ���쭮��� ��५�� - const float ShootSpeed = 12f; // ������� ᭠�鸞 - const int ShootDamage = 450; // �஭ ᭠�鸞 - const float ShootKnockback = 2; // ���� ᭠�鸞 - int ShootType = 668; // ��� ����५� (�᫨ �� �����쭮� �ન) - int TimeToShoot = ShootRate; - string ShootTypeMod; + const int ShootRate = 20; // ����� ����५� (1 ᥪ㭤� = 60��.) + const float ShootDistance = 500f; // ���쭮��� ��५�� + const float ShootSpeed = 12f; // ������� ᭠�鸞 + const int ShootDamage = 450; // �஭ ᭠�鸞 + const float ShootKnockback = 2; // ���� ᭠�鸞 + int ShootType = 668; // ��� ����५� (�᫨ �� �����쭮� �ન) + int TimeToShoot = ShootRate; + string ShootTypeMod; public override void SetDefaults() { @@ -36,67 +36,67 @@ public override void SetDefaults() ProjectileID.Sets.TrailingMode[projectile.type] = 0; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Inferno Rift"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Inferno Rift"); + + } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Vector2 drawOrigin = new Vector2(Main.projectileTexture[projectile.type].Width * 0.5f, projectile.height * 0.5f); - for (int k = 0; k < projectile.oldPos.Length; k++) - { - Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); - spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, Color.White, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); - } - return true; - } + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Vector2 drawOrigin = new Vector2(Main.projectileTexture[projectile.type].Width * 0.5f, projectile.height * 0.5f); + for (int k = 0; k < projectile.oldPos.Length; k++) + { + Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); + spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, Color.White, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); + } + return true; + } - public override void Kill(int timeLeft) - { - for(int k = 0; k < 5; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 6, projectile.oldVelocity.X * 0.1f, projectile.oldVelocity.Y * 0.1f); - } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 109); - } + public override void Kill(int timeLeft) + { + for (int k = 0; k < 5; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 6, projectile.oldVelocity.X * 0.1f, projectile.oldVelocity.Y * 0.1f); + } + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 109); + } - void Shoot() - { - if (--TimeToShoot <= 0) - { - TimeToShoot = ShootRate; - if (ShootType == -1) - ShootType = mod.ProjectileType(ShootTypeMod); + void Shoot() + { + if (--TimeToShoot <= 0) + { + TimeToShoot = ShootRate; + if (ShootType == -1) + ShootType = mod.ProjectileType(ShootTypeMod); - float NearestNPCDist = ShootDistance; - int NearestNPC = -1; - foreach (NPC npc in Main.npc) - { - if (!npc.active) - continue; - if (npc.friendly || npc.lifeMax <= 5) - continue; - if (NearestNPCDist == -1 || npc.Distance(projectile.Center) < NearestNPCDist && Collision.CanHitLine(projectile.Center, 16, 16, npc.Center, 16, 16)) - { - NearestNPCDist = npc.Distance(projectile.Center); - NearestNPC = npc.whoAmI; - } - } - if (NearestNPC == -1) - return; - Vector2 Velocity = Helper.VelocityToPoint(projectile.Center, Main.npc[NearestNPC].Center, ShootSpeed); - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, Velocity.X, Velocity.Y, ShootType, ShootDamage, ShootKnockback, projectile.owner); - } - } + float NearestNPCDist = ShootDistance; + int NearestNPC = -1; + foreach (NPC npc in Main.npc) + { + if (!npc.active) + continue; + if (npc.friendly || npc.lifeMax <= 5) + continue; + if (NearestNPCDist == -1 || npc.Distance(projectile.Center) < NearestNPCDist && Collision.CanHitLine(projectile.Center, 16, 16, npc.Center, 16, 16)) + { + NearestNPCDist = npc.Distance(projectile.Center); + NearestNPC = npc.whoAmI; + } + } + if (NearestNPC == -1) + return; + Vector2 Velocity = Helper.VelocityToPoint(projectile.Center, Main.npc[NearestNPC].Center, ShootSpeed); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, Velocity.X, Velocity.Y, ShootType, ShootDamage, ShootKnockback, projectile.owner); + } + } -public override void AI() - { - Shoot(); - projectile.ai[1] = 1; - base.AI(); + public override void AI() + { + Shoot(); + projectile.ai[1] = 1; + base.AI(); projectile.light = 0.9f; int DustID1 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 120, default(Color), 1.75f); int DustID2 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 120, default(Color), 1.75f); diff --git a/Projectiles/IronSpearPro.cs b/Projectiles/IronSpearPro.cs index e33256e9..b5093a95 100644 --- a/Projectiles/IronSpearPro.cs +++ b/Projectiles/IronSpearPro.cs @@ -5,21 +5,23 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class IronSpearPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class IronSpearPro : ModProjectile + { + public override void SetDefaults() + { projectile.CloneDefaults(66); aiType = 66; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("IronSpearPro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("IronSpearPro"); + } -}} + + } +} diff --git a/Projectiles/Kunai.cs b/Projectiles/Kunai.cs index f507c85d..618e0ff8 100644 --- a/Projectiles/Kunai.cs +++ b/Projectiles/Kunai.cs @@ -5,38 +5,40 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class Kunai : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class Kunai : ModProjectile + { + public override void SetDefaults() + { - projectile.width = 1; - projectile.height = 1; - projectile.friendly = true; - projectile.aiStyle = 1; - projectile.timeLeft = 1200; - } + projectile.width = 1; + projectile.height = 1; + projectile.friendly = true; + projectile.aiStyle = 1; + projectile.timeLeft = 1200; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Kunai"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Kunai"); + } - public override void Kill(int timeLeft) - { + + public override void Kill(int timeLeft) + { Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1); for (int num431 = 0; num431 < 10; num431++) { Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 1, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 0, default(Color), 0.75f); } - } + } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - projectile.ai[0] += 0.1f; - projectile.velocity *= 0.75f; - } -}} + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + projectile.ai[0] += 0.1f; + projectile.velocity *= 0.75f; + } + } +} diff --git a/Projectiles/LeadSpearPro.cs b/Projectiles/LeadSpearPro.cs index cb028c5e..4df3253b 100644 --- a/Projectiles/LeadSpearPro.cs +++ b/Projectiles/LeadSpearPro.cs @@ -5,21 +5,23 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class LeadSpearPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class LeadSpearPro : ModProjectile + { + public override void SetDefaults() + { projectile.CloneDefaults(66); aiType = 66; - } + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("LeadSpearPro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("LeadSpearPro"); + } -}} + + } +} diff --git a/Projectiles/LeafBallPro.cs b/Projectiles/LeafBallPro.cs index 2cfad7f9..4542a58a 100644 --- a/Projectiles/LeafBallPro.cs +++ b/Projectiles/LeafBallPro.cs @@ -9,64 +9,64 @@ namespace Tremor.Projectiles { - public class LeafBallPro : ModProjectile - { - public override void SetDefaults() - { + public class LeafBallPro : ModProjectile + { + public override void SetDefaults() + { - projectile.width = 26; - projectile.height = 26; - projectile.friendly = true; - projectile.penetrate = -1; // Penetrates NPCs infinitely. - projectile.melee = true; // Deals melee dmg. + projectile.width = 26; + projectile.height = 26; + projectile.friendly = true; + projectile.penetrate = -1; // Penetrates NPCs infinitely. + projectile.melee = true; // Deals melee dmg. - projectile.aiStyle = 15; // Set the aiStyle to that of a flail. - } + projectile.aiStyle = 15; // Set the aiStyle to that of a flail. + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("LeafBall"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("LeafBall"); + } - // Now this is where the chain magic happens. You don't have to try to figure this whole thing out. - // Just make sure that you edit the first line (which starts with 'Texture2D texture') correctly. - public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Color lightColor) - { - Texture2D texture = ModLoader.GetTexture("Tremor/Projectiles/LeafBall_Chain"); - Vector2 position = projectile.Center; - Vector2 mountedCenter = Main.player[projectile.owner].MountedCenter; - Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(); - Vector2 origin = new Vector2((float)texture.Width * 0.5f, (float)texture.Height * 0.5f); - float num1 = (float)texture.Height; - Vector2 vector2_4 = mountedCenter - position; - float rotation = (float)Math.Atan2((double)vector2_4.Y, (double)vector2_4.X) - 1.57f; - bool flag = true; - if (float.IsNaN(position.X) && float.IsNaN(position.Y)) - flag = false; - if (float.IsNaN(vector2_4.X) && float.IsNaN(vector2_4.Y)) - flag = false; - while (flag) - { - if ((double)vector2_4.Length() < (double)num1 + 1.0) - { - flag = false; - } - else - { - Vector2 vector2_1 = vector2_4; - vector2_1.Normalize(); - position += vector2_1 * num1; - vector2_4 = mountedCenter - position; - Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)position.X / 16, (int)((double)position.Y / 16.0)); - color2 = projectile.GetAlpha(color2); - Main.spriteBatch.Draw(texture, position - Main.screenPosition, sourceRectangle, color2, rotation, origin, 1f, SpriteEffects.None, 0.0f); - } - } + // Now this is where the chain magic happens. You don't have to try to figure this whole thing out. + // Just make sure that you edit the first line (which starts with 'Texture2D texture') correctly. + public override bool PreDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture = ModLoader.GetTexture("Tremor/Projectiles/LeafBall_Chain"); - return true; - } - } + Vector2 position = projectile.Center; + Vector2 mountedCenter = Main.player[projectile.owner].MountedCenter; + Microsoft.Xna.Framework.Rectangle? sourceRectangle = new Microsoft.Xna.Framework.Rectangle?(); + Vector2 origin = new Vector2((float)texture.Width * 0.5f, (float)texture.Height * 0.5f); + float num1 = (float)texture.Height; + Vector2 vector2_4 = mountedCenter - position; + float rotation = (float)Math.Atan2((double)vector2_4.Y, (double)vector2_4.X) - 1.57f; + bool flag = true; + if (float.IsNaN(position.X) && float.IsNaN(position.Y)) + flag = false; + if (float.IsNaN(vector2_4.X) && float.IsNaN(vector2_4.Y)) + flag = false; + while (flag) + { + if ((double)vector2_4.Length() < (double)num1 + 1.0) + { + flag = false; + } + else + { + Vector2 vector2_1 = vector2_4; + vector2_1.Normalize(); + position += vector2_1 * num1; + vector2_4 = mountedCenter - position; + Microsoft.Xna.Framework.Color color2 = Lighting.GetColor((int)position.X / 16, (int)((double)position.Y / 16.0)); + color2 = projectile.GetAlpha(color2); + Main.spriteBatch.Draw(texture, position - Main.screenPosition, sourceRectangle, color2, rotation, origin, 1f, SpriteEffects.None, 0.0f); + } + } + + return true; + } + } } diff --git a/Projectiles/LightningBoltPro.cs b/Projectiles/LightningBoltPro.cs index db580195..5692c3ca 100644 --- a/Projectiles/LightningBoltPro.cs +++ b/Projectiles/LightningBoltPro.cs @@ -5,26 +5,28 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class LightningBoltPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class LightningBoltPro : ModProjectile + { + public override void SetDefaults() + { projectile.CloneDefaults(443); aiType = 443; - projectile.magic = true; + projectile.magic = true; - projectile.timeLeft = 500; - Main.projFrames[projectile.type] = 4; - } + projectile.timeLeft = 500; + Main.projFrames[projectile.type] = 4; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("LightningBoltPro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("LightningBoltPro"); + } -}} + + } +} diff --git a/Projectiles/LightningTome.cs b/Projectiles/LightningTome.cs index 893deeea..f196ba22 100644 --- a/Projectiles/LightningTome.cs +++ b/Projectiles/LightningTome.cs @@ -5,52 +5,54 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class LightningTome : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { - - projectile.width = 24; - projectile.height = 32; - projectile.aiStyle = 8; - projectile.friendly = true; - projectile.magic = true; - projectile.penetrate = 5; - projectile.timeLeft = 600; - projectile.light = 0.6f; - projectile.extraUpdates = 1; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - } - - public override void SetStaticDefaults() - { - DisplayName.SetDefault("LightningTome"); - - } - - - public override void Kill(int timeLeft) - { - for(int k = 0; k < 40; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 6, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); - } - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); + public class LightningTome : ModProjectile + { + public override void SetDefaults() + { + + projectile.width = 24; + projectile.height = 32; + projectile.aiStyle = 8; + projectile.friendly = true; + projectile.magic = true; + projectile.penetrate = 5; + projectile.timeLeft = 600; + projectile.light = 0.6f; + projectile.extraUpdates = 1; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("LightningTome"); + + } + + + public override void Kill(int timeLeft) + { + for (int k = 0; k < 40; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 6, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); + } + Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); + } + + + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Vector2 drawOrigin = new Vector2(Main.projectileTexture[projectile.type].Width * 0.5f, projectile.height * 0.5f); + for (int k = 0; k < projectile.oldPos.Length; k++) + { + Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); + Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); + spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); + } + return true; + } + } } - - - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - Vector2 drawOrigin = new Vector2(Main.projectileTexture[projectile.type].Width * 0.5f, projectile.height * 0.5f); - for(int k = 0; k < projectile.oldPos.Length; k++) - { - Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY); - Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length); - spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f); - } - return true; - } -}} diff --git a/Projectiles/LivingTombstonePro.cs b/Projectiles/LivingTombstonePro.cs index b5f00545..34756b8b 100644 --- a/Projectiles/LivingTombstonePro.cs +++ b/Projectiles/LivingTombstonePro.cs @@ -14,16 +14,16 @@ public override void SetDefaults() aiType = 198; Main.projFrames[projectile.type] = 4; - projectile.width = 24; - projectile.height = 36; + projectile.width = 24; + projectile.height = 36; Main.projPet[projectile.type] = true; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Living Tombstone"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Living Tombstone"); + + } public override bool PreAI() diff --git a/Projectiles/LizardPro.cs b/Projectiles/LizardPro.cs index b3527c8b..da85fb4d 100644 --- a/Projectiles/LizardPro.cs +++ b/Projectiles/LizardPro.cs @@ -4,26 +4,27 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class LizardPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class LizardPro : ModProjectile + { + public override void SetDefaults() + { - projectile.width = 26; - projectile.height = 26; - projectile.aiStyle = 2; - projectile.timeLeft = 1200; - projectile.penetrate = 5; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; - ProjectileID.Sets.TrailingMode[projectile.type] = 2; - } + projectile.width = 26; + projectile.height = 26; + projectile.aiStyle = 2; + projectile.timeLeft = 1200; + projectile.penetrate = 5; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("LizardPro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("LizardPro"); + + } @@ -48,10 +49,11 @@ public override bool OnTileCollide(Vector2 oldVelocity) return false; } - public override void Kill(int timeLeft) - { - NPC.NewNPC((int)projectile.Center.X, (int)projectile.Center.Y, mod.NPCType("Lizard")); - } + public override void Kill(int timeLeft) + { + NPC.NewNPC((int)projectile.Center.X, (int)projectile.Center.Y, mod.NPCType("Lizard")); + } -}} + } +} diff --git a/Projectiles/LostTurtleKnifePro.cs b/Projectiles/LostTurtleKnifePro.cs index c0572d5c..1444cc98 100644 --- a/Projectiles/LostTurtleKnifePro.cs +++ b/Projectiles/LostTurtleKnifePro.cs @@ -4,40 +4,42 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class LostTurtleKnifePro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class LostTurtleKnifePro : ModProjectile + { + public override void SetDefaults() + { - projectile.width = 12; - projectile.height = 18; - projectile.friendly = true; - projectile.aiStyle = 1; - projectile.timeLeft = 1200; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; - ProjectileID.Sets.TrailingMode[projectile.type] = 2; - } + projectile.width = 12; + projectile.height = 18; + projectile.friendly = true; + projectile.aiStyle = 1; + projectile.timeLeft = 1200; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("LostTurtleKnifePro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("LostTurtleKnifePro"); + } - public override void Kill(int timeLeft) - { - for(int k = 0; k < 5; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 1, projectile.oldVelocity.X * 0.1f, projectile.oldVelocity.Y * 0.1f); - } - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); - } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - projectile.ai[0] += 0.1f; - projectile.velocity *= 0.75f; - } -}} + public override void Kill(int timeLeft) + { + for (int k = 0; k < 5; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 1, projectile.oldVelocity.X * 0.1f, projectile.oldVelocity.Y * 0.1f); + } + Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + projectile.ai[0] += 0.1f; + projectile.velocity *= 0.75f; + } + } +} diff --git a/Projectiles/MagicGrenade.cs b/Projectiles/MagicGrenade.cs index 5f02966f..027fe898 100644 --- a/Projectiles/MagicGrenade.cs +++ b/Projectiles/MagicGrenade.cs @@ -5,22 +5,24 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class MagicGrenade : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { - projectile.CloneDefaults(30); + public class MagicGrenade : ModProjectile + { + public override void SetDefaults() + { + projectile.CloneDefaults(30); - projectile.width = 14; - projectile.height = 20; - } + projectile.width = 14; + projectile.height = 20; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Magic Grenade"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Magic Grenade"); + } -}} + + } +} diff --git a/Projectiles/MagicShurikenPro.cs b/Projectiles/MagicShurikenPro.cs index dcf38769..c7adbea4 100644 --- a/Projectiles/MagicShurikenPro.cs +++ b/Projectiles/MagicShurikenPro.cs @@ -5,22 +5,24 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class MagicShurikenPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class MagicShurikenPro : ModProjectile + { + public override void SetDefaults() + { projectile.CloneDefaults(3); projectile.width = 22; - projectile.height = 22; - } + projectile.height = 22; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Magic Shuriken"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Magic Shuriken"); + } -}} + + } +} diff --git a/Projectiles/MagiumRodPro.cs b/Projectiles/MagiumRodPro.cs index d3cbd7c7..a89c5354 100644 --- a/Projectiles/MagiumRodPro.cs +++ b/Projectiles/MagiumRodPro.cs @@ -4,26 +4,27 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class MagiumRodPro : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class MagiumRodPro : ModProjectile + { + public override void SetDefaults() + { - projectile.width = 14; - projectile.height = 22; - projectile.friendly = true; - projectile.aiStyle = 1; - projectile.timeLeft = 1200; - ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; - ProjectileID.Sets.TrailingMode[projectile.type] = 2; - } + projectile.width = 14; + projectile.height = 22; + projectile.friendly = true; + projectile.aiStyle = 1; + projectile.timeLeft = 1200; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Magium Rod Pro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Magium Rod Pro"); + + } public override Color? GetAlpha(Color lightColor) @@ -31,18 +32,19 @@ public override void SetStaticDefaults() return Color.White; } - public override void Kill(int timeLeft) - { - for(int k = 0; k < 5; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 59, projectile.oldVelocity.X * 0.1f, projectile.oldVelocity.Y * 0.1f); - } - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - projectile.ai[0] += 0.1f; - projectile.velocity *= 0.75f; - } -}} + public override void Kill(int timeLeft) + { + for (int k = 0; k < 5; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 59, projectile.oldVelocity.X * 0.1f, projectile.oldVelocity.Y * 0.1f); + } + Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 0); + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + projectile.ai[0] += 0.1f; + projectile.velocity *= 0.75f; + } + } +} diff --git a/Projectiles/MagusBall.cs b/Projectiles/MagusBall.cs index f2d9486e..a69f9dd3 100644 --- a/Projectiles/MagusBall.cs +++ b/Projectiles/MagusBall.cs @@ -11,83 +11,83 @@ public class MagusBall : ModProjectile public override void SetDefaults() { - projectile.width = 12; - projectile.height = 12; - projectile.hostile = true; - projectile.tileCollide = false; - projectile.penetrate = -1; - projectile.extraUpdates = 1; + projectile.width = 12; + projectile.height = 12; + projectile.hostile = true; + projectile.tileCollide = false; + projectile.penetrate = -1; + projectile.extraUpdates = 1; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Rune Ball"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Rune Ball"); + + } - public override bool PreAI() - { - for (int i = 0; i < 10; i++) - { - float x = projectile.Center.X - projectile.velocity.X / 10f * (float)i; - float y = projectile.Center.Y - projectile.velocity.Y / 10f * (float)i; - int dust = Dust.NewDust(new Vector2(x, y), 1, 1, 68, 0f, 0f, 0, default(Color), 1f); - Main.dust[dust].alpha = projectile.alpha; - Main.dust[dust].position.X = x; - Main.dust[dust].position.Y = y; - Main.dust[dust].velocity *= 0f; - Main.dust[dust].noGravity = true; - } - if (projectile.localAI[1] == 0f) - { - projectile.localAI[1] = 1f; - } - if (projectile.ai[0] == 0f || projectile.ai[0] == 2f) - { - projectile.scale += 0.01f; - projectile.alpha -= 50; - if (projectile.alpha <= 0) - { - projectile.ai[0] = 1f; - projectile.alpha = 0; - } - } - else if (projectile.ai[0] == 1f) - { - projectile.scale -= 0.01f; - projectile.alpha += 50; - if (projectile.alpha >= 255) - { - projectile.ai[0] = 2f; - projectile.alpha = 255; - } - } - return false; - } + public override bool PreAI() + { + for (int i = 0; i < 10; i++) + { + float x = projectile.Center.X - projectile.velocity.X / 10f * (float)i; + float y = projectile.Center.Y - projectile.velocity.Y / 10f * (float)i; + int dust = Dust.NewDust(new Vector2(x, y), 1, 1, 68, 0f, 0f, 0, default(Color), 1f); + Main.dust[dust].alpha = projectile.alpha; + Main.dust[dust].position.X = x; + Main.dust[dust].position.Y = y; + Main.dust[dust].velocity *= 0f; + Main.dust[dust].noGravity = true; + } + if (projectile.localAI[1] == 0f) + { + projectile.localAI[1] = 1f; + } + if (projectile.ai[0] == 0f || projectile.ai[0] == 2f) + { + projectile.scale += 0.01f; + projectile.alpha -= 50; + if (projectile.alpha <= 0) + { + projectile.ai[0] = 1f; + projectile.alpha = 0; + } + } + else if (projectile.ai[0] == 1f) + { + projectile.scale -= 0.01f; + projectile.alpha += 50; + if (projectile.alpha >= 255) + { + projectile.ai[0] = 2f; + projectile.alpha = 255; + } + } + return false; + } - public override void Kill(int timeLeft) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); - Helper.Explode(projectile.whoAmI, 120, 120, delegate - { - for (int i = 0; i < 40; i++) - { - int num = Dust.NewDust(projectile.position, projectile.width, projectile.height, 68, 0f, -2f, 0, default(Color), 2f); - Main.dust[num].noGravity = true; - Dust expr_62_cp_0 = Main.dust[num]; - expr_62_cp_0.position.X = expr_62_cp_0.position.X + ((float)(Main.rand.Next(-50, 51) / 20) - 1.5f); - Dust expr_92_cp_0 = Main.dust[num]; - expr_92_cp_0.position.Y = expr_92_cp_0.position.Y + ((float)(Main.rand.Next(-50, 51) / 20) - 1.5f); - if (Main.dust[num].position != projectile.Center) - { - Main.dust[num].velocity = projectile.DirectionTo(Main.dust[num].position) * 6f; - } - } - }); - } + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Helper.Explode(projectile.whoAmI, 120, 120, delegate + { + for (int i = 0; i < 40; i++) + { + int num = Dust.NewDust(projectile.position, projectile.width, projectile.height, 68, 0f, -2f, 0, default(Color), 2f); + Main.dust[num].noGravity = true; + Dust expr_62_cp_0 = Main.dust[num]; + expr_62_cp_0.position.X = expr_62_cp_0.position.X + ((float)(Main.rand.Next(-50, 51) / 20) - 1.5f); + Dust expr_92_cp_0 = Main.dust[num]; + expr_92_cp_0.position.Y = expr_92_cp_0.position.Y + ((float)(Main.rand.Next(-50, 51) / 20) - 1.5f); + if (Main.dust[num].position != projectile.Center) + { + Main.dust[num].velocity = projectile.DirectionTo(Main.dust[num].position) * 6f; + } + } + }); + } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Helper.DrawAroundOrigin(projectile.whoAmI, lightColor); return false; diff --git a/Projectiles/MagusBallF.cs b/Projectiles/MagusBallF.cs index b592b004..37b70cd9 100644 --- a/Projectiles/MagusBallF.cs +++ b/Projectiles/MagusBallF.cs @@ -11,83 +11,83 @@ public class MagusBallF : ModProjectile public override void SetDefaults() { - projectile.width = 12; - projectile.height = 12; - projectile.friendly = true; - projectile.tileCollide = true; - projectile.penetrate = -1; - projectile.extraUpdates = 1; + projectile.width = 12; + projectile.height = 12; + projectile.friendly = true; + projectile.tileCollide = true; + projectile.penetrate = -1; + projectile.extraUpdates = 1; } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Rune Ball"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Rune Ball"); + + } - public override bool PreAI() - { - for (int i = 0; i < 10; i++) - { - float x = projectile.Center.X - projectile.velocity.X / 10f * (float)i; - float y = projectile.Center.Y - projectile.velocity.Y / 10f * (float)i; - int dust = Dust.NewDust(new Vector2(x, y), 1, 1, 68, 0f, 0f, 0, default(Color), 1f); - Main.dust[dust].alpha = projectile.alpha; - Main.dust[dust].position.X = x; - Main.dust[dust].position.Y = y; - Main.dust[dust].velocity *= 0f; - Main.dust[dust].noGravity = true; - } - if (projectile.localAI[1] == 0f) - { - projectile.localAI[1] = 1f; - } - if (projectile.ai[0] == 0f || projectile.ai[0] == 2f) - { - projectile.scale += 0.01f; - projectile.alpha -= 50; - if (projectile.alpha <= 0) - { - projectile.ai[0] = 1f; - projectile.alpha = 0; - } - } - else if (projectile.ai[0] == 1f) - { - projectile.scale -= 0.01f; - projectile.alpha += 50; - if (projectile.alpha >= 255) - { - projectile.ai[0] = 2f; - projectile.alpha = 255; - } - } - return false; - } + public override bool PreAI() + { + for (int i = 0; i < 10; i++) + { + float x = projectile.Center.X - projectile.velocity.X / 10f * (float)i; + float y = projectile.Center.Y - projectile.velocity.Y / 10f * (float)i; + int dust = Dust.NewDust(new Vector2(x, y), 1, 1, 68, 0f, 0f, 0, default(Color), 1f); + Main.dust[dust].alpha = projectile.alpha; + Main.dust[dust].position.X = x; + Main.dust[dust].position.Y = y; + Main.dust[dust].velocity *= 0f; + Main.dust[dust].noGravity = true; + } + if (projectile.localAI[1] == 0f) + { + projectile.localAI[1] = 1f; + } + if (projectile.ai[0] == 0f || projectile.ai[0] == 2f) + { + projectile.scale += 0.01f; + projectile.alpha -= 50; + if (projectile.alpha <= 0) + { + projectile.ai[0] = 1f; + projectile.alpha = 0; + } + } + else if (projectile.ai[0] == 1f) + { + projectile.scale -= 0.01f; + projectile.alpha += 50; + if (projectile.alpha >= 255) + { + projectile.ai[0] = 2f; + projectile.alpha = 255; + } + } + return false; + } - public override void Kill(int timeLeft) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); - Helper.Explode(projectile.whoAmI, 120, 120, delegate - { - for (int i = 0; i < 40; i++) - { - int num = Dust.NewDust(projectile.position, projectile.width, projectile.height, 68, 0f, -2f, 0, default(Color), 2f); - Main.dust[num].noGravity = true; - Dust expr_62_cp_0 = Main.dust[num]; - expr_62_cp_0.position.X = expr_62_cp_0.position.X + ((float)(Main.rand.Next(-50, 51) / 20) - 1.5f); - Dust expr_92_cp_0 = Main.dust[num]; - expr_92_cp_0.position.Y = expr_92_cp_0.position.Y + ((float)(Main.rand.Next(-50, 51) / 20) - 1.5f); - if (Main.dust[num].position != projectile.Center) - { - Main.dust[num].velocity = projectile.DirectionTo(Main.dust[num].position) * 6f; - } - } - }); - } + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + Helper.Explode(projectile.whoAmI, 120, 120, delegate + { + for (int i = 0; i < 40; i++) + { + int num = Dust.NewDust(projectile.position, projectile.width, projectile.height, 68, 0f, -2f, 0, default(Color), 2f); + Main.dust[num].noGravity = true; + Dust expr_62_cp_0 = Main.dust[num]; + expr_62_cp_0.position.X = expr_62_cp_0.position.X + ((float)(Main.rand.Next(-50, 51) / 20) - 1.5f); + Dust expr_92_cp_0 = Main.dust[num]; + expr_92_cp_0.position.Y = expr_92_cp_0.position.Y + ((float)(Main.rand.Next(-50, 51) / 20) - 1.5f); + if (Main.dust[num].position != projectile.Center) + { + Main.dust[num].velocity = projectile.DirectionTo(Main.dust[num].position) * 6f; + } + } + }); + } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Helper.DrawAroundOrigin(projectile.whoAmI, lightColor); return false; diff --git a/Projectiles/ManiacChainsawPro.cs b/Projectiles/ManiacChainsawPro.cs index 206ce153..8246351e 100644 --- a/Projectiles/ManiacChainsawPro.cs +++ b/Projectiles/ManiacChainsawPro.cs @@ -7,109 +7,109 @@ namespace Tremor.Projectiles { - public class ManiacChainsawPro : ModProjectile - { - public override void SetDefaults() - { - //projectile.CloneDefaults(509); + public class ManiacChainsawPro : ModProjectile + { + public override void SetDefaults() + { + //projectile.CloneDefaults(509); - //aiType = 509; - projectile.melee = true; - projectile.friendly = true; - projectile.penetrate = -1; - Main.projFrames[projectile.type] = 2; - projectile.width = 34; - projectile.height = 140; + //aiType = 509; + projectile.melee = true; + projectile.friendly = true; + projectile.penetrate = -1; + Main.projFrames[projectile.type] = 2; + projectile.width = 34; + projectile.height = 140; - projectile.tileCollide = false; - projectile.hide = true; - projectile.ownerHitCheck = true; - } + projectile.tileCollide = false; + projectile.hide = true; + projectile.ownerHitCheck = true; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("ManiacChainsawPro"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("ManiacChainsawPro"); + } - public override void AI() - { - Vector2 vector22; - float num263; - Vector2 vector23; - float num264; - float num265; - float num266; - int num267; - vector22 = Main.player[projectile.owner].RotatedRelativePoint(Main.player[projectile.owner].MountedCenter, true); - if (Main.myPlayer == projectile.owner) - { - if (Main.player[projectile.owner].channel) - { - num263 = Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].shootSpeed * projectile.scale; - vector23 = vector22; - num264 = (float)Main.mouseX + Main.screenPosition.X - vector23.X - 20; - num265 = (float)Main.mouseY + Main.screenPosition.Y - vector23.Y; - if (Main.player[projectile.owner].gravDir == -1f) - { - num265 = (float)(Main.screenHeight - Main.mouseY) + Main.screenPosition.Y - vector23.Y; - } - num266 = (float)Math.Sqrt((double)(num264 * num264 + num265 * num265)); - num266 = (float)Math.Sqrt((double)(num264 * num264 + num265 * num265)); - num266 = num263 / num266; - num264 *= num266; - num265 *= num266; - if (num264 != projectile.velocity.X || num265 != projectile.velocity.Y) - { - projectile.netUpdate = true; - } - projectile.velocity.X = num264; - projectile.velocity.Y = num265; - } - else - { - projectile.Kill(); - } - } - if (projectile.velocity.X > 0f) - { - Main.player[projectile.owner].ChangeDir(1); - } - else if (projectile.velocity.X < 0f) - { - Main.player[projectile.owner].ChangeDir(-1); - } - projectile.spriteDirection = projectile.direction; - Main.player[projectile.owner].ChangeDir(projectile.direction); - Main.player[projectile.owner].heldProj = projectile.whoAmI; - Main.player[projectile.owner].itemTime = 2; - Main.player[projectile.owner].itemAnimation = 2; - projectile.position.X = vector22.X - (float)(projectile.width / 2); - projectile.position.Y = vector22.Y - (float)(projectile.height / 2); - projectile.rotation = (float)(Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.5700000524520874); - if (Main.player[projectile.owner].direction == 1) - { - Main.player[projectile.owner].itemRotation = (float)Math.Atan2((double)(projectile.velocity.Y * (float)projectile.direction), (double)(projectile.velocity.X * (float)projectile.direction)); - } - else - { - Main.player[projectile.owner].itemRotation = (float)Math.Atan2((double)(projectile.velocity.Y * (float)projectile.direction), (double)(projectile.velocity.X * (float)projectile.direction)); - } - projectile.frameCounter += 1; - if (projectile.frameCounter >= 4) - { - projectile.frameCounter = 0; - projectile.frame++; - if (projectile.frame >= 2) - { - projectile.frame = 0; - } - } + public override void AI() + { + Vector2 vector22; + float num263; + Vector2 vector23; + float num264; + float num265; + float num266; + int num267; + vector22 = Main.player[projectile.owner].RotatedRelativePoint(Main.player[projectile.owner].MountedCenter, true); + if (Main.myPlayer == projectile.owner) + { + if (Main.player[projectile.owner].channel) + { + num263 = Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].shootSpeed * projectile.scale; + vector23 = vector22; + num264 = (float)Main.mouseX + Main.screenPosition.X - vector23.X - 20; + num265 = (float)Main.mouseY + Main.screenPosition.Y - vector23.Y; + if (Main.player[projectile.owner].gravDir == -1f) + { + num265 = (float)(Main.screenHeight - Main.mouseY) + Main.screenPosition.Y - vector23.Y; + } + num266 = (float)Math.Sqrt((double)(num264 * num264 + num265 * num265)); + num266 = (float)Math.Sqrt((double)(num264 * num264 + num265 * num265)); + num266 = num263 / num266; + num264 *= num266; + num265 *= num266; + if (num264 != projectile.velocity.X || num265 != projectile.velocity.Y) + { + projectile.netUpdate = true; + } + projectile.velocity.X = num264; + projectile.velocity.Y = num265; + } + else + { + projectile.Kill(); + } + } + if (projectile.velocity.X > 0f) + { + Main.player[projectile.owner].ChangeDir(1); + } + else if (projectile.velocity.X < 0f) + { + Main.player[projectile.owner].ChangeDir(-1); + } + projectile.spriteDirection = projectile.direction; + Main.player[projectile.owner].ChangeDir(projectile.direction); + Main.player[projectile.owner].heldProj = projectile.whoAmI; + Main.player[projectile.owner].itemTime = 2; + Main.player[projectile.owner].itemAnimation = 2; + projectile.position.X = vector22.X - (float)(projectile.width / 2); + projectile.position.Y = vector22.Y - (float)(projectile.height / 2); + projectile.rotation = (float)(Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.5700000524520874); + if (Main.player[projectile.owner].direction == 1) + { + Main.player[projectile.owner].itemRotation = (float)Math.Atan2((double)(projectile.velocity.Y * (float)projectile.direction), (double)(projectile.velocity.X * (float)projectile.direction)); + } + else + { + Main.player[projectile.owner].itemRotation = (float)Math.Atan2((double)(projectile.velocity.Y * (float)projectile.direction), (double)(projectile.velocity.X * (float)projectile.direction)); + } - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 22); - } - } + projectile.frameCounter += 1; + if (projectile.frameCounter >= 4) + { + projectile.frameCounter = 0; + projectile.frame++; + if (projectile.frame >= 2) + { + projectile.frame = 0; + } + } + + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 22); + } + } } diff --git a/Projectiles/MasterKunai.cs b/Projectiles/MasterKunai.cs index 24dcee13..e8389f47 100644 --- a/Projectiles/MasterKunai.cs +++ b/Projectiles/MasterKunai.cs @@ -5,39 +5,41 @@ using Terraria.ID; using Terraria.ModLoader; -namespace Tremor.Projectiles { -public class MasterKunai : ModProjectile +namespace Tremor.Projectiles { - public override void SetDefaults() - { + public class MasterKunai : ModProjectile + { + public override void SetDefaults() + { - projectile.width = 1; - projectile.height = 1; - projectile.friendly = true; - projectile.aiStyle = 1; - projectile.penetrate = 5; - projectile.timeLeft = 1200; - } + projectile.width = 1; + projectile.height = 1; + projectile.friendly = true; + projectile.aiStyle = 1; + projectile.penetrate = 5; + projectile.timeLeft = 1200; + } - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Master Kunai"); - - } + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Master Kunai"); + } - public override void Kill(int timeLeft) - { - for(int k = 0; k < 5; k++) - { - int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 73, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); - } - Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 27); - } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - projectile.ai[0] += 0.1f; - projectile.velocity *= 0.75f; - } -}} + public override void Kill(int timeLeft) + { + for (int k = 0; k < 5; k++) + { + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 73, projectile.oldVelocity.X * 0.7f, projectile.oldVelocity.Y * 0.7f); + } + Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 27); + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + projectile.ai[0] += 0.1f; + projectile.velocity *= 0.75f; + } + } +} diff --git a/Tremor.csproj b/Tremor.csproj index 7fecbe15..2a5bc791 100644 --- a/Tremor.csproj +++ b/Tremor.csproj @@ -61,6 +61,7109 @@ ..\..\..\..\..\..\..\Apps\Steam\steamapps\common\Terraria\Terraria.exe + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +