From 4dfca3e8908e95571491caaa901e79f33890cb67 Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Mon, 15 Jun 2020 02:19:59 -0500 Subject: [PATCH] 1 - Blorb. 2 - Changed life fruit upgrade recipes. 3 - DoG phase 2 teleport refactor. 4 - Reduced life fruit spawns pre-mech by 3x. --- Items/Materials/BloodOrb.cs | 2 +- Items/PermanentBoosters/BloodOrange.cs | 14 +++--- Items/PermanentBoosters/Dragonfruit.cs | 9 ++-- Items/PermanentBoosters/Elderberry.cs | 10 ++-- Items/PermanentBoosters/MiracleFruit.cs | 9 ++-- NPCs/DevourerofGods/DevourerofGodsHeadS.cs | 54 ++++------------------ World/CalamityWorld.cs | 2 +- 7 files changed, 33 insertions(+), 67 deletions(-) diff --git a/Items/Materials/BloodOrb.cs b/Items/Materials/BloodOrb.cs index 781a4ae398..5dc7343cb8 100644 --- a/Items/Materials/BloodOrb.cs +++ b/Items/Materials/BloodOrb.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Items.Materials { public override void SetStaticDefaults() { - DisplayName.SetDefault("Blood Orb"); + DisplayName.SetDefault("Blorb"); } public override void SetDefaults() diff --git a/Items/PermanentBoosters/BloodOrange.cs b/Items/PermanentBoosters/BloodOrange.cs index 66069735ac..61de1eacc5 100644 --- a/Items/PermanentBoosters/BloodOrange.cs +++ b/Items/PermanentBoosters/BloodOrange.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.PermanentBoosters item.width = 20; item.height = 20; item.useAnimation = 30; - item.rare = 5; + item.rare = ItemRarityID.LightPurple; item.useTime = 30; item.useStyle = ItemUseStyleID.HoldingUp; item.UseSound = SoundID.Item4; @@ -57,12 +57,12 @@ namespace CalamityMod.Items.PermanentBoosters { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.LifeFruit, 5); - recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddIngredient(ItemID.SoulofNight, 10); - recipe.AddIngredient(ItemID.SoulofLight, 10); - recipe.AddTile(TileID.MythrilAnvil); + recipe.AddIngredient(ItemID.OrangeBloodroot); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ItemID.SoulofMight, 5); + recipe.AddIngredient(ItemID.SoulofSight, 5); + recipe.AddIngredient(ItemID.SoulofFright, 5); + recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); } diff --git a/Items/PermanentBoosters/Dragonfruit.cs b/Items/PermanentBoosters/Dragonfruit.cs index 7b73d56c32..958ee7bf41 100644 --- a/Items/PermanentBoosters/Dragonfruit.cs +++ b/Items/PermanentBoosters/Dragonfruit.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.PermanentBoosters item.useStyle = ItemUseStyleID.HoldingUp; item.UseSound = SoundID.Item4; item.consumable = true; - item.rare = 10; + item.rare = ItemRarityID.Red; item.Calamity().customRarity = CalamityRarity.Violet; } @@ -59,11 +59,10 @@ namespace CalamityMod.Items.PermanentBoosters { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.LifeFruit, 5); - recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ItemID.SkyBlueFlower); recipe.AddIngredient(ItemID.FragmentSolar, 15); - recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); diff --git a/Items/PermanentBoosters/Elderberry.cs b/Items/PermanentBoosters/Elderberry.cs index 7f5293d1f0..6c578c6593 100644 --- a/Items/PermanentBoosters/Elderberry.cs +++ b/Items/PermanentBoosters/Elderberry.cs @@ -21,8 +21,9 @@ namespace CalamityMod.Items.PermanentBoosters item.width = 20; item.height = 20; item.useAnimation = 30; - item.rare = 10; - item.useTime = 30; + item.rare = ItemRarityID.Red; + item.Calamity().customRarity = CalamityRarity.Turquoise; + item.useTime = 30; item.useStyle = ItemUseStyleID.HoldingUp; item.UseSound = SoundID.Item4; item.consumable = true; @@ -57,8 +58,9 @@ namespace CalamityMod.Items.PermanentBoosters { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.LifeFruit, 5); - recipe.AddIngredient(ModContent.ItemType(), 10); - recipe.AddIngredient(ItemID.LunarBar, 10); + recipe.AddIngredient(ItemID.BlueBerries); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ModContent.ItemType(), 20); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); diff --git a/Items/PermanentBoosters/MiracleFruit.cs b/Items/PermanentBoosters/MiracleFruit.cs index 8db3c03a1e..a90671f387 100644 --- a/Items/PermanentBoosters/MiracleFruit.cs +++ b/Items/PermanentBoosters/MiracleFruit.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.PermanentBoosters item.width = 20; item.height = 20; item.useAnimation = 30; - item.rare = 7; + item.rare = ItemRarityID.Yellow; item.useTime = 30; item.useStyle = ItemUseStyleID.HoldingUp; item.UseSound = SoundID.Item4; @@ -58,9 +58,10 @@ namespace CalamityMod.Items.PermanentBoosters { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.LifeFruit, 5); - recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddIngredient(ModContent.ItemType(), 10); - recipe.AddIngredient(ModContent.ItemType(), 20); + recipe.AddIngredient(ItemID.TealMushroom); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/NPCs/DevourerofGods/DevourerofGodsHeadS.cs b/NPCs/DevourerofGods/DevourerofGodsHeadS.cs index 77b64b28d0..532ca4481e 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHeadS.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHeadS.cs @@ -871,51 +871,16 @@ namespace CalamityMod.NPCs.DevourerofGods postTeleportTimer = 255; npc.alpha = postTeleportTimer; - int playerWidth = player.width / 2; - int playerHeight = player.height / 2; + Vector2 targetVector = player.Center + Vector2.Normalize(player.velocity) * 320f + new Vector2(Main.rand.Next(-40, 41), Main.rand.Next(-40, 41)); - float playerVelocityX = player.velocity.X; - float playerVelocityY = player.velocity.Y; - - int x = (int)player.position.X + playerWidth - 25; - int y = (int)player.position.Y + playerHeight - 25; - - float velocityThreshold = 0.05f; - int vectorAdjustment = 500; - if (playerVelocityX >= velocityThreshold) - { - x += vectorAdjustment; - yAdjustment(); - } - else if (playerVelocityX <= -velocityThreshold) - { - x -= vectorAdjustment; - yAdjustment(); - } - - void yAdjustment() - { - if (playerVelocityY >= velocityThreshold) - y += vectorAdjustment; - else if (playerVelocityY <= -velocityThreshold) - y -= vectorAdjustment; - } - - int x2 = x + 50; - int y2 = y + 50; - - float locationX = Main.rand.Next(x, x2); - float locationY = Main.rand.Next(y, y2); - Vector2 teleportLocation = new Vector2(locationX, locationY); - - npc.position = teleportLocation; + npc.position = targetVector; npc.netUpdate = true; - for (int i = 0; i < 200; i++) + for (int i = 0; i < Main.maxNPCs; i++) { if (Main.npc[i].active && (Main.npc[i].type == ModContent.NPCType() || Main.npc[i].type == ModContent.NPCType())) { - Main.npc[i].position = teleportLocation; + Main.npc[i].position = targetVector; if (Main.npc[i].type == ModContent.NPCType()) { ((DevourerofGodsTailS)Main.npc[i].modNPC).setInvulTime(720); @@ -924,8 +889,7 @@ namespace CalamityMod.NPCs.DevourerofGods } } - Vector2 npcCenter = new Vector2(npc.position.X + (npc.width / 2), npc.position.Y + (npc.height / 2)); - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LargeMechGaussRifle"), (int)npcCenter.X, (int)npcCenter.Y); + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LargeMechGaussRifle"), (int)npc.Center.X, (int)npc.Center.Y); int dustAmt = 50; int random = 5; @@ -935,8 +899,8 @@ namespace CalamityMod.NPCs.DevourerofGods random += j * 2; int dustAmtSpawned = 0; int scale = random * 13; - float dustPositionX = npcCenter.X - (scale / 2); - float dustPositionY = npcCenter.Y - (scale / 2); + float dustPositionX = npc.Center.X - (scale / 2); + float dustPositionY = npc.Center.Y - (scale / 2); while (dustAmtSpawned < dustAmt) { float dustVelocityX = Main.rand.Next(-random, random); @@ -948,8 +912,8 @@ namespace CalamityMod.NPCs.DevourerofGods dustVelocityY *= dustVelocity; int dust = Dust.NewDust(new Vector2(dustPositionX, dustPositionY), scale, scale, 173, 0f, 0f, 100, default, 5f); Main.dust[dust].noGravity = true; - Main.dust[dust].position.X = teleportLocation.X; - Main.dust[dust].position.Y = teleportLocation.Y; + Main.dust[dust].position.X = targetVector.X; + Main.dust[dust].position.Y = targetVector.Y; Main.dust[dust].position.X += Main.rand.Next(-10, 11); Main.dust[dust].position.Y += Main.rand.Next(-10, 11); Main.dust[dust].velocity.X = dustVelocityX; diff --git a/World/CalamityWorld.cs b/World/CalamityWorld.cs index a98ff26869..ccb0c8ee0b 100644 --- a/World/CalamityWorld.cs +++ b/World/CalamityWorld.cs @@ -1124,7 +1124,7 @@ namespace CalamityMod.World } // Life Fruit pre-mech - int random = Main.expertMode ? 30 : 40; + int random = Main.expertMode ? 90 : 120; if (WorldGen.genRand.Next(random) == 0) { if (Main.hardMode && !NPC.downedMechBossAny)