From 2d432726b30b94a413841d7f0fa60f96f3fecdaa Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Fri, 8 Nov 2019 20:47:28 -0600 Subject: [PATCH 1/8] dick --- NPCs/CalamityGlobalAI.cs | 65 +++++++++++------- .../PlaguebringerGoliath.cs | 30 ++++++-- NPCs/Polterghast/PolterPhantom.cs | 4 +- NPCs/Polterghast/PolterPhantom_Head_Boss.png | Bin 0 -> 457 bytes 4 files changed, 68 insertions(+), 31 deletions(-) create mode 100644 NPCs/Polterghast/PolterPhantom_Head_Boss.png diff --git a/NPCs/CalamityGlobalAI.cs b/NPCs/CalamityGlobalAI.cs index f64b2f72d0..826ad30642 100644 --- a/NPCs/CalamityGlobalAI.cs +++ b/NPCs/CalamityGlobalAI.cs @@ -1218,7 +1218,7 @@ namespace CalamityMod.NPCs npc.ai[2] += 1f; - if (npc.ai[2] % 45f == 0f) + if (npc.ai[2] % 45f == 0f) { float num19 = CalamityWorld.bossRushActive ? 9f : 6f; Vector2 vector = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)npc.height * 0.5f); @@ -1256,8 +1256,6 @@ namespace CalamityMod.NPCs if (npc.ai[2] >= (horizontalCharge ? 100f : 70f)) { - npc.TargetClosest(true); - switch ((int)calamityGlobalNPC.newAI[0]) { case 0: // Normal Eye behavior @@ -1284,10 +1282,13 @@ namespace CalamityMod.NPCs calamityGlobalNPC.newAI[0] += 1f; if (calamityGlobalNPC.newAI[0] > 3f) calamityGlobalNPC.newAI[0] = 0f; - - npc.netUpdate = true; } - } + + npc.netUpdate = true; + + if (npc.netSpam > 10) + npc.netSpam = 10; + } else if (npc.ai[1] == 6f) { @@ -2685,7 +2686,12 @@ namespace CalamityMod.NPCs // Face the correct direction npc.spriteDirection = npc.direction; - } + + npc.netUpdate = true; + + if (npc.netSpam > 10) + npc.netSpam = 10; + } else { // Face the correct direction @@ -2747,7 +2753,12 @@ namespace CalamityMod.NPCs npc.ai[2] = 0f; npc.ai[1] += 1f; } - } + + npc.netUpdate = true; + + if (npc.netSpam > 10) + npc.netSpam = 10; + } } // Fly above target before bee spawning phase @@ -6115,9 +6126,13 @@ namespace CalamityMod.NPCs npc.TargetClosest(true); npc.ai[1] = 3f; npc.ai[2] = -1f; - npc.netUpdate = true; } - } + + npc.netUpdate = true; + + if (npc.netSpam > 10) + npc.netSpam = 10; + } } } @@ -9207,21 +9222,21 @@ namespace CalamityMod.NPCs bool phase3 = lifeRatio < 0.4f || golemLifeRatio < 0.7f || CalamityWorld.death || CalamityWorld.bossRushActive; bool phase4 = lifeRatio < 0.1f || golemLifeRatio < 0.55f || CalamityWorld.death || CalamityWorld.bossRushActive; - // Float through tiles or not - bool flag44 = false; - if (!Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].Center, 1, 1) || phase3) - { - npc.noTileCollide = true; - flag44 = true; - } - else - npc.noTileCollide = false; - // Target npc.TargetClosest(true); - // Enrage if the target isn't inside the temple - bool enrage = true; + // Float through tiles or not + bool flag44 = false; + if (!Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].Center, 1, 1) || phase3) + { + npc.noTileCollide = true; + flag44 = true; + } + else + npc.noTileCollide = false; + + // Enrage if the target isn't inside the temple + bool enrage = true; if ((double)Main.player[npc.target].Center.Y > Main.worldSurface * 16.0) { int num = (int)Main.player[npc.target].Center.X / 16; @@ -9299,7 +9314,9 @@ namespace CalamityMod.NPCs calamityGlobalNPC.newAI[0] = 0f; calamityGlobalNPC.newAI[1] = -maxDistance; } - } + + npc.netUpdate = true; + } npc.ai[3] -= 1f + (phase2 ? 1f : 0f) + @@ -9392,8 +9409,6 @@ namespace CalamityMod.NPCs if (npc.ai[1] >= (float)num705 && Vector2.Distance(Main.player[npc.target].Center, npc.Center) > 160f) { - npc.TargetClosest(true); - npc.ai[1] = 0f; Vector2 vector88 = new Vector2(npc.Center.X, npc.Center.Y - 10f); diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index c1fed72ff0..378c1f0ba5 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -176,7 +176,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath jungleEnrage = true; // Despawn - if (jungleEnrage || Vector2.Distance(Main.player[npc.target].Center, npc.Center) > 5600f) + if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > 5600f) { if (despawnTimer > 0) despawnTimer--; @@ -343,7 +343,12 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.direction = playerLocation < 0 ? 1 : -1; npc.spriteDirection = npc.direction; - } + + npc.netUpdate = true; + + if (npc.netSpam > 10) + npc.netSpam = 10; + } // Slow down after charge else @@ -408,7 +413,12 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.ai[2] = 0f; npc.ai[1] += 1f; } - } + + npc.netUpdate = true; + + if (npc.netSpam > 10) + npc.netSpam = 10; + } } // Move closer if too far away @@ -782,7 +792,12 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.direction = playerLocation < 0 ? 1 : -1; npc.spriteDirection = npc.direction; - } + + npc.netUpdate = true; + + if (npc.netSpam > 10) + npc.netSpam = 10; + } // Slow down after charge else @@ -837,7 +852,12 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath npc.ai[2] = 0f; npc.ai[1] += 1f; } - } + + npc.netUpdate = true; + + if (npc.netSpam > 10) + npc.netSpam = 10; + } } } diff --git a/NPCs/Polterghast/PolterPhantom.cs b/NPCs/Polterghast/PolterPhantom.cs index c3f119edde..5e1a84c03a 100644 --- a/NPCs/Polterghast/PolterPhantom.cs +++ b/NPCs/Polterghast/PolterPhantom.cs @@ -7,9 +7,11 @@ using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.NPCs.Polterghast { - public class PolterPhantom : ModNPC + [AutoloadBossHead] + public class PolterPhantom : ModNPC { private int despawnTimer = 600; diff --git a/NPCs/Polterghast/PolterPhantom_Head_Boss.png b/NPCs/Polterghast/PolterPhantom_Head_Boss.png new file mode 100644 index 0000000000000000000000000000000000000000..9c15b730abe054640ffb9c43829c4ed865c76ee0 GIT binary patch literal 457 zcmV;)0XF`LP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGf6951U69E94oEQKA0bWT&K~zXf&6lxG z0znXl2gO*>SwN1)MiXCvSXt6pLvLw9Vr6A%Wo1HQNsqOiom9L5g^i5_dI}NIHF-95-{K&~f5)61j2aimlFuefiP|{T zpTeJUZ?F=RhqHCa-&PV+CNS?`S0#V^Je1hKsqP)`$5@+MGuIS-zBJ>)Kg?^W_v|)S zzsA2YS2MTS$8y6h-X`SekGD zI9`PPYMBE6Rn4Z{>d!-I)H;{O=G@R<6#rGN*OsQ=A!bbpe_d-o#xMnX-{$7L&cDp> zx)NauU<}-Ro$^`0^!8NJoR_b75z%X|*A%4Q1M||1!vSfFlcQjgJb9o7GNXFqIGjX? zc5A?IRcjNgA6Vo3R5eJM0F1Z(Ii%iOk}=T_j>W+Z5&FW_00000NkvXXu0mjfcmv8X literal 0 HcmV?d00001 From 4e95207b2186c4d8e4bde41485aa7dba7778697c Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Fri, 8 Nov 2019 21:57:27 -0500 Subject: [PATCH 2/8] GlobalNPCLoot explicitly has no instances --- NPCs/CalamityGlobalNPCLoot.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index 726fd1209c..d06414bdd3 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -41,6 +41,11 @@ namespace CalamityMod.NPCs { public class CalamityGlobalNPCLoot : GlobalNPC { + #region Instance Per Entity + public override bool InstancePerEntity => false; + public override bool CloneNewInstances => false; + #endregion + #region PreNPCLoot public override bool PreNPCLoot(NPC npc) { From 2ff47fafc2ed6ef76a7921ddc00a294a0fc0b8f2 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Fri, 8 Nov 2019 23:02:50 -0500 Subject: [PATCH 3/8] fixed error in biome syncing code --- CalPlayer/CalamityPlayer.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 83f0d0391d..4f811d9a01 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -1658,10 +1658,18 @@ namespace CalamityMod.CalPlayer public override bool CustomBiomesMatch(Player other) { CalamityPlayer modOther = other.Calamity(); - return ZoneCalamity == modOther.ZoneCalamity || ZoneAstral == modOther.ZoneAstral || ZoneAbyss == modOther.ZoneAbyss || - ZoneAbyssLayer1 == modOther.ZoneAbyssLayer1 || ZoneAbyssLayer2 == modOther.ZoneAbyssLayer2 || - ZoneAbyssLayer3 == modOther.ZoneAbyssLayer3 || ZoneAbyssLayer4 == modOther.ZoneAbyssLayer4 || - ZoneSulphur == modOther.ZoneSulphur || ZoneSunkenSea == modOther.ZoneSunkenSea; + + // efficiently short circuits to false if there are any discrepancies + // TODO -- order this list by how frequently players are in these various biomes + return ZoneSunkenSea == modOther.ZoneSunkenSea && + ZoneCalamity == modOther.ZoneCalamity && + ZoneAstral == modOther.ZoneAstral && + ZoneSulphur == modOther.ZoneSulphur && + ZoneAbyss == modOther.ZoneAbyss && + ZoneAbyssLayer1 == modOther.ZoneAbyssLayer1 && + ZoneAbyssLayer2 == modOther.ZoneAbyssLayer2 && + ZoneAbyssLayer3 == modOther.ZoneAbyssLayer3 && + ZoneAbyssLayer4 == modOther.ZoneAbyssLayer4; } public override void CopyCustomBiomesTo(Player other) From 8b4dcc280f9a937e233c455d8c134d887a3068cd Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sat, 9 Nov 2019 07:47:02 -0500 Subject: [PATCH 4/8] added sparkling empress Redcode is like hell itself --- CalPlayer/CalamityPlayer.cs | 17 +- .../SunkenSeaCatches/SparklingEmpress.cs | 47 +++ Projectiles/Magic/SparklingBeam.cs | 301 ++++++++++++++++++ Projectiles/Magic/SparklingBeam.png | Bin 812 -> 640 bytes Projectiles/Rogue/BloodsoakedCrashax.cs | 2 +- 5 files changed, 353 insertions(+), 14 deletions(-) create mode 100644 Items/Fishing/SunkenSeaCatches/SparklingEmpress.cs create mode 100644 Projectiles/Magic/SparklingBeam.cs diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 4f811d9a01..83ca668c2b 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -7406,19 +7406,14 @@ namespace CalamityMod.CalPlayer } if (ZoneSunkenSea) { - /*switch (Main.rand.Next(2)) + switch (Main.rand.Next(2)) { case 0: - rareItemList.Add(ModContent.ItemType()); + rareItemList.Add(ModContent.ItemType()); break; case 1: rareItemList.Add(ModContent.ItemType()); break; - }*/ - rareItemList.Add(ModContent.ItemType()); - if (Main.hardMode) - { - rareItemList.Add(ModContent.ItemType()); } } if (player.ZoneSnow && player.ZoneRockLayerHeight && (player.ZoneCorrupt || player.ZoneCrimson || player.ZoneHoly)) @@ -7437,10 +7432,6 @@ namespace CalamityMod.CalPlayer { rareItemList.Add(ItemID.CrystalSerpent); } - if (player.ZoneDirtLayerHeight) - { - rareItemList.Add(ModContent.ItemType()); - } if (rareItemList.Any()) { @@ -7633,10 +7624,10 @@ namespace CalamityMod.CalPlayer { caughtType = ModContent.ItemType(); } - /*else if (sunkenFish <= 2 && sunkenFish >= 0) //3% + else if (sunkenFish <= 2 && sunkenFish >= 0) //3% { caughtType = ModContent.ItemType(); - }*/ + } else //33% w/o crate pot, 23% w/ crate pot + 28% if prehardmode { caughtType = ModContent.ItemType(); diff --git a/Items/Fishing/SunkenSeaCatches/SparklingEmpress.cs b/Items/Fishing/SunkenSeaCatches/SparklingEmpress.cs new file mode 100644 index 0000000000..3be944ff51 --- /dev/null +++ b/Items/Fishing/SunkenSeaCatches/SparklingEmpress.cs @@ -0,0 +1,47 @@ +using CalamityMod.Projectiles.Magic; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Microsoft.Xna.Framework; +using static Terraria.ModLoader.ModContent; + +namespace CalamityMod.Items.Fishing.SunkenSeaCatches +{ + public class SparklingEmpress : ModItem + { + public static int BaseDamage = 20; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sparkling Empress"); + Tooltip.SetDefault("Fires a concentrated laser to annihilate your foes\n" + + "Slowly drains mana once the laser is fully charged\n" + + "Defeated enemies explode into prism shards"); + Item.staff[item.type] = true; //so it doesn't look weird af when holding it + } + + public override void SetDefaults() + { + item.damage = BaseDamage; + item.noMelee = true; + item.magic = true; + item.channel = true; //Channel so that you can hold the weapon [Important] + item.rare = 2; + item.mana = 5; + item.width = 42; + item.height = 34; + item.useTime = 20; + item.useAnimation = 20; + item.UseSound = SoundID.Item13; + item.useStyle = 5; + item.shootSpeed = 14f; + item.shoot = ModContent.ProjectileType(); + item.value = Item.sellPrice(silver: 40); + } + + public override Vector2? HoldoutOrigin() //so it looks normal when holding + { + return new Vector2(10, 10); + } + } +} \ No newline at end of file diff --git a/Projectiles/Magic/SparklingBeam.cs b/Projectiles/Magic/SparklingBeam.cs new file mode 100644 index 0000000000..c565e60dae --- /dev/null +++ b/Projectiles/Magic/SparklingBeam.cs @@ -0,0 +1,301 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.Enums; +using Terraria.ModLoader; +using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Fishing.SunkenSeaCatches; + +namespace CalamityMod.Projectiles.Magic +{ + // The following laser shows a channeled ability, after charging up the laser will be fired + // Using custom drawing, dust effects, and custom collision checks for tiles + public class SparklingBeam : ModProjectile + { + // Use a different style for constant so it is very clear in code when a constant is used + + // The maximum charge value + private const float MAX_CHARGE = 50f; + //The distance charge particle from the player center + private const float MOVE_DISTANCE = 60f; + + // The actual distance is stored in the ai0 field + // By making a property to handle this it makes our life easier, and the accessibility more readable + public float Distance { + get => projectile.ai[0]; + set => projectile.ai[0] = value; + } + + // The actual charge value is stored in the localAI0 field + public float Charge { + get => projectile.localAI[0]; + set => projectile.localAI[0] = value; + } + + // Are we at max charge? With c#6 you can simply use => which indicates this is a get only property + public bool IsAtMaxCharge => Charge == MAX_CHARGE; + + private bool playedSound = false; + private int manaDrain = 0; + + public override void SetDefaults() + { + projectile.width = 10; + projectile.height = 10; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.magic = true; + projectile.hide = true; + projectile.usesIDStaticNPCImmunity = true; + projectile.idStaticNPCHitCooldown = 10; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + // We start drawing the laser if we have charged up + if (IsAtMaxCharge) + { + DrawLaser(spriteBatch, Main.projectileTexture[projectile.type], Main.player[projectile.owner].Center, + projectile.velocity, 10, projectile.damage, -1.57f, 1f, 1000f, Color.White, (int)MOVE_DISTANCE); + } + return false; + } + + // The core function of drawing a laser + public void DrawLaser(SpriteBatch spriteBatch, Texture2D texture, Vector2 start, Vector2 unit, float step, int damage, float rotation = 0f, float scale = 1f, float maxDist = 2000f, Color color = default(Color), int transDist = 50) + { + float r = unit.ToRotation() + rotation; + + // Draws the laser 'body' + for (float i = transDist; i <= Distance; i += step) + { + Color c = Color.White; + var origin = start + i * unit; + spriteBatch.Draw(texture, origin - Main.screenPosition, + new Rectangle(0, 26, 28, 26), i < transDist ? Color.Transparent : c, r, + new Vector2(28 * .5f, 26 * .5f), scale, 0, 0); + } + + // Draws the laser 'tail' + spriteBatch.Draw(texture, start + unit * (transDist - step) - Main.screenPosition, + new Rectangle(0, 0, 28, 26), Color.White, r, new Vector2(28 * .5f, 26 * .5f), scale, 0, 0); + + // Draws the laser 'head' + spriteBatch.Draw(texture, start + (Distance + step) * unit - Main.screenPosition, + new Rectangle(0, 52, 28, 26), Color.White, r, new Vector2(28 * .5f, 26 * .5f), scale, 0, 0); + } + + // Change the way of collision check of the projectile + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + // We can only collide if we are at max charge, which is when the laser is actually fired + if (!IsAtMaxCharge) return false; + + Player player = Main.player[projectile.owner]; + Vector2 unit = projectile.velocity; + float point = 0f; + // Run an AABB versus Line check to look for collisions, look up AABB collision first to see how it works + // It will look for collisions on the given line using AABB + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), player.Center, + player.Center + unit * Distance, 22, ref point); + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (target.life <= 0) + { + int shardDamage = SparklingEmpress.BaseDamage / 2; + int num251 = Main.rand.Next(2, 4); + if (projectile.owner == Main.myPlayer) + { + for (int num252 = 0; num252 < num251; num252++) + { + Vector2 value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + while (value15.X == 0f && value15.Y == 0f) + { + value15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101)); + } + value15.Normalize(); + value15 *= (float)Main.rand.Next(70, 101) * 0.1f; + int shard = Projectile.NewProjectile(target.Center.X, target.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), shardDamage, 0f, projectile.owner, 0f, 0f); + Main.projectile[shard].Calamity().forceMagic = true; + } + } + } + } + + // The AI of the projectile + public override void AI() + { + Player player = Main.player[projectile.owner]; + projectile.position = player.Center + projectile.velocity * MOVE_DISTANCE; + projectile.timeLeft = 2; + + // By separating large AI into methods it becomes very easy to see the flow of the AI in a broader sense + // First we update player variables that are needed to channel the laser + // Then we run our charging laser logic + // If we are fully charged, we proceed to update the laser's position + // Finally we spawn some effects like dusts and light + + UpdatePlayer(player); + ChargeLaser(player); + + // If laser is not charged yet, stop the AI here. + if (Charge < MAX_CHARGE) return; + + //Repeatedly drain mana once fully charged. Unaffected by modifiers. + //Only normal mode because redcode is EXTREME BRUH moment. + if (!Main.expertMode) + { + manaDrain++; + if (manaDrain == 15) + { + player.statMana -= 5; + if (player.statMana <= 0) + { + player.statMana = 0; + projectile.Kill(); + } + manaDrain = 0; + } + } + + //Play cool sound when fully charged + if (playedSound == false) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 68); + playedSound = true; + } + + SetLaserPosition(player); + SpawnDusts(player); + CastLights(); + } + + private void SpawnDusts(Player player) + { + Vector2 unit = projectile.velocity * -1; + Vector2 dustPos = player.Center + projectile.velocity * Distance; + + for (int i = 0; i < 2; ++i) + { + float num1 = projectile.velocity.ToRotation() + (Main.rand.Next(2) == 1 ? -1.0f : 1.0f) * 1.57f; + float num2 = (float)(Main.rand.NextDouble() * 0.8f + 1.0f); + Vector2 dustVel = new Vector2((float)Math.Cos(num1) * num2, (float)Math.Sin(num1) * num2); + Dust dust = Main.dust[Dust.NewDust(dustPos, 0, 0, 226, dustVel.X, dustVel.Y)]; + dust.noGravity = true; + dust.scale = 1.2f; + dust = Dust.NewDustDirect(Main.player[projectile.owner].Center, 0, 0, 31, + -unit.X * Distance, -unit.Y * Distance); + dust.fadeIn = 0f; + dust.noGravity = true; + dust.scale = 0.88f; + dust.color = Color.Cyan; + } + + if (Main.rand.NextBool(5)) + { + Vector2 offset = projectile.velocity.RotatedBy(1.57f) * ((float)Main.rand.NextDouble() - 0.5f) * projectile.width; + Dust dust = Main.dust[Dust.NewDust(dustPos + offset - Vector2.One * 4f, 8, 8, 31, 0.0f, 0.0f, 100, new Color(), 1.5f)]; + dust.velocity *= 0.5f; + dust.velocity.Y = -Math.Abs(dust.velocity.Y); + unit = dustPos - Main.player[projectile.owner].Center; + unit.Normalize(); + dust = Main.dust[Dust.NewDust(Main.player[projectile.owner].Center + 55 * unit, 8, 8, 31, 0.0f, 0.0f, 100, new Color(), 1.5f)]; + dust.velocity = dust.velocity * 0.5f; + dust.velocity.Y = -Math.Abs(dust.velocity.Y); + } + } + + /* + * Sets the end of the laser position based on where it collides with something + */ + private void SetLaserPosition(Player player) + { + for (Distance = MOVE_DISTANCE; Distance <= 2200f; Distance += 5f) + { + var start = player.Center + projectile.velocity * Distance; + if (!Collision.CanHit(player.Center, 1, 1, start, 1, 1)) + { + Distance -= 5f; + break; + } + } + } + + private void ChargeLaser(Player player) + { + // Kill the projectile if the player stops channeling + if (!player.channel) + { + projectile.Kill(); + } + else { + // Do we still have enough mana? If not, we kill the projectile because we cannot use it anymore + if (Main.time % 10 < 1 && !player.CheckMana(player.inventory[player.selectedItem].mana, true)) + { + projectile.Kill(); + } + Vector2 offset = projectile.velocity; + offset *= MOVE_DISTANCE - 20; + Vector2 pos = player.Center + offset - new Vector2(10, 10); + if (Charge < MAX_CHARGE) + { + Charge++; + } + int chargeFact = (int)(Charge / 20f); + Vector2 dustVelocity = Vector2.UnitX * 18f; + dustVelocity = dustVelocity.RotatedBy(projectile.rotation - 1.57f); + Vector2 spawnPos = projectile.Center + dustVelocity; + for (int k = 0; k < chargeFact + 1; k++) + { + Vector2 spawn = spawnPos + ((float)Main.rand.NextDouble() * 6.28f).ToRotationVector2() * (12f - chargeFact * 2); + Dust dust = Main.dust[Dust.NewDust(pos, 20, 20, 226, projectile.velocity.X / 2f, projectile.velocity.Y / 2f)]; + dust.velocity = Vector2.Normalize(spawnPos - spawn) * 1.5f * (10f - chargeFact * 2f) / 10f; + dust.noGravity = true; + dust.scale = Main.rand.Next(10, 20) * 0.05f; + } + } + } + + private void UpdatePlayer(Player player) + { + // Multiplayer support here, only run this code if the client running it is the owner of the projectile + if (projectile.owner == Main.myPlayer) + { + Vector2 diff = Main.MouseWorld - player.Center; + diff.Normalize(); + projectile.velocity = diff; + projectile.direction = Main.MouseWorld.X > player.position.X ? 1 : -1; + projectile.netUpdate = true; + } + int dir = projectile.direction; + player.ChangeDir(dir); // Set player direction to where we are shooting + player.heldProj = projectile.whoAmI; // Update player's held projectile + player.itemTime = 2; // Set item time to 2 frames while we are used + player.itemAnimation = 2; // Set item animation time to 2 frames while we are used + player.itemRotation = (float)Math.Atan2(projectile.velocity.Y * dir, projectile.velocity.X * dir); // Set the item rotation to where we are shooting + } + + private void CastLights() + { + // Cast a light along the line of the laser + DelegateMethods.v3_1 = new Vector3(0.8f, 0.8f, 1f); + Utils.PlotTileLine(projectile.Center, projectile.Center + projectile.velocity * (Distance - MOVE_DISTANCE), 26, DelegateMethods.CastLight); + } + + public override bool ShouldUpdatePosition() => false; + + /* + * Update CutTiles so the laser will cut tiles (like grass) + */ + public override void CutTiles() + { + DelegateMethods.tilecut_0 = TileCuttingContext.AttackProjectile; + Vector2 unit = projectile.velocity; + Utils.PlotTileLine(projectile.Center, projectile.Center + unit * Distance, (projectile.width + 16) * projectile.scale, DelegateMethods.CutTiles); + } + } +} \ No newline at end of file diff --git a/Projectiles/Magic/SparklingBeam.png b/Projectiles/Magic/SparklingBeam.png index a9f69e54a41727da545b049f6d2bb19392ad4812..7508432a14bf41f9c3eeea0825a59ddfb65b36af 100644 GIT binary patch delta 602 zcmV-g0;T<|27m>SF@HKqL_t(oh3%QYPTW8c#(#!XAh?3VmLimfg78O(7ReRQK*1XX z(Ik%o4I*!lf;T{-Iw>tWL2`*i6Gf4Za|(!{OD=`)1KHkMnjT&D14}UT7m*xSu`F__0*nGVS zKz-vk0MX?%0L@lY`d&{T$TBO9(F>bEOm=qH0r11^gxn9~-+Civcz$}N7-rrQxQLNr zGdnX2!2QF07hv!3O(8=c-o4j&uQwieij}(G-D662K_1gDu{D1)}~VXIFXEC1f-StlZ=9d=|&yojG06;rx8|}Gg)Q;L+fS?o4R7?atPn~_0 zzC>=n8LW(ie(RDA!BQt3ROMI zpsGieqrOq)y61B=DrEX~LQs!S5sRxY0eH2w3}nwo-!85J=zRVGWY0%V`*n#v+X&7_ z342cWQKDm?SC0(Y+t~4Uw~uyq*B^V`gTOZ4eXi@5Ri3{4T<3?OwMRFIzPlKuyIFax z(sEm-FH@gUx|h1fwr$Kmp&K&U6Ut|l?uC9j`3S(;elce17TfH(TXniu?YHlJej4|^ o)3=vGbq_l*jQvmekMGL=0!;?$OPj{mx&QzG07*qoM6N<$g1!JGp#T5? delta 776 zcmV+j1NZ!Z1*`^;F@NSsL_t(oh2@z~YZE~j#(&cUA`L_jX+UWN+k&N*kRFA2=~3{c z2fu+Lf_?)(fENW3y?gNBP0(9Uh0;?)NJ9(#15Hs#f=D36i0OLReUt2DH`#6LY+9d7 zvYDB8=E?hKW}a0ypS@)mGILh}sO@~WeA<=MKGe>{(AG0VynpYz=Za;e4_`ghqBWu>9bbt3#$x2xO?Xy6Spf`Lx-c1ETOzGL=xyN<5hbg)k9&t!5iA z%*g7WS(Y%jzpESz$r$m!q^!1`G=4nTKW-gEJy!>FV?64Uq z+Ju>&H#&q#W`8qzc-v%I&P6JRa?n-|E_A7Nydw^c8rqSGSuM43V%@D1Zs6P*;H zE5pT!Ivru7aQu8EkcexP*FudOUq*tk`_uSE-MOiC7w^pQAMda_&VQ}b??+=>>$)d@ z{iY}PoqxD>34mUc)nQqgFsQs+bDrG>{C^lmrhBXVU)KSMPaFeK{IU`1&6r;m z&);2A0Dq2cF6J1$usRmNL2*|BT+h#rdJ7o{x;>+eJR52|-vC&7^Vx!-?_mL0etJ&< zWah4U_A`G9(jjMwY<>oSYH`ogciH@ma@v7Gy<1?6(O-u&DOZzQL_`1p002ovPDHLk GU;%<{nt|8= diff --git a/Projectiles/Rogue/BloodsoakedCrashax.cs b/Projectiles/Rogue/BloodsoakedCrashax.cs index 1f879d6c81..05fc50cae0 100644 --- a/Projectiles/Rogue/BloodsoakedCrashax.cs +++ b/Projectiles/Rogue/BloodsoakedCrashax.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.timeLeft = 600; //10 seconds and counting aiType = 48; //Throwing Knife AI projectile.Calamity().rogue = true; - projectile.usesIDStaticNPCImmunity = true; //afaik, no Calamity projectiles use this and only 1 vanilla projectile + projectile.usesIDStaticNPCImmunity = true; projectile.idStaticNPCHitCooldown = 5; projectile.extraUpdates = 1; } From 3d1647a036f17ef983b097f2b446ddfe6e8740b9 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sat, 9 Nov 2019 07:53:54 -0500 Subject: [PATCH 5/8] Update SparklingEmpress.cs --- Items/Fishing/SunkenSeaCatches/SparklingEmpress.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Items/Fishing/SunkenSeaCatches/SparklingEmpress.cs b/Items/Fishing/SunkenSeaCatches/SparklingEmpress.cs index 3be944ff51..3b2cc0116f 100644 --- a/Items/Fishing/SunkenSeaCatches/SparklingEmpress.cs +++ b/Items/Fishing/SunkenSeaCatches/SparklingEmpress.cs @@ -15,7 +15,6 @@ namespace CalamityMod.Items.Fishing.SunkenSeaCatches { DisplayName.SetDefault("Sparkling Empress"); Tooltip.SetDefault("Fires a concentrated laser to annihilate your foes\n" + - "Slowly drains mana once the laser is fully charged\n" + "Defeated enemies explode into prism shards"); Item.staff[item.type] = true; //so it doesn't look weird af when holding it } From b9b7fec8d9bc6ffd1ca2a756a4b19e0376c7a0a3 Mon Sep 17 00:00:00 2001 From: Ozzatron Date: Sat, 9 Nov 2019 11:37:53 -0500 Subject: [PATCH 6/8] deep sea dumbbell reworked Flexes now increase the power of the next stealth strike by 100%, stacking up to 9 times for 10x damage. Stealth flexing still possible, so this stacks with flexing's base 22,500 damage. --- Items/Weapons/Rogue/DeepSeaDumbbell.cs | 49 +++++++++++++++++++++----- 1 file changed, 41 insertions(+), 8 deletions(-) diff --git a/Items/Weapons/Rogue/DeepSeaDumbbell.cs b/Items/Weapons/Rogue/DeepSeaDumbbell.cs index f00cdae001..4fe31c8e89 100644 --- a/Items/Weapons/Rogue/DeepSeaDumbbell.cs +++ b/Items/Weapons/Rogue/DeepSeaDumbbell.cs @@ -1,4 +1,5 @@ using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -7,13 +8,16 @@ namespace CalamityMod.Items.Weapons.Rogue { public class DeepSeaDumbbell : RogueWeapon { - private int BaseDamage = 900; + private static int BaseDamage = 900; + private static float MeleeFlexMult = 25f; + private float flexBonusDamageMult = 0f; public override void SetStaticDefaults() { DisplayName.SetDefault("Deep Sea Dumbbell"); Tooltip.SetDefault("Throws a dumbbell that bounces and flings weights with each bounce\n" + - "Right click to flex with it"); + "Right click to flex with it, increasing the power of your next stealth strike\n" + + "Flexes are melee attacks, and are boosted by flexing and stealth"); } public override void SafeSetDefaults() @@ -29,6 +33,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.knockBack = 16f; item.UseSound = SoundID.Item1; item.autoReuse = true; + item.useTurn = false; item.height = 24; item.value = Item.buyPrice(1, 40, 0, 0); item.rare = 10; @@ -53,7 +58,6 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = false; item.noUseGraphic = false; item.autoReuse = false; - item.damage = BaseDamage * 25; item.UseSound = SoundID.Item1; } else @@ -64,18 +68,47 @@ namespace CalamityMod.Items.Weapons.Rogue item.noMelee = true; item.noUseGraphic = true; item.autoReuse = true; - item.damage = BaseDamage; item.UseSound = SoundID.Item1; } return base.CanUseItem(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) + public override void ModifyWeaponDamage(Player player, ref float add, ref float mult, ref float flat) { - if (player.altFunctionUse == 2) - return false; + if (player.Calamity().StealthStrikeAvailable()) + mult += flexBonusDamageMult; + base.ModifyWeaponDamage(player, ref add, ref mult, ref flat); + } - Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, (int)((float)BaseDamage * player.Calamity().throwingDamage), knockBack, player.whoAmI, 0f, 0f); + // Flexes deal 25x damage if you actually hit with them directly. + public override void ModifyHitNPC(Player player, NPC target, ref int damage, ref float knockBack, ref bool crit) + { + damage = (int)(damage * MeleeFlexMult); + } + + public override void ModifyHitPvp(Player player, Player target, ref int damage, ref bool crit) + { + damage = (int)(damage * MeleeFlexMult); + } + + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + // Alt fire doesn't actually shoot anything. It flexes, increasing the damage of the next stealth strike + if (player.altFunctionUse == 2) + { + flexBonusDamageMult += 1f; + if (flexBonusDamageMult > 10f) + flexBonusDamageMult = 10f; + return false; + } + + int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f); + if (player.Calamity().StealthStrikeAvailable()) + { + Main.projectile[proj].Calamity().stealthStrike = true; + flexBonusDamageMult = 0f; + } return false; } } From fe1d8b36c42acc74e3976cc1fe687c2c02223318 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sat, 9 Nov 2019 13:43:45 -0500 Subject: [PATCH 7/8] nerfed hell's sun and sea's searing --- Items/Weapons/Ranged/SeasSearing.cs | 4 ++-- Items/Weapons/Rogue/HellsSun.cs | 2 +- NPCs/CalamityGlobalNPC.cs | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Items/Weapons/Ranged/SeasSearing.cs b/Items/Weapons/Ranged/SeasSearing.cs index 67fcda0b97..4e6d2fea79 100644 --- a/Items/Weapons/Ranged/SeasSearing.cs +++ b/Items/Weapons/Ranged/SeasSearing.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Items.Weapons.Ranged { public class SeasSearing : ModItem { - public static int BaseDamage = 100; + public static int BaseDamage = 90; public override void SetStaticDefaults() { @@ -54,7 +54,7 @@ namespace CalamityMod.Items.Weapons.Ranged { if (player.altFunctionUse == 2) { - item.damage = 150; + item.damage = 130; item.useTime = 30; item.useAnimation = 30; item.reuseDelay = 0; diff --git a/Items/Weapons/Rogue/HellsSun.cs b/Items/Weapons/Rogue/HellsSun.cs index 112548a38e..0dfd061e24 100644 --- a/Items/Weapons/Rogue/HellsSun.cs +++ b/Items/Weapons/Rogue/HellsSun.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Rogue { public class HellsSun : RogueWeapon { - private static int damage = 250; + private static int damage = 180; private static int knockBack = 5; public override void SetStaticDefaults() diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index d10988c035..bfb686fd6f 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -2364,6 +2364,10 @@ namespace CalamityMod.NPCs { damage = (int)(damage * 0.75); } + if (projectile.type == ModContent.ProjectileType()) + { + damage = (int)(damage * 0.25); + } } else if (npc.type == NPCID.EaterofWorldsHead || npc.type == NPCID.EaterofWorldsBody || npc.type == NPCID.EaterofWorldsTail || npc.type == NPCID.Creeper) { From 7c8fbdd2d11cc1ccd14ea2bd796b9873628dfc44 Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Sat, 9 Nov 2019 15:50:56 -0500 Subject: [PATCH 8/8] added various recipe groups --- Items/Accessories/CoinofDeceit.cs | 22 +--- Items/Accessories/EnchantedPearl.cs | 11 +- Items/Ammo/VanquisherArrow.cs | 8 +- .../Fishing/FishingRods/TheDevourerofCods.cs | 8 +- .../Furniture/CraftingStations/SilvaBasin.cs | 8 +- .../Placeables/FurnitureSilva/SilvaCrystal.cs | 13 +-- Items/Tools/ClimateChange/AridArtifact.cs | 8 +- Items/Tools/ClimateChange/BloodIdol.cs | 8 +- Items/Tools/MarniteObliterator.cs | 9 +- Items/Weapons/Magic/IonBlaster.cs | 8 +- Items/Weapons/Magic/SoulPiercer.cs | 8 +- Items/Weapons/Melee/CatastropheClaymore.cs | 13 +-- Items/Weapons/Melee/EssenceFlayer.cs | 8 +- Items/Weapons/Melee/Floodtide.cs | 12 +-- Items/Weapons/Melee/ForsakenSaber.cs | 8 +- Items/Weapons/Melee/MarniteSpear.cs | 9 +- Items/Weapons/Melee/StreamGouge.cs | 8 +- Items/Weapons/Melee/TheEnforcer.cs | 8 +- Items/Weapons/Ranged/CleansingBlaze.cs | 8 +- Items/Weapons/Ranged/FirestormCannon.cs | 10 +- Items/Weapons/Ranged/MagnaStriker.cs | 10 +- Items/Weapons/Ranged/MarniteRifleSpear.cs | 9 +- Items/Weapons/Ranged/MineralMortar.cs | 8 +- Items/Weapons/Rogue/ExecutionersBlade.cs | 8 +- Items/Weapons/Rogue/Sandslasher.cs | 10 +- Items/Weapons/Rogue/SpearofPaleolith.cs | 8 +- Items/Weapons/Typeless/FiniteUse/Bazooka.cs | 10 +- Utilities/CalamityRecipes.cs | 102 +++++++++++------- 28 files changed, 92 insertions(+), 268 deletions(-) diff --git a/Items/Accessories/CoinofDeceit.cs b/Items/Accessories/CoinofDeceit.cs index c215b571d9..23e4a72eed 100644 --- a/Items/Accessories/CoinofDeceit.cs +++ b/Items/Accessories/CoinofDeceit.cs @@ -29,26 +29,8 @@ namespace CalamityMod.Items.Accessories public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.GoldBar, 4); - recipe.AddIngredient(ItemID.CopperBar, 8); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(this); - recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.GoldBar, 4); - recipe.AddIngredient(ItemID.TinBar, 8); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(this); - recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.PlatinumBar, 4); - recipe.AddIngredient(ItemID.CopperBar, 8); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(this); - recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.PlatinumBar, 4); - recipe.AddIngredient(ItemID.TinBar, 8); + recipe.AddRecipeGroup("AnyGoldBar", 4); + recipe.AddRecipeGroup("AnyCopperBar", 8); recipe.AddTile(TileID.Anvils); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Accessories/EnchantedPearl.cs b/Items/Accessories/EnchantedPearl.cs index 02aadefce8..554ccc2f0f 100644 --- a/Items/Accessories/EnchantedPearl.cs +++ b/Items/Accessories/EnchantedPearl.cs @@ -35,16 +35,7 @@ namespace CalamityMod.Items.Accessories ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.FishingPotion); recipe.AddIngredient(ItemID.CratePotion, 8); - recipe.AddIngredient(ItemID.TissueSample, 5); - recipe.AddIngredient(ModContent.ItemType(), 10); - recipe.AddIngredient(ModContent.ItemType(), 3); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(this); - recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.FishingPotion); - recipe.AddIngredient(ItemID.CratePotion, 8); - recipe.AddIngredient(ItemID.ShadowScale, 5); + recipe.AddRecipeGroup("Boss2Material", 5); recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ModContent.ItemType(), 3); recipe.AddTile(TileID.Anvils); diff --git a/Items/Ammo/VanquisherArrow.cs b/Items/Ammo/VanquisherArrow.cs index 81ecb9a48b..6e1641b00f 100644 --- a/Items/Ammo/VanquisherArrow.cs +++ b/Items/Ammo/VanquisherArrow.cs @@ -43,13 +43,7 @@ namespace CalamityMod.Items.Ammo { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddTile(TileID.LunarCraftingStation); - recipe.SetResult(this, 250); - recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType()); + recipe.AddRecipeGroup("NForEE"); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this, 250); recipe.AddRecipe(); diff --git a/Items/Fishing/FishingRods/TheDevourerofCods.cs b/Items/Fishing/FishingRods/TheDevourerofCods.cs index f3ce7c4ab5..4cccf7c8cd 100644 --- a/Items/Fishing/FishingRods/TheDevourerofCods.cs +++ b/Items/Fishing/FishingRods/TheDevourerofCods.cs @@ -59,13 +59,7 @@ namespace CalamityMod.Items.Fishing.FishingRods { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 12); - recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddTile(TileID.LunarCraftingStation); - recipe.SetResult(this); - recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 12); - recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddRecipeGroup("NForEE", 5); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Placeables/Furniture/CraftingStations/SilvaBasin.cs b/Items/Placeables/Furniture/CraftingStations/SilvaBasin.cs index 76ee77a8ce..8960cb33af 100644 --- a/Items/Placeables/Furniture/CraftingStations/SilvaBasin.cs +++ b/Items/Placeables/Furniture/CraftingStations/SilvaBasin.cs @@ -29,13 +29,7 @@ namespace CalamityMod.Items.Placeables.Furniture.CraftingStations { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 10); - recipe.AddIngredient(ItemID.GoldBar, 5); - recipe.SetResult(this); - recipe.AddTile(ModContent.TileType()); - recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 10); - recipe.AddIngredient(ItemID.PlatinumBar, 5); + recipe.AddRecipeGroup("AnyGoldBar", 5); recipe.SetResult(this); recipe.AddTile(ModContent.TileType()); recipe.AddRecipe(); diff --git a/Items/Placeables/FurnitureSilva/SilvaCrystal.cs b/Items/Placeables/FurnitureSilva/SilvaCrystal.cs index dd22f46b02..5cfa242a3a 100644 --- a/Items/Placeables/FurnitureSilva/SilvaCrystal.cs +++ b/Items/Placeables/FurnitureSilva/SilvaCrystal.cs @@ -29,18 +29,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.CrystalBlock, 200); - recipe.AddIngredient(ItemID.GoldBar, 25); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType()); - recipe.SetResult(this, 400); - recipe.AddTile(ModContent.TileType()); - recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.CrystalBlock, 200); - recipe.AddIngredient(ItemID.PlatinumBar, 25); + recipe.AddRecipeGroup("AnyGoldBar", 25); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ModContent.ItemType(), 5); diff --git a/Items/Tools/ClimateChange/AridArtifact.cs b/Items/Tools/ClimateChange/AridArtifact.cs index 70f9b43d30..5667c2df14 100644 --- a/Items/Tools/ClimateChange/AridArtifact.cs +++ b/Items/Tools/ClimateChange/AridArtifact.cs @@ -45,13 +45,7 @@ namespace CalamityMod.Items.Tools.ClimateChange { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.AncientBattleArmorMaterial); - recipe.AddIngredient(ItemID.AdamantiteBar, 5); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(this); - recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.AncientBattleArmorMaterial); - recipe.AddIngredient(ItemID.TitaniumBar, 5); + recipe.AddRecipeGroup("AnyAdamantiteBar", 5); recipe.AddTile(TileID.Anvils); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Tools/ClimateChange/BloodIdol.cs b/Items/Tools/ClimateChange/BloodIdol.cs index 8b2e16f55d..b191d29a34 100644 --- a/Items/Tools/ClimateChange/BloodIdol.cs +++ b/Items/Tools/ClimateChange/BloodIdol.cs @@ -41,13 +41,7 @@ namespace CalamityMod.Items.Tools.ClimateChange public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 2); - recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this); - recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 2); + recipe.AddRecipeGroup("FetidBloodletting", 2); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); diff --git a/Items/Tools/MarniteObliterator.cs b/Items/Tools/MarniteObliterator.cs index c76001cae1..e4947f0e73 100644 --- a/Items/Tools/MarniteObliterator.cs +++ b/Items/Tools/MarniteObliterator.cs @@ -38,14 +38,7 @@ namespace CalamityMod.Items.Tools public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.PlatinumBar, 3); - recipe.AddIngredient(ItemID.Granite, 5); - recipe.AddIngredient(ItemID.Marble, 5); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(this); - recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.GoldBar, 3); + recipe.AddRecipeGroup("AnyGoldBar", 3); recipe.AddIngredient(ItemID.Granite, 5); recipe.AddIngredient(ItemID.Marble, 5); recipe.AddTile(TileID.Anvils); diff --git a/Items/Weapons/Magic/IonBlaster.cs b/Items/Weapons/Magic/IonBlaster.cs index adc8a9f41e..82eaf50a6d 100644 --- a/Items/Weapons/Magic/IonBlaster.cs +++ b/Items/Weapons/Magic/IonBlaster.cs @@ -53,13 +53,7 @@ namespace CalamityMod.Items.Weapons.Magic { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.SoulofFright, 10); - recipe.AddIngredient(ItemID.AdamantiteBar, 7); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this); - recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.SoulofFright, 10); - recipe.AddIngredient(ItemID.TitaniumBar, 7); + recipe.AddRecipeGroup("AnyAdamantiteBar", 7); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Magic/SoulPiercer.cs b/Items/Weapons/Magic/SoulPiercer.cs index 44c4495c4b..3cb3b7a21b 100644 --- a/Items/Weapons/Magic/SoulPiercer.cs +++ b/Items/Weapons/Magic/SoulPiercer.cs @@ -48,13 +48,7 @@ namespace CalamityMod.Items.Weapons.Magic { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 12); - recipe.AddIngredient(ModContent.ItemType(), 6); - recipe.AddTile(TileID.LunarCraftingStation); - recipe.SetResult(this); - recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 12); - recipe.AddIngredient(ModContent.ItemType(), 6); + recipe.AddRecipeGroup("NForEE", 6); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Melee/CatastropheClaymore.cs b/Items/Weapons/Melee/CatastropheClaymore.cs index 31a29df5f8..65027c211f 100644 --- a/Items/Weapons/Melee/CatastropheClaymore.cs +++ b/Items/Weapons/Melee/CatastropheClaymore.cs @@ -59,18 +59,7 @@ namespace CalamityMod.Items.Weapons.Melee recipe.AddIngredient(ItemID.HallowedBar, 10); recipe.AddIngredient(ItemID.CrystalShard, 15); recipe.AddIngredient(ItemID.SoulofNight, 5); - recipe.AddIngredient(ItemID.CursedFlame, 5); - recipe.AddIngredient(ItemID.SoulofMight, 3); - recipe.AddIngredient(ItemID.SoulofSight, 3); - recipe.AddIngredient(ItemID.SoulofFright, 3); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this); - recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.HallowedBar, 10); - recipe.AddIngredient(ItemID.CrystalShard, 15); - recipe.AddIngredient(ItemID.SoulofNight, 5); - recipe.AddIngredient(ItemID.Ichor, 5); + recipe.AddRecipeGroup("CursedFlameIchor", 5); recipe.AddIngredient(ItemID.SoulofMight, 3); recipe.AddIngredient(ItemID.SoulofSight, 3); recipe.AddIngredient(ItemID.SoulofFright, 3); diff --git a/Items/Weapons/Melee/EssenceFlayer.cs b/Items/Weapons/Melee/EssenceFlayer.cs index a24d3b002f..0976f07661 100644 --- a/Items/Weapons/Melee/EssenceFlayer.cs +++ b/Items/Weapons/Melee/EssenceFlayer.cs @@ -47,13 +47,7 @@ namespace CalamityMod.Items.Weapons.Melee { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 11); - recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddTile(TileID.LunarCraftingStation); - recipe.SetResult(this); - recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 11); - recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddRecipeGroup("NForEE", 5); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Melee/Floodtide.cs b/Items/Weapons/Melee/Floodtide.cs index 39ddd9ac9d..1b2a9fe924 100644 --- a/Items/Weapons/Melee/Floodtide.cs +++ b/Items/Weapons/Melee/Floodtide.cs @@ -59,17 +59,7 @@ namespace CalamityMod.Items.Weapons.Melee ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ItemID.SharkFin, 2); - recipe.AddIngredient(ItemID.AdamantiteBar, 5); - recipe.AddIngredient(ModContent.ItemType(), 10); - recipe.AddIngredient(ModContent.ItemType(), 10); - recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this); - recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddIngredient(ItemID.SharkFin, 2); - recipe.AddIngredient(ItemID.TitaniumBar, 5); + recipe.AddRecipeGroup("AnyAdamantiteBar", 5); recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ModContent.ItemType(), 5); diff --git a/Items/Weapons/Melee/ForsakenSaber.cs b/Items/Weapons/Melee/ForsakenSaber.cs index 0a6654f5b0..21e9788520 100644 --- a/Items/Weapons/Melee/ForsakenSaber.cs +++ b/Items/Weapons/Melee/ForsakenSaber.cs @@ -37,13 +37,7 @@ namespace CalamityMod.Items.Weapons.Melee { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.AncientBattleArmorMaterial, 2); - recipe.AddIngredient(ItemID.AdamantiteBar, 5); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(this); - recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.AncientBattleArmorMaterial, 2); - recipe.AddIngredient(ItemID.TitaniumBar, 5); + recipe.AddRecipeGroup("AnyAdamantiteBar", 5); recipe.AddTile(TileID.Anvils); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Melee/MarniteSpear.cs b/Items/Weapons/Melee/MarniteSpear.cs index 33eb846e4d..4cbf780e06 100644 --- a/Items/Weapons/Melee/MarniteSpear.cs +++ b/Items/Weapons/Melee/MarniteSpear.cs @@ -36,14 +36,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.PlatinumBar, 5); - recipe.AddIngredient(ItemID.Granite, 9); - recipe.AddIngredient(ItemID.Marble, 9); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(this); - recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.GoldBar, 5); + recipe.AddRecipeGroup("AnyGoldBar", 5); recipe.AddIngredient(ItemID.Granite, 9); recipe.AddIngredient(ItemID.Marble, 9); recipe.AddTile(TileID.Anvils); diff --git a/Items/Weapons/Melee/StreamGouge.cs b/Items/Weapons/Melee/StreamGouge.cs index d7d2acb235..174d3f1ba6 100644 --- a/Items/Weapons/Melee/StreamGouge.cs +++ b/Items/Weapons/Melee/StreamGouge.cs @@ -61,13 +61,7 @@ namespace CalamityMod.Items.Weapons.Melee { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 14); - recipe.AddIngredient(ModContent.ItemType(), 7); - recipe.AddTile(TileID.LunarCraftingStation); - recipe.SetResult(this); - recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 14); - recipe.AddIngredient(ModContent.ItemType(), 7); + recipe.AddRecipeGroup("NForEE", 7); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Melee/TheEnforcer.cs b/Items/Weapons/Melee/TheEnforcer.cs index 425e35db63..5c78db58ca 100644 --- a/Items/Weapons/Melee/TheEnforcer.cs +++ b/Items/Weapons/Melee/TheEnforcer.cs @@ -103,13 +103,7 @@ namespace CalamityMod.Items.Weapons.Melee { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 15); - recipe.AddIngredient(ModContent.ItemType(), 7); - recipe.AddTile(TileID.LunarCraftingStation); - recipe.SetResult(this); - recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 15); - recipe.AddIngredient(ModContent.ItemType(), 7); + recipe.AddRecipeGroup("NForEE", 7); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Ranged/CleansingBlaze.cs b/Items/Weapons/Ranged/CleansingBlaze.cs index 0012ef1aaa..7677d818b9 100644 --- a/Items/Weapons/Ranged/CleansingBlaze.cs +++ b/Items/Weapons/Ranged/CleansingBlaze.cs @@ -71,13 +71,7 @@ namespace CalamityMod.Items.Weapons.Ranged { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 12); - recipe.AddIngredient(ModContent.ItemType(), 6); - recipe.AddTile(TileID.LunarCraftingStation); - recipe.SetResult(this); - recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 12); - recipe.AddIngredient(ModContent.ItemType(), 6); + recipe.AddRecipeGroup("NForEE", 6); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Ranged/FirestormCannon.cs b/Items/Weapons/Ranged/FirestormCannon.cs index be6f1c842f..0d265139da 100644 --- a/Items/Weapons/Ranged/FirestormCannon.cs +++ b/Items/Weapons/Ranged/FirestormCannon.cs @@ -97,15 +97,7 @@ namespace CalamityMod.Items.Weapons.Ranged ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.FlareGun); recipe.AddIngredient(ItemID.Boomstick); - recipe.AddIngredient(ItemID.GoldBar, 10); - recipe.AddIngredient(ModContent.ItemType(), 10); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(this); - recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.FlareGun); - recipe.AddIngredient(ItemID.Boomstick); - recipe.AddIngredient(ItemID.PlatinumBar, 10); + recipe.AddRecipeGroup("AnyGoldBar", 10); recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddTile(TileID.Anvils); recipe.SetResult(this); diff --git a/Items/Weapons/Ranged/MagnaStriker.cs b/Items/Weapons/Ranged/MagnaStriker.cs index ddb9c011b1..fcdea5c35c 100644 --- a/Items/Weapons/Ranged/MagnaStriker.cs +++ b/Items/Weapons/Ranged/MagnaStriker.cs @@ -60,15 +60,7 @@ namespace CalamityMod.Items.Weapons.Ranged ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ItemID.AdamantiteBar, 6); - recipe.AddIngredient(ItemID.Ectoplasm, 5); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this); - recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ItemID.TitaniumBar, 6); + recipe.AddRecipeGroup("AnyAdamantiteBar", 6); recipe.AddIngredient(ItemID.Ectoplasm, 5); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); diff --git a/Items/Weapons/Ranged/MarniteRifleSpear.cs b/Items/Weapons/Ranged/MarniteRifleSpear.cs index 801cd15071..f462e8f6af 100644 --- a/Items/Weapons/Ranged/MarniteRifleSpear.cs +++ b/Items/Weapons/Ranged/MarniteRifleSpear.cs @@ -34,14 +34,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.PlatinumBar, 7); - recipe.AddIngredient(ItemID.Granite, 5); - recipe.AddIngredient(ItemID.Marble, 5); - recipe.AddTile(TileID.Anvils); - recipe.SetResult(this); - recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.GoldBar, 7); + recipe.AddRecipeGroup("AnyGoldBar", 7); recipe.AddIngredient(ItemID.Granite, 5); recipe.AddIngredient(ItemID.Marble, 5); recipe.AddTile(TileID.Anvils); diff --git a/Items/Weapons/Ranged/MineralMortar.cs b/Items/Weapons/Ranged/MineralMortar.cs index c5aae36bbb..534c0a9458 100644 --- a/Items/Weapons/Ranged/MineralMortar.cs +++ b/Items/Weapons/Ranged/MineralMortar.cs @@ -43,13 +43,7 @@ namespace CalamityMod.Items.Weapons.Ranged { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.AncientBattleArmorMaterial, 2); - recipe.AddIngredient(ItemID.AdamantiteBar, 13); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this); - recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.AncientBattleArmorMaterial, 2); - recipe.AddIngredient(ItemID.TitaniumBar, 13); + recipe.AddRecipeGroup("AnyAdamantiteBar", 13); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Rogue/ExecutionersBlade.cs b/Items/Weapons/Rogue/ExecutionersBlade.cs index fde584daa2..055b881f69 100644 --- a/Items/Weapons/Rogue/ExecutionersBlade.cs +++ b/Items/Weapons/Rogue/ExecutionersBlade.cs @@ -47,13 +47,7 @@ namespace CalamityMod.Items.Weapons.Rogue { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 11); - recipe.AddIngredient(ModContent.ItemType(), 5); - recipe.AddTile(TileID.LunarCraftingStation); - recipe.SetResult(this); - recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType(), 11); - recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddRecipeGroup("NForEE", 5); recipe.AddTile(TileID.LunarCraftingStation); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Rogue/Sandslasher.cs b/Items/Weapons/Rogue/Sandslasher.cs index 9509e0c61b..322b10499e 100644 --- a/Items/Weapons/Rogue/Sandslasher.cs +++ b/Items/Weapons/Rogue/Sandslasher.cs @@ -57,15 +57,7 @@ namespace CalamityMod.Items.Weapons.Rogue ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType(), 6); - recipe.AddIngredient(ItemID.GoldBar, 10); - recipe.AddIngredient(ItemID.HardenedSand, 25); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this); - recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ModContent.ItemType(), 6); - recipe.AddIngredient(ItemID.PlatinumBar, 10); + recipe.AddRecipeGroup("AnyGoldBar", 10); recipe.AddIngredient(ItemID.HardenedSand, 25); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); diff --git a/Items/Weapons/Rogue/SpearofPaleolith.cs b/Items/Weapons/Rogue/SpearofPaleolith.cs index 2bee0001ca..3012af457d 100644 --- a/Items/Weapons/Rogue/SpearofPaleolith.cs +++ b/Items/Weapons/Rogue/SpearofPaleolith.cs @@ -38,13 +38,7 @@ namespace CalamityMod.Items.Weapons.Rogue { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.AncientBattleArmorMaterial, 2); - recipe.AddIngredient(ItemID.AdamantiteBar, 4); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this); - recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.AncientBattleArmorMaterial, 2); - recipe.AddIngredient(ItemID.TitaniumBar, 4); + recipe.AddRecipeGroup("AnyAdamantiteBar", 4); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/Weapons/Typeless/FiniteUse/Bazooka.cs b/Items/Weapons/Typeless/FiniteUse/Bazooka.cs index b5a6d6f07a..89ef19bf8c 100644 --- a/Items/Weapons/Typeless/FiniteUse/Bazooka.cs +++ b/Items/Weapons/Typeless/FiniteUse/Bazooka.cs @@ -89,15 +89,7 @@ namespace CalamityMod.Items.Weapons.Typeless.FiniteUse recipe.AddIngredient(ItemID.IronBar, 20); recipe.anyIronBar = true; recipe.AddIngredient(ItemID.IllegalGunParts); - recipe.AddIngredient(ItemID.AdamantiteBar, 15); - recipe.AddTile(TileID.MythrilAnvil); - recipe.SetResult(this); - recipe.AddRecipe(); - recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.IronBar, 20); - recipe.anyIronBar = true; - recipe.AddIngredient(ItemID.IllegalGunParts); - recipe.AddIngredient(ItemID.TitaniumBar, 15); + recipe.AddRecipeGroup("AnyAdamantiteBar", 15); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Utilities/CalamityRecipes.cs b/Utilities/CalamityRecipes.cs index 28cb4dc1c5..25f39c522d 100644 --- a/Utilities/CalamityRecipes.cs +++ b/Utilities/CalamityRecipes.cs @@ -303,14 +303,7 @@ namespace CalamityMod // Guide Voodoo Doll ModRecipe r = GetNewRecipe(); r.AddIngredient(ItemID.Leather, 2); - r.AddIngredient(ModContent.ItemType(), 2); - r.AddTile(TileID.Hellforge); - r.SetResult(ItemID.GuideVoodooDoll); - r.AddRecipe(); - - r = GetNewRecipe(); - r.AddIngredient(ItemID.Leather, 2); - r.AddIngredient(ModContent.ItemType(), 2); + r.AddRecipeGroup("FetidBloodletting", 2); r.AddTile(TileID.Hellforge); r.SetResult(ItemID.GuideVoodooDoll); r.AddRecipe(); @@ -400,16 +393,9 @@ namespace CalamityMod r.SetResult(ItemID.EnchantedSword); r.AddRecipe(); - // Muramasa w/ Cobalt Bars + // Muramasa r = GetNewRecipe(); - r.AddIngredient(ItemID.CobaltBar, 15); - r.AddTile(TileID.MythrilAnvil); - r.SetResult(ItemID.Muramasa); - r.AddRecipe(); - - // Muramasa w/ Palladium Bars - r = GetNewRecipe(); - r.AddIngredient(ItemID.PalladiumBar, 15); + r.AddRecipeGroup("AnyCobaltBar", 15); r.AddTile(TileID.MythrilAnvil); r.SetResult(ItemID.Muramasa); r.AddRecipe(); @@ -515,20 +501,11 @@ namespace CalamityMod r.SetResult(ItemID.IceSkates); r.AddRecipe(); - // Lucky Horseshoe w/ Gold Bars + // Lucky Horseshoe r = GetNewRecipe(); r.AddIngredient(ItemID.SunplateBlock, 10); r.AddIngredient(ItemID.Cloud, 10); - r.AddIngredient(ItemID.GoldBar, 5); - r.AddTile(TileID.Anvils); - r.SetResult(ItemID.LuckyHorseshoe); - r.AddRecipe(); - - // Lucky Horseshoe w/ Platinum Bars - r = GetNewRecipe(); - r.AddIngredient(ItemID.SunplateBlock, 10); - r.AddIngredient(ItemID.Cloud, 10); - r.AddIngredient(ItemID.PlatinumBar, 5); + r.AddRecipeGroup("AnyGoldBar", 5); r.AddTile(TileID.Anvils); r.SetResult(ItemID.LuckyHorseshoe); r.AddRecipe(); @@ -583,16 +560,9 @@ namespace CalamityMod // Every base component for the Ankh Shield private static void AddAnkhShieldRecipes() { - // Cobalt Shield w/ Cobalt + // Cobalt Shield ModRecipe r = GetNewRecipe(); - r.AddIngredient(ItemID.CobaltBar, 10); - r.AddTile(TileID.MythrilAnvil); - r.SetResult(ItemID.CobaltShield); - r.AddRecipe(); - - // Cobalt Shield w/ Palladium - r = GetNewRecipe(); - r.AddIngredient(ItemID.PalladiumBar, 10); + r.AddRecipeGroup("AnyCobaltBar", 10); r.AddTile(TileID.MythrilAnvil); r.SetResult(ItemID.CobaltShield); r.AddRecipe(); @@ -748,7 +718,63 @@ namespace CalamityMod public static void AddRecipeGroups() { - RecipeGroup group = new RecipeGroup(() => "Any Silt", new int[] + RecipeGroup group = new RecipeGroup(() => "Any Copper Bar", new int[] + { + ItemID.CopperBar, + ItemID.TinBar + }); + RecipeGroup.RegisterGroup("AnyCopperBar", group); + + group = new RecipeGroup(() => "Any Gold Bar", new int[] + { + ItemID.GoldBar, + ItemID.PlatinumBar + }); + RecipeGroup.RegisterGroup("AnyGoldBar", group); + + group = new RecipeGroup(() => "Any Cobalt Bar", new int[] + { + ItemID.CobaltBar, + ItemID.PalladiumBar + }); + RecipeGroup.RegisterGroup("AnyCobaltBar", group); + + group = new RecipeGroup(() => "Any Adamantite Bar", new int[] + { + ItemID.AdamantiteBar, + ItemID.TitaniumBar + }); + RecipeGroup.RegisterGroup("AnyAdamantiteBar", group); + + group = new RecipeGroup(() => "Nightmare Fuel or Endothermic Energy", new int[] + { + ModContent.ItemType(), + ModContent.ItemType() + }); + RecipeGroup.RegisterGroup("NForEE", group); + + group = new RecipeGroup(() => "Fetid or Bloodletting Essence", new int[] + { + ModContent.ItemType(), + ModContent.ItemType() + }); + RecipeGroup.RegisterGroup("FetidBloodletting", group); + + group = new RecipeGroup(() => "Shadow Scale or Tissue Sample", new int[] + { + ItemID.ShadowScale, + ItemID.TissueSample + }); + RecipeGroup.RegisterGroup("Boss2Material", group); + + group = new RecipeGroup(() => "Cursed Flame or Ichor", new int[] + { + ItemID.CursedFlame, + ItemID.Ichor + }); + RecipeGroup.RegisterGroup("CursedFlameIchor", group); + + group = new RecipeGroup(() => "Any Silt", new int[] { ItemID.SiltBlock, ItemID.SlushBlock