diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 33d6d0a5ea..b5ab610de8 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -324,6 +324,9 @@ namespace CalamityMod.CalPlayer public bool raiderTalisman = false; public int raiderStack = 0; public int raiderCooldown = 0; + public bool gSabaton = false; + public int gSabatonFall = 0; + public int gSabatonCooldown = 0; public bool sGenerator = false; public bool sDefense = false; public bool sPower = false; @@ -1146,6 +1149,7 @@ namespace CalamityMod.CalPlayer royalGel = false; lol = false; raiderTalisman = false; + gSabaton = false; sGenerator = false; sDefense = false; sRegen = false; @@ -1442,6 +1446,8 @@ namespace CalamityMod.CalPlayer adrenalineDmgMult = 1f; raiderStack = 0; raiderCooldown = 0; + gSabatonFall = 0; + gSabatonCooldown = 0; fleshTotemCooldown = 0; astralStarRainCooldown = 0; bloodflareMageCooldown = 0; @@ -6837,15 +6843,14 @@ namespace CalamityMod.CalPlayer for (int num24 = 0; num24 < 20; num24++) { int num25 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 246, 0f, 0f, 100, default, 3f); - Dust expr_13AF_cp_0 = Main.dust[num25]; - expr_13AF_cp_0.position.X += (float)Main.rand.Next(-5, 6); - Dust expr_13D6_cp_0 = Main.dust[num25]; - expr_13D6_cp_0.position.Y += (float)Main.rand.Next(-5, 6); - Main.dust[num25].velocity *= 0.2f; - Main.dust[num25].scale *= 1f + (float)Main.rand.Next(20) * 0.01f; - Main.dust[num25].shader = GameShaders.Armor.GetSecondaryShader(player.ArmorSetDye(), player); - Main.dust[num25].noGravity = true; - Main.dust[num25].fadeIn = 0.5f; + Dust dust = Main.dust[num25]; + dust.position.X += (float)Main.rand.Next(-5, 6); + dust.position.Y += (float)Main.rand.Next(-5, 6); + dust.velocity *= 0.2f; + dust.scale *= 1f + (float)Main.rand.Next(20) * 0.01f; + dust.shader = GameShaders.Armor.GetSecondaryShader(player.ArmorSetDye(), player); + dust.noGravity = true; + dust.fadeIn = 0.5f; } } } @@ -6900,15 +6905,14 @@ namespace CalamityMod.CalPlayer for (int num24 = 0; num24 < 40; num24++) { int num25 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 244, 0f, 0f, 100, default, 3f); - Dust expr_13AF_cp_0 = Main.dust[num25]; - expr_13AF_cp_0.position.X += (float)Main.rand.Next(-5, 6); - Dust expr_13D6_cp_0 = Main.dust[num25]; - expr_13D6_cp_0.position.Y += (float)Main.rand.Next(-5, 6); - Main.dust[num25].velocity *= 0.2f; - Main.dust[num25].scale *= 1f + (float)Main.rand.Next(20) * 0.01f; - Main.dust[num25].shader = GameShaders.Armor.GetSecondaryShader(player.ArmorSetDye(), player); - Main.dust[num25].noGravity = true; - Main.dust[num25].fadeIn = 0.5f; + Dust dust = Main.dust[num25]; + dust.position.X += (float)Main.rand.Next(-5, 6); + dust.position.Y += (float)Main.rand.Next(-5, 6); + dust.velocity *= 0.2f; + dust.scale *= 1f + (float)Main.rand.Next(20) * 0.01f; + dust.shader = GameShaders.Armor.GetSecondaryShader(player.ArmorSetDye(), player); + dust.noGravity = true; + dust.fadeIn = 0.5f; } } } @@ -6963,15 +6967,14 @@ namespace CalamityMod.CalPlayer for (int num24 = 0; num24 < 60; num24++) { int num25 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 244, 0f, 0f, 100, default, 3f); - Dust expr_13AF_cp_0 = Main.dust[num25]; - expr_13AF_cp_0.position.X += (float)Main.rand.Next(-5, 6); - Dust expr_13D6_cp_0 = Main.dust[num25]; - expr_13D6_cp_0.position.Y += (float)Main.rand.Next(-5, 6); - Main.dust[num25].velocity *= 0.2f; - Main.dust[num25].scale *= 1f + (float)Main.rand.Next(20) * 0.01f; - Main.dust[num25].shader = GameShaders.Armor.GetSecondaryShader(player.ArmorSetDye(), player); - Main.dust[num25].noGravity = true; - Main.dust[num25].fadeIn = 0.5f; + Dust dust = Main.dust[num25]; + dust.position.X += (float)Main.rand.Next(-5, 6); + dust.position.Y += (float)Main.rand.Next(-5, 6); + dust.velocity *= 0.2f; + dust.scale *= 1f + (float)Main.rand.Next(20) * 0.01f; + dust.shader = GameShaders.Armor.GetSecondaryShader(player.ArmorSetDye(), player); + dust.noGravity = true; + dust.fadeIn = 0.5f; } } } @@ -7026,15 +7029,14 @@ namespace CalamityMod.CalPlayer for (int num24 = 0; num24 < 60; num24++) { int num25 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 33, 0f, 0f, 100, default, 3f); - Dust expr_13AF_cp_0 = Main.dust[num25]; - expr_13AF_cp_0.position.X += (float)Main.rand.Next(-5, 6); - Dust expr_13D6_cp_0 = Main.dust[num25]; - expr_13D6_cp_0.position.Y += (float)Main.rand.Next(-5, 6); - Main.dust[num25].velocity *= 0.2f; - Main.dust[num25].scale *= 1f + (float)Main.rand.Next(20) * 0.01f; - Main.dust[num25].shader = GameShaders.Armor.GetSecondaryShader(player.ArmorSetDye(), player); - Main.dust[num25].noGravity = true; - Main.dust[num25].fadeIn = 0.5f; + Dust dust = Main.dust[num25]; + dust.position.X += (float)Main.rand.Next(-5, 6); + dust.position.Y += (float)Main.rand.Next(-5, 6); + dust.velocity *= 0.2f; + dust.scale *= 1f + (float)Main.rand.Next(20) * 0.01f; + dust.shader = GameShaders.Armor.GetSecondaryShader(player.ArmorSetDye(), player); + dust.noGravity = true; + dust.fadeIn = 0.5f; } } } @@ -7089,15 +7091,14 @@ namespace CalamityMod.CalPlayer for (int num24 = 0; num24 < 60; num24++) { int num25 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 67, 0f, 0f, 100, default, 1.25f); - Dust expr_13AF_cp_0 = Main.dust[num25]; - expr_13AF_cp_0.position.X += (float)Main.rand.Next(-5, 6); - Dust expr_13D6_cp_0 = Main.dust[num25]; - expr_13D6_cp_0.position.Y += (float)Main.rand.Next(-5, 6); - Main.dust[num25].velocity *= 0.2f; - Main.dust[num25].scale *= 1f + (float)Main.rand.Next(20) * 0.01f; - Main.dust[num25].shader = GameShaders.Armor.GetSecondaryShader(player.ArmorSetDye(), player); - Main.dust[num25].noGravity = true; - Main.dust[num25].fadeIn = 0.5f; + Dust dust = Main.dust[num25]; + dust.position.X += (float)Main.rand.Next(-5, 6); + dust.position.Y += (float)Main.rand.Next(-5, 6); + dust.velocity *= 0.2f; + dust.scale *= 1f + (float)Main.rand.Next(20) * 0.01f; + dust.shader = GameShaders.Armor.GetSecondaryShader(player.ArmorSetDye(), player); + dust.noGravity = true; + dust.fadeIn = 0.5f; } } } @@ -7123,17 +7124,16 @@ namespace CalamityMod.CalPlayer for (int j = 0; j < 100; j++) { int num = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 235, 0f, 0f, 100, default, 2f); - Dust expr_A4_cp_0 = Main.dust[num]; - expr_A4_cp_0.position.X += (float)Main.rand.Next(-20, 21); - Dust expr_CB_cp_0 = Main.dust[num]; - expr_CB_cp_0.position.Y += (float)Main.rand.Next(-20, 21); - Main.dust[num].velocity *= 0.4f; - Main.dust[num].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; - Main.dust[num].shader = GameShaders.Armor.GetSecondaryShader(player.cWaist, player); + Dust dust = Main.dust[num]; + dust.position.X += (float)Main.rand.Next(-20, 21); + dust.position.Y += (float)Main.rand.Next(-20, 21); + dust.velocity *= 0.4f; + dust.scale *= 1f + (float)Main.rand.Next(40) * 0.01f; + dust.shader = GameShaders.Armor.GetSecondaryShader(player.cWaist, player); if (Main.rand.NextBool(2)) { - Main.dust[num].scale *= 1f + (float)Main.rand.Next(40) * 0.01f; - Main.dust[num].noGravity = true; + dust.scale *= 1f + (float)Main.rand.Next(40) * 0.01f; + dust.noGravity = true; } } if (player.whoAmI == Main.myPlayer) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 09734492d9..18816f50f4 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -6,6 +6,7 @@ using CalamityMod.Buffs.Potions; using CalamityMod.Buffs.StatBuffs; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Buffs.Summon; +using CalamityMod.Dusts; using CalamityMod.Items.Fishing.AstralCatches; using CalamityMod.Items.Fishing.FishingRods; using CalamityMod.NPCs; @@ -352,6 +353,8 @@ namespace CalamityMod.CalPlayer player.maxFallSpeed = 9f; if (modPlayer.aeroSet && !player.wet) player.maxFallSpeed = 15f; + if (modPlayer.gSabatonFall > 0 && !player.wet) + player.maxFallSpeed = 20f; if (modPlayer.normalityRelocator) player.maxFallSpeed *= 1.1f; if (modPlayer.etherealExtorter && player.ZoneSkyHeight) @@ -451,6 +454,10 @@ namespace CalamityMod.CalPlayer modPlayer.galileoCooldown--; if (modPlayer.raiderCooldown > 0) modPlayer.raiderCooldown--; + if (modPlayer.gSabatonCooldown > 0) + modPlayer.gSabatonCooldown--; + if (modPlayer.gSabatonFall > 0) + modPlayer.gSabatonFall--; if (modPlayer.draconicSurgeCooldown > 0) modPlayer.draconicSurgeCooldown--; if (modPlayer.fleshTotemCooldown > 0) @@ -663,6 +670,7 @@ namespace CalamityMod.CalPlayer if ((double)Math.Abs(player.velocity.X) < 0.05 && (double)Math.Abs(player.velocity.Y) < 0.05 && player.itemAnimation == 0) player.manaRegenBonus += 2; + //This stacks with Sea Shell if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) { player.statDefense += 2; @@ -1195,6 +1203,32 @@ namespace CalamityMod.CalPlayer Main.dust[dust].velocity.Y -= 0.15f; } } + + // Gravistar Sabaton effects + if (modPlayer.gSabaton) + { + if (modPlayer.gSabatonCooldown <= 0) + { + if (player.controlDown && player.releaseDown) + { + modPlayer.gSabatonFall = 300; + modPlayer.gSabatonCooldown = 480; + player.gravity *= 2f; + Projectile.NewProjectile(player.Center.X, player.Center.Y, player.velocity.X, player.velocity.Y, ModContent.ProjectileType(), 0, 0, player.whoAmI); + } + } + if (modPlayer.gSabatonCooldown == 1) //dust when ready to use again + { + for (int i = 0; i < 66; i++) + { + int d = Dust.NewDust(player.position, player.width, player.height, Main.rand.NextBool(2) ? ModContent.DustType() : ModContent.DustType(), 0, 0, 100, default, 2.6f); + Main.dust[d].noGravity = true; + Main.dust[d].noLight = true; + Main.dust[d].fadeIn = 1f; + Main.dust[d].velocity *= 6.6f; + } + } + } } #endregion diff --git a/CalamityMod.cs b/CalamityMod.cs index 71f731d29c..0785ca41c0 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -577,6 +577,7 @@ namespace CalamityMod NPCID.GolemHead, NPCID.GolemFistRight, NPCID.GolemFistLeft, + NPCID.GolemHeadFree, NPCID.DukeFishron, NPCID.CultistBoss, NPCID.MoonLordHead, diff --git a/Items/Accessories/GravistarSabaton.cs b/Items/Accessories/GravistarSabaton.cs new file mode 100644 index 0000000000..1c9bcf78cf --- /dev/null +++ b/Items/Accessories/GravistarSabaton.cs @@ -0,0 +1,34 @@ +using CalamityMod.Projectiles.Typeless; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Accessories +{ + public class GravistarSabaton : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gravistar Sabaton"); + Tooltip.SetDefault("Double tap the DOWN key to increase your fall speed for 5 seconds\n" + + "This has a 8 second cooldown\n" + + "Striking the ground with increased fall speed will cause an astral explosion"); + } + + public override void SetDefaults() + { + item.width = 20; + item.height = 22; + item.value = Item.buyPrice(0, 30, 0, 0); + item.accessory = true; + item.expert = true; + item.rare = 9; + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.Calamity().gSabaton = true; + } + } +} diff --git a/Items/Accessories/GravistarSabaton.png b/Items/Accessories/GravistarSabaton.png new file mode 100644 index 0000000000..65599543a5 Binary files /dev/null and b/Items/Accessories/GravistarSabaton.png differ diff --git a/Items/TreasureBags/AstrageldonBag.cs b/Items/TreasureBags/AstrageldonBag.cs index c343c1e135..532db4f083 100644 --- a/Items/TreasureBags/AstrageldonBag.cs +++ b/Items/TreasureBags/AstrageldonBag.cs @@ -1,4 +1,4 @@ - +using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.Materials; using CalamityMod.Items.Mounts; @@ -52,6 +52,7 @@ namespace CalamityMod.Items.TreasureBags // Equipment DropHelper.DropItemCondition(player, ModContent.ItemType(), CalamityWorld.revenge && NPC.downedMoonlord); + DropHelper.DropItem(player, ModContent.ItemType()); // Vanity DropHelper.DropItemChance(player, ModContent.ItemType(), 7); diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 16bbf61445..2b16d73672 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -263,7 +263,7 @@ namespace CalamityMod (Func)(() => CalamityWorld.downedAstrageldon), ModContent.ItemType(), new List() { ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType()}, - new List() { ModContent.ItemType(), ModContent.ItemType(), ItemID.FallenStar, ModContent.ItemType(), ModContent.ItemType(), ItemID.HallowedKey, ItemID.FragmentSolar, ItemID.FragmentVortex, ItemID.FragmentNebula, ItemID.FragmentStardust, ModContent.ItemType(), ItemID.GreaterHealingPotion}, + new List() { ModContent.ItemType(), ModContent.ItemType(), ItemID.FallenStar, ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ItemID.HallowedKey, ItemID.FragmentSolar, ItemID.FragmentVortex, ItemID.FragmentNebula, ItemID.FragmentStardust, ModContent.ItemType(), ItemID.GreaterHealingPotion}, "Use an [i:" + ModContent.ItemType() + "] at Night in the Astral Biome", "[c/FFD700:Astrum Aureus’ program has been executed. Initiate recall.]", "CalamityMod/NPCs/AstrumAureus/AstrumAureus_BossChecklist"); diff --git a/Projectiles/Typeless/SabatonBoom.cs b/Projectiles/Typeless/SabatonBoom.cs new file mode 100644 index 0000000000..7ea0641f76 --- /dev/null +++ b/Projectiles/Typeless/SabatonBoom.cs @@ -0,0 +1,25 @@ +using Terraria; +using Terraria.ModLoader; +using CalamityMod.Buffs.DamageOverTime; +namespace CalamityMod.Projectiles.Typeless +{ + public class SabatonBoom : ModProjectile + { + public override void SetDefaults() + { + projectile.penetrate = -1; + projectile.width = 450; + projectile.height = 450; + projectile.friendly = true; + projectile.tileCollide = false; + projectile.timeLeft = 40; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = -1; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 300); + } + } +} diff --git a/Projectiles/Typeless/SabatonBoom.png b/Projectiles/Typeless/SabatonBoom.png new file mode 100644 index 0000000000..73557dc730 Binary files /dev/null and b/Projectiles/Typeless/SabatonBoom.png differ diff --git a/Projectiles/Typeless/SabatonSlam.cs b/Projectiles/Typeless/SabatonSlam.cs new file mode 100644 index 0000000000..9f8a6f36d5 --- /dev/null +++ b/Projectiles/Typeless/SabatonSlam.cs @@ -0,0 +1,49 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; +using CalamityMod.Dusts; +namespace CalamityMod.Projectiles.Typeless +{ + public class SabatonSlam : ModProjectile + { + public override void SetDefaults() + { + projectile.width = 50; + projectile.height = 50; + projectile.friendly = true; + projectile.timeLeft = 300; + projectile.tileCollide = true; + } + + public override void AI() + { + Player player = Main.player[Main.myPlayer]; + if (player.Calamity().gSabatonFall == 0) + { + projectile.Kill(); + } + //Makes the projectiles follow the player + projectile.velocity.X = player.velocity.X; + projectile.velocity.Y = player.velocity.Y; + } + + public override bool OnTileCollide(Vector2 oldVelocity) + { + //Spawns the shockwave + Projectile.NewProjectile(projectile.position.X + 25, projectile.position.Y + 25, 0f, 0f, ModContent.ProjectileType(), 300, 12, projectile.owner); + Main.PlaySound(2, projectile.position, 14); + Player player = Main.player[Main.myPlayer]; + player.Calamity().gSabatonFall = 0; + projectile.Kill(); + //Pretty things + for (int dustexplode = 0; dustexplode < 360; dustexplode++) + { + Vector2 dustd = new Vector2(17f, 17f).RotatedBy(MathHelper.ToRadians(dustexplode)); + int d = Dust.NewDust(projectile.Center, projectile.width, projectile.height, Main.rand.NextBool(2) ? ModContent.DustType() : ModContent.DustType(), dustd.X, dustd.Y, 100, default, 3f); + Main.dust[d].noGravity = true; + Main.dust[d].position = projectile.Center; + } + return false; + } + } +} diff --git a/Projectiles/Typeless/SabatonSlam.png b/Projectiles/Typeless/SabatonSlam.png new file mode 100644 index 0000000000..73557dc730 Binary files /dev/null and b/Projectiles/Typeless/SabatonSlam.png differ