diff --git a/Buffs/Pets/RotomBuff.cs b/Buffs/Pets/RotomBuff.cs new file mode 100644 index 0000000000..a3fc3e925d --- /dev/null +++ b/Buffs/Pets/RotomBuff.cs @@ -0,0 +1,31 @@ +using CalamityMod.Projectiles.Pets; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.Pets +{ + public class RotomBuff : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Electric Troublemaker"); + Description.SetDefault("Lightning never strikes the same place twice"); + Main.buffNoTimeDisplay[Type] = true; + Main.vanityPet[Type] = true; + } + + public override void Update(Player player, ref int buffIndex) + { + player.buffTime[buffIndex] = 18000; + player.Calamity().rotomPet = true; + bool PetProjectileNotSpawned = player.ownedProjectileCounts[ModContent.ProjectileType()] <= 0; + if (PetProjectileNotSpawned && player.whoAmI == Main.myPlayer) + { + float baseDamage = 10f + + (Main.hardMode ? 10f : 0f) + + (NPC.downedMoonlord ? 30f : 0f); + Projectile.NewProjectile(player.position.X + (player.width / 2), player.position.Y + (player.height / 2), 0f, 0f, ModContent.ProjectileType(), (int)(baseDamage * (player.allDamage + player.minionDamage - 1f)), 0f, player.whoAmI, 50f, 0f); + } + } + } +} diff --git a/Buffs/Pets/RotomBuff.png b/Buffs/Pets/RotomBuff.png new file mode 100644 index 0000000000..47ac01e1b0 Binary files /dev/null and b/Buffs/Pets/RotomBuff.png differ diff --git a/Buffs/Summon/ApexSharkBuff.cs b/Buffs/Summon/ApexSharkBuff.cs new file mode 100644 index 0000000000..f6ec84e5e6 --- /dev/null +++ b/Buffs/Summon/ApexSharkBuff.cs @@ -0,0 +1,36 @@ +using CalamityMod.CalPlayer; +using CalamityMod.Projectiles.Summon; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.Summon +{ + public class ApexSharkBuff : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Ancient Mineral Shark"); + Description.SetDefault("Ancient yet so dangerous"); + Main.buffNoTimeDisplay[Type] = true; + Main.buffNoSave[Type] = true; + } + + public override void Update(Player player, ref int buffIndex) + { + CalamityPlayer modPlayer = player.Calamity(); + if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) + { + modPlayer.apexShark = true; + } + if (!modPlayer.apexShark) + { + player.DelBuff(buffIndex); + buffIndex--; + } + else + { + player.buffTime[buffIndex] = 18000; + } + } + } +} diff --git a/Buffs/Summon/ApexSharkBuff.png b/Buffs/Summon/ApexSharkBuff.png new file mode 100644 index 0000000000..c08d502984 Binary files /dev/null and b/Buffs/Summon/ApexSharkBuff.png differ diff --git a/Buffs/Summon/Corroslime.png b/Buffs/Summon/Corroslime.png index c249f7a17c..a25c81cb06 100644 Binary files a/Buffs/Summon/Corroslime.png and b/Buffs/Summon/Corroslime.png differ diff --git a/Buffs/Summon/Crimslime.png b/Buffs/Summon/Crimslime.png index 96d5cf5128..c97a4960ab 100644 Binary files a/Buffs/Summon/Crimslime.png and b/Buffs/Summon/Crimslime.png differ diff --git a/Buffs/Summon/EndoCooperBuff.cs b/Buffs/Summon/EndoCooperBuff.cs new file mode 100644 index 0000000000..965bd795e1 --- /dev/null +++ b/Buffs/Summon/EndoCooperBuff.cs @@ -0,0 +1,36 @@ +using CalamityMod.CalPlayer; +using CalamityMod.Projectiles.Summon; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.Summon +{ + public class EndoCooperBuff : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Endo Cooper"); + Description.SetDefault("The ascened Cooper will protect you"); + Main.buffNoTimeDisplay[Type] = true; + Main.buffNoSave[Type] = true; + } + + public override void Update(Player player, ref int buffIndex) + { + CalamityPlayer modPlayer = player.Calamity(); + if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) + { + modPlayer.endoCooper = true; + } + if (!modPlayer.endoCooper) + { + player.DelBuff(buffIndex); + buffIndex--; + } + else + { + player.buffTime[buffIndex] = 18000; + } + } + } +} diff --git a/Buffs/Summon/EndoCooperBuff.png b/Buffs/Summon/EndoCooperBuff.png new file mode 100644 index 0000000000..95f5c74f6e Binary files /dev/null and b/Buffs/Summon/EndoCooperBuff.png differ diff --git a/Buffs/Summon/SiriusBuff.cs b/Buffs/Summon/SiriusBuff.cs new file mode 100644 index 0000000000..107fb96793 --- /dev/null +++ b/Buffs/Summon/SiriusBuff.cs @@ -0,0 +1,36 @@ +using CalamityMod.CalPlayer; +using CalamityMod.Projectiles.Summon; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Buffs.Summon +{ + public class SiriusBuff : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Sirius"); + Description.SetDefault("A bit too bright, but it helps me"); + Main.buffNoTimeDisplay[Type] = true; + Main.buffNoSave[Type] = true; + } + + public override void Update(Player player, ref int buffIndex) + { + CalamityPlayer modPlayer = player.Calamity(); + if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) + { + modPlayer.sirius = true; + } + if (!modPlayer.sirius) + { + player.DelBuff(buffIndex); + buffIndex--; + } + else + { + player.buffTime[buffIndex] = 18000; + } + } + } +} diff --git a/Buffs/Summon/SiriusBuff.png b/Buffs/Summon/SiriusBuff.png new file mode 100644 index 0000000000..b3389bc825 Binary files /dev/null and b/Buffs/Summon/SiriusBuff.png differ diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 5f6aa55854..72062ccb73 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -1,25 +1,15 @@ using CalamityMod.Buffs; -using CalamityMod.Buffs.Alcohol; using CalamityMod.Buffs.Cooldowns; using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.Pets; using CalamityMod.Buffs.Potions; using CalamityMod.Buffs.StatBuffs; using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Buffs.Summon; using CalamityMod.Dusts; using CalamityMod.Items.Accessories; using CalamityMod.Items.Accessories.Vanity; using CalamityMod.Items.DifficultyItems; -using CalamityMod.Items.Fishing; -using CalamityMod.Items.Fishing.AstralCatches; using CalamityMod.Items.Fishing.BrimstoneCragCatches; -using CalamityMod.Items.Fishing.SulphurCatches; -using CalamityMod.Items.Fishing.SunkenSeaCatches; -using CalamityMod.Items.Fishing.FishingRods; using CalamityMod.Items.Mounts; -using CalamityMod.Items.Pets; -using CalamityMod.Items.Placeables; using CalamityMod.Items.TreasureBags; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; @@ -27,21 +17,17 @@ using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Items.Weapons.Summon; using CalamityMod.NPCs; -using CalamityMod.NPCs.Astral; -using CalamityMod.NPCs.AcidRain; using CalamityMod.NPCs.Calamitas; using CalamityMod.NPCs.DevourerofGods; using CalamityMod.NPCs.Leviathan; using CalamityMod.NPCs.NormalNPCs; using CalamityMod.NPCs.PlaguebringerGoliath; using CalamityMod.NPCs.Providence; -using CalamityMod.NPCs.Signus; using CalamityMod.NPCs.SupremeCalamitas; using CalamityMod.NPCs.Yharon; using CalamityMod.Projectiles.Melee; using CalamityMod.Projectiles.Ranged; using CalamityMod.Projectiles.Rogue; -using CalamityMod.Projectiles.Summon; using CalamityMod.Projectiles.Typeless; using CalamityMod.UI; using CalamityMod.World; @@ -50,7 +36,6 @@ using Microsoft.Xna.Framework.Graphics; using System; using System.Collections.Generic; using System.IO; -using System.Linq; using Terraria; using Terraria.DataStructures; using Terraria.GameInput; @@ -83,6 +68,7 @@ namespace CalamityMod.CalPlayer public int deathCount = 0; public int actualMaxLife = 0; public bool killSpikyBalls = false; + public Projectile lastProjectileHit; // Stat Meter public int[] damageStats = new int[5]; @@ -184,6 +170,7 @@ namespace CalamityMod.CalPlayer public bool perfmini = false; public bool akato = false; public bool leviPet = false; + public bool rotomPet = false; public bool sirenPet = false; public bool fox = false; public bool chibii = false; @@ -507,6 +494,8 @@ namespace CalamityMod.CalPlayer public bool valkyrie = false; public bool slimeGod = false; public bool molluskSet = false; + public bool fearmongerSet = false; + public int fearmongerRegenFrames = 0; public bool daedalusCrystal = false; public bool reaverOrb = false; public bool chaosSpirit = false; @@ -641,7 +630,9 @@ namespace CalamityMod.CalPlayer public bool dCreeper = false; public bool bClot = false; public bool eAxe = false; + public bool endoCooper = false; public bool SPG = false; + public bool sirius = false; public bool aChicken = false; public bool cLamp = false; public bool pGuy = false; @@ -666,6 +657,7 @@ namespace CalamityMod.CalPlayer public bool fClump = false; public bool rDevil = false; public bool aValkyrie = false; + public bool apexShark = false; public bool sGod = false; public bool vUrchin = false; public bool cSpirit = false; @@ -968,6 +960,7 @@ namespace CalamityMod.CalPlayer perfmini = false; akato = false; leviPet = false; + rotomPet = false; sirenPet = false; fox = false; chibii = false; @@ -1033,6 +1026,7 @@ namespace CalamityMod.CalPlayer omegaBlueHentai = false; molluskSet = false; + fearmongerSet = false; ataxiaBolt = false; ataxiaGeyser = false; @@ -1373,7 +1367,10 @@ namespace CalamityMod.CalPlayer dCreeper = false; bClot = false; eAxe = false; + endoCooper = false; + apexShark = false; SPG = false; + sirius = false; aChicken = false; cLamp = false; pGuy = false; @@ -1429,6 +1426,8 @@ namespace CalamityMod.CalPlayer rageMode = false; adrenalineMode = false; + + lastProjectileHit = null; } #endregion @@ -1639,6 +1638,7 @@ namespace CalamityMod.CalPlayer omegaBlueSet = false; omegaBlueCooldown = 0; molluskSet = false; + fearmongerSet = false; daedalusReflect = false; daedalusSplit = false; daedalusAbsorb = false; @@ -1687,6 +1687,8 @@ namespace CalamityMod.CalPlayer bloodflareMage = false; bloodflareSummon = false; bloodflareSummonTimer = 0; + fearmongerSet = false; + fearmongerRegenFrames = 0; xerocSet = false; IBoots = false; elysianFire = false; @@ -1694,6 +1696,8 @@ namespace CalamityMod.CalPlayer elysianGuard = false; #endregion + lastProjectileHit = null; + if (CalamityWorld.bossRushActive) { @@ -1759,10 +1763,7 @@ namespace CalamityMod.CalPlayer bool useHoly = NPC.AnyNPCs(ModContent.NPCType()); player.ManageSpecialBiomeVisuals("CalamityMod:Providence", useHoly); - bool useDark = NPC.AnyNPCs(ModContent.NPCType()); - player.ManageSpecialBiomeVisuals("CalamityMod:Signus", useDark); - - bool useSBrimstone = NPC.AnyNPCs(ModContent.NPCType()); + bool useSBrimstone = NPC.AnyNPCs(ModContent.NPCType()); player.ManageSpecialBiomeVisuals("CalamityMod:SupremeCalamitas", useSBrimstone); bool inAstral = ZoneAstral; @@ -1913,18 +1914,18 @@ namespace CalamityMod.CalPlayer #region InventoryStartup public override void SetupStartInventory(IList items, bool mediumcoreDeath) { - Item createItem(int type) - { - Item i = new Item(); - i.SetDefaults(type); - return i; - } - - if (!mediumcoreDeath) + Item createItem(int type) { + Item i = new Item(); + i.SetDefaults(type); + return i; + } + + if (!mediumcoreDeath) + { + items.Add(createItem(ModContent.ItemType())); items.Add(createItem(ModContent.ItemType())); items.Add(createItem(ModContent.ItemType())); - items.Add(createItem(ModContent.ItemType())); } } #endregion @@ -3026,16 +3027,15 @@ namespace CalamityMod.CalPlayer for (int j = 0; j < 25; j++) { int num = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 173, 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.9f; - 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.9f; + 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; + dust.scale *= 1f + (float)Main.rand.Next(40) * 0.01f; } } player.statLife += 100; @@ -3052,16 +3052,15 @@ namespace CalamityMod.CalPlayer for (int j = 0; j < 50; j++) { int num = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 173, 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.9f; - 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.9f; + 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; + dust.scale *= 1f + (float)Main.rand.Next(40) * 0.01f; } } int heal = draconicSurge ? player.statLifeMax2 : 150; @@ -4259,7 +4258,7 @@ namespace CalamityMod.CalPlayer { if (item.melee) { - damageMult += (DHorHoD ? 2.3 : 2.0); + damageMult += CalamityWorld.death ? (DHorHoD ? 7.6 : 6.8) : (DHorHoD ? 2.3 : 2.0); // Death Mode values: 8.9 and 8.0, rev: 2.3 and 2.0 } } else if (rageMode) @@ -4267,10 +4266,10 @@ namespace CalamityMod.CalPlayer if (item.melee) { double rageDamageBoost = 0.0 + - (rageBoostOne ? 0.15 : 0.0) + - (rageBoostTwo ? 0.15 : 0.0) + - (rageBoostThree ? 0.15 : 0.0); - double rageDamage = (DHorHoD ? 0.65 : 0.5) + rageDamageBoost; + (rageBoostOne ? (CalamityWorld.death ? 0.5 : 0.15) : 0.0) + // Death Mode values: 0.6, rev: 0.15 + (rageBoostTwo ? (CalamityWorld.death ? 0.5 : 0.15) : 0.0) + // Death Mode values: 0.6, rev: 0.15 + (rageBoostThree ? (CalamityWorld.death ? 0.5 : 0.15) : 0.0); // Death Mode values: 0.6, rev: 0.15 + double rageDamage = (CalamityWorld.death ? (DHorHoD ? 2.0 : 1.7) : (DHorHoD ? 0.65 : 0.5)) + rageDamageBoost; // Death Mode values: 2.3 and 2.0, rev: 0.65 and 0.5 damageMult += rageDamage; } } @@ -4278,7 +4277,7 @@ namespace CalamityMod.CalPlayer { if (item.melee) { - double damageMultAdr = 1.5 * (double)adrenalineDmgMult; + double damageMultAdr = (CalamityWorld.death ? 5.0 : 1.5) * (double)adrenalineDmgMult; // Death Mode values: 6, rev: 1.5 damageMult += damageMultAdr; } } @@ -4549,7 +4548,7 @@ namespace CalamityMod.CalPlayer { if (hasClassType) { - damageMult += (DHorHoD ? 2.3 : 2.0); + damageMult += CalamityWorld.death ? (DHorHoD ? 7.6 : 6.8) : (DHorHoD ? 2.3 : 2.0); // Death Mode values: 8.9 and 8.0, rev: 2.3 and 2.0 } } else if (rageMode) @@ -4557,10 +4556,10 @@ namespace CalamityMod.CalPlayer if (hasClassType) { double rageDamageBoost = 0.0 + - (rageBoostOne ? 0.15 : 0.0) + - (rageBoostTwo ? 0.15 : 0.0) + - (rageBoostThree ? 0.15 : 0.0); - double rageDamage = (DHorHoD ? 0.65 : 0.5) + rageDamageBoost; + (rageBoostOne ? (CalamityWorld.death ? 0.5 : 0.15) : 0.0) + // Death Mode values: 0.6, rev: 0.15 + (rageBoostTwo ? (CalamityWorld.death ? 0.5 : 0.15) : 0.0) + // Death Mode values: 0.6, rev: 0.15 + (rageBoostThree ? (CalamityWorld.death ? 0.5 : 0.15) : 0.0); // Death Mode values: 0.6, rev: 0.15 + double rageDamage = (CalamityWorld.death ? (DHorHoD ? 2.0 : 1.7) : (DHorHoD ? 0.65 : 0.5)) + rageDamageBoost; // Death Mode values: 2.3 and 2.0, rev: 0.65 and 0.5 damageMult += rageDamage; } } @@ -4568,7 +4567,7 @@ namespace CalamityMod.CalPlayer { if (hasClassType) { - double damageMultAdr = 1.5 * (double)adrenalineDmgMult; + double damageMultAdr = (CalamityWorld.death ? 5.0 : 1.5) * (double)adrenalineDmgMult; // Death Mode values: 6, rev: 1.5 damageMult += damageMultAdr; } } @@ -4666,7 +4665,8 @@ namespace CalamityMod.CalPlayer #endregion #region MultiplicativeReductions - if (isSummon) + // Fearmonger armor makes you immune to the summoner cross-class nerf + if (isSummon && !fearmongerSet) { if (heldItem.type > 0) { @@ -5522,6 +5522,12 @@ namespace CalamityMod.CalPlayer { damage = (int)((double)damage - ((double)player.statDefense * 0.05)); } + // Fearmonger set provides 15% multiplicative DR that ignores caps during the Holiday Moons. + // To prevent abuse, this effect does not work if there are any bosses alive. + if(fearmongerSet && !areThereAnyDamnBosses && (Main.pumpkinMoon || Main.snowMoon)) + { + damage = (int)(damage * 0.85f); + } if (abyssalDivingSuitPlates) { damage = (int)((double)damage * 0.85); @@ -5633,29 +5639,22 @@ namespace CalamityMod.CalPlayer scaleFactor10 = 1f; } int num626 = Gore.NewGore(new Vector2(player.position.X + (float)(player.width / 2) - 24f, player.position.Y + (float)(player.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13AB6_cp_0 = Main.gore[num626]; - expr_13AB6_cp_0.velocity.X += 1f; - Gore expr_13AD6_cp_0 = Main.gore[num626]; - expr_13AD6_cp_0.velocity.Y += 1f; + Gore gore = Main.gore[num626]; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(player.position.X + (float)(player.width / 2) - 24f, player.position.Y + (float)(player.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13B79_cp_0 = Main.gore[num626]; - expr_13B79_cp_0.velocity.X -= 1f; - Gore expr_13B99_cp_0 = Main.gore[num626]; - expr_13B99_cp_0.velocity.Y += 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(player.position.X + (float)(player.width / 2) - 24f, player.position.Y + (float)(player.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13C3C_cp_0 = Main.gore[num626]; - expr_13C3C_cp_0.velocity.X += 1f; - Gore expr_13C5C_cp_0 = Main.gore[num626]; - expr_13C5C_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y -= 1f; num626 = Gore.NewGore(new Vector2(player.position.X + (float)(player.width / 2) - 24f, player.position.Y + (float)(player.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13CFF_cp_0 = Main.gore[num626]; - expr_13CFF_cp_0.velocity.X -= 1f; - Gore expr_13D1F_cp_0 = Main.gore[num626]; - expr_13D1F_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y -= 1f; } } } @@ -5790,40 +5789,41 @@ namespace CalamityMod.CalPlayer player.AddBuff(ModContent.BuffType(), 300, true); } bool hardMode = Main.hardMode; + int iFramesToAdd = 0; if (player.whoAmI == Main.myPlayer) { if (cTracers && damage > 200) { - player.immuneTime += 60; + iFramesToAdd += 60; } if (godSlayerThrowing && damage > 80) { - player.immuneTime += 30; + iFramesToAdd += 30; } if (statigelSet && damage > 100) { - player.immuneTime += 30; + iFramesToAdd += 30; } if (dAmulet) { if (damage == 1.0) { - player.immuneTime += 10; + iFramesToAdd += 10; } else { - player.immuneTime += 20; + iFramesToAdd += 20; } } if (fabsolVodka) { if (damage == 1.0) { - player.immuneTime += 5; + iFramesToAdd += 5; } else { - player.immuneTime += 10; + iFramesToAdd += 10; } } if (CalamityWorld.bossRushActive && Config.BossRushImmunityFrameCurse) @@ -6114,6 +6114,24 @@ namespace CalamityMod.CalPlayer } } } + if (lastProjectileHit != null) + { + switch (lastProjectileHit.modProjectile.cooldownSlot) + { + case 0: + case 1: + player.hurtCooldowns[lastProjectileHit.modProjectile.cooldownSlot] += iFramesToAdd; + break; + case -1: + default: + player.immuneTime += iFramesToAdd; + break; + } + } + else + { + player.immuneTime += iFramesToAdd; + } } #endregion @@ -6399,7 +6417,7 @@ namespace CalamityMod.CalPlayer Rectangle rect = nPC.getRect(); if (rectangle.Intersects(rect) && (nPC.noTileCollide || player.CanHit(nPC))) { - float num = 50f * player.meleeDamage; + float num = 50f * (player.allDamage + player.meleeDamage - 1f); float num2 = 3f; bool crit = false; if (player.kbGlove) @@ -6447,7 +6465,7 @@ namespace CalamityMod.CalPlayer Rectangle rect = nPC.getRect(); if (rectangle.Intersects(rect) && (nPC.noTileCollide || player.CanHit(nPC))) { - float num = 1500f * player.meleeDamage; + float num = 1500f * (player.allDamage + player.meleeDamage - 1f); float num2 = 15f; bool crit = false; if (player.kbGlove) @@ -6498,7 +6516,7 @@ namespace CalamityMod.CalPlayer Rectangle rect = nPC.getRect(); if (rectangle.Intersects(rect) && (nPC.noTileCollide || player.CanHit(nPC))) { - float num = 500f * player.meleeDamage; + float num = 500f * (player.allDamage + player.meleeDamage - 1f); float num2 = 12f; bool crit = false; if (player.kbGlove) @@ -6548,7 +6566,7 @@ namespace CalamityMod.CalPlayer Rectangle rect = nPC.getRect(); if (rectangle.Intersects(rect) && (nPC.noTileCollide || player.CanHit(nPC))) { - float num = 100f * player.meleeDamage; + float num = 100f * (player.allDamage + player.meleeDamage - 1f); float num2 = 9f; bool crit = false; if (player.kbGlove) @@ -6803,13 +6821,12 @@ namespace CalamityMod.CalPlayer for (int num17 = 0; num17 < 20; num17++) { int num18 = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 235, 0f, 0f, 100, default, 2f); - Dust expr_CDB_cp_0 = Main.dust[num18]; - expr_CDB_cp_0.position.X += (float)Main.rand.Next(-5, 6); - Dust expr_D02_cp_0 = Main.dust[num18]; - expr_D02_cp_0.position.Y += (float)Main.rand.Next(-5, 6); - Main.dust[num18].velocity *= 0.2f; - Main.dust[num18].scale *= 1f + (float)Main.rand.Next(20) * 0.01f; - Main.dust[num18].shader = GameShaders.Armor.GetSecondaryShader(player.cShoe, player); + Dust dust = Main.dust[num18]; + 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.cShoe, player); } return; } @@ -7284,7 +7301,7 @@ namespace CalamityMod.CalPlayer rect.Width = 2; rect.Inflate(6, 12); - float damage = 800f * player.minionDamage; + float damage = 800f * (player.allDamage + player.minionDamage - 1f); float knockback = 10f; int nPCImmuneTime = 30; int playerImmuneTime = 6; @@ -7300,7 +7317,7 @@ namespace CalamityMod.CalPlayer rect2.Width = 2; rect2.Inflate(6, 12); - float damage2 = 50f * player.minionDamage; + float damage2 = 50f * (player.allDamage + player.minionDamage - 1f); float knockback2 = 8f; int nPCImmuneTime2 = 30; int playerImmuneTime2 = 6; @@ -7316,7 +7333,7 @@ namespace CalamityMod.CalPlayer rect2.Width = 2; rect2.Inflate(6, 12); - float damage2 = 25f * player.minionDamage; + float damage2 = 25f * (player.allDamage + player.minionDamage - 1f); float knockback2 = 5f; int nPCImmuneTime2 = 30; int playerImmuneTime2 = 6; @@ -7397,7 +7414,6 @@ namespace CalamityMod.CalPlayer Item item = drawPlayer.inventory[drawPlayer.selectedItem]; if (!drawPlayer.frozen && - ((drawPlayer.itemAnimation > 0 && item.useStyle != 0) || (item.holdStyle > 0 && !drawPlayer.pulley)) && item.type > 0 && !drawPlayer.dead && !item.noUseGraphic && @@ -7420,130 +7436,156 @@ namespace CalamityMod.CalPlayer else effect = SpriteEffects.FlipHorizontally | SpriteEffects.FlipVertically; } + if ((drawPlayer.itemAnimation > 0 && item.useStyle != 0) || (item.holdStyle > 0 && !drawPlayer.pulley)) + { + // Staff + if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || + item.type == ModContent.ItemType()) + { + Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/DeathhailStaffGlow"); + if (item.type == ModContent.ItemType()) + texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/VesuviusGlow"); + else if (item.type == ModContent.ItemType()) + texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/SoulPiercerGlow"); + else if (item.type == ModContent.ItemType()) + texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/FatesRevealGlow"); - // Staff - if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || - item.type == ModContent.ItemType()) - { - Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/DeathhailStaffGlow"); - if (item.type == ModContent.ItemType()) - texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/VesuviusGlow"); - else if (item.type == ModContent.ItemType()) - texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/SoulPiercerGlow"); - else if (item.type == ModContent.ItemType()) - texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/FatesRevealGlow"); + float num104 = drawPlayer.itemRotation + 0.785f * (float)drawPlayer.direction; + int num105 = 0; + Vector2 zero3 = new Vector2(0f, (float)Main.itemTexture[item.type].Height); - float num104 = drawPlayer.itemRotation + 0.785f * (float)drawPlayer.direction; - int num105 = 0; - Vector2 zero3 = new Vector2(0f, (float)Main.itemTexture[item.type].Height); + if (drawPlayer.gravDir == -1f) + { + if (drawPlayer.direction == -1) + { + num104 += 1.57f; + zero3 = new Vector2((float)Main.itemTexture[item.type].Width, 0f); + num105 -= Main.itemTexture[item.type].Width; + } + else + { + num104 -= 1.57f; + zero3 = Vector2.Zero; + } + } + else if (drawPlayer.direction == -1) + { + zero3 = new Vector2((float)Main.itemTexture[item.type].Width, (float)Main.itemTexture[item.type].Height); + num105 -= Main.itemTexture[item.type].Width; + } - if (drawPlayer.gravDir == -1f) - { - if (drawPlayer.direction == -1) - { - num104 += 1.57f; - zero3 = new Vector2((float)Main.itemTexture[item.type].Width, 0f); - num105 -= Main.itemTexture[item.type].Width; - } - else - { - num104 -= 1.57f; - zero3 = Vector2.Zero; - } - } - else if (drawPlayer.direction == -1) - { - zero3 = new Vector2((float)Main.itemTexture[item.type].Width, (float)Main.itemTexture[item.type].Height); - num105 -= Main.itemTexture[item.type].Width; - } + DrawData data = new DrawData(texture, + new Vector2((float)(int)(vector.X - Main.screenPosition.X + zero3.X + (float)num105), (float)(int)(vector.Y - Main.screenPosition.Y + 0f)), + new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, 0, Main.itemTexture[item.type].Width, Main.itemTexture[item.type].Height)), + Color.White, + num104, + zero3, + item.scale, + effect, + 0); - DrawData data = new DrawData(texture, - new Vector2((float)(int)(vector.X - Main.screenPosition.X + zero3.X + (float)num105), (float)(int)(vector.Y - Main.screenPosition.Y + 0f)), - new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, 0, Main.itemTexture[item.type].Width, Main.itemTexture[item.type].Height)), - Color.White, - num104, - zero3, - item.scale, - effect, - 0); + Main.playerDrawData.Add(data); + } - Main.playerDrawData.Add(data); - } + // Bow and Book + else if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || + item.type == ModContent.ItemType()) + { + Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/DeathwindGlow"); + int offsetX = 10; + if (item.type == ModContent.ItemType()) + { + texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/ApotheosisGlow"); + offsetX = 6; + } + else if (item.type == ModContent.ItemType()) + { + texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/CleansingBlazeGlow"); + offsetX = 37; + } + else if (item.type == ModContent.ItemType()) + { + texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/SubsumingVortexGlow"); + offsetX = 9; + } - // Bow and Book - else if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || - item.type == ModContent.ItemType()) - { - Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/DeathwindGlow"); - int offsetX = 10; - if (item.type == ModContent.ItemType()) - { - texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/ApotheosisGlow"); - offsetX = 6; - } - else if (item.type == ModContent.ItemType()) - { - texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Ranged/CleansingBlazeGlow"); - offsetX = 37; - } - else if (item.type == ModContent.ItemType()) - { - texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Magic/SubsumingVortexGlow"); - offsetX = 9; - } + Vector2 vector13 = new Vector2((float)(Main.itemTexture[item.type].Width / 2), (float)(Main.itemTexture[item.type].Height / 2)); + Vector2 vector14 = vector13; + int num107 = (int)vector14.X - offsetX; + vector13.Y = vector14.Y; - Vector2 vector13 = new Vector2((float)(Main.itemTexture[item.type].Width / 2), (float)(Main.itemTexture[item.type].Height / 2)); - Vector2 vector14 = vector13; - int num107 = (int)vector14.X - offsetX; - vector13.Y = vector14.Y; + Vector2 origin4 = new Vector2(-(float)num107, (float)(Main.itemTexture[item.type].Height / 2)); + if (drawPlayer.direction == -1) + origin4 = new Vector2((float)(Main.itemTexture[item.type].Width + num107), (float)(Main.itemTexture[item.type].Height / 2)); - Vector2 origin4 = new Vector2(-(float)num107, (float)(Main.itemTexture[item.type].Height / 2)); - if (drawPlayer.direction == -1) - origin4 = new Vector2((float)(Main.itemTexture[item.type].Width + num107), (float)(Main.itemTexture[item.type].Height / 2)); + DrawData data = new DrawData(texture, + new Vector2((float)(int)(vector.X - Main.screenPosition.X + vector13.X), (float)(int)(vector.Y - Main.screenPosition.Y + vector13.Y)), + new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, 0, Main.itemTexture[item.type].Width, Main.itemTexture[item.type].Height)), + Color.White, + drawPlayer.itemRotation, + origin4, + item.scale, + effect, + 0); - DrawData data = new DrawData(texture, - new Vector2((float)(int)(vector.X - Main.screenPosition.X + vector13.X), (float)(int)(vector.Y - Main.screenPosition.Y + vector13.Y)), - new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, 0, Main.itemTexture[item.type].Width, Main.itemTexture[item.type].Height)), - Color.White, - drawPlayer.itemRotation, - origin4, - item.scale, - effect, - 0); + Main.playerDrawData.Add(data); + } - Main.playerDrawData.Add(data); - } + // Sword + else if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || + item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) + { + Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/ExcelsusGlow"); + if (item.type == ModContent.ItemType()) + texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/EssenceFlayerGlow"); + else if (item.type == ModContent.ItemType()) + texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/TheEnforcerGlow"); + else if (item.type == ModContent.ItemType()) + texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/ElementalExcaliburGlow"); + else if (item.type == ModContent.ItemType()) + texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/TerrorBladeGlow"); + else if (item.type == ModContent.ItemType()) + texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Summon/EtherealSubjugatorGlow"); - // Sword - else if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || - item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) - { - Texture2D texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/ExcelsusGlow"); - if (item.type == ModContent.ItemType()) - texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/EssenceFlayerGlow"); - else if (item.type == ModContent.ItemType()) - texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/TheEnforcerGlow"); - else if (item.type == ModContent.ItemType()) - texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/ElementalExcaliburGlow"); - else if (item.type == ModContent.ItemType()) - texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/TerrorBladeGlow"); - else if (item.type == ModContent.ItemType()) - texture = ModContent.GetTexture("CalamityMod/Items/Weapons/Summon/EtherealSubjugatorGlow"); + float yOffset = drawPlayer.gravDir == -1f ? 0f : (float)Main.itemTexture[item.type].Height; - float yOffset = drawPlayer.gravDir == -1f ? 0f : (float)Main.itemTexture[item.type].Height; + DrawData data = new DrawData(texture, + new Vector2((float)(int)(vector.X - Main.screenPosition.X), (float)(int)(vector.Y - Main.screenPosition.Y)), + new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, 0, Main.itemTexture[item.type].Width, Main.itemTexture[item.type].Height)), + Color.White, + drawPlayer.itemRotation, + new Vector2((float)Main.itemTexture[item.type].Width * 0.5f - (float)Main.itemTexture[item.type].Width * 0.5f * (float)drawPlayer.direction, yOffset) + Vector2.Zero, + item.scale, + effect, + 0); - DrawData data = new DrawData(texture, - new Vector2((float)(int)(vector.X - Main.screenPosition.X), (float)(int)(vector.Y - Main.screenPosition.Y)), - new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, 0, Main.itemTexture[item.type].Width, Main.itemTexture[item.type].Height)), - Color.White, - drawPlayer.itemRotation, - new Vector2((float)Main.itemTexture[item.type].Width * 0.5f - (float)Main.itemTexture[item.type].Width * 0.5f * (float)drawPlayer.direction, yOffset) + Vector2.Zero, - item.scale, - effect, - 0); + Main.playerDrawData.Add(data); + } + } - Main.playerDrawData.Add(data); - } + //NOTE -- This doesn't work and I don't know what I'm doing + + /*Microsoft.Xna.Framework.Color color12 = drawPlayer.GetImmuneAlphaPure(Lighting.GetColor((int) ((double) drawPlayer.position.X + (double) drawPlayer.width * 0.5) / 16, (int) ((double) drawPlayer.position.Y + (double) drawPlayer.height * 0.5) / 16, Microsoft.Xna.Framework.Color.White), drawInfo.shadow);*/ + + if (item.type == ModContent.ItemType()) + //32 is the height of the texture, 14 is the width of the texture + { + Texture2D texture = ModContent.GetTexture("CalamityMod/ExtraTextures/Tanks/FlurrystormCannonTankFull"); + + DrawData data = new DrawData(texture, + new Vector2((float) (int) ((double) drawPlayer.position.X - (double) Main.screenPosition.X + (double) (drawPlayer.width / 2) - (double) (9 * drawPlayer.direction)) + -4f * (float) drawPlayer.direction, + (float) (int) ((double) drawPlayer.position.Y - (double) Main.screenPosition.Y + (double) (drawPlayer.height / 2) + 2.0 * (double) drawPlayer.gravDir + (double) -8f * (double) drawPlayer.gravDir)), + new Microsoft.Xna.Framework.Rectangle?(new Microsoft.Xna.Framework.Rectangle(0, 0, 14, 32)), + Color.White, + drawPlayer.bodyRotation, + new Vector2((float) (14 / 2), + (float) (32 / 2)), + 1f, + effect, + 0); + + Main.playerDrawData.Add(data); + } } }); @@ -7972,7 +8014,7 @@ namespace CalamityMod.CalPlayer fullBright = true; } } - } + } #endregion #region Nurse Modifications diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 55db67b0f9..48aec96df5 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -1,11 +1,9 @@ using CalamityMod.Buffs.Alcohol; using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; using CalamityMod.World; using Microsoft.Xna.Framework; using System; using Terraria; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.CalPlayer @@ -585,10 +583,19 @@ namespace CalamityMod.CalPlayer player.lifeRegen += 2; } + if(modPlayer.fearmongerSet && modPlayer.fearmongerRegenFrames > 0) + { + player.lifeRegen += 14; + player.lifeRegenTime += 7; + if (player.lifeRegenTime < 1800) + player.lifeRegenTime = 1800; + } + if (modPlayer.etherealExtorter || player.ZoneGlowshroom) player.lifeRegen += 1; - if (!player.shinyStone) + // Standing still healing bonuses (all exclusive with vanilla Shiny Stone) + if (!player.shinyStone) { int lifeRegenTimeMaxBoost = CalamityPlayer.areThereAnyDamnBosses ? 450 : 1800; int lifeRegenMaxBoost = CalamityPlayer.areThereAnyDamnBosses ? 1 : 4; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 18816f50f4..09f1e6a9e1 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -39,6 +39,10 @@ namespace CalamityMod.CalPlayer // No category + // Decrease the counter on Fearmonger set turbo regeneration + if (modPlayer.fearmongerRegenFrames > 0) + modPlayer.fearmongerRegenFrames--; + // Reduce the expert debuff time multiplier to the normal mode multiplier if (Config.ExpertDebuffDurationReduction) Main.expertDebuffTime = 1f; @@ -384,7 +388,7 @@ namespace CalamityMod.CalPlayer if (!tentaclesPresent[i]) { float modifier = player.meleeDamage + player.magicDamage + player.rangedDamage + - modPlayer.throwingDamage + player.minionDamage; + modPlayer.throwingDamage + player.minionDamage + ((player.allDamage - 1f) * 5f); modifier /= 5f; int damage = (int)(666 * modifier); @@ -539,16 +543,15 @@ namespace CalamityMod.CalPlayer for (int j = 0; j < 2; j++) { int num = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 157, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 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.9f; - Main.dust[num].noGravity = true; - 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.9f; + dust.noGravity = true; + 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; + dust.scale *= 1f + (float)Main.rand.Next(40) * 0.01f; } } @@ -620,16 +623,15 @@ namespace CalamityMod.CalPlayer for (int j = 0; j < 2; j++) { int num = Dust.NewDust(new Vector2(player.position.X, player.position.Y), player.width, player.height, 5, 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.9f; - Main.dust[num].noGravity = true; - 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.9f; + dust.noGravity = true; + 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; + dust.scale *= 1f + (float)Main.rand.Next(40) * 0.01f; } } } @@ -1207,12 +1209,12 @@ namespace CalamityMod.CalPlayer // Gravistar Sabaton effects if (modPlayer.gSabaton) { - if (modPlayer.gSabatonCooldown <= 0) + if (modPlayer.gSabatonCooldown <= 0 && !player.mount.Active) { - if (player.controlDown && player.releaseDown) + if (player.controlDown && player.releaseDown && player.position.Y != player.oldPosition.Y) { modPlayer.gSabatonFall = 300; - modPlayer.gSabatonCooldown = 480; + modPlayer.gSabatonCooldown = 480; //8 second cooldown player.gravity *= 2f; Projectile.NewProjectile(player.Center.X, player.Center.Y, player.velocity.X, player.velocity.Y, ModContent.ProjectileType(), 0, 0, player.whoAmI); } @@ -2454,7 +2456,7 @@ namespace CalamityMod.CalPlayer { float ai1 = (float)(I * 120); Projectile.NewProjectile(player.Center.X + (float)(Math.Sin(I * 120) * 550), player.Center.Y + (float)(Math.Cos(I * 120) * 550), 0f, 0f, - ModContent.ProjectileType(), (int)((modPlayer.auricSet ? 15000f : 5000f) * player.minionDamage), 1f, player.whoAmI, ai1, 0f); + ModContent.ProjectileType(), (int)((modPlayer.auricSet ? 15000f : 5000f) * (player.allDamage + player.minionDamage - 1f)), 1f, player.whoAmI, ai1, 0f); } } } @@ -2673,7 +2675,7 @@ namespace CalamityMod.CalPlayer player.AddBuff(ModContent.BuffType(), 3600, true); if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 2) - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(232f * player.minionDamage), 2f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(232f * (player.allDamage + player.minionDamage - 1f)), 2f, Main.myPlayer, 0f, 0f); } } @@ -2697,16 +2699,16 @@ namespace CalamityMod.CalPlayer player.AddBuff(ModContent.BuffType(), 3600, true); if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -3f, ModContent.ProjectileType(), (int)(baseDamage * player.minionDamage), 1f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -3f, ModContent.ProjectileType(), (int)(baseDamage * (player.allDamage + player.minionDamage - 1f)), 1f, Main.myPlayer, 0f, 0f); } - if (modPlayer.tarraSummon || modPlayer.bloodflareSummon || modPlayer.godSlayerSummon || modPlayer.silvaSummon || modPlayer.dsSetBonus || modPlayer.omegaBlueSet) + if (modPlayer.tarraSummon || modPlayer.bloodflareSummon || modPlayer.godSlayerSummon || modPlayer.silvaSummon || modPlayer.dsSetBonus || modPlayer.omegaBlueSet || modPlayer.fearmongerSet) { if (player.FindBuffIndex(ModContent.BuffType()) == -1) player.AddBuff(ModContent.BuffType(), 3600, true); if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(baseDamage * player.minionDamage), 1f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(baseDamage * (player.allDamage + player.minionDamage - 1f)), 1f, Main.myPlayer, 0f, 0f); } } } @@ -2734,7 +2736,7 @@ namespace CalamityMod.CalPlayer if (player.whoAmI == Main.myPlayer) { if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, ModContent.ProjectileType(), 25, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, ModContent.ProjectileType(), 15, 0f, Main.myPlayer, 0f, 0f); } } else if (player.ownedProjectileCounts[ModContent.ProjectileType()] != 0) diff --git a/CalamityMod.cs b/CalamityMod.cs index aa2966146b..a7d0ad1a96 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -524,7 +524,10 @@ namespace CalamityMod ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), - ModContent.ProjectileType() + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType() }; projectileMinionList = new List() @@ -870,6 +873,8 @@ namespace CalamityMod ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), ModContent.ItemType() }; @@ -916,6 +921,8 @@ namespace CalamityMod ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), //Cryonic Bar set stuff, could potentially be removed ModContent.ItemType(), ModContent.ItemType(), @@ -1034,6 +1041,9 @@ namespace CalamityMod ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), ModContent.ItemType() }; @@ -1945,8 +1955,6 @@ namespace CalamityMod ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), - ModContent.ProjectileType(), - ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), @@ -1976,6 +1984,8 @@ namespace CalamityMod ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType(), ModContent.ItemType() }; @@ -1992,6 +2002,8 @@ namespace CalamityMod ModContent.ProjectileType(), ModContent.ProjectileType(), ModContent.ProjectileType(), + ModContent.ProjectileType(), + ModContent.ProjectileType(), ModContent.ProjectileType() }; diff --git a/ExtraTextures/Lasers/LaserBegin.png b/ExtraTextures/Lasers/LaserBegin.png new file mode 100644 index 0000000000..dae7de415f Binary files /dev/null and b/ExtraTextures/Lasers/LaserBegin.png differ diff --git a/ExtraTextures/Lasers/LaserEnd.png b/ExtraTextures/Lasers/LaserEnd.png new file mode 100644 index 0000000000..cce9f915f9 Binary files /dev/null and b/ExtraTextures/Lasers/LaserEnd.png differ diff --git a/ExtraTextures/Lasers/LaserMid.png b/ExtraTextures/Lasers/LaserMid.png new file mode 100644 index 0000000000..fcfeb8fe4b Binary files /dev/null and b/ExtraTextures/Lasers/LaserMid.png differ diff --git a/ExtraTextures/Tanks/FlurrystormCannonTankFull.png b/ExtraTextures/Tanks/FlurrystormCannonTankFull.png new file mode 100644 index 0000000000..596a1e863e Binary files /dev/null and b/ExtraTextures/Tanks/FlurrystormCannonTankFull.png differ diff --git a/Gores/BobbitWorm.png b/Gores/BobbitWorm.png index d421321607..eabc92976e 100644 Binary files a/Gores/BobbitWorm.png and b/Gores/BobbitWorm.png differ diff --git a/Gores/BobbitWorm2.png b/Gores/BobbitWorm2.png index a3590cbd8a..b5f8f92565 100644 Binary files a/Gores/BobbitWorm2.png and b/Gores/BobbitWorm2.png differ diff --git a/Gores/BobbitWorm3.png b/Gores/BobbitWorm3.png index 433dccd8f2..4646816deb 100644 Binary files a/Gores/BobbitWorm3.png and b/Gores/BobbitWorm3.png differ diff --git a/Gores/BobbitWorm4.png b/Gores/BobbitWorm4.png index 288fe8c477..affe2ab218 100644 Binary files a/Gores/BobbitWorm4.png and b/Gores/BobbitWorm4.png differ diff --git a/Gores/GiantSquid.png b/Gores/GiantSquid.png index c67bf9e0c6..5c0a3cc557 100644 Binary files a/Gores/GiantSquid.png and b/Gores/GiantSquid.png differ diff --git a/Gores/GiantSquid2.png b/Gores/GiantSquid2.png index 23797b4967..be1d16de9f 100644 Binary files a/Gores/GiantSquid2.png and b/Gores/GiantSquid2.png differ diff --git a/Gores/GiantSquid3.png b/Gores/GiantSquid3.png index 2267863c0f..4cbd87e8b6 100644 Binary files a/Gores/GiantSquid3.png and b/Gores/GiantSquid3.png differ diff --git a/Gores/GiantSquid4.png b/Gores/GiantSquid4.png index 49d7793b80..2020af0ba4 100644 Binary files a/Gores/GiantSquid4.png and b/Gores/GiantSquid4.png differ diff --git a/Gores/HiveMindGores/DankCreeperGore.png b/Gores/HiveMindGores/DankCreeperGore.png index 459b5ba81f..ce7b538cc2 100644 Binary files a/Gores/HiveMindGores/DankCreeperGore.png and b/Gores/HiveMindGores/DankCreeperGore.png differ diff --git a/Gores/HiveMindGores/DankCreeperGore2.png b/Gores/HiveMindGores/DankCreeperGore2.png index b1191eeed5..af7052e2d7 100644 Binary files a/Gores/HiveMindGores/DankCreeperGore2.png and b/Gores/HiveMindGores/DankCreeperGore2.png differ diff --git a/Gores/HiveMindGores/DankCreeperGore3.png b/Gores/HiveMindGores/DankCreeperGore3.png index 562b12d0bc..b60e788026 100644 Binary files a/Gores/HiveMindGores/DankCreeperGore3.png and b/Gores/HiveMindGores/DankCreeperGore3.png differ diff --git a/Gores/ViperFish.png b/Gores/ViperFish.png index ab7a2bfdc4..05d7d4fb67 100644 Binary files a/Gores/ViperFish.png and b/Gores/ViperFish.png differ diff --git a/Gores/ViperFish2.png b/Gores/ViperFish2.png index 41ee3dea2d..d7485cde9e 100644 Binary files a/Gores/ViperFish2.png and b/Gores/ViperFish2.png differ diff --git a/Items/Accessories/EyeoftheStorm.cs b/Items/Accessories/EyeoftheStorm.cs index 66e76f7cc2..430e0a6ddf 100644 --- a/Items/Accessories/EyeoftheStorm.cs +++ b/Items/Accessories/EyeoftheStorm.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Accessories } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(45f * player.minionDamage), 2f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(45f * (player.allDamage + player.minionDamage - 1f)), 2f, Main.myPlayer, 0f, 0f); } } } diff --git a/Items/Accessories/FungalClump.cs b/Items/Accessories/FungalClump.cs index 4898ec3ad6..d217875929 100644 --- a/Items/Accessories/FungalClump.cs +++ b/Items/Accessories/FungalClump.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Items.Accessories } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(10f * player.minionDamage), 1f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(10f * (player.allDamage + player.minionDamage - 1f)), 1f, Main.myPlayer, 0f, 0f); } } } diff --git a/Items/Accessories/GladiatorsLocket.cs b/Items/Accessories/GladiatorsLocket.cs index 03f73999b5..726b2e02f1 100644 --- a/Items/Accessories/GladiatorsLocket.cs +++ b/Items/Accessories/GladiatorsLocket.cs @@ -45,8 +45,8 @@ namespace CalamityMod.Items.Accessories } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(20f * player.minionDamage), 6f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(20f * player.minionDamage), 6f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(20f * (player.allDamage + player.minionDamage - 1f)), 6f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(20f * (player.allDamage + player.minionDamage - 1f)), 6f, Main.myPlayer, 0f, 0f); } } } diff --git a/Items/Accessories/GravistarSabaton.cs b/Items/Accessories/GravistarSabaton.cs index 1c9bcf78cf..90b1b77a11 100644 --- a/Items/Accessories/GravistarSabaton.cs +++ b/Items/Accessories/GravistarSabaton.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Accessories public override void SetStaticDefaults() { DisplayName.SetDefault("Gravistar Sabaton"); - Tooltip.SetDefault("Double tap the DOWN key to increase your fall speed for 5 seconds\n" + + Tooltip.SetDefault("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"); } diff --git a/Items/Accessories/HeartoftheElements.cs b/Items/Accessories/HeartoftheElements.cs index 657df38d32..3e22d38ca2 100644 --- a/Items/Accessories/HeartoftheElements.cs +++ b/Items/Accessories/HeartoftheElements.cs @@ -76,23 +76,23 @@ namespace CalamityMod.Items.Accessories } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)((float)damage * damageMult * player.minionDamage), 2f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)((float)damage * damageMult * (player.allDamage + player.minionDamage - 1f)), 2f, Main.myPlayer, 0f, 0f); } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)((float)damage * damageMult * player.minionDamage), 2f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)((float)damage * damageMult * (player.allDamage + player.minionDamage - 1f)), 2f, Main.myPlayer, 0f, 0f); } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)((float)damage * damageMult * player.minionDamage), 2f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)((float)damage * damageMult * (player.allDamage + player.minionDamage - 1f)), 2f, Main.myPlayer, 0f, 0f); } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)((float)damage * damageMult * player.minionDamage), 2f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)((float)damage * damageMult * (player.allDamage + player.minionDamage - 1f)), 2f, Main.myPlayer, 0f, 0f); } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)((float)damage * damageMult * player.minionDamage), 2f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)((float)damage * damageMult * (player.allDamage + player.minionDamage - 1f)), 2f, Main.myPlayer, 0f, 0f); } } else diff --git a/Items/Accessories/LureofEnthrallment.cs b/Items/Accessories/LureofEnthrallment.cs index 980262d698..ea0b82b9e3 100644 --- a/Items/Accessories/LureofEnthrallment.cs +++ b/Items/Accessories/LureofEnthrallment.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Items.Accessories } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(65f * player.minionDamage), 2f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(65f * (player.allDamage + player.minionDamage - 1f)), 2f, Main.myPlayer, 0f, 0f); } } } diff --git a/Items/Accessories/Nanotech.cs b/Items/Accessories/Nanotech.cs index 6c8860a212..fd26b56a7c 100644 --- a/Items/Accessories/Nanotech.cs +++ b/Items/Accessories/Nanotech.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Accessories if (line2.mod == "Terraria" && line2.Name == "Tooltip0") { line2.text = "Rogue projectiles create nanoblades as they travel\n" + - "Stealth strikes summon lunar flares and sparks on enemy hits\n" + + "Stealth strikes summon nanobeams and sparks on enemy hits\n" + "Stealth strikes have +20 armor penetration, deal 5% more damage, and heal for 1 HP\n" + "Rogue weapons have a chance to instantly kill normal enemies\n" + "5% increased rogue damage, 5% increased rogue crit chance, and 15% increased rogue velocity\n" + diff --git a/Items/Accessories/OrnateShield.cs b/Items/Accessories/OrnateShield.cs index f8711265d5..62eac13dc4 100644 --- a/Items/Accessories/OrnateShield.cs +++ b/Items/Accessories/OrnateShield.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Armor; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -11,6 +12,7 @@ namespace CalamityMod.Items.Accessories public override void SetStaticDefaults() { DisplayName.SetDefault("Ornate Shield"); + Tooltip.SetDefault("Boosted damage reduction and health while wearing the Daedalus armor"); } public override void SetDefaults() @@ -23,6 +25,18 @@ namespace CalamityMod.Items.Accessories item.accessory = true; } + public override void UpdateAccessory(Player player, bool hideVisual) + { + if ((player.armor[0].type == ModContent.ItemType() || player.armor[0].type == ModContent.ItemType() || + player.armor[0].type == ModContent.ItemType() || player.armor[0].type == ModContent.ItemType() || + player.armor[0].type == ModContent.ItemType()) && + player.armor[1].type == ModContent.ItemType() && player.armor[2].type == ModContent.ItemType()) + { + player.endurance += 0.08f; + player.statLifeMax2 += 20; + } + } + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Accessories/PlaguedFuelPack.cs b/Items/Accessories/PlaguedFuelPack.cs index 238b57cecf..7d711ee88a 100644 --- a/Items/Accessories/PlaguedFuelPack.cs +++ b/Items/Accessories/PlaguedFuelPack.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Accessories public override void SetStaticDefaults() { DisplayName.SetDefault("Plagued Fuel Pack"); - Tooltip.SetDefault("*5 increased rogue damage\n" + + Tooltip.SetDefault("5% increased rogue damage\n" + "15% increased rogue projectile velocity\n" + "Press [Hotkey] to consume 25% of your maximum stealth to perform a swift upwards/diagonal dash which leaves a trail of plagued clouds\n" + "This effect has a 3 second cooldown before it can be used again"); diff --git a/Items/Accessories/RoseStone.cs b/Items/Accessories/RoseStone.cs index 69e1e03695..eac8d9cee8 100644 --- a/Items/Accessories/RoseStone.cs +++ b/Items/Accessories/RoseStone.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Items.Accessories } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(45f * player.minionDamage), 2f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(45f * (player.allDamage + player.minionDamage - 1f)), 2f, Main.myPlayer, 0f, 0f); } } } diff --git a/Items/Accessories/ShieldoftheOcean.cs b/Items/Accessories/ShieldoftheOcean.cs index be68e81adc..534b6ef4ae 100644 --- a/Items/Accessories/ShieldoftheOcean.cs +++ b/Items/Accessories/ShieldoftheOcean.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Armor; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -10,7 +11,8 @@ namespace CalamityMod.Items.Accessories public override void SetStaticDefaults() { DisplayName.SetDefault("Shield of the Ocean"); - Tooltip.SetDefault("Increased defense by 5 when submerged in liquid"); + Tooltip.SetDefault("Increased defense by 5 when submerged in liquid\n" + + "Increases movement speed and life regen while wearing the Victide armor"); } public override void SetDefaults() @@ -29,6 +31,14 @@ namespace CalamityMod.Items.Accessories { player.statDefense += 5; } + if ((player.armor[0].type == ModContent.ItemType() || player.armor[0].type == ModContent.ItemType() || + player.armor[0].type == ModContent.ItemType() || player.armor[0].type == ModContent.ItemType() || + player.armor[0].type == ModContent.ItemType()) && + player.armor[1].type == ModContent.ItemType() && player.armor[2].type == ModContent.ItemType()) + { + player.moveSpeed += 0.1f; + player.lifeRegen += 2; + } } public override void AddRecipes() diff --git a/Items/Accessories/StatisNinjaBelt.png b/Items/Accessories/StatisNinjaBelt.png index ca2b4746cb..cbbc61f739 100644 Binary files a/Items/Accessories/StatisNinjaBelt.png and b/Items/Accessories/StatisNinjaBelt.png differ diff --git a/Items/Accessories/TheAmalgam.cs b/Items/Accessories/TheAmalgam.cs index 714d62af2c..2a22ae0f73 100644 --- a/Items/Accessories/TheAmalgam.cs +++ b/Items/Accessories/TheAmalgam.cs @@ -69,7 +69,7 @@ namespace CalamityMod.Items.Accessories } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(1000f * player.minionDamage), 1f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(1000f * (player.allDamage + player.minionDamage - 1f)), 1f, Main.myPlayer, 0f, 0f); } } player.allDamage += 0.15f; diff --git a/Items/Accessories/WifeinaBottle.cs b/Items/Accessories/WifeinaBottle.cs index 015a10e53a..97056ed62c 100644 --- a/Items/Accessories/WifeinaBottle.cs +++ b/Items/Accessories/WifeinaBottle.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Accessories } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(45f * player.minionDamage), 2f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(45f * (player.allDamage + player.minionDamage - 1f)), 2f, Main.myPlayer, 0f, 0f); } } } diff --git a/Items/Accessories/WifeinaBottlewithBoobs.cs b/Items/Accessories/WifeinaBottlewithBoobs.cs index dbc8892f23..75dc6e2000 100644 --- a/Items/Accessories/WifeinaBottlewithBoobs.cs +++ b/Items/Accessories/WifeinaBottlewithBoobs.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Items.Accessories } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(45f * player.minionDamage), 2f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(45f * (player.allDamage + player.minionDamage - 1f)), 2f, Main.myPlayer, 0f, 0f); } } } diff --git a/Items/Armor/AerospecHelmet.cs b/Items/Armor/AerospecHelmet.cs index eab83620c0..495d23c962 100644 --- a/Items/Armor/AerospecHelmet.cs +++ b/Items/Armor/AerospecHelmet.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Items.Armor } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(25f * player.minionDamage), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(25f * (player.allDamage + player.minionDamage - 1f)), 0f, Main.myPlayer, 0f, 0f); } } player.minionDamage += 0.16f; diff --git a/Items/Armor/AstralBreastplate.cs b/Items/Armor/AstralBreastplate.cs index 7d49c5f873..6ebe8b4b0a 100644 --- a/Items/Armor/AstralBreastplate.cs +++ b/Items/Armor/AstralBreastplate.cs @@ -11,7 +11,7 @@ namespace CalamityMod.Items.Armor public override void SetStaticDefaults() { DisplayName.SetDefault("Astral Breastplate"); - Tooltip.SetDefault("+20 max mana and life\n" + + Tooltip.SetDefault("+80 max mana and +20 max life\n" + "+3 max minions\n" + "Creature detection"); } @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Armor public override void UpdateEquip(Player player) { player.statLifeMax2 += 20; - player.statManaMax2 += 20; + player.statManaMax2 += 80; player.maxMinions += 3; player.detectCreature = true; } diff --git a/Items/Armor/AtaxiaHelmet.cs b/Items/Armor/AtaxiaHelmet.cs index 2bafcfb9d9..ab154d3abb 100644 --- a/Items/Armor/AtaxiaHelmet.cs +++ b/Items/Armor/AtaxiaHelmet.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Items.Armor } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(190f * player.minionDamage), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(190f * (player.allDamage + player.minionDamage - 1f)), 0f, Main.myPlayer, 0f, 0f); } } player.minionDamage += 0.4f; diff --git a/Items/Armor/AuricTeslaSpaceHelmet.cs b/Items/Armor/AuricTeslaSpaceHelmet.cs index bbeb2fcd0f..8d9feea085 100644 --- a/Items/Armor/AuricTeslaSpaceHelmet.cs +++ b/Items/Armor/AuricTeslaSpaceHelmet.cs @@ -76,7 +76,7 @@ namespace CalamityMod.Items.Armor } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(3000f * player.minionDamage), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(3000f * (player.allDamage + player.minionDamage - 1f)), 0f, Main.myPlayer, 0f, 0f); } if (player.FindBuffIndex(ModContent.BuffType()) == -1) { @@ -105,7 +105,7 @@ namespace CalamityMod.Items.Armor { maxMinionScale = 10; } - int damage = (int)(35 * ((player.minionDamage * 5 / 3) + (player.minionDamage * 0.46f * (maxMinionScale - 1)))); + int damage = (int)(35 * (((player.allDamage + player.minionDamage - 1f) * 5 / 3) + ((player.allDamage + player.minionDamage - 1f) * 0.46f * (maxMinionScale - 1)))); Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default); Vector2 vector3 = Main.MouseWorld - vector2; diff --git a/Items/Armor/DaedalusHeadgear.cs b/Items/Armor/DaedalusHeadgear.cs index d98f03696a..3f32855caf 100644 --- a/Items/Armor/DaedalusHeadgear.cs +++ b/Items/Armor/DaedalusHeadgear.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Items.Armor } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(95f * player.minionDamage), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(95f * (player.allDamage + player.minionDamage - 1f)), 0f, Main.myPlayer, 0f, 0f); } } player.minionDamage += 0.2f; diff --git a/Items/Armor/FearmongerGreathelm.cs b/Items/Armor/FearmongerGreathelm.cs new file mode 100644 index 0000000000..bd4d624dc0 --- /dev/null +++ b/Items/Armor/FearmongerGreathelm.cs @@ -0,0 +1,105 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Armor +{ + [AutoloadEquip(EquipType.Head)] + public class FearmongerGreathelm : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Fearmonger Greathelm"); + Tooltip.SetDefault("+60 max mana and 10% decreased mana usage\n" + + "10% increased minion damage and +2 max minions\n" + + "Pure terror radiates from your eyes"); + } + + public override void SetDefaults() + { + item.width = 18; + item.height = 18; + item.value = Item.buyPrice(gold: 75); + item.defense = 38; // 132 total + item.Calamity().postMoonLordRarity = 14; + } + + public override void UpdateEquip(Player player) + { + // Don't override the Yoraiz0r's Eye effect if the accessory itself is equipped + if (player.yoraiz0rEye == 0) + player.yoraiz0rEye = 3; + + player.statManaMax2 += 60; + player.maxMinions += 2; + player.minionDamage += 0.1f; + player.manaCost *= 0.9f; + } + + public override bool IsArmorSet(Item head, Item body, Item legs) + { + return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); + } + + public override void ArmorSetShadows(Player player) + { + player.armorEffectDrawOutlines = true; + } + + public override void UpdateArmorSet(Player player) + { + player.setBonus = @"30% increased minion damage +Minions deal full damage while wielding weaponry +Immunity to all forms of frost and flame +All minion attacks grant colossal life regeneration +15% increased damage reduction during the Pumpkin and Frost Moons +This extra damage reduction ignores the soft cap"; + + // This bool encompasses cross-class nerf immunity, colossal life regen on minion attack, and the holiday moon DR + player.Calamity().fearmongerSet = true; + + // All-class armors count as rogue sets, but don't grant stealth bonuses + player.Calamity().wearingRogueArmor = true; + player.minionDamage += 0.3f; + + int[] immuneDebuffs = { + BuffID.OnFire, + BuffID.Frostburn, + BuffID.CursedInferno, + BuffID.ShadowFlame, //doesn't do anything + BuffID.Daybreak, //doesn't do anything + BuffID.Burning, + ModContent.BuffType(), + ModContent.BuffType(), + ModContent.BuffType(), + ModContent.BuffType(), + ModContent.BuffType(), + BuffID.Chilled, + BuffID.Frozen, + ModContent.BuffType(), + }; + for (int i = 0; i < immuneDebuffs.Length; ++i) + player.buffImmune[immuneDebuffs[i]] = true; + + // Constantly emit dim orange light + Lighting.AddLight(player.Center, 0.3f, 0.18f, 0f); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.SpookyHelmet); + recipe.AddIngredient(ModContent.ItemType(), 8); + recipe.AddIngredient(ModContent.ItemType(), 8); + recipe.AddIngredient(ModContent.ItemType(), 8); + recipe.AddIngredient(ItemID.SoulofFright, 8); + recipe.AddTile(ModContent.TileType()); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} \ No newline at end of file diff --git a/Items/Armor/FearmongerGreathelm.png b/Items/Armor/FearmongerGreathelm.png new file mode 100644 index 0000000000..1d98c040ec Binary files /dev/null and b/Items/Armor/FearmongerGreathelm.png differ diff --git a/Items/Armor/FearmongerGreathelm_Head.png b/Items/Armor/FearmongerGreathelm_Head.png new file mode 100644 index 0000000000..1429b823dc Binary files /dev/null and b/Items/Armor/FearmongerGreathelm_Head.png differ diff --git a/Items/Armor/FearmongerGreaves.cs b/Items/Armor/FearmongerGreaves.cs new file mode 100644 index 0000000000..bba444ef4c --- /dev/null +++ b/Items/Armor/FearmongerGreaves.cs @@ -0,0 +1,52 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Armor +{ + [AutoloadEquip(EquipType.Legs)] + public class FearmongerGreaves : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Fearmonger Greaves"); + Tooltip.SetDefault("+2 max minions and 6% increased damage\n" + + "50% increased minion knockback\n" + + "15% increased movement speed\n" + + "Taking damage makes you move very fast for a short time"); + } + + public override void SetDefaults() + { + item.width = 18; + item.height = 18; + item.value = Item.buyPrice(gold: 45); + item.defense = 44; + item.Calamity().postMoonLordRarity = 14; + } + + public override void UpdateEquip(Player player) + { + player.maxMinions += 2; + player.allDamage += 0.06f; + player.minionKB += 0.5f; + player.moveSpeed += 0.15f; + player.panic = true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.SpookyLeggings); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ItemID.SoulofFright, 10); + recipe.AddTile(ModContent.TileType()); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} \ No newline at end of file diff --git a/Items/Armor/FearmongerGreaves.png b/Items/Armor/FearmongerGreaves.png new file mode 100644 index 0000000000..e2c5e68301 Binary files /dev/null and b/Items/Armor/FearmongerGreaves.png differ diff --git a/Items/Armor/FearmongerGreaves_Legs.png b/Items/Armor/FearmongerGreaves_Legs.png new file mode 100644 index 0000000000..3ea1bf4af8 Binary files /dev/null and b/Items/Armor/FearmongerGreaves_Legs.png differ diff --git a/Items/Armor/FearmongerHelmet_Head.png b/Items/Armor/FearmongerHelmet_Head.png new file mode 100644 index 0000000000..1429b823dc Binary files /dev/null and b/Items/Armor/FearmongerHelmet_Head.png differ diff --git a/Items/Armor/FearmongerPlateMail.cs b/Items/Armor/FearmongerPlateMail.cs new file mode 100644 index 0000000000..1f6d21769d --- /dev/null +++ b/Items/Armor/FearmongerPlateMail.cs @@ -0,0 +1,52 @@ +using CalamityMod.CalPlayer; +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Armor +{ + [AutoloadEquip(EquipType.Body)] + public class FearmongerPlateMail : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Fearmonger Plate Mail"); + Tooltip.SetDefault("+100 max life and 8% increased damage reduction\n" + + "+2 max minions\n" + + "5% increased damage and critical strike chance"); + } + + public override void SetDefaults() + { + item.width = 18; + item.height = 18; + item.value = Item.buyPrice(gold: 60); + item.defense = 50; + item.Calamity().postMoonLordRarity = 14; + } + + public override void UpdateEquip(Player player) + { + player.statLifeMax2 += 100; + player.endurance += 0.08f; + player.maxMinions += 2; + player.allDamage += 0.05f; + player.Calamity().AllCritBoost(5); + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.SpookyBreastplate); + recipe.AddIngredient(ModContent.ItemType(), 12); + recipe.AddIngredient(ModContent.ItemType(), 12); + recipe.AddIngredient(ModContent.ItemType(), 12); + recipe.AddIngredient(ItemID.SoulofFright, 12); + recipe.AddTile(ModContent.TileType()); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} \ No newline at end of file diff --git a/Items/Armor/FearmongerPlateMail.png b/Items/Armor/FearmongerPlateMail.png new file mode 100644 index 0000000000..e542e145fb Binary files /dev/null and b/Items/Armor/FearmongerPlateMail.png differ diff --git a/Items/Armor/FearmongerPlateMail_Arms.png b/Items/Armor/FearmongerPlateMail_Arms.png new file mode 100644 index 0000000000..8a91da0e5c Binary files /dev/null and b/Items/Armor/FearmongerPlateMail_Arms.png differ diff --git a/Items/Armor/FearmongerPlateMail_Body.png b/Items/Armor/FearmongerPlateMail_Body.png new file mode 100644 index 0000000000..df6e41ae80 Binary files /dev/null and b/Items/Armor/FearmongerPlateMail_Body.png differ diff --git a/Items/Armor/FearmongerPlateMail_FemaleBody.png b/Items/Armor/FearmongerPlateMail_FemaleBody.png new file mode 100644 index 0000000000..df6e41ae80 Binary files /dev/null and b/Items/Armor/FearmongerPlateMail_FemaleBody.png differ diff --git a/Items/Armor/GodSlayerHornedHelm.cs b/Items/Armor/GodSlayerHornedHelm.cs index e8c2e55867..77318968fb 100644 --- a/Items/Armor/GodSlayerHornedHelm.cs +++ b/Items/Armor/GodSlayerHornedHelm.cs @@ -72,7 +72,7 @@ namespace CalamityMod.Items.Armor { maxMinionScale = 10; } - int damage = (int)(35 * ((player.minionDamage * 5 / 3) + (player.minionDamage * 0.46f * (maxMinionScale - 1)))); + int damage = (int)(35 * (((player.allDamage + player.minionDamage - 1f) * 5 / 3) + ((player.allDamage + player.minionDamage - 1f) * 0.46f * (maxMinionScale - 1)))); Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default); Vector2 vector3 = Main.MouseWorld - vector2; diff --git a/Items/Armor/MolluskShellmet.cs b/Items/Armor/MolluskShellmet.cs index fe9a9d2b9f..26488e824a 100644 --- a/Items/Armor/MolluskShellmet.cs +++ b/Items/Armor/MolluskShellmet.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Items.Armor } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 2) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)((double)1500 * player.minionDamage), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)((double)1500 * (player.allDamage + player.minionDamage - 1f)), 0f, Main.myPlayer, 0f, 0f); } } player.Calamity().wearingRogueArmor = true; diff --git a/Items/Armor/ReaverHelmet.cs b/Items/Armor/ReaverHelmet.cs index 818f1a043d..f51c131c78 100644 --- a/Items/Armor/ReaverHelmet.cs +++ b/Items/Armor/ReaverHelmet.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Items.Armor } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(80f * player.minionDamage), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(80f * (player.allDamage + player.minionDamage - 1f)), 0f, Main.myPlayer, 0f, 0f); } } player.minionDamage += 0.16f; diff --git a/Items/Armor/SilvaHelmet.cs b/Items/Armor/SilvaHelmet.cs index 215aeee412..78307b412f 100644 --- a/Items/Armor/SilvaHelmet.cs +++ b/Items/Armor/SilvaHelmet.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Items.Armor } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(1500f * player.minionDamage), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(1500f * (player.allDamage + player.minionDamage - 1f)), 0f, Main.myPlayer, 0f, 0f); } } player.minionDamage += 0.75f; diff --git a/Items/Armor/StatigelHood.cs b/Items/Armor/StatigelHood.cs index cc4437e822..eaa6b8d86d 100644 --- a/Items/Armor/StatigelHood.cs +++ b/Items/Armor/StatigelHood.cs @@ -51,11 +51,11 @@ namespace CalamityMod.Items.Armor } if (WorldGen.crimson && player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(33f * player.minionDamage), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(33f * (player.allDamage + player.minionDamage - 1f)), 0f, Main.myPlayer, 0f, 0f); } else if (!WorldGen.crimson && player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(33f * player.minionDamage), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(33f * (player.allDamage + player.minionDamage - 1f)), 0f, Main.myPlayer, 0f, 0f); } } } diff --git a/Items/Armor/Vanity/AquaticScourgeMask.cs b/Items/Armor/Vanity/AquaticScourgeMask.cs new file mode 100644 index 0000000000..507e794e0c --- /dev/null +++ b/Items/Armor/Vanity/AquaticScourgeMask.cs @@ -0,0 +1,25 @@ +using Terraria.ModLoader; +namespace CalamityMod.Items.Armor.Vanity +{ + [AutoloadEquip(EquipType.Head)] + public class AquaticScourgeMask : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Aquatic Scourge Mask"); + } + + public override void SetDefaults() + { + item.width = 28; + item.height = 20; + item.rare = 1; + item.vanity = true; + } + + public override bool DrawHead() + { + return false; + } + } +} diff --git a/Items/Armor/Vanity/AquaticScourgeMask.png b/Items/Armor/Vanity/AquaticScourgeMask.png new file mode 100644 index 0000000000..b112d6d836 Binary files /dev/null and b/Items/Armor/Vanity/AquaticScourgeMask.png differ diff --git a/Items/Armor/Vanity/AquaticScourgeMask_Head.png b/Items/Armor/Vanity/AquaticScourgeMask_Head.png new file mode 100644 index 0000000000..6354be6c11 Binary files /dev/null and b/Items/Armor/Vanity/AquaticScourgeMask_Head.png differ diff --git a/Items/Armor/Vanity/BrimstoneWaifuMask.cs b/Items/Armor/Vanity/BrimstoneWaifuMask.cs new file mode 100644 index 0000000000..3dbfed96c5 --- /dev/null +++ b/Items/Armor/Vanity/BrimstoneWaifuMask.cs @@ -0,0 +1,25 @@ +using Terraria.ModLoader; +namespace CalamityMod.Items.Armor.Vanity +{ + [AutoloadEquip(EquipType.Head)] + public class BrimstoneWaifuMask : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Brimstone Elemental Mask"); + } + + public override void SetDefaults() + { + item.width = 30; + item.height = 28; + item.rare = 1; + item.vanity = true; + } + + public override bool DrawHead() + { + return false; + } + } +} diff --git a/Items/Armor/Vanity/BrimstoneWaifuMask.png b/Items/Armor/Vanity/BrimstoneWaifuMask.png new file mode 100644 index 0000000000..9429f292e8 Binary files /dev/null and b/Items/Armor/Vanity/BrimstoneWaifuMask.png differ diff --git a/Items/Armor/Vanity/BrimstoneWaifuMask_Head.png b/Items/Armor/Vanity/BrimstoneWaifuMask_Head.png new file mode 100644 index 0000000000..4efc3563e9 Binary files /dev/null and b/Items/Armor/Vanity/BrimstoneWaifuMask_Head.png differ diff --git a/Items/Armor/Vanity/BumblefuckMask.cs b/Items/Armor/Vanity/BumblefuckMask.cs new file mode 100644 index 0000000000..6e910823dc --- /dev/null +++ b/Items/Armor/Vanity/BumblefuckMask.cs @@ -0,0 +1,25 @@ +using Terraria.ModLoader; +namespace CalamityMod.Items.Armor.Vanity +{ + [AutoloadEquip(EquipType.Head)] + public class BumblefuckMask : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Bumblebirb Mask"); + } + + public override void SetDefaults() + { + item.width = 28; + item.height = 20; + item.rare = 1; + item.vanity = true; + } + + public override bool DrawHead() + { + return false; + } + } +} diff --git a/Items/Armor/Vanity/BumblefuckMask.png b/Items/Armor/Vanity/BumblefuckMask.png new file mode 100644 index 0000000000..3195e97651 Binary files /dev/null and b/Items/Armor/Vanity/BumblefuckMask.png differ diff --git a/Items/Armor/Vanity/BumblefuckMask_Head.png b/Items/Armor/Vanity/BumblefuckMask_Head.png new file mode 100644 index 0000000000..4d94c642e5 Binary files /dev/null and b/Items/Armor/Vanity/BumblefuckMask_Head.png differ diff --git a/Items/Armor/Vanity/CeaselessVoidMask.cs b/Items/Armor/Vanity/CeaselessVoidMask.cs new file mode 100644 index 0000000000..ebf06297c6 --- /dev/null +++ b/Items/Armor/Vanity/CeaselessVoidMask.cs @@ -0,0 +1,26 @@ +using Terraria.ModLoader; + +namespace CalamityMod.Items.Armor.Vanity +{ + [AutoloadEquip(EquipType.Head)] + class CeaselessVoidMask : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ceaseless Void Mask"); + } + + public override void SetDefaults() + { + item.width = 28; + item.height = 20; + item.rare = 1; + item.vanity = true; + } + + public override bool DrawHead() + { + return false; + } + } +} diff --git a/Items/Armor/Vanity/CeaselessVoidMask.png b/Items/Armor/Vanity/CeaselessVoidMask.png new file mode 100644 index 0000000000..546d939764 Binary files /dev/null and b/Items/Armor/Vanity/CeaselessVoidMask.png differ diff --git a/Items/Armor/Vanity/CeaselessVoidMask_Head.png b/Items/Armor/Vanity/CeaselessVoidMask_Head.png new file mode 100644 index 0000000000..915dab26f7 Binary files /dev/null and b/Items/Armor/Vanity/CeaselessVoidMask_Head.png differ diff --git a/Items/Armor/Vanity/DevourerofGodsMask.png b/Items/Armor/Vanity/DevourerofGodsMask.png index d4ffe99b9e..7f86352111 100644 Binary files a/Items/Armor/Vanity/DevourerofGodsMask.png and b/Items/Armor/Vanity/DevourerofGodsMask.png differ diff --git a/Items/Armor/Vanity/DevourerofGodsMask_Head.png b/Items/Armor/Vanity/DevourerofGodsMask_Head.png index 3f6d066edd..e129662899 100644 Binary files a/Items/Armor/Vanity/DevourerofGodsMask_Head.png and b/Items/Armor/Vanity/DevourerofGodsMask_Head.png differ diff --git a/Items/Armor/Vanity/HiveMindMask.png b/Items/Armor/Vanity/HiveMindMask.png index 7d575df3c7..84689ccd2e 100644 Binary files a/Items/Armor/Vanity/HiveMindMask.png and b/Items/Armor/Vanity/HiveMindMask.png differ diff --git a/Items/Armor/Vanity/HiveMindMask_Head.png b/Items/Armor/Vanity/HiveMindMask_Head.png index 5caf675ccb..bc885a76e1 100644 Binary files a/Items/Armor/Vanity/HiveMindMask_Head.png and b/Items/Armor/Vanity/HiveMindMask_Head.png differ diff --git a/Items/Armor/Vanity/PolterghastMask.cs b/Items/Armor/Vanity/PolterghastMask.cs new file mode 100644 index 0000000000..e1aab7801d --- /dev/null +++ b/Items/Armor/Vanity/PolterghastMask.cs @@ -0,0 +1,25 @@ +using Terraria.ModLoader; +namespace CalamityMod.Items.Armor.Vanity +{ + [AutoloadEquip(EquipType.Head)] + public class PolterghastMask : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Polterghast Mask"); + } + + public override void SetDefaults() + { + item.width = 28; + item.height = 20; + item.rare = 1; + item.vanity = true; + } + + public override bool DrawHead() + { + return false; + } + } +} diff --git a/Items/Armor/Vanity/PolterghastMask.png b/Items/Armor/Vanity/PolterghastMask.png new file mode 100644 index 0000000000..ac01df1f6b Binary files /dev/null and b/Items/Armor/Vanity/PolterghastMask.png differ diff --git a/Items/Armor/Vanity/PolterghastMask_Head.png b/Items/Armor/Vanity/PolterghastMask_Head.png new file mode 100644 index 0000000000..0ed260829e Binary files /dev/null and b/Items/Armor/Vanity/PolterghastMask_Head.png differ diff --git a/Items/Armor/Vanity/ProfanedGuardianMask.cs b/Items/Armor/Vanity/ProfanedGuardianMask.cs new file mode 100644 index 0000000000..ccab43ca41 --- /dev/null +++ b/Items/Armor/Vanity/ProfanedGuardianMask.cs @@ -0,0 +1,25 @@ +using Terraria.ModLoader; +namespace CalamityMod.Items.Armor.Vanity +{ + [AutoloadEquip(EquipType.Head)] + public class ProfanedGuardianMask : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Profaned Guardian Mask"); + } + + public override void SetDefaults() + { + item.width = 28; + item.height = 20; + item.rare = 1; + item.vanity = true; + } + + public override bool DrawHead() + { + return false; + } + } +} diff --git a/Items/Armor/Vanity/ProfanedGuardianMask.png b/Items/Armor/Vanity/ProfanedGuardianMask.png new file mode 100644 index 0000000000..453f2d6f5b Binary files /dev/null and b/Items/Armor/Vanity/ProfanedGuardianMask.png differ diff --git a/Items/Armor/Vanity/ProfanedGuardianMask_Head.png b/Items/Armor/Vanity/ProfanedGuardianMask_Head.png new file mode 100644 index 0000000000..e8f8bda484 Binary files /dev/null and b/Items/Armor/Vanity/ProfanedGuardianMask_Head.png differ diff --git a/Items/Armor/Vanity/ProvidenceMask.png b/Items/Armor/Vanity/ProvidenceMask.png index 3eb2c42b9d..d2b2c8893b 100644 Binary files a/Items/Armor/Vanity/ProvidenceMask.png and b/Items/Armor/Vanity/ProvidenceMask.png differ diff --git a/Items/Armor/Vanity/ProvidenceMask_Head.png b/Items/Armor/Vanity/ProvidenceMask_Head.png index 91ce4b416b..75423ac672 100644 Binary files a/Items/Armor/Vanity/ProvidenceMask_Head.png and b/Items/Armor/Vanity/ProvidenceMask_Head.png differ diff --git a/Items/Armor/Vanity/RavagerMask.cs b/Items/Armor/Vanity/RavagerMask.cs new file mode 100644 index 0000000000..1b00b99e4d --- /dev/null +++ b/Items/Armor/Vanity/RavagerMask.cs @@ -0,0 +1,27 @@ +using Terraria.ModLoader; + +namespace CalamityMod.Items.Armor.Vanity +{ + [AutoloadEquip(EquipType.Head)] + class RavagerMask : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ravager Mask"); + } + + public override void SetDefaults() + { + item.width = 28; + item.height = 20; + item.rare = 1; + item.vanity = true; + } + + public override bool DrawHead() + { + return false; + } + } +} + diff --git a/Items/Armor/Vanity/RavagerMask.png b/Items/Armor/Vanity/RavagerMask.png new file mode 100644 index 0000000000..343bf37391 Binary files /dev/null and b/Items/Armor/Vanity/RavagerMask.png differ diff --git a/Items/Armor/Vanity/RavagerMask_Head.png b/Items/Armor/Vanity/RavagerMask_Head.png new file mode 100644 index 0000000000..1d5d7ef6ee Binary files /dev/null and b/Items/Armor/Vanity/RavagerMask_Head.png differ diff --git a/Items/Armor/Vanity/SignusMask.cs b/Items/Armor/Vanity/SignusMask.cs new file mode 100644 index 0000000000..6bc29b369c --- /dev/null +++ b/Items/Armor/Vanity/SignusMask.cs @@ -0,0 +1,27 @@ +using Terraria.ModLoader; + +namespace CalamityMod.Items.Armor.Vanity +{ + [AutoloadEquip(EquipType.Head)] + class SignusMask : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Signus Mask"); + } + + public override void SetDefaults() + { + item.width = 28; + item.height = 20; + item.rare = 1; + item.vanity = true; + } + + public override bool DrawHead() + { + return false; + } + } +} + diff --git a/Items/Armor/Vanity/SignusMask.png b/Items/Armor/Vanity/SignusMask.png new file mode 100644 index 0000000000..40db9836d7 Binary files /dev/null and b/Items/Armor/Vanity/SignusMask.png differ diff --git a/Items/Armor/Vanity/SignusMask_Head.png b/Items/Armor/Vanity/SignusMask_Head.png new file mode 100644 index 0000000000..e0437cbcb6 Binary files /dev/null and b/Items/Armor/Vanity/SignusMask_Head.png differ diff --git a/Items/Armor/Vanity/StormWeaverMask.cs b/Items/Armor/Vanity/StormWeaverMask.cs new file mode 100644 index 0000000000..647c467542 --- /dev/null +++ b/Items/Armor/Vanity/StormWeaverMask.cs @@ -0,0 +1,26 @@ +using Terraria.ModLoader; + +namespace CalamityMod.Items.Armor.Vanity +{ + [AutoloadEquip(EquipType.Head)] + class StormWeaverMask : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Storm Weaver Mask"); + } + + public override void SetDefaults() + { + item.width = 28; + item.height = 20; + item.rare = 1; + item.vanity = true; + } + + public override bool DrawHead() + { + return false; + } + } +} diff --git a/Items/Armor/Vanity/StormWeaverMask.png b/Items/Armor/Vanity/StormWeaverMask.png new file mode 100644 index 0000000000..89ef1cb57d Binary files /dev/null and b/Items/Armor/Vanity/StormWeaverMask.png differ diff --git a/Items/Armor/Vanity/StormWeaverMask_Head.png b/Items/Armor/Vanity/StormWeaverMask_Head.png new file mode 100644 index 0000000000..9e91ea5506 Binary files /dev/null and b/Items/Armor/Vanity/StormWeaverMask_Head.png differ diff --git a/Items/Armor/VictideHelmet.cs b/Items/Armor/VictideHelmet.cs index 8d335e6dd1..27dc554057 100644 --- a/Items/Armor/VictideHelmet.cs +++ b/Items/Armor/VictideHelmet.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Items.Armor } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(7f * player.minionDamage), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(7f * (player.allDamage + player.minionDamage - 1f)), 0f, Main.myPlayer, 0f, 0f); } } player.ignoreWater = true; diff --git a/Items/Armor/XerocMask.cs b/Items/Armor/XerocMask.cs index dc34f65f84..12a2412850 100644 --- a/Items/Armor/XerocMask.cs +++ b/Items/Armor/XerocMask.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Items.Armor modPlayer.xerocSet = true; modPlayer.rogueStealthMax += 1.25f; player.setBonus = "9% increased rogue damage and velocity\n" + - "All projectile types have special effects on enemy hits\n" + + "Rogue projectiles have special effects on enemy hits\n" + "Imbued with cosmic wrath and rage when you are damaged\n" + "Rogue stealth builds while not attacking and not moving, up to a max of 125\n" + "Once you have built max stealth, you will be able to perform a Stealth Strike\n" + diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index d21e91671e..6d1828b32b 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -73,26 +73,26 @@ namespace CalamityMod.Items if (item.type >= ItemID.GreenSolution && item.type <= ItemID.RedSolution) item.value = Item.buyPrice(0, 0, 5, 0); - if (CalamityMod.weaponAutoreuseList.Contains(item.type)) + if (CalamityMod.weaponAutoreuseList?.Contains(item.type) ?? false) item.autoReuse = true; if (item.type == ItemID.PsychoKnife) item.damage *= 4; else if (item.type == ItemID.SpectreStaff) item.damage *= 3; - else if (CalamityMod.doubleDamageBuffList.Contains(item.type)) + else if (CalamityMod.doubleDamageBuffList?.Contains(item.type) ?? false) item.damage *= 2; else if (item.type == ItemID.RainbowRod) item.damage = (int)((double)item.damage * 1.75); - else if (CalamityMod.sixtySixDamageBuffList.Contains(item.type)) + else if (CalamityMod.sixtySixDamageBuffList?.Contains(item.type) ?? false) item.damage = (int)((double)item.damage * 1.66); - else if (CalamityMod.fiftyDamageBuffList.Contains(item.type)) + else if (CalamityMod.fiftyDamageBuffList?.Contains(item.type) ?? false) item.damage = (int)((double)item.damage * 1.5); - else if (CalamityMod.thirtyThreeDamageBuffList.Contains(item.type)) + else if (CalamityMod.thirtyThreeDamageBuffList?.Contains(item.type) ?? false) item.damage = (int)((double)item.damage * 1.33); - else if (CalamityMod.twentyFiveDamageBuffList.Contains(item.type)) + else if (CalamityMod.twentyFiveDamageBuffList?.Contains(item.type) ?? false) item.damage = (int)((double)item.damage * 1.25); - else if (CalamityMod.twentyDamageBuffList.Contains(item.type)) + else if (CalamityMod.twentyDamageBuffList?.Contains(item.type) ?? false) item.damage = (int)((double)item.damage * 1.2); else if (item.type == ItemID.Frostbrand || item.type == ItemID.MagnetSphere) item.damage = (int)((double)item.damage * 1.1); @@ -100,7 +100,7 @@ namespace CalamityMod.Items item.damage = (int)((double)item.damage * 0.95); else if (item.type == ItemID.LastPrism) item.damage = (int)((double)item.damage * 0.85); - else if (CalamityMod.quarterDamageNerfList.Contains(item.type)) + else if (CalamityMod.quarterDamageNerfList?.Contains(item.type) ?? false) item.damage = (int)((double)item.damage * 0.75); if (item.type == ItemID.BookStaff) diff --git a/Items/Fishing/SunkenSeaCatches/RustedJingleBell.cs b/Items/Fishing/SunkenSeaCatches/RustedJingleBell.cs index fc75ce689e..e72a8f5682 100644 --- a/Items/Fishing/SunkenSeaCatches/RustedJingleBell.cs +++ b/Items/Fishing/SunkenSeaCatches/RustedJingleBell.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Fishing.SunkenSeaCatches { DisplayName.SetDefault("Rusted Jingle Bell"); Tooltip.SetDefault("Summons a baby ghost bell light pet\n" + - "Provides a good amount of light while underwater"); + "Provides a moderate amount of light while underwater"); } public override void SetDefaults() diff --git a/Items/LoreItems/KnowledgeAquaticScourge.png b/Items/LoreItems/KnowledgeAquaticScourge.png index 4d7497c375..315b3b7d78 100644 Binary files a/Items/LoreItems/KnowledgeAquaticScourge.png and b/Items/LoreItems/KnowledgeAquaticScourge.png differ diff --git a/Items/LoreItems/KnowledgeAstralInfection.png b/Items/LoreItems/KnowledgeAstralInfection.png index 2976af7e04..b66cbbede5 100644 Binary files a/Items/LoreItems/KnowledgeAstralInfection.png and b/Items/LoreItems/KnowledgeAstralInfection.png differ diff --git a/Items/LoreItems/KnowledgeAstrumAureus.png b/Items/LoreItems/KnowledgeAstrumAureus.png index 2976af7e04..37375a6bda 100644 Binary files a/Items/LoreItems/KnowledgeAstrumAureus.png and b/Items/LoreItems/KnowledgeAstrumAureus.png differ diff --git a/Items/LoreItems/KnowledgeAstrumDeus.png b/Items/LoreItems/KnowledgeAstrumDeus.png index 220c10080b..8b22cb5414 100644 Binary files a/Items/LoreItems/KnowledgeAstrumDeus.png and b/Items/LoreItems/KnowledgeAstrumDeus.png differ diff --git a/Items/LoreItems/KnowledgeBloodMoon.png b/Items/LoreItems/KnowledgeBloodMoon.png index 2976af7e04..1d1718f8d7 100644 Binary files a/Items/LoreItems/KnowledgeBloodMoon.png and b/Items/LoreItems/KnowledgeBloodMoon.png differ diff --git a/Items/LoreItems/KnowledgeBrainofCthulhu.png b/Items/LoreItems/KnowledgeBrainofCthulhu.png index 9156472fcf..f46dfbf162 100644 Binary files a/Items/LoreItems/KnowledgeBrainofCthulhu.png and b/Items/LoreItems/KnowledgeBrainofCthulhu.png differ diff --git a/Items/LoreItems/KnowledgeBrimstoneCrag.png b/Items/LoreItems/KnowledgeBrimstoneCrag.png index 4d7497c375..fefe5fc3f4 100644 Binary files a/Items/LoreItems/KnowledgeBrimstoneCrag.png and b/Items/LoreItems/KnowledgeBrimstoneCrag.png differ diff --git a/Items/LoreItems/KnowledgeBrimstoneElemental.png b/Items/LoreItems/KnowledgeBrimstoneElemental.png index 2976af7e04..efbf311ed4 100644 Binary files a/Items/LoreItems/KnowledgeBrimstoneElemental.png and b/Items/LoreItems/KnowledgeBrimstoneElemental.png differ diff --git a/Items/LoreItems/KnowledgeBumblebirb.png b/Items/LoreItems/KnowledgeBumblebirb.png index 9156472fcf..a4fbadfe27 100644 Binary files a/Items/LoreItems/KnowledgeBumblebirb.png and b/Items/LoreItems/KnowledgeBumblebirb.png differ diff --git a/Items/LoreItems/KnowledgeCalamitas.png b/Items/LoreItems/KnowledgeCalamitas.png index 2976af7e04..6f0dc65751 100644 Binary files a/Items/LoreItems/KnowledgeCalamitas.png and b/Items/LoreItems/KnowledgeCalamitas.png differ diff --git a/Items/LoreItems/KnowledgeCalamitasClone.png b/Items/LoreItems/KnowledgeCalamitasClone.png index 220c10080b..db8279fa7f 100644 Binary files a/Items/LoreItems/KnowledgeCalamitasClone.png and b/Items/LoreItems/KnowledgeCalamitasClone.png differ diff --git a/Items/LoreItems/KnowledgeCorruption.png b/Items/LoreItems/KnowledgeCorruption.png index 2976af7e04..4ae08ff873 100644 Binary files a/Items/LoreItems/KnowledgeCorruption.png and b/Items/LoreItems/KnowledgeCorruption.png differ diff --git a/Items/LoreItems/KnowledgeCrabulon.png b/Items/LoreItems/KnowledgeCrabulon.png index 2976af7e04..c3882f47e4 100644 Binary files a/Items/LoreItems/KnowledgeCrabulon.png and b/Items/LoreItems/KnowledgeCrabulon.png differ diff --git a/Items/LoreItems/KnowledgeCrimson.png b/Items/LoreItems/KnowledgeCrimson.png index 220c10080b..376025b30e 100644 Binary files a/Items/LoreItems/KnowledgeCrimson.png and b/Items/LoreItems/KnowledgeCrimson.png differ diff --git a/Items/LoreItems/KnowledgeCryogen.png b/Items/LoreItems/KnowledgeCryogen.png index 9156472fcf..5e09a7e601 100644 Binary files a/Items/LoreItems/KnowledgeCryogen.png and b/Items/LoreItems/KnowledgeCryogen.png differ diff --git a/Items/LoreItems/KnowledgeDesertScourge.png b/Items/LoreItems/KnowledgeDesertScourge.png index 2976af7e04..f8f66e4666 100644 Binary files a/Items/LoreItems/KnowledgeDesertScourge.png and b/Items/LoreItems/KnowledgeDesertScourge.png differ diff --git a/Items/LoreItems/KnowledgeDestroyer.png b/Items/LoreItems/KnowledgeDestroyer.png index 2976af7e04..c0606a89f4 100644 Binary files a/Items/LoreItems/KnowledgeDestroyer.png and b/Items/LoreItems/KnowledgeDestroyer.png differ diff --git a/Items/LoreItems/KnowledgeDevourerofGods.png b/Items/LoreItems/KnowledgeDevourerofGods.png index 4d7497c375..7bd4c0fad7 100644 Binary files a/Items/LoreItems/KnowledgeDevourerofGods.png and b/Items/LoreItems/KnowledgeDevourerofGods.png differ diff --git a/Items/LoreItems/KnowledgeDukeFishron.png b/Items/LoreItems/KnowledgeDukeFishron.png index 4d7497c375..956bb1da9c 100644 Binary files a/Items/LoreItems/KnowledgeDukeFishron.png and b/Items/LoreItems/KnowledgeDukeFishron.png differ diff --git a/Items/LoreItems/KnowledgeEaterofWorlds.png b/Items/LoreItems/KnowledgeEaterofWorlds.png index 220c10080b..b68d02174a 100644 Binary files a/Items/LoreItems/KnowledgeEaterofWorlds.png and b/Items/LoreItems/KnowledgeEaterofWorlds.png differ diff --git a/Items/LoreItems/KnowledgeEyeofCthulhu.png b/Items/LoreItems/KnowledgeEyeofCthulhu.png index 9156472fcf..86ca932b3c 100644 Binary files a/Items/LoreItems/KnowledgeEyeofCthulhu.png and b/Items/LoreItems/KnowledgeEyeofCthulhu.png differ diff --git a/Items/LoreItems/KnowledgeGolem.png b/Items/LoreItems/KnowledgeGolem.png index 4d7497c375..76dc98974f 100644 Binary files a/Items/LoreItems/KnowledgeGolem.png and b/Items/LoreItems/KnowledgeGolem.png differ diff --git a/Items/LoreItems/KnowledgeHiveMind.png b/Items/LoreItems/KnowledgeHiveMind.png index 4d7497c375..65eb03bead 100644 Binary files a/Items/LoreItems/KnowledgeHiveMind.png and b/Items/LoreItems/KnowledgeHiveMind.png differ diff --git a/Items/LoreItems/KnowledgeKingSlime.png b/Items/LoreItems/KnowledgeKingSlime.png index 4d7497c375..abab44834f 100644 Binary files a/Items/LoreItems/KnowledgeKingSlime.png and b/Items/LoreItems/KnowledgeKingSlime.png differ diff --git a/Items/LoreItems/KnowledgeLeviathanandSiren.png b/Items/LoreItems/KnowledgeLeviathanandSiren.png index 9156472fcf..155928f2bf 100644 Binary files a/Items/LoreItems/KnowledgeLeviathanandSiren.png and b/Items/LoreItems/KnowledgeLeviathanandSiren.png differ diff --git a/Items/LoreItems/KnowledgeLunaticCultist.png b/Items/LoreItems/KnowledgeLunaticCultist.png index 220c10080b..5f55d521f5 100644 Binary files a/Items/LoreItems/KnowledgeLunaticCultist.png and b/Items/LoreItems/KnowledgeLunaticCultist.png differ diff --git a/Items/LoreItems/KnowledgeMechs.png b/Items/LoreItems/KnowledgeMechs.png index 220c10080b..92e38b22c2 100644 Binary files a/Items/LoreItems/KnowledgeMechs.png and b/Items/LoreItems/KnowledgeMechs.png differ diff --git a/Items/LoreItems/KnowledgeMoonLord.png b/Items/LoreItems/KnowledgeMoonLord.png index 4d7497c375..b139537022 100644 Binary files a/Items/LoreItems/KnowledgeMoonLord.png and b/Items/LoreItems/KnowledgeMoonLord.png differ diff --git a/Items/LoreItems/KnowledgeOcean.png b/Items/LoreItems/KnowledgeOcean.png index 4d7497c375..74d0d2b0ce 100644 Binary files a/Items/LoreItems/KnowledgeOcean.png and b/Items/LoreItems/KnowledgeOcean.png differ diff --git a/Items/LoreItems/KnowledgePerforators.png b/Items/LoreItems/KnowledgePerforators.png index 2976af7e04..7080d3ef3d 100644 Binary files a/Items/LoreItems/KnowledgePerforators.png and b/Items/LoreItems/KnowledgePerforators.png differ diff --git a/Items/LoreItems/KnowledgePlaguebringerGoliath.png b/Items/LoreItems/KnowledgePlaguebringerGoliath.png index 9156472fcf..35498a2f1e 100644 Binary files a/Items/LoreItems/KnowledgePlaguebringerGoliath.png and b/Items/LoreItems/KnowledgePlaguebringerGoliath.png differ diff --git a/Items/LoreItems/KnowledgePlantera.png b/Items/LoreItems/KnowledgePlantera.png index 2976af7e04..93781852d5 100644 Binary files a/Items/LoreItems/KnowledgePlantera.png and b/Items/LoreItems/KnowledgePlantera.png differ diff --git a/Items/LoreItems/KnowledgePolterghast.png b/Items/LoreItems/KnowledgePolterghast.png index 2976af7e04..e98141e2db 100644 Binary files a/Items/LoreItems/KnowledgePolterghast.png and b/Items/LoreItems/KnowledgePolterghast.png differ diff --git a/Items/LoreItems/KnowledgeProfanedGuardians.png b/Items/LoreItems/KnowledgeProfanedGuardians.png index 9156472fcf..f624e45db9 100644 Binary files a/Items/LoreItems/KnowledgeProfanedGuardians.png and b/Items/LoreItems/KnowledgeProfanedGuardians.png differ diff --git a/Items/LoreItems/KnowledgeProvidence.png b/Items/LoreItems/KnowledgeProvidence.png index 220c10080b..b947521070 100644 Binary files a/Items/LoreItems/KnowledgeProvidence.png and b/Items/LoreItems/KnowledgeProvidence.png differ diff --git a/Items/LoreItems/KnowledgeQueenBee.png b/Items/LoreItems/KnowledgeQueenBee.png index 220c10080b..d4c74160c2 100644 Binary files a/Items/LoreItems/KnowledgeQueenBee.png and b/Items/LoreItems/KnowledgeQueenBee.png differ diff --git a/Items/LoreItems/KnowledgeRavager.png b/Items/LoreItems/KnowledgeRavager.png index 220c10080b..5c4c603d9c 100644 Binary files a/Items/LoreItems/KnowledgeRavager.png and b/Items/LoreItems/KnowledgeRavager.png differ diff --git a/Items/LoreItems/KnowledgeSentinels.png b/Items/LoreItems/KnowledgeSentinels.png index 2976af7e04..503d18f9a0 100644 Binary files a/Items/LoreItems/KnowledgeSentinels.png and b/Items/LoreItems/KnowledgeSentinels.png differ diff --git a/Items/LoreItems/KnowledgeSkeletron.png b/Items/LoreItems/KnowledgeSkeletron.png index 2976af7e04..d110d7c1f7 100644 Binary files a/Items/LoreItems/KnowledgeSkeletron.png and b/Items/LoreItems/KnowledgeSkeletron.png differ diff --git a/Items/LoreItems/KnowledgeSkeletronPrime.png b/Items/LoreItems/KnowledgeSkeletronPrime.png index 9156472fcf..a5da1acb78 100644 Binary files a/Items/LoreItems/KnowledgeSkeletronPrime.png and b/Items/LoreItems/KnowledgeSkeletronPrime.png differ diff --git a/Items/LoreItems/KnowledgeSlimeGod.png b/Items/LoreItems/KnowledgeSlimeGod.png index 9156472fcf..5dcc068d81 100644 Binary files a/Items/LoreItems/KnowledgeSlimeGod.png and b/Items/LoreItems/KnowledgeSlimeGod.png differ diff --git a/Items/LoreItems/KnowledgeSulphurSea.png b/Items/LoreItems/KnowledgeSulphurSea.png index 220c10080b..8a692695d0 100644 Binary files a/Items/LoreItems/KnowledgeSulphurSea.png and b/Items/LoreItems/KnowledgeSulphurSea.png differ diff --git a/Items/LoreItems/KnowledgeTwins.png b/Items/LoreItems/KnowledgeTwins.png index 4d7497c375..741a79a124 100644 Binary files a/Items/LoreItems/KnowledgeTwins.png and b/Items/LoreItems/KnowledgeTwins.png differ diff --git a/Items/LoreItems/KnowledgeUnderworld.png b/Items/LoreItems/KnowledgeUnderworld.png index 9156472fcf..f1af7c287b 100644 Binary files a/Items/LoreItems/KnowledgeUnderworld.png and b/Items/LoreItems/KnowledgeUnderworld.png differ diff --git a/Items/LoreItems/KnowledgeWallofFlesh.png b/Items/LoreItems/KnowledgeWallofFlesh.png index 4d7497c375..1599732cac 100644 Binary files a/Items/LoreItems/KnowledgeWallofFlesh.png and b/Items/LoreItems/KnowledgeWallofFlesh.png differ diff --git a/Items/LoreItems/KnowledgeYharon.png b/Items/LoreItems/KnowledgeYharon.png index 220c10080b..a1e3043817 100644 Binary files a/Items/LoreItems/KnowledgeYharon.png and b/Items/LoreItems/KnowledgeYharon.png differ diff --git a/Items/Pets/IbarakiBox.cs b/Items/Pets/IbarakiBox.cs index 9f33e787a0..0ebcc5372c 100644 --- a/Items/Pets/IbarakiBox.cs +++ b/Items/Pets/IbarakiBox.cs @@ -15,15 +15,13 @@ namespace CalamityMod.Items.Pets "And waves wash the old moss’ hair…\n" + "Thank you, Goodbye.\n" + "While equipped, the player will spawn with full health rather than half.\n" + - "Summons the Third Sage"); + "Summons the Third Sage\n" + + "Provides a small amount of light in the abyss"); } public override void SetDefaults() { - item.damage = 0; - item.useTime = 20; - item.useAnimation = 20; - item.useStyle = 1; + item.CloneDefaults(ItemID.WispinaBottle); item.noMelee = true; item.width = 36; item.height = 30; diff --git a/Items/Pets/RadiatingCrystal.cs b/Items/Pets/RadiatingCrystal.cs index 0d8fb4d722..87d0aa64c1 100644 --- a/Items/Pets/RadiatingCrystal.cs +++ b/Items/Pets/RadiatingCrystal.cs @@ -12,7 +12,8 @@ namespace CalamityMod.Items.Pets { DisplayName.SetDefault("Radiating Crystal"); Tooltip.SetDefault("Summons a radiator light pet\n" + - "The crystal contains traces of holothurin"); + "The crystal contains traces of holothurin\n" + + "Provides a small amount of light in the abyss"); } public override void SetDefaults() diff --git a/Items/Pets/RotomRemote.cs b/Items/Pets/RotomRemote.cs new file mode 100644 index 0000000000..7afb1b0bdf --- /dev/null +++ b/Items/Pets/RotomRemote.cs @@ -0,0 +1,60 @@ +using CalamityMod.Buffs.Pets; +using CalamityMod.Projectiles.Pets; +using CalamityMod.Items.Placeables; +using CalamityMod.Items.Materials; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Pets +{ + public class RotomRemote : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Trifigelycen Etomer"); + Tooltip.SetDefault("Summons an electric troublemaker\n" + + "Zaps nearby enemies\n" + + "A little note is attached:\n" + + "Thank you, Aloe! Very much appreciated from Ben"); + } + + public override void SetDefaults() + { + item.damage = 0; + item.useTime = 20; + item.useAnimation = 20; + item.useStyle = 1; + item.noMelee = true; + item.width = 30; + item.height = 34; + item.value = Item.buyPrice(0, 4, 0, 0); + item.UseSound = SoundID.Item113; + item.shoot = ModContent.ProjectileType(); + item.buffType = ModContent.BuffType(); + item.rare = 3; + } + + public override void UseStyle(Player player) + { + if (player.whoAmI == Main.myPlayer && player.itemTime == 0) + { + player.AddBuff(item.buffType, 3600, true); + } + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ItemID.IronBar, 10); + recipe.AddIngredient(ModContent.ItemType()); + recipe.anyIronBar = true; + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Pets/RotomRemote.png b/Items/Pets/RotomRemote.png new file mode 100644 index 0000000000..3a06b4687d Binary files /dev/null and b/Items/Pets/RotomRemote.png differ diff --git a/Items/Tools/Gelpick.png b/Items/Tools/Gelpick.png index cac800560a..8ebec5de95 100644 Binary files a/Items/Tools/Gelpick.png and b/Items/Tools/Gelpick.png differ diff --git a/Items/TreasureBags/AquaticScourgeBag.cs b/Items/TreasureBags/AquaticScourgeBag.cs index 02b72b4e8b..fe2b442528 100644 --- a/Items/TreasureBags/AquaticScourgeBag.cs +++ b/Items/TreasureBags/AquaticScourgeBag.cs @@ -10,6 +10,7 @@ using CalamityMod.NPCs.AquaticScourge; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Items.Armor.Vanity; namespace CalamityMod.Items.TreasureBags { @@ -65,7 +66,7 @@ namespace CalamityMod.Items.TreasureBags DropHelper.DropItemChance(player, ModContent.ItemType(), 8); // Vanity - // there is no Aquatic Scourge mask yet + DropHelper.DropItemChance(player, ModContent.ItemType(), 7); // Fishing DropHelper.DropItemChance(player, ItemID.HighTestFishingLine, 10); diff --git a/Items/TreasureBags/AstrumDeusBag.cs b/Items/TreasureBags/AstrumDeusBag.cs index 02bdb23f91..e0444ecd78 100644 --- a/Items/TreasureBags/AstrumDeusBag.cs +++ b/Items/TreasureBags/AstrumDeusBag.cs @@ -49,6 +49,7 @@ namespace CalamityMod.Items.TreasureBags DropHelper.DropItemChance(player, ModContent.ItemType(), 3); DropHelper.DropItemChance(player, ModContent.ItemType(), 3); DropHelper.DropItemChance(player, ModContent.ItemType(), 3); + DropHelper.DropItemChance(player, ModContent.ItemType(), 3); DropHelper.DropItemChance(player, ModContent.ItemType(), DropHelper.RareVariantDropRateInt); // Equipment diff --git a/Items/TreasureBags/BrimstoneWaifuBag.cs b/Items/TreasureBags/BrimstoneWaifuBag.cs index 5848eab5dc..27a400ae65 100644 --- a/Items/TreasureBags/BrimstoneWaifuBag.cs +++ b/Items/TreasureBags/BrimstoneWaifuBag.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Accessories; +using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.Materials; using CalamityMod.Items.Mounts; using CalamityMod.Items.Pets; @@ -59,6 +60,7 @@ namespace CalamityMod.Items.TreasureBags // Vanity DropHelper.DropItemCondition(player, ModContent.ItemType(), CalamityWorld.revenge); + DropHelper.DropItemChance(player, ModContent.ItemType(), 7); } } } diff --git a/Items/TreasureBags/BumblebirbBag.cs b/Items/TreasureBags/BumblebirbBag.cs index cdffbaeb33..e4e06f26f8 100644 --- a/Items/TreasureBags/BumblebirbBag.cs +++ b/Items/TreasureBags/BumblebirbBag.cs @@ -8,6 +8,7 @@ using CalamityMod.NPCs.Bumblebirb; using CalamityMod.World; using Terraria; using Terraria.ModLoader; +using CalamityMod.Items.Armor.Vanity; namespace CalamityMod.Items.TreasureBags { @@ -50,6 +51,9 @@ namespace CalamityMod.Items.TreasureBags // Equipment DropHelper.DropItem(player, ModContent.ItemType()); DropHelper.DropItemCondition(player, ModContent.ItemType(), CalamityWorld.revenge); + + // Vanity + DropHelper.DropItemChance(player, ModContent.ItemType(), 7); } } } diff --git a/Items/TreasureBags/PolterghastBag.cs b/Items/TreasureBags/PolterghastBag.cs index 06c0b65f12..0d81274260 100644 --- a/Items/TreasureBags/PolterghastBag.cs +++ b/Items/TreasureBags/PolterghastBag.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Accessories; +using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.Materials; using CalamityMod.Items.PermanentBoosters; using CalamityMod.Items.Weapons.Magic; @@ -68,7 +69,7 @@ namespace CalamityMod.Items.TreasureBags DropHelper.DropItemCondition(player, ModContent.ItemType(), CalamityWorld.revenge); // Vanity - // there is no Polterghast mask yet + DropHelper.DropItemChance(player, ModContent.ItemType(), 7); } } } diff --git a/Items/TreasureBags/ProvidenceBag.cs b/Items/TreasureBags/ProvidenceBag.cs index 2590fabc0b..56d9e3a24b 100644 --- a/Items/TreasureBags/ProvidenceBag.cs +++ b/Items/TreasureBags/ProvidenceBag.cs @@ -59,9 +59,6 @@ namespace CalamityMod.Items.TreasureBags // Vanity DropHelper.DropItemChance(player, ModContent.ItemType(), 7); - - // Other - DropHelper.DropItem(player, ModContent.ItemType()); } } } diff --git a/Items/TreasureBags/RavagerBag.cs b/Items/TreasureBags/RavagerBag.cs index 04c735702b..f40dfcf0ef 100644 --- a/Items/TreasureBags/RavagerBag.cs +++ b/Items/TreasureBags/RavagerBag.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Accessories; +using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.Materials; using CalamityMod.Items.PermanentBoosters; using CalamityMod.Items.Weapons.Magic; @@ -73,7 +74,7 @@ namespace CalamityMod.Items.TreasureBags DropHelper.DropItemCondition(player, ModContent.ItemType(), CalamityWorld.revenge); // Vanity - // there is no Ravager mask yet + DropHelper.DropItemChance(player, ModContent.ItemType(), 7); } } } diff --git a/Items/TreasureBags/StarterBag.cs b/Items/TreasureBags/StarterBag.cs index 1c308c7207..f7574a0f23 100644 --- a/Items/TreasureBags/StarterBag.cs +++ b/Items/TreasureBags/StarterBag.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.DifficultyItems; using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -36,8 +37,8 @@ namespace CalamityMod.Items.TreasureBags DropHelper.DropItem(player, ItemID.WoodenArrow, 100); DropHelper.DropItem(player, ItemID.AmethystStaff); DropHelper.DropItem(player, ItemID.ManaCrystal); - DropHelper.DropItem(player, ItemID.SlimeStaff); - DropHelper.DropItem(player, ModContent.ItemType(), 150); + DropHelper.DropItem(player, ModContent.ItemType()); + DropHelper.DropItem(player, ModContent.ItemType(), 150); // Tools / Utility DropHelper.DropItem(player, ItemID.CopperHammer); diff --git a/Items/Weapons/Magic/AbyssShocker.cs b/Items/Weapons/Magic/AbyssShocker.cs index 094fea7b29..c2cbffa684 100644 --- a/Items/Weapons/Magic/AbyssShocker.cs +++ b/Items/Weapons/Magic/AbyssShocker.cs @@ -17,19 +17,20 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { - item.damage = 24; + item.damage = 21; item.noMelee = true; item.magic = true; item.channel = true; item.width = 86; item.height = 32; - item.useTime = 50; + item.useTime = 20; item.useAnimation = 20; item.UseSound = SoundID.Item13; item.useStyle = 5; item.mana = 10; item.value = Item.buyPrice(0, 4, 0, 0); item.rare = 3; + item.autoReuse = true; item.Calamity().postMoonLordRarity = 21; item.shoot = ModContent.ProjectileType(); item.shootSpeed = 14f; diff --git a/Items/Weapons/Magic/RecitationoftheBeast.cs b/Items/Weapons/Magic/RecitationoftheBeast.cs new file mode 100644 index 0000000000..44a1baba24 --- /dev/null +++ b/Items/Weapons/Magic/RecitationoftheBeast.cs @@ -0,0 +1,70 @@ +using CalamityMod.Projectiles.Magic; +using CalamityMod.Items.Materials; +using CalamityMod.Tiles.Furniture.CraftingStations; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Magic +{ + public class RecitationoftheBeast : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Recitation of the Beast"); + Tooltip.SetDefault("A thousand years sealed in the demon's realm will teach you a thing or two\n" + + "Summons beast scythes around the player in a small circle,\n" + + "before firing toward the cursor and home in to nearby enemies"); + } + + public override void SetDefaults() + { + item.mana = 24; + item.width = 38; + item.height = 34; + item.damage = 300; + item.crit += 20; + item.noMelee = true; + item.useAnimation = 18; + item.useStyle = 5; + item.useTime = 18; + item.knockBack = 8.5f; + item.UseSound = SoundID.Item8; + item.autoReuse = true; + item.value = Item.buyPrice(1, 80, 0, 0); + item.rare = 10; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 10f; + item.magic = true; + item.Calamity().postMoonLordRarity = 14; + } + + 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 spread = 60f * 0.0174f; + double startAngle = Math.Atan2(speedX, speedY) - spread / 2; + double deltaAngle = spread / 6f; + double offsetAngle; + int i; + for (i = 0; i < 3; i++) + { + offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; + Projectile.NewProjectile(player.Center.X, player.Center.Y, (float)(Math.Sin(offsetAngle) * 2f), (float)(Math.Cos(offsetAngle) * 2f), type, damage, knockBack, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(player.Center.X, player.Center.Y, (float)(-Math.Sin(offsetAngle) * 2f), (float)(-Math.Cos(offsetAngle) * 2f), type, damage, knockBack, Main.myPlayer, 0f, 0f); + } + return false; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.DemonScythe); + recipe.AddIngredient(ModContent.ItemType(), 17); + recipe.AddIngredient(ModContent.ItemType(), 8); + recipe.AddTile(ModContent.TileType()); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Weapons/Magic/RecitationoftheBeast.png b/Items/Weapons/Magic/RecitationoftheBeast.png new file mode 100644 index 0000000000..36374e4f96 Binary files /dev/null and b/Items/Weapons/Magic/RecitationoftheBeast.png differ diff --git a/Items/Weapons/Melee/CosmicShiv.cs b/Items/Weapons/Melee/CosmicShiv.cs index 5c2c58a8ea..fa83a05cd2 100644 --- a/Items/Weapons/Melee/CosmicShiv.cs +++ b/Items/Weapons/Melee/CosmicShiv.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Melee item.width = 44; item.height = 44; - item.damage = 920; + item.damage = 800; item.melee = true; item.knockBack = 9f; diff --git a/Items/Weapons/Melee/DraedonsExoblade.cs b/Items/Weapons/Melee/DraedonsExoblade.cs index 4201d7fe8a..94c8424e76 100644 --- a/Items/Weapons/Melee/DraedonsExoblade.cs +++ b/Items/Weapons/Melee/DraedonsExoblade.cs @@ -1,7 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Ores; using CalamityMod.Projectiles.Melee; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; diff --git a/Items/Weapons/Melee/DragonPow.cs b/Items/Weapons/Melee/DragonPow.cs index f54dd6129a..32cccc271d 100644 --- a/Items/Weapons/Melee/DragonPow.cs +++ b/Items/Weapons/Melee/DragonPow.cs @@ -10,7 +10,7 @@ namespace CalamityMod.Items.Weapons.Melee { public class DragonPow : ModItem { - public static int BaseDamage = 4400; + public static int BaseDamage = 4000; public static float Speed = 13f; public static float ReturnSpeed = 20f; public static float SparkSpeed = 0.6f; diff --git a/Items/Weapons/Melee/ExoGladius.cs b/Items/Weapons/Melee/ExoGladius.cs new file mode 100644 index 0000000000..794de98f0f --- /dev/null +++ b/Items/Weapons/Melee/ExoGladius.cs @@ -0,0 +1,112 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Melee; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Melee +{ + public class ExoGladius : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Exo Gladius"); + Tooltip.SetDefault("Do not underestimate the power of Exoblade's younger brother\n" + + "Striking an enemy with the blade makes you immune for a short time and summons comets from the sky\n" + + "Fires a rainbow orb that summons sword beams on hit"); + } + + public override void SetDefaults() + { + item.useStyle = 3; + item.useTurn = false; + item.useAnimation = 12; + item.useTime = 12; + item.width = 56; + item.height = 56; + item.damage = 3001; + item.melee = true; + item.knockBack = 9.9f; + item.UseSound = SoundID.Item1; + item.useTurn = true; + item.autoReuse = true; + item.value = Item.buyPrice(2, 50, 0, 0); + item.rare = 10; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 19f; + item.Calamity().postMoonLordRarity = 15; + } + + 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, item.shootSpeed * player.direction, 0f, type, damage, knockBack, player.whoAmI, 0f, 0f); + return false; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 4); + recipe.AddTile(ModContent.TileType()); + recipe.SetResult(this); + recipe.AddRecipe(); + } + + public override void MeleeEffects(Player player, Rectangle hitbox) + { + if (Main.rand.NextBool(5)) + { + int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 107); + } + } + + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) + { + if (!player.immune) + { + player.immune = true; + if (player.immuneTime < 10) + player.immuneTime = 10; + if (player.hurtCooldowns[0] < 10) + player.hurtCooldowns[0] = 10; + if (player.hurtCooldowns[1] < 10) + player.hurtCooldowns[1] = 10; + } + + target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.CursedInferno, 120); + target.AddBuff(BuffID.Frostburn, 120); + target.AddBuff(BuffID.OnFire, 120); + target.AddBuff(BuffID.Ichor, 120); + + float x = target.Center.X + (float)Main.rand.Next(-400, 400); + float y = target.Center.Y - (float)Main.rand.Next(500, 800); + Vector2 vector = new Vector2(x, y); + float num15 = target.Center.X + (float)(target.width / 2) - vector.X; + float num16 = target.Center.Y + (float)(target.height / 2) - vector.Y; + num15 += (float)Main.rand.Next(-100, 101); + int num17 = 25; + float num18 = (float)Math.Sqrt((double)(num15 * num15 + num16 * num16)); + num18 = (float)num17 / num18; + num15 *= num18; + num16 *= num18; + if (player.whoAmI == Main.myPlayer) + { + Projectile.NewProjectile(x, y, num15, num16, ModContent.ProjectileType(), (int)(item.damage * (player.allDamage + player.meleeDamage - 1f)), 15f, player.whoAmI, 0f, 0f); + } + } + } +} diff --git a/Items/Weapons/Melee/ExoGladius.png b/Items/Weapons/Melee/ExoGladius.png new file mode 100644 index 0000000000..e1c9f0323b Binary files /dev/null and b/Items/Weapons/Melee/ExoGladius.png differ diff --git a/Items/Weapons/Melee/GeliticBlade.png b/Items/Weapons/Melee/GeliticBlade.png index ec94702f16..0369a046ba 100644 Binary files a/Items/Weapons/Melee/GeliticBlade.png and b/Items/Weapons/Melee/GeliticBlade.png differ diff --git a/Items/Weapons/Melee/Terratomere.cs b/Items/Weapons/Melee/Terratomere.cs index 396db746b7..0577ad78e4 100644 --- a/Items/Weapons/Melee/Terratomere.cs +++ b/Items/Weapons/Melee/Terratomere.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Melee { DisplayName.SetDefault("Terratomere"); Tooltip.SetDefault("Linked to the essence of Terraria\n" + - "Heals the player on enemy hits\n" + + "Heals the player on true melee hits\n" + "Fires a barrage of homing beams that inflict several debuffs"); } diff --git a/Items/Weapons/Melee/TheGodsGambit.png b/Items/Weapons/Melee/TheGodsGambit.png index 6e74d1da77..2d8201ded6 100644 Binary files a/Items/Weapons/Melee/TheGodsGambit.png and b/Items/Weapons/Melee/TheGodsGambit.png differ diff --git a/Items/Weapons/Melee/TheMicrowave.cs b/Items/Weapons/Melee/TheMicrowave.cs index 919f854634..70364e6cb5 100644 --- a/Items/Weapons/Melee/TheMicrowave.cs +++ b/Items/Weapons/Melee/TheMicrowave.cs @@ -10,8 +10,9 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { DisplayName.SetDefault("The Microwave"); - //Tooltip.SetDefault("MMMMMMMMMMMMM"); - Tooltip.SetDefault("Fries nearby enemies with radiation\nAn exceptionally agile yoyo\n'Cooking, Astral Infection style'"); + Tooltip.SetDefault("Fries nearby enemies with radiation\n" + + "An exceptionally agile yoyo\n" + + "Cooking, Astral Infection style"); ItemID.Sets.Yoyo[item.type] = true; ItemID.Sets.GamepadExtraRange[item.type] = 15; ItemID.Sets.GamepadSmartQuickReach[item.type] = true; @@ -22,7 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee item.width = 34; item.height = 34; item.melee = true; - item.damage = 80; + item.damage = 65; item.knockBack = 3f; item.useTime = 22; item.useAnimation = 22; diff --git a/Items/Weapons/Ranged/Alluvion.cs b/Items/Weapons/Ranged/Alluvion.cs index 6e4990f910..448268b588 100644 --- a/Items/Weapons/Ranged/Alluvion.cs +++ b/Items/Weapons/Ranged/Alluvion.cs @@ -74,6 +74,7 @@ namespace CalamityMod.Items.Weapons.Ranged int num121 = Projectile.NewProjectile(vector2.X + value9.X, vector2.Y + value9.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f); Main.projectile[num121].Calamity().forceRanged = true; Main.projectile[num121].noDropItem = true; + Main.projectile[num121].arrow = true; } else { diff --git a/Items/Weapons/Ranged/FlurrystormCannon.cs b/Items/Weapons/Ranged/FlurrystormCannon.cs new file mode 100644 index 0000000000..ce14f9bb15 --- /dev/null +++ b/Items/Weapons/Ranged/FlurrystormCannon.cs @@ -0,0 +1,71 @@ +using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Materials; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Ranged +{ + public class FlurrystormCannon : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Flurrystorm Cannon"); + Tooltip.SetDefault("Fires a chain of snowballs that become faster over time\n" + + "Has a chance to also fire an ice chunk that shatters into shards\n" + + "50% chance to not consume snowballs"); + } + + public override void SetDefaults() + { + item.damage = 12; + item.width = 58; + item.height = 34; + item.useTime = 8; + item.useAnimation = 8; + item.useStyle = 5; + item.knockBack = 1.2f; + item.value = Item.buyPrice(0, 4, 0, 0); + item.rare = 3; + item.UseSound = SoundID.Item11; + item.noMelee = true; + item.noUseGraphic = true; + item.ranged = true; + item.channel = true; + item.autoReuse = true; + item.shoot = ModContent.ProjectileType(); + item.useAmmo = AmmoID.Snowball; + item.Calamity().postMoonLordRarity = 21; + item.shootSpeed = 18f; + } + + 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, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); + return false; + } + + public override bool ConsumeAmmo(Player player) + { + if (Main.rand.Next(0, 100) < 50) + return false; + return true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.SnowballCannon); + recipe.AddIngredient(ModContent.ItemType(), 10); + recipe.AddIngredient(ItemID.Bone, 50); + recipe.AddIngredient(ModContent.ItemType(), 25); + recipe.AddIngredient(ItemID.WaterBucket, 3); + recipe.AddIngredient(ItemID.IllegalGunParts); + recipe.AddTile(TileID.Anvils); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Weapons/Ranged/FlurrystormCannon.png b/Items/Weapons/Ranged/FlurrystormCannon.png new file mode 100644 index 0000000000..049336535e Binary files /dev/null and b/Items/Weapons/Ranged/FlurrystormCannon.png differ diff --git a/Items/Weapons/Ranged/Goobow.cs b/Items/Weapons/Ranged/Goobow.cs index 3e8fc53395..9707f8f76e 100644 --- a/Items/Weapons/Ranged/Goobow.cs +++ b/Items/Weapons/Ranged/Goobow.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.damage = 40; item.ranged = true; item.width = 30; - item.height = 48; + item.height = 50; item.useTime = 20; item.useAnimation = 20; item.useStyle = 5; diff --git a/Items/Weapons/Ranged/Goobow.png b/Items/Weapons/Ranged/Goobow.png index e861989d69..fbec958fc9 100644 Binary files a/Items/Weapons/Ranged/Goobow.png and b/Items/Weapons/Ranged/Goobow.png differ diff --git a/Items/Weapons/Ranged/GunkShot.cs b/Items/Weapons/Ranged/GunkShot.cs index 663255affc..fb967e555c 100644 --- a/Items/Weapons/Ranged/GunkShot.cs +++ b/Items/Weapons/Ranged/GunkShot.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Items.Weapons.Ranged { item.damage = 30; item.ranged = true; - item.width = 42; - item.height = 18; + item.width = 44; + item.height = 30; item.useTime = 32; item.useAnimation = 32; item.useStyle = 5; diff --git a/Items/Weapons/Ranged/GunkShot.png b/Items/Weapons/Ranged/GunkShot.png index e6e0b94e40..c8f9979b94 100644 Binary files a/Items/Weapons/Ranged/GunkShot.png and b/Items/Weapons/Ranged/GunkShot.png differ diff --git a/Items/Weapons/Ranged/HeavenlyGale.cs b/Items/Weapons/Ranged/HeavenlyGale.cs index 488d158d44..7ebf69029a 100644 --- a/Items/Weapons/Ranged/HeavenlyGale.cs +++ b/Items/Weapons/Ranged/HeavenlyGale.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetDefaults() { - item.damage = 585; + item.damage = 570; item.ranged = true; item.width = 44; item.height = 58; diff --git a/Items/Weapons/Ranged/MagnomalyCannon.cs b/Items/Weapons/Ranged/MagnomalyCannon.cs new file mode 100644 index 0000000000..6203417bf3 --- /dev/null +++ b/Items/Weapons/Ranged/MagnomalyCannon.cs @@ -0,0 +1,73 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Typeless; +using CalamityMod.Projectiles.Ranged; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Ranged +{ + public class MagnomalyCannon : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Magnomaly Cannon"); + Tooltip.SetDefault("Launches a powerful exo rocket to nuke anything and everything\n" + + "Rockets are surrounded by an invisible damaging aura and split into damaging beams on hit\n" + + "66% chance to not consume rockets"); + } + + public override void SetDefaults() + { + item.damage = 1301; + item.ranged = true; + item.width = 84; + item.height = 30; + item.useTime = 15; + item.useAnimation = 15; + item.useStyle = 5; + item.noMelee = true; + item.knockBack = 9.5f; + item.UseSound = SoundID.Item11; + item.value = Item.buyPrice(2, 50, 0, 0); + item.rare = 10; + item.autoReuse = true; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 15f; + item.useAmmo = 771; + item.Calamity().postMoonLordRarity = 15; + } + + public override Vector2? HoldoutOffset() + { + return new Vector2(-30, -10); + } + + 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, speedX, speedY, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); + return false; + } + + public override bool ConsumeAmmo(Player player) + { + if (Main.rand.Next(0, 100) < 66) + return false; + return true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ItemID.ElectrosphereLauncher); + recipe.AddIngredient(ModContent.ItemType(), 4); + recipe.AddTile(ModContent.TileType()); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Weapons/Ranged/MagnomalyCannon.png b/Items/Weapons/Ranged/MagnomalyCannon.png new file mode 100644 index 0000000000..e9a97e771c Binary files /dev/null and b/Items/Weapons/Ranged/MagnomalyCannon.png differ diff --git a/Items/Weapons/Ranged/Monsoon.cs b/Items/Weapons/Ranged/Monsoon.cs index 4c1738e0e0..2e616a5911 100644 --- a/Items/Weapons/Ranged/Monsoon.cs +++ b/Items/Weapons/Ranged/Monsoon.cs @@ -67,6 +67,7 @@ namespace CalamityMod.Items.Weapons.Ranged int num121 = Projectile.NewProjectile(vector2.X + value9.X, vector2.Y + value9.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f); Main.projectile[num121].Calamity().forceRanged = true; Main.projectile[num121].noDropItem = true; + Main.projectile[num121].arrow = true; } else { diff --git a/Items/Weapons/Ranged/OverloadedBlaster.cs b/Items/Weapons/Ranged/OverloadedBlaster.cs index 5295ad16e2..230d977a10 100644 --- a/Items/Weapons/Ranged/OverloadedBlaster.cs +++ b/Items/Weapons/Ranged/OverloadedBlaster.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.damage = 16; item.ranged = true; item.width = 42; - item.height = 20; + item.height = 34; item.useTime = 17; item.useAnimation = 17; item.useStyle = 5; diff --git a/Items/Weapons/Ranged/OverloadedBlaster.png b/Items/Weapons/Ranged/OverloadedBlaster.png index 2fc59d956c..1900f8756b 100644 Binary files a/Items/Weapons/Ranged/OverloadedBlaster.png and b/Items/Weapons/Ranged/OverloadedBlaster.png differ diff --git a/Items/Weapons/Ranged/PestilentDefiler.cs b/Items/Weapons/Ranged/PestilentDefiler.cs index eb2b5d68f5..5d356ae7d5 100644 --- a/Items/Weapons/Ranged/PestilentDefiler.cs +++ b/Items/Weapons/Ranged/PestilentDefiler.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.value = Item.buyPrice(0, 80, 0, 0); item.rare = 8; item.UseSound = SoundID.Item40; - item.autoReuse = false; + item.autoReuse = true; item.shootSpeed = 20f; item.shoot = ModContent.ProjectileType(); item.useAmmo = 97; diff --git a/Items/Weapons/Ranged/Starfleet.cs b/Items/Weapons/Ranged/Starfleet.cs index 139df4e8da..65f59c3e34 100644 --- a/Items/Weapons/Ranged/Starfleet.cs +++ b/Items/Weapons/Ranged/Starfleet.cs @@ -18,8 +18,8 @@ namespace CalamityMod.Items.Weapons.Ranged { item.damage = 78; item.ranged = true; - item.width = 80; - item.height = 26; + item.width = 76; + item.height = 36; item.useTime = 55; item.useAnimation = 55; item.useStyle = 5; @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override Vector2? HoldoutOffset() { - return new Vector2(-5, 0); + return new Vector2(-8, -11); } 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/Weapons/Ranged/Starfleet.png b/Items/Weapons/Ranged/Starfleet.png index 4dcca33db0..809984b332 100644 Binary files a/Items/Weapons/Ranged/Starfleet.png and b/Items/Weapons/Ranged/Starfleet.png differ diff --git a/Items/Weapons/Ranged/TitaniumRailgun.cs b/Items/Weapons/Ranged/TitaniumRailgun.cs index c7f9575f38..ca588121bf 100644 --- a/Items/Weapons/Ranged/TitaniumRailgun.cs +++ b/Items/Weapons/Ranged/TitaniumRailgun.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Ranged item.damage = 100; item.ranged = true; item.width = 62; - item.height = 26; + item.height = 32; item.useTime = 25; item.useAnimation = 25; item.useStyle = 5; diff --git a/Items/Weapons/Ranged/TitaniumRailgun.png b/Items/Weapons/Ranged/TitaniumRailgun.png index 7a58e41c3a..869227b094 100644 Binary files a/Items/Weapons/Ranged/TitaniumRailgun.png and b/Items/Weapons/Ranged/TitaniumRailgun.png differ diff --git a/Items/Weapons/Rogue/AlphaVirus.cs b/Items/Weapons/Rogue/AlphaVirus.cs index 929164e8bb..5022651efa 100644 --- a/Items/Weapons/Rogue/AlphaVirus.cs +++ b/Items/Weapons/Rogue/AlphaVirus.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { item.width = 44; - item.damage = 450; + item.damage = 400; item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 31; diff --git a/Items/Weapons/Rogue/BallisticPoisonBomb.cs b/Items/Weapons/Rogue/BallisticPoisonBomb.cs index 2e5f81c6bb..1715ae47ab 100644 --- a/Items/Weapons/Rogue/BallisticPoisonBomb.cs +++ b/Items/Weapons/Rogue/BallisticPoisonBomb.cs @@ -1,6 +1,8 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; +using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -12,7 +14,8 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SetStaticDefaults() { DisplayName.SetDefault("Ballistic Poison Bomb"); - Tooltip.SetDefault("Throws a sticky bomb that explodes into spikes and poison clouds"); + Tooltip.SetDefault("Throws a sticky bomb that explodes into spikes and poison clouds\n" + + "Stealth strikes throw three at once"); } public override void SafeSetDefaults() @@ -35,9 +38,27 @@ namespace CalamityMod.Items.Weapons.Rogue item.Calamity().rogue = 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) + { + if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike + { + int spread = 5; + for (int i = 0; i < 3; i++) + { + Vector2 perturbedspeed = new Vector2(speedX + Main.rand.Next(-3,4), speedY + Main.rand.Next(-3,4)).RotatedBy(MathHelper.ToRadians(spread)); + int proj = Projectile.NewProjectile(position.X, position.Y, perturbedspeed.X, perturbedspeed.Y, type, damage, knockBack, player.whoAmI, 0f, 0f); + Main.projectile[proj].Calamity().stealthStrike = true; + spread -= Main.rand.Next(2,6); + } + return false; + } + return true; + } + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ModContent.ItemType(), 20); recipe.AddIngredient(ModContent.ItemType(), 10); diff --git a/Items/Weapons/Rogue/Celestus.cs b/Items/Weapons/Rogue/Celestus.cs index ec0f234d7a..3ed43aa436 100644 --- a/Items/Weapons/Rogue/Celestus.cs +++ b/Items/Weapons/Rogue/Celestus.cs @@ -1,5 +1,4 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Ores; using CalamityMod.Projectiles.Rogue; using CalamityMod.Tiles.Furniture.CraftingStations; using Microsoft.Xna.Framework; diff --git a/Items/Weapons/Rogue/CrushsawCrasher.cs b/Items/Weapons/Rogue/CrushsawCrasher.cs index eeb9268e64..e1103a68ae 100644 --- a/Items/Weapons/Rogue/CrushsawCrasher.cs +++ b/Items/Weapons/Rogue/CrushsawCrasher.cs @@ -1,5 +1,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; +using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -11,7 +13,8 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SetStaticDefaults() { DisplayName.SetDefault("Crushsaw Crasher"); - Tooltip.SetDefault("Throws bouncing axes"); + Tooltip.SetDefault("Throws bouncing axes\n" + + "Stealth strikes throw five at once"); } public override void SafeSetDefaults() @@ -32,6 +35,25 @@ namespace CalamityMod.Items.Weapons.Rogue item.Calamity().rogue = 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) + { + if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike + { + int spread = 3; + for (int i = 0; i < 5; i++) + { + Vector2 perturbedspeed = new Vector2(speedX + Main.rand.Next(-3,4), speedY + Main.rand.Next(-3,4)).RotatedBy(MathHelper.ToRadians(spread)); + int proj = Projectile.NewProjectile(position.X, position.Y, perturbedspeed.X, perturbedspeed.Y, type, damage, knockBack, player.whoAmI, 0f, 0f); + Main.projectile[proj].Calamity().stealthStrike = true; + Main.projectile[proj].usesLocalNPCImmunity = true; + Main.projectile[proj].localNPCHitCooldown = 10; + spread -= Main.rand.Next(1,4); + } + return false; + } + return true; + } + public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { target.AddBuff(ModContent.BuffType(), 300); diff --git a/Items/Weapons/Rogue/DuneHopper.cs b/Items/Weapons/Rogue/DuneHopper.cs index cedc32b005..2b85dea96b 100644 --- a/Items/Weapons/Rogue/DuneHopper.cs +++ b/Items/Weapons/Rogue/DuneHopper.cs @@ -1,4 +1,5 @@ using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -10,7 +11,8 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SetStaticDefaults() { DisplayName.SetDefault("Dune Hopper"); - Tooltip.SetDefault("Throws a spear that bounces a lot"); + Tooltip.SetDefault(@"Throws a spear that bounces a lot +Stealth strikes throws three high speed spears"); } public override void SafeSetDefaults() @@ -33,5 +35,21 @@ namespace CalamityMod.Items.Weapons.Rogue item.Calamity().rogue = true; item.Calamity().postMoonLordRarity = 22; } + + 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 (player.Calamity().StealthStrikeAvailable()) + { + int numProj = 2; + float rotation = MathHelper.ToRadians(3); + for (int i = 0; i < numProj + 1; i++) + { + Vector2 perturbedSpeed = new Vector2(speedX - 3f, speedY - 3f).RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1))); + Projectile.NewProjectile(position.X, position.Y, perturbedSpeed.X, perturbedSpeed.Y, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); + } + return false; + } + return true; + } } } diff --git a/Items/Weapons/Rogue/EmpyreanKnivesThrown.cs b/Items/Weapons/Rogue/EmpyreanKnivesThrown.cs index f4351d3219..9c5fdb960c 100644 --- a/Items/Weapons/Rogue/EmpyreanKnivesThrown.cs +++ b/Items/Weapons/Rogue/EmpyreanKnivesThrown.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { item.width = 18; - item.damage = 600; + item.damage = 520; item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 15; diff --git a/Items/Weapons/Rogue/FeatherKnife.cs b/Items/Weapons/Rogue/FeatherKnife.cs index 515d3b136f..ae66ad6dda 100644 --- a/Items/Weapons/Rogue/FeatherKnife.cs +++ b/Items/Weapons/Rogue/FeatherKnife.cs @@ -1,5 +1,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -10,18 +12,20 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SetStaticDefaults() { DisplayName.SetDefault("Feather Knife"); + Tooltip.SetDefault(@"Throws a knife which summons homing feathers +Stealth strike throws a volley of knives"); } public override void SafeSetDefaults() { item.width = 18; - item.damage = 24; + item.damage = 32; item.noMelee = true; item.consumable = true; item.noUseGraphic = true; item.useAnimation = 11; item.useStyle = 1; - item.useTime = 11; + item.useTime = 18; item.knockBack = 2f; item.UseSound = SoundID.Item1; item.autoReuse = true; @@ -30,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.value = 300; item.rare = 3; item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 14f; + item.shootSpeed = 25f; item.Calamity().rogue = true; } @@ -42,5 +46,22 @@ namespace CalamityMod.Items.Weapons.Rogue recipe.SetResult(this, 30); 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) + { + if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike + { + int spread = 6; + for (int i = 0; i < 5; i++) + { + Vector2 perturbedspeed = new Vector2(speedX + Main.rand.Next(-3, 4), speedY + Main.rand.Next(-3, 4)).RotatedBy(MathHelper.ToRadians(spread)); + int proj = Projectile.NewProjectile(position.X, position.Y, perturbedspeed.X, perturbedspeed.Y, type, damage, knockBack, player.whoAmI, 0f, 0f); + Main.projectile[proj].Calamity().stealthStrike = true; + spread -= Main.rand.Next(2, 6); + } + return false; + } + return true; + } } } diff --git a/Items/Weapons/Rogue/GelDart.png b/Items/Weapons/Rogue/GelDart.png index d4b10b05ac..f01a1c46a1 100644 Binary files a/Items/Weapons/Rogue/GelDart.png and b/Items/Weapons/Rogue/GelDart.png differ diff --git a/Items/Weapons/Rogue/HeavenfallenStardisk.cs b/Items/Weapons/Rogue/HeavenfallenStardisk.cs index 594b3c6e38..8fca139416 100644 --- a/Items/Weapons/Rogue/HeavenfallenStardisk.cs +++ b/Items/Weapons/Rogue/HeavenfallenStardisk.cs @@ -1,4 +1,5 @@ using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -11,7 +12,8 @@ namespace CalamityMod.Items.Weapons.Rogue { DisplayName.SetDefault("Heavenfallen Stardisk"); Tooltip.SetDefault("Throws a stardisk upwards which then launches itself towards your mouse cursor,\n" + - "explodes into several astral energy bolts if the thrower is moving vertically when throwing it and during its impact"); + "explodes into several astral energy bolts if the thrower is moving vertically when throwing it and during its impact\n" + + "Stealth strikes spawn astral energy bolts from the sky as it flies"); } public override void SafeSetDefaults() @@ -35,9 +37,17 @@ namespace CalamityMod.Items.Weapons.Rogue item.Calamity().rogue = 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) + 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, 0f, -10f, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f); + if (player.Calamity().StealthStrikeAvailable()) + { + int proj = Projectile.NewProjectile(position.X, position.Y, 0f, -10f, type, damage, knockBack, player.whoAmI, 0f, 0f); + Main.projectile[proj].Calamity().stealthStrike = true; + } + else + { + Projectile.NewProjectile(position.X, position.Y, 0f, -10f, type, damage, knockBack, player.whoAmI, 0.0f, 0.0f); + } return false; } } diff --git a/Items/Weapons/Rogue/LatcherMine.cs b/Items/Weapons/Rogue/LatcherMine.cs index 103304298a..4275b2264e 100644 --- a/Items/Weapons/Rogue/LatcherMine.cs +++ b/Items/Weapons/Rogue/LatcherMine.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Items.Weapons.Rogue { public class LatcherMine : RogueWeapon { - public const int BaseDamage = 60; + public const int BaseDamage = 80; public override void SetStaticDefaults() { DisplayName.SetDefault("Latcher Mine"); diff --git a/Items/Weapons/Rogue/LuminousStriker.cs b/Items/Weapons/Rogue/LuminousStriker.cs index 88f668ebad..c3ad2ce218 100644 --- a/Items/Weapons/Rogue/LuminousStriker.cs +++ b/Items/Weapons/Rogue/LuminousStriker.cs @@ -47,6 +47,7 @@ namespace CalamityMod.Items.Weapons.Rogue ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ItemID.FragmentStardust, 10); recipe.AddTile(TileID.LunarCraftingStation); diff --git a/Items/Weapons/Rogue/Plaguenade.cs b/Items/Weapons/Rogue/Plaguenade.cs index 5f3da6b07f..3e6be11d3b 100644 --- a/Items/Weapons/Rogue/Plaguenade.cs +++ b/Items/Weapons/Rogue/Plaguenade.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -11,7 +12,8 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SetStaticDefaults() { DisplayName.SetDefault("Plaguenade"); - Tooltip.SetDefault("Releases a swarm of angry plague bees"); + Tooltip.SetDefault("Releases a swarm of angry plague bees\n" + + "Stealth strikes spawn more bees and generate a larger explosion"); } public override void SafeSetDefaults() @@ -37,6 +39,16 @@ namespace CalamityMod.Items.Weapons.Rogue item.Calamity().postMoonLordRarity = 21; } + 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 (player.Calamity().StealthStrikeAvailable()) + { + int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f); + Main.projectile[proj].Calamity().stealthStrike = true; + } + return true; + } + public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Items/Weapons/Rogue/RegulusRiot.cs b/Items/Weapons/Rogue/RegulusRiot.cs new file mode 100644 index 0000000000..b5a5b7294f --- /dev/null +++ b/Items/Weapons/Rogue/RegulusRiot.cs @@ -0,0 +1,53 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Rogue; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Microsoft.Xna.Framework; + +namespace CalamityMod.Items.Weapons.Rogue +{ + public class RegulusRiot : RogueWeapon + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Regulus Riot"); + Tooltip.SetDefault(@"Fires a swift homing disk +Stealth strikes explode into energy stars"); + } + + public override void SafeSetDefaults() + { + item.damage = 116; + item.knockBack = 4.5f; + + item.width = 28; + item.height = 34; + item.useStyle = 1; + item.noMelee = true; + item.noUseGraphic = true; + + item.value = Item.buyPrice(0, 95, 0, 0); + item.useTime = 26; + item.useAnimation = 26; + item.UseSound = SoundID.Item1; + item.rare = 9; + item.Calamity().rogue = true; + + item.autoReuse = true; + item.shootSpeed = 8f; + item.shoot = ModContent.ProjectileType(); + } + + 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 (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike + { + int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f); + Main.projectile[stealth].Calamity().stealthStrike = true; + return false; + } + return true; + } + } +} diff --git a/Items/Weapons/Rogue/RegulusRiot.png b/Items/Weapons/Rogue/RegulusRiot.png new file mode 100644 index 0000000000..923bd363b8 Binary files /dev/null and b/Items/Weapons/Rogue/RegulusRiot.png differ diff --git a/Items/Weapons/Rogue/ScourgeoftheCosmosThrown.cs b/Items/Weapons/Rogue/ScourgeoftheCosmosThrown.cs index 05ef663de7..601b5fd819 100644 --- a/Items/Weapons/Rogue/ScourgeoftheCosmosThrown.cs +++ b/Items/Weapons/Rogue/ScourgeoftheCosmosThrown.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SafeSetDefaults() { item.width = 18; - item.damage = 1550; + item.damage = 1300; item.noMelee = true; item.noUseGraphic = true; item.useAnimation = 20; diff --git a/Items/Weapons/Rogue/ScourgeoftheDesert.cs b/Items/Weapons/Rogue/ScourgeoftheDesert.cs index 563c9f05b0..93fbb34f65 100644 --- a/Items/Weapons/Rogue/ScourgeoftheDesert.cs +++ b/Items/Weapons/Rogue/ScourgeoftheDesert.cs @@ -1,4 +1,5 @@ using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -10,7 +11,8 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SetStaticDefaults() { DisplayName.SetDefault("Scourge of the Desert"); - Tooltip.SetDefault("Gains velocity over time"); + Tooltip.SetDefault(@"Gains velocity over time +Stealth strikes gain damage as they damage enemies"); } public override void SafeSetDefaults() @@ -32,5 +34,16 @@ namespace CalamityMod.Items.Weapons.Rogue item.shootSpeed = 12f; item.Calamity().rogue = 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) + { + if (player.Calamity().StealthStrikeAvailable()) + { + int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f); + Main.projectile[stealth].Calamity().stealthStrike = true; + return false; + } + return true; + } } } diff --git a/Items/Weapons/Rogue/SeafoamBomb.cs b/Items/Weapons/Rogue/SeafoamBomb.cs index ae0f29500a..bdd5e761b4 100644 --- a/Items/Weapons/Rogue/SeafoamBomb.cs +++ b/Items/Weapons/Rogue/SeafoamBomb.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Placeables; using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -11,7 +12,8 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SetStaticDefaults() { DisplayName.SetDefault("Seafoam Bomb"); - Tooltip.SetDefault("Throws a bomb that explodes into a bubble which deals extra damage to enemies"); + Tooltip.SetDefault(@"Throws a bomb that explodes into a bubble which deals extra damage to enemies +Stealth strikes are faster and explode into 5 bubbles"); } public override void SafeSetDefaults() @@ -43,5 +45,16 @@ namespace CalamityMod.Items.Weapons.Rogue 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) + { + if (player.Calamity().StealthStrikeAvailable()) + { + int stealth = Projectile.NewProjectile(position, new Vector2(speedX + speedX / 3, speedY + speedY / 3), type, damage, knockBack, player.whoAmI, 0f, 0f); + Main.projectile[stealth].Calamity().stealthStrike = true; + return false; + } + return true; + } } } diff --git a/Items/Weapons/Rogue/ShatteredSun.cs b/Items/Weapons/Rogue/ShatteredSun.cs index c501b0d739..d3bf873fa8 100644 --- a/Items/Weapons/Rogue/ShatteredSun.cs +++ b/Items/Weapons/Rogue/ShatteredSun.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -11,14 +12,15 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SetStaticDefaults() { DisplayName.SetDefault("Shattered Sun"); - Tooltip.SetDefault("Throws daggers that split twice and explode upon contact"); + Tooltip.SetDefault("Throws daggers that transform into homing meteors\n" + + "Stealth strikes fire volleys of meteors from the player on meteor hits"); } public override void SafeSetDefaults() { item.width = 56; item.height = 56; - item.damage = 60; + item.damage = 90; item.crit += 10; item.noMelee = true; item.noUseGraphic = true; @@ -45,5 +47,16 @@ namespace CalamityMod.Items.Weapons.Rogue 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) + { + if (player.Calamity().StealthStrikeAvailable()) + { + int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f); + Main.projectile[stealth].Calamity().stealthStrike = true; + return false; + } + return true; + } } } diff --git a/Items/Weapons/Rogue/Supernova.cs b/Items/Weapons/Rogue/Supernova.cs new file mode 100644 index 0000000000..b75aa31dc9 --- /dev/null +++ b/Items/Weapons/Rogue/Supernova.cs @@ -0,0 +1,71 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Rogue; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Microsoft.Xna.Framework; + +namespace CalamityMod.Items.Weapons.Rogue +{ + public class Supernova : RogueWeapon + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Supernova"); + Tooltip.SetDefault(@"Creates a massive explosion on impact +Explodes into spikes and homing energy +Stealth strikes release energy as they fly"); + } + + public override void SafeSetDefaults() + { + item.width = 34; + item.damage = 1299; + item.noMelee = true; + item.noUseGraphic = true; + item.useAnimation = 24; + item.useStyle = 1; + item.useTime = 24; + item.knockBack = 8f; + item.UseSound = SoundID.Item15; + item.autoReuse = true; + item.height = 36; + item.value = Item.buyPrice(2, 50, 0, 0); + item.rare = 10; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 16f; + item.Calamity().rogue = true; + item.Calamity().postMoonLordRarity = 15; + } + + 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 (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike + { + int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f); + Main.projectile[stealth].Calamity().stealthStrike = true; + return false; + } + return true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 200); + recipe.AddIngredient(ModContent.ItemType()); + + //replaces Duststorm in a Bottle when added + //recipe.AddIngredient(ModContent.ItemType()); + + recipe.AddIngredient(ModContent.ItemType(), 4); + recipe.AddTile(ModContent.TileType()); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Weapons/Rogue/Supernova.png b/Items/Weapons/Rogue/Supernova.png new file mode 100644 index 0000000000..d4aa9c8ad8 Binary files /dev/null and b/Items/Weapons/Rogue/Supernova.png differ diff --git a/Items/Weapons/Rogue/TheReaper.cs b/Items/Weapons/Rogue/TheReaper.cs index 2ce8ff692e..e018e76f0c 100644 --- a/Items/Weapons/Rogue/TheReaper.cs +++ b/Items/Weapons/Rogue/TheReaper.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Rogue { DisplayName.SetDefault("The Reaper"); Tooltip.SetDefault("Slice 'n dice\n" + - "Stealth strikes throw five at once"); + "Stealth strikes throw four at once"); } public override void SafeSetDefaults() @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Rogue if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike { int spread = 10; - for (int i = 0; i < 3; i++) + for (int i = 0; i < 4; i++) { Vector2 perturbedspeed = new Vector2(speedX + Main.rand.Next(-3,4), speedY + Main.rand.Next(-3,4)).RotatedBy(MathHelper.ToRadians(spread)); int proj = Projectile.NewProjectile(position.X, position.Y, perturbedspeed.X, perturbedspeed.Y, type, damage / 2, knockBack, player.whoAmI, 0f, 0f); diff --git a/Items/Weapons/Summon/CorroslimeStaff.cs b/Items/Weapons/Summon/CorroslimeStaff.cs index df2b11eff5..6bc992e543 100644 --- a/Items/Weapons/Summon/CorroslimeStaff.cs +++ b/Items/Weapons/Summon/CorroslimeStaff.cs @@ -19,8 +19,8 @@ namespace CalamityMod.Items.Weapons.Summon { item.damage = 24; item.mana = 10; - item.width = 50; - item.height = 50; + item.width = 52; + item.height = 54; item.useTime = 36; item.useAnimation = 36; item.useStyle = 1; diff --git a/Items/Weapons/Summon/CorroslimeStaff.png b/Items/Weapons/Summon/CorroslimeStaff.png index f00b9f5c67..795cbc9f90 100644 Binary files a/Items/Weapons/Summon/CorroslimeStaff.png and b/Items/Weapons/Summon/CorroslimeStaff.png differ diff --git a/Items/Weapons/Summon/CosmicImmaterializer.cs b/Items/Weapons/Summon/CosmicImmaterializer.cs index 50f2e4d644..f274a58061 100644 --- a/Items/Weapons/Summon/CosmicImmaterializer.cs +++ b/Items/Weapons/Summon/CosmicImmaterializer.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Items.Weapons.Summon public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { CalamityPlayer modPlayer = player.Calamity(); - bool hasSummonerSet = modPlayer.tarraSummon || modPlayer.bloodflareSummon || modPlayer.godSlayerSummon || modPlayer.silvaSummon; + bool hasSummonerSet = modPlayer.tarraSummon || modPlayer.bloodflareSummon || modPlayer.godSlayerSummon || modPlayer.silvaSummon || modPlayer.dsSetBonus; //demonshade included so summoner isn't forced to use auric for BR player.itemTime = item.useTime; Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X; @@ -90,7 +90,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); diff --git a/Items/Weapons/Summon/CrimslimeStaff.cs b/Items/Weapons/Summon/CrimslimeStaff.cs index 9798c1fea6..439a248385 100644 --- a/Items/Weapons/Summon/CrimslimeStaff.cs +++ b/Items/Weapons/Summon/CrimslimeStaff.cs @@ -19,8 +19,8 @@ namespace CalamityMod.Items.Weapons.Summon { item.damage = 24; item.mana = 10; - item.width = 50; - item.height = 50; + item.width = 52; + item.height = 52; item.useTime = 36; item.useAnimation = 36; item.useStyle = 1; diff --git a/Items/Weapons/Summon/CrimslimeStaff.png b/Items/Weapons/Summon/CrimslimeStaff.png index 85d0916e5f..3e40afc20b 100644 Binary files a/Items/Weapons/Summon/CrimslimeStaff.png and b/Items/Weapons/Summon/CrimslimeStaff.png differ diff --git a/Items/Weapons/Summon/Endogenesis.cs b/Items/Weapons/Summon/Endogenesis.cs new file mode 100644 index 0000000000..a1bd44d31c --- /dev/null +++ b/Items/Weapons/Summon/Endogenesis.cs @@ -0,0 +1,122 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Summon; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Summon +{ + public class Endogenesis : ModItem + { + //Cooper be like cool + + public static int AttackMode = 0; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Endogenesis"); + Tooltip.SetDefault("Summons an ascended ice construct to protect you \n" + + "Changes attack modes by resummoning or reusing the staff \n" + + "The first mode makes it shoot sweeping lasers aimed at the enemy \n" + + "The second mode sacrifices its limbs to shoot out homing projectiles \n" + + "The third mode allows it to agressively tackle its enemies \n" + + "The fourth mode makes the limbs function as endothermic flamethrowers \n" + + "Requires 10 minion slots to be summoned \n" + + "There can only be one \n" + + "[c/B0FBFF:Ice puns not included]"); //Icy no problems with that + } + + public override void SetDefaults() + { + item.width = 80; + item.height = 80; + item.useStyle = ItemUseStyleID.SwingThrow; + item.noMelee = true; + item.UseSound = SoundID.Item78; + + item.summon = true; + item.mana = 80; + item.damage = 7000; + item.knockBack = 4f; + item.crit += 18; + item.autoReuse = true; + item.useTime = 36; + item.useAnimation = 36; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 10f; + + item.value = Item.buyPrice(5, 0, 0, 0); + item.Calamity().postMoonLordRarity = 16; + } + + public override bool CanUseItem(Player player) + { + if (player.maxMinions < 10f) + return false; + 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) + { + if (player.altFunctionUse != 2) + { + player.itemTime = item.useTime; + Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); + vector2.X = Main.mouseX + Main.screenPosition.X; + vector2.Y = Main.mouseY + Main.screenPosition.Y; + for (int x = 0; x < Main.projectile.Length; x++) + { + Projectile projectile = Main.projectile[x]; + if (projectile.active && projectile.owner == player.whoAmI && (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType())) + { + projectile.Kill(); + } + } + float dmgMult = 1f; + if (AttackMode == 0) //lasers + dmgMult = 0.65f; + if (AttackMode == 1) //icicles + dmgMult = 1f; + if (AttackMode == 2) //melee + dmgMult = 0.95f; + if (AttackMode == 3) //flamethrower + dmgMult = 0.9f; + int body = Projectile.NewProjectile(vector2.X, vector2.Y, 0f, 0f, type, (int)(damage * dmgMult), knockBack, player.whoAmI, AttackMode, 0f); + int limbs = Projectile.NewProjectile(vector2.X, vector2.Y, 0f, 0f, ModContent.ProjectileType(), (int)(damage * dmgMult), knockBack, player.whoAmI, AttackMode, body); + Main.projectile[body].ai[1] = limbs; + AttackMode++; + if (AttackMode > 3) + AttackMode = 0; + } + return false; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ItemID.BlizzardStaff); + recipe.AddIngredient(ModContent.ItemType(), 99); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddIngredient(ModContent.ItemType(), 5); + recipe.AddTile(ModContent.TileType()); + recipe.SetResult(this); + recipe.AddRecipe(); + } + + public override bool AltFunctionUse(Player player) + { + return true; + } + + public override bool UseItem(Player player) + { + if (player.altFunctionUse == 2) + { + player.MinionNPCTargetAim(); + } + return base.UseItem(player); + } + } +} diff --git a/Items/Weapons/Summon/Endogenesis.png b/Items/Weapons/Summon/Endogenesis.png new file mode 100644 index 0000000000..a55c35a1d3 Binary files /dev/null and b/Items/Weapons/Summon/Endogenesis.png differ diff --git a/Items/Weapons/Summon/ForgottenApexWand.cs b/Items/Weapons/Summon/ForgottenApexWand.cs new file mode 100644 index 0000000000..6aa4ae6555 --- /dev/null +++ b/Items/Weapons/Summon/ForgottenApexWand.cs @@ -0,0 +1,77 @@ +using Terraria.ModLoader; +using Terraria.ID; +using Terraria; +using CalamityMod.Projectiles.Summon; +using Microsoft.Xna.Framework; + +namespace CalamityMod.Items.Weapons.Summon +{ + public class ForgottenApexWand : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Forgotten Apex Wand"); + Tooltip.SetDefault("Summons ancient mineral sharks to take on your foes. \n" + + "Seems to have lost its jaw some time in the past"); + } + + public override void SetDefaults() + { + item.width = 44; + item.height = 48; + item.useStyle = ItemUseStyleID.SwingThrow; + item.summon = true; + item.UseSound = SoundID.Item89; + item.noMelee = true; + item.rare = 5; + item.value = Item.buyPrice(0, 36, 0, 0); + item.autoReuse = true; + + item.knockBack = 4f; + item.mana = 15; + item.damage = 28; + item.useTime = 30; + item.useAnimation = 30; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 12f; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.AncientBattleArmorMaterial, 2); + recipe.AddRecipeGroup("AnyAdamantiteBar", 5); + recipe.AddIngredient(ItemID.Amethyst, 4); + recipe.AddTile(TileID.MythrilAnvil); + 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) + { + if (player.altFunctionUse != 2) + { + player.itemTime = item.useTime; + Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true); + vector2.X = Main.mouseX + Main.screenPosition.X; + vector2.Y = Main.mouseY + Main.screenPosition.Y; + Projectile.NewProjectile(vector2, Vector2.Zero, ModContent.ProjectileType(), damage, knockBack, player.whoAmI, 0f, 0f); + } + return false; + } + + public override bool AltFunctionUse(Player player) + { + return true; + } + + public override bool UseItem(Player player) + { + if (player.altFunctionUse == 2) + { + player.MinionNPCTargetAim(); + } + return base.UseItem(player); + } + } +} diff --git a/Items/Weapons/Summon/ForgottenApexWand.png b/Items/Weapons/Summon/ForgottenApexWand.png new file mode 100644 index 0000000000..3ced09f472 Binary files /dev/null and b/Items/Weapons/Summon/ForgottenApexWand.png differ diff --git a/Items/Weapons/Summon/GodspawnHelixStaff.cs b/Items/Weapons/Summon/GodspawnHelixStaff.cs index 208e16351b..e7d6f4c8c3 100644 --- a/Items/Weapons/Summon/GodspawnHelixStaff.cs +++ b/Items/Weapons/Summon/GodspawnHelixStaff.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetDefaults() { - item.damage = 100; + item.damage = 43; item.mana = 10; item.width = 50; item.height = 50; diff --git a/Items/Weapons/Summon/LanternoftheSoul.cs b/Items/Weapons/Summon/LanternoftheSoul.cs new file mode 100644 index 0000000000..530a31b1f2 --- /dev/null +++ b/Items/Weapons/Summon/LanternoftheSoul.cs @@ -0,0 +1,49 @@ +using CalamityMod.Projectiles.Summon; +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Summon +{ + public class LanternoftheSoul : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Lantern of the Soul"); + Tooltip.SetDefault("Summons a lantern turret to fight for you"); + } + + public override void SetDefaults() + { + item.damage = 180; + item.summon = true; + item.sentry = true; + item.mana = 10; + item.width = 42; + item.height = 60; + item.useTime = 36; + item.useAnimation = 36; + item.useStyle = 1; + item.noMelee = true; + item.knockBack = 5f; + item.value = Item.buyPrice(1, 40, 0, 0); + item.rare = 10; + item.autoReuse = true; + item.shoot = ModContent.ProjectileType(); + item.Calamity().postMoonLordRarity = 22; + item.UseSound = SoundID.Item44; + } + + 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) + { + position = Main.MouseWorld; + speedX = 0; + speedY = 0; + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI); + player.UpdateMaxTurrets(); + return false; + } + } +} diff --git a/Items/Weapons/Summon/LanternoftheSoul.png b/Items/Weapons/Summon/LanternoftheSoul.png new file mode 100644 index 0000000000..2f2f239a4b Binary files /dev/null and b/Items/Weapons/Summon/LanternoftheSoul.png differ diff --git a/Items/Weapons/Summon/SandSharknadoStaff.cs b/Items/Weapons/Summon/SandSharknadoStaff.cs index 13f9cffcfc..2f90592568 100644 --- a/Items/Weapons/Summon/SandSharknadoStaff.cs +++ b/Items/Weapons/Summon/SandSharknadoStaff.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetDefaults() { - item.damage = 65; + item.damage = 35; item.mana = 10; item.width = 48; item.height = 56; @@ -64,9 +64,9 @@ namespace CalamityMod.Items.Weapons.Summon public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.TempestStaff); + recipe.AddIngredient(ModContent.ItemType()); recipe.AddIngredient(ModContent.ItemType()); - recipe.AddIngredient(ItemID.HallowedBar, 10); + recipe.AddIngredient(ModContent.ItemType(), 10); recipe.AddIngredient(ItemID.AncientCloth, 5); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); diff --git a/Items/Weapons/Summon/Sirius.cs b/Items/Weapons/Summon/Sirius.cs new file mode 100644 index 0000000000..0687fdc1f5 --- /dev/null +++ b/Items/Weapons/Summon/Sirius.cs @@ -0,0 +1,106 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Summon; +using CalamityMod.Items.Placeables.Ores; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Summon +{ + public class Sirius : ModItem + { + int siriusSlots; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sirius"); + Tooltip.SetDefault("Summons the brightest star in the night sky to shine upon your foes\n" + + "Consumes all of the remaining minion slots on use\n" + + "Increased power based on the number of minion slots used"); + } + + public override void SetDefaults() + { + item.width = 62; + item.height = 62; + item.useStyle = ItemUseStyleID.SwingThrow; + item.noMelee = true; + item.UseSound = SoundID.Item44; + + item.summon = true; + item.mana = 60; + item.damage = 275; + item.knockBack = 3f; + item.autoReuse = true; + item.useTime = 36; + item.useAnimation = 36; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 10f; + + item.value = Item.buyPrice(1, 40, 0, 0); + item.rare = 10; + item.Calamity().postMoonLordRarity = 13; + } + + public override void HoldItem(Player player) + { + double minionCount = 0; + for (int j = 0; j < Main.projectile.Length; j++) + { + Projectile projectile = Main.projectile[j]; + if (projectile.active && projectile.owner == player.whoAmI && projectile.minion && projectile.type != ModContent.ProjectileType()) + { + minionCount += projectile.minionSlots; + } + } + siriusSlots = (int)((double)player.maxMinions - minionCount); + } + + public override bool CanUseItem(Player player) + { + return siriusSlots >= 1; + } + + 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) + { + for (int x = 0; x < Main.projectile.Length; x++) + { + Projectile projectile2 = Main.projectile[x]; + if (projectile2.active && projectile2.owner == player.whoAmI && projectile2.type == ModContent.ProjectileType()) + { + projectile2.Kill(); + } + } + position = Main.MouseWorld; + speedX = 0; + speedY = 0; + Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, siriusSlots); + return false; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 12); + recipe.AddIngredient(ModContent.ItemType(), 2); + recipe.AddTile(TileID.LunarCraftingStation); + recipe.SetResult(this); + recipe.AddRecipe(); + } + + public override bool AltFunctionUse(Player player) + { + return true; + } + + public override bool UseItem(Player player) + { + if (player.altFunctionUse == 2) + { + player.MinionNPCTargetAim(); + } + return base.UseItem(player); + } + } +} diff --git a/Items/Weapons/Summon/Sirius.png b/Items/Weapons/Summon/Sirius.png new file mode 100644 index 0000000000..7fbaf86838 Binary files /dev/null and b/Items/Weapons/Summon/Sirius.png differ diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index 2b16d73672..52035cadab 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -104,8 +104,8 @@ namespace CalamityMod calamity, "Giant Clam", (Func)(() => CalamityWorld.downedCLAM), - ItemID.None, - ItemID.None, + null, + null, new List() { ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType()}, "Can spawn naturally in the Sunken Sea", "[c/7FFFD4:The Giant Clam returns into hiding in its grotto.]"); @@ -190,7 +190,7 @@ namespace CalamityMod "Brimstone Elemental", (Func)(() => CalamityWorld.downedBrimstoneElemental), ModContent.ItemType(), - new List() {ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType()}, + new List() {ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType()}, new List() {ModContent.ItemType(), ItemID.SoulofFright, ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ItemID.GreaterHealingPotion}, "Use a [i:" + ModContent.ItemType() + "] in the Brimstone Crag", "[c/DC143C:Brimstone Elemental withdraws to the ruins of her shrine.]"); @@ -204,7 +204,7 @@ namespace CalamityMod "Aquatic Scourge", (Func)(() => CalamityWorld.downedAquaticScourge), ModContent.ItemType(), - new List() { ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType()}, + new List() { ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType()}, new List() { ModContent.ItemType(), ModContent.ItemType(), ItemID.SoulofSight, ModContent.ItemType(), ItemID.Coral, ItemID.Seashell, ItemID.Starfish, ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ItemID.AnglerTackleBag, ItemID.HighTestFishingLine, ItemID.TackleBox, ItemID.AnglerEarring, ItemID.FishermansGuide, ItemID.WeatherRadio, ItemID.Sextant, ItemID.AnglerHat, ItemID.AnglerVest, ItemID.AnglerPants, ItemID.FishingPotion, ItemID.SonarPotion, ItemID.CratePotion, ItemID.GoldenBugNet, ItemID.GreaterHealingPotion}, "Use a [i:" + ModContent.ItemType() + "] in the Sulphuric Sea or wait for it to spawn in the Sulphuric Sea", "[c/F0E68C:The Aquatic Scourge swam back into the open ocean.]", @@ -214,7 +214,7 @@ namespace CalamityMod bossChecklist.Call( "AddBoss", 9.7f, - new List() {ModContent.NPCType()}, + new List() {ModContent.NPCType()}, calamity, "Calamitas", (Func)(() => CalamityWorld.downedCalamitas), @@ -246,7 +246,7 @@ namespace CalamityMod calamity, "Leviathan", (Func)(() => CalamityWorld.downedLeviathan), - ItemID.None, + null, new List() {ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType()}, new List() {ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ItemID.HotlineFishingHook, ItemID.BottomlessBucket, ItemID.SuperAbsorbantSponge, ItemID.FishingPotion, ItemID.SonarPotion, ItemID.CratePotion, ItemID.GreaterHealingPotion}, "By killing an unknown entity in the Ocean Biome", @@ -291,7 +291,7 @@ namespace CalamityMod "Ravager", (Func)(() => CalamityWorld.downedScavenger), ModContent.ItemType(), - new List() {ModContent.ItemType(), ModContent.ItemType()}, + new List() {ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType()}, new List() {ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ItemID.GreaterHealingPotion}, "Use an [i:" + ModContent.ItemType() + "]", "[c/B22222:The automaton of misshapen victims went looking for the true perpetrator.]", @@ -307,7 +307,7 @@ namespace CalamityMod (Func)(() => CalamityWorld.downedStarGod), ModContent.ItemType(), new List() { ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType()}, - new List() { ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ItemID.FragmentSolar, ItemID.FragmentVortex, ItemID.FragmentNebula, ItemID.FragmentStardust, ItemID.GreaterHealingPotion}, + new List() { ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ItemID.FragmentSolar, ItemID.FragmentVortex, ItemID.FragmentNebula, ItemID.FragmentStardust, ItemID.GreaterHealingPotion}, "Defeat 3 empowered astral titans or use a [i:" + ModContent.ItemType() + "] at Night", "[c/FFD700:The infected deity retreats to the heavens.]", "CalamityMod/NPCs/AstrumDeus/AstrumDeus_BossChecklist"); @@ -320,7 +320,7 @@ namespace CalamityMod calamity, "Profaned Guardians", (Func)(() => CalamityWorld.downedGuardians), ModContent.ItemType(), - ModContent.ItemType(), + new List() { ModContent.ItemType(), ModContent.ItemType() }, new List() { ModContent.ItemType(), ItemID.GreaterHealingPotion}, "Use a [i:" + ModContent.ItemType() + "] in the Hallow or Underworld Biomes", "[c/FFA500:The guardians must protect their goddess at all costs.]", @@ -335,7 +335,7 @@ namespace CalamityMod "Bumblebirb", (Func)(() => CalamityWorld.downedBumble), ModContent.ItemType(), - new List() {ModContent.ItemType(), ModContent.ItemType()}, + new List() {ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType()}, new List() {ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ItemID.SuperHealingPotion}, "Use [i:" + ModContent.ItemType() + "] in the Jungle Biome", "[c/FFD700:The failed experiment returns into its reproductive routine.]"); @@ -364,7 +364,7 @@ namespace CalamityMod "Ceaseless Void", (Func)(() => CalamityWorld.downedSentinel1), ModContent.ItemType(), - new List() {ModContent.ItemType(), ModContent.ItemType()}, + new List() {ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType()}, new List() {ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ItemID.SuperHealingPotion}, "Use a [i:" + ModContent.ItemType() + "] in the Dungeon", "[c/4B0082:The rift in time and space has moved away from your reach.]"); @@ -376,7 +376,7 @@ namespace CalamityMod calamity, "Storm Weaver", (Func)(() => CalamityWorld.downedSentinel2), ModContent.ItemType(), - new List() {ModContent.ItemType(), ModContent.ItemType()}, + new List() {ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType()}, new List() {ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ItemID.SuperHealingPotion}, "Use a [i:" + ModContent.ItemType() + "] in Space", "[c/EE82EE:Storm Weaver hid itself once again within the stormfront.]", @@ -391,7 +391,7 @@ namespace CalamityMod "Signus", (Func)(() => CalamityWorld.downedSentinel3), ModContent.ItemType(), - new List() {ModContent.ItemType(), ModContent.ItemType()}, + new List() {ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType()}, new List() {ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ItemID.SuperHealingPotion}, "Use a [i:" + ModContent.ItemType() + "] in the Underworld", "[c/BA55D3:The Devourer's assassin has finished its easy task.]"); @@ -405,7 +405,7 @@ namespace CalamityMod "Polterghast", (Func)(() => CalamityWorld.downedPolterghast), ModContent.ItemType(), - new List() {ModContent.ItemType(), ModContent.ItemType()}, + new List() {ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType()}, new List() {ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ItemID.SuperHealingPotion}, "Kill 30 phantom spirits or use a [i:" + ModContent.ItemType() + "] in the Dungeon", "[c/B0E0E6:The volatile spirits disperse throughout the depths of the dungeon.]"); @@ -414,7 +414,7 @@ namespace CalamityMod bossChecklist.Call( "AddBoss", 16f, - new List() {ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType()}, + new List() {ModContent.NPCType()}, calamity, "Devourer of Gods", (Func)(() => CalamityWorld.downedDoG), ModContent.ItemType(), @@ -422,7 +422,8 @@ namespace CalamityMod new List() {ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType()}, "Use a [i:" + ModContent.ItemType() + "]", "[c/00FFFF:The Devourer of Gods has slain everyone and feasted on their essence.]", - "CalamityMod/NPCs/DevourerofGods/DevourerofGods_BossChecklist"); + "CalamityMod/NPCs/DevourerofGods/DevourerofGods_BossChecklist", + "CalamityMod/NPCs/DevourerofGods/DevourerofGodsHead_Head_Boss"); //Yharon bossChecklist.Call( @@ -448,7 +449,7 @@ namespace CalamityMod "Supreme Calamitas", (Func)(() => CalamityWorld.downedSCal), ModContent.ItemType(), new List() {ModContent.ItemType(), ModContent.ItemType()}, - new List() {ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType()}, + new List() {ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType()}, "Use an [i:" + ModContent.ItemType() + "]", "[c/FFA500:Please don't waste my time.]"); @@ -715,7 +716,7 @@ namespace CalamityMod "AddToBossLoot", "Terraria", "Martian Madness", - new List() {ModContent.ItemType(), ModContent.ItemType()}); + new List() {ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType()}); //Martian Saucer bossChecklist.Call( @@ -776,6 +777,7 @@ namespace CalamityMod SummonersAssociation.Call("AddMinionInfo", ModContent.ItemType(), ModContent.BuffType(), ModContent.ProjectileType(), 1f); SummonersAssociation.Call("AddMinionInfo", ModContent.ItemType(), ModContent.BuffType(), ModContent.ProjectileType()); SummonersAssociation.Call("AddMinionInfo", ModContent.ItemType(), ModContent.BuffType(), ModContent.ProjectileType()); + SummonersAssociation.Call("AddMinionInfo", ModContent.ItemType(), ModContent.BuffType(), ModContent.ProjectileType()); } } } diff --git a/NPCs/Abyss/BobbitWormHead.png b/NPCs/Abyss/BobbitWormHead.png index 5109108e00..ad1d0161a0 100644 Binary files a/NPCs/Abyss/BobbitWormHead.png and b/NPCs/Abyss/BobbitWormHead.png differ diff --git a/NPCs/Abyss/BobbitWormSegment.png b/NPCs/Abyss/BobbitWormSegment.png index 8a07013302..ff0fe7853e 100644 Binary files a/NPCs/Abyss/BobbitWormSegment.png and b/NPCs/Abyss/BobbitWormSegment.png differ diff --git a/NPCs/Abyss/BoxJellyfish.cs b/NPCs/Abyss/BoxJellyfish.cs index c5a4e36b01..d730bd4a3e 100644 --- a/NPCs/Abyss/BoxJellyfish.cs +++ b/NPCs/Abyss/BoxJellyfish.cs @@ -14,7 +14,7 @@ namespace CalamityMod.NPCs.Abyss public override void SetStaticDefaults() { DisplayName.SetDefault("Box Jellyfish"); - Main.npcFrameCount[npc.type] = 5; + Main.npcFrameCount[npc.type] = 4; } public override void SetDefaults() @@ -22,7 +22,7 @@ namespace CalamityMod.NPCs.Abyss npc.noGravity = true; npc.damage = 22; npc.width = 30; - npc.height = 30; + npc.height = 33; npc.defense = 5; npc.lifeMax = 45; npc.alpha = 20; diff --git a/NPCs/Abyss/BoxJellyfish.png b/NPCs/Abyss/BoxJellyfish.png index 857d40b0db..a2878737a5 100644 Binary files a/NPCs/Abyss/BoxJellyfish.png and b/NPCs/Abyss/BoxJellyfish.png differ diff --git a/NPCs/Abyss/Cuttlefish.png b/NPCs/Abyss/Cuttlefish.png index a7aace459c..4258fd6a70 100644 Binary files a/NPCs/Abyss/Cuttlefish.png and b/NPCs/Abyss/Cuttlefish.png differ diff --git a/NPCs/Abyss/CuttlefishGlow.png b/NPCs/Abyss/CuttlefishGlow.png index bc1570b0e7..0a1341d39c 100644 Binary files a/NPCs/Abyss/CuttlefishGlow.png and b/NPCs/Abyss/CuttlefishGlow.png differ diff --git a/NPCs/Abyss/DevilFish.cs b/NPCs/Abyss/DevilFish.cs index b1eef2d437..bf46fe9204 100644 --- a/NPCs/Abyss/DevilFish.cs +++ b/NPCs/Abyss/DevilFish.cs @@ -16,7 +16,6 @@ namespace CalamityMod.NPCs.Abyss { public class DevilFish : ModNPC { - public bool hasBeenHit = false; public bool brokenMask = false; public int hitCounter = 0; @@ -48,7 +47,6 @@ namespace CalamityMod.NPCs.Abyss public override void SendExtraAI(BinaryWriter writer) { - writer.Write(hasBeenHit); writer.Write(brokenMask); writer.Write(hitCounter); writer.Write(npc.chaseable); @@ -56,7 +54,6 @@ namespace CalamityMod.NPCs.Abyss public override void ReceiveExtraAI(BinaryReader reader) { - hasBeenHit = reader.ReadBoolean(); brokenMask = reader.ReadBoolean(); hitCounter = reader.ReadInt32(); npc.chaseable = reader.ReadBoolean(); @@ -72,7 +69,7 @@ namespace CalamityMod.NPCs.Abyss { npc.TargetClosest(true); } - npc.chaseable = hasBeenHit; + npc.chaseable = brokenMask; if (hitCounter >= 5 && !brokenMask) { @@ -231,7 +228,7 @@ namespace CalamityMod.NPCs.Abyss { if (projectile.minion) { - return hasBeenHit; + return brokenMask; } return null; } diff --git a/NPCs/Abyss/GiantSquid.png b/NPCs/Abyss/GiantSquid.png index 9f94d8ebb3..afb7d9f2d2 100644 Binary files a/NPCs/Abyss/GiantSquid.png and b/NPCs/Abyss/GiantSquid.png differ diff --git a/NPCs/Abyss/GiantSquidGlow.png b/NPCs/Abyss/GiantSquidGlow.png index 2eebc3b884..c14270a1c8 100644 Binary files a/NPCs/Abyss/GiantSquidGlow.png and b/NPCs/Abyss/GiantSquidGlow.png differ diff --git a/NPCs/Abyss/MorayEel.cs b/NPCs/Abyss/MorayEel.cs index 66e3dc1d60..5e5505d46f 100644 --- a/NPCs/Abyss/MorayEel.cs +++ b/NPCs/Abyss/MorayEel.cs @@ -228,23 +228,6 @@ namespace CalamityMod.NPCs.Abyss npc.frame.Y = frame * frameHeight; } - public override void PostDraw(SpriteBatch spriteBatch, Color drawColor) - { - SpriteEffects spriteEffects = SpriteEffects.None; - if (npc.spriteDirection == 1) - { - spriteEffects = SpriteEffects.FlipHorizontally; - } - Vector2 center = new Vector2(npc.Center.X, npc.Center.Y); - Vector2 vector11 = new Vector2((float)(Main.npcTexture[npc.type].Width / 2), (float)(Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type] / 2)); - Vector2 vector = center - Main.screenPosition; - vector -= new Vector2((float)ModContent.GetTexture("CalamityMod/NPCs/Abyss/MorayEelGlow").Width, (float)(ModContent.GetTexture("CalamityMod/NPCs/Abyss/MorayEelGlow").Height / Main.npcFrameCount[npc.type])) * 1f / 2f; - vector += vector11 * 1f + new Vector2(0f, 0f + 4f + npc.gfxOffY); - Color color = new Color(127 - npc.alpha, 127 - npc.alpha, 127 - npc.alpha, 0).MultiplyRGBA(Microsoft.Xna.Framework.Color.Gold); - Main.spriteBatch.Draw(ModContent.GetTexture("CalamityMod/NPCs/Abyss/MorayEelGlow"), vector, - new Microsoft.Xna.Framework.Rectangle?(npc.frame), color, npc.rotation, vector11, 1f, spriteEffects, 0f); - } - public override void OnHitPlayer(Player player, int damage, bool crit) { player.AddBuff(BuffID.Bleeding, 180, true); diff --git a/NPCs/Abyss/MorayEel.png b/NPCs/Abyss/MorayEel.png index e510a9cec2..c8d6a595a4 100644 Binary files a/NPCs/Abyss/MorayEel.png and b/NPCs/Abyss/MorayEel.png differ diff --git a/NPCs/Abyss/MorayEelGlow.png b/NPCs/Abyss/MorayEelGlow.png deleted file mode 100644 index 57690ac74d..0000000000 Binary files a/NPCs/Abyss/MorayEelGlow.png and /dev/null differ diff --git a/NPCs/Abyss/Viperfish.png b/NPCs/Abyss/Viperfish.png index fbd1a610cf..3aeb7c48bf 100644 Binary files a/NPCs/Abyss/Viperfish.png and b/NPCs/Abyss/Viperfish.png differ diff --git a/NPCs/Abyss/ViperfishGlow.png b/NPCs/Abyss/ViperfishGlow.png index 6f97e08cb9..5c4c12bd1f 100644 Binary files a/NPCs/Abyss/ViperfishGlow.png and b/NPCs/Abyss/ViperfishGlow.png differ diff --git a/NPCs/AquaticScourge/AquaticScourgeHead.cs b/NPCs/AquaticScourge/AquaticScourgeHead.cs index 40c9f80706..794b62ce71 100644 --- a/NPCs/AquaticScourge/AquaticScourgeHead.cs +++ b/NPCs/AquaticScourge/AquaticScourgeHead.cs @@ -18,6 +18,7 @@ using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Items.Armor.Vanity; namespace CalamityMod.NPCs.AquaticScourge { @@ -176,7 +177,7 @@ namespace CalamityMod.NPCs.AquaticScourge DropHelper.DropItemChance(npc, ModContent.ItemType(), 9); // Vanity - // there is no Aquatic Scourge mask yet + DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); // Fishing DropHelper.DropItemChance(npc, ItemID.HighTestFishingLine, 12); diff --git a/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs b/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs index f1ee93a1ea..91a5559ce9 100644 --- a/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs +++ b/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs @@ -232,6 +232,7 @@ namespace CalamityMod.NPCs.AstrumDeus DropHelper.DropItemChance(npc, ModContent.ItemType(), 4); DropHelper.DropItemChance(npc, ModContent.ItemType(), 4); DropHelper.DropItemChance(npc, ModContent.ItemType(), 4); + DropHelper.DropItemChance(npc, ModContent.ItemType(), 4); DropHelper.DropItemChance(npc, ModContent.ItemType(), DropHelper.RareVariantDropRateInt); // Equipment diff --git a/NPCs/BrimstoneElemental/BrimstoneElemental.cs b/NPCs/BrimstoneElemental/BrimstoneElemental.cs index ee60e7115b..c6809a4c87 100644 --- a/NPCs/BrimstoneElemental/BrimstoneElemental.cs +++ b/NPCs/BrimstoneElemental/BrimstoneElemental.cs @@ -2,6 +2,7 @@ using CalamityMod.Buffs.StatDebuffs; using CalamityMod.CalPlayer; using CalamityMod.Items.Accessories; +using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Furniture.Trophies; @@ -208,6 +209,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental DropHelper.DropResidentEvilAmmo(npc, CalamityWorld.downedBrimstoneElemental, 4, 2, 1); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !CalamityWorld.downedBrimstoneElemental); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !CalamityWorld.downedBrimstoneElemental); + DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); // if prime hasn't been killed and this is the first time killing brimmy, do the message string key = "Mods.CalamityMod.SteelSkullBossText"; diff --git a/NPCs/Bumblebirb/Bumblefuck.cs b/NPCs/Bumblebirb/Bumblefuck.cs index 69f82ad819..1575c3da7e 100644 --- a/NPCs/Bumblebirb/Bumblefuck.cs +++ b/NPCs/Bumblebirb/Bumblefuck.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Furniture.Trophies; @@ -129,6 +130,9 @@ namespace CalamityMod.NPCs.Bumblebirb // Materials DropHelper.DropItemSpray(npc, ModContent.ItemType(), 6, 11); + // Vanity + DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); + // Weapons DropHelper.DropItemFromSet(npc, ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType()); DropHelper.DropItemChance(npc, ModContent.ItemType(), DropHelper.RareVariantDropRateInt); diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 65f8eb3a87..344a4586c4 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -2442,7 +2442,7 @@ namespace CalamityMod.NPCs { damage = (int)(damage * 0.2); } - else if (projectile.type == ProjectileID.DD2BetsyArrow) + else if (projectile.type == ProjectileID.DD2BetsyArrow || projectile.type == ModContent.ProjectileType()) { damage = (int)(damage * 0.3); } diff --git a/NPCs/CeaselessVoid/CeaselessVoid.cs b/NPCs/CeaselessVoid/CeaselessVoid.cs index 07836b3e3d..74936e834e 100644 --- a/NPCs/CeaselessVoid/CeaselessVoid.cs +++ b/NPCs/CeaselessVoid/CeaselessVoid.cs @@ -1,14 +1,12 @@ using CalamityMod.Items.Accessories; +using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Furniture.Trophies; using CalamityMod.Items.Weapons.Melee; -using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; -using System.IO; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -103,6 +101,7 @@ namespace CalamityMod.NPCs.CeaselessVoid // Vanity DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); + DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); // Other bool lastSentinelKilled = !CalamityWorld.downedSentinel1 && CalamityWorld.downedSentinel2 && CalamityWorld.downedSentinel3; diff --git a/NPCs/GreatSandShark/GreatSandShark.cs b/NPCs/GreatSandShark/GreatSandShark.cs index 5144c33930..69cb4c2a10 100644 --- a/NPCs/GreatSandShark/GreatSandShark.cs +++ b/NPCs/GreatSandShark/GreatSandShark.cs @@ -13,6 +13,7 @@ using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.NPCs.GreatSandShark { + [AutoloadBossHead] public class GreatSandShark : ModNPC { private bool resetAI = false; diff --git a/NPCs/GreatSandShark/GreatSandShark_Head_Boss.png b/NPCs/GreatSandShark/GreatSandShark_Head_Boss.png new file mode 100644 index 0000000000..998eefcfdf Binary files /dev/null and b/NPCs/GreatSandShark/GreatSandShark_Head_Boss.png differ diff --git a/NPCs/NormalNPCs/PhantomSpirit.cs b/NPCs/NormalNPCs/PhantomSpirit.cs index 2da359038d..5becb74b6c 100644 --- a/NPCs/NormalNPCs/PhantomSpirit.cs +++ b/NPCs/NormalNPCs/PhantomSpirit.cs @@ -93,7 +93,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType()); + DropHelper.DropItem(npc, ModContent.ItemType()); } } } diff --git a/NPCs/NormalNPCs/Pitbull.cs b/NPCs/NormalNPCs/Pitbull.cs index 1bd101d748..2d681fc606 100644 --- a/NPCs/NormalNPCs/Pitbull.cs +++ b/NPCs/NormalNPCs/Pitbull.cs @@ -63,7 +63,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void NPCLoot() { int bandageDropRate = CalamityWorld.defiled ? DropHelper.DefiledDropRateInt : Main.expertMode ? 50 : 100; - DropHelper.DropItemCondition(npc, ItemID.AdhesiveBandage, Main.hardMode, bandageDropRate, 1, 1); + DropHelper.DropItemChance(npc, ItemID.AdhesiveBandage, bandageDropRate, 1, 1); } } } diff --git a/NPCs/Polterghast/Polterghast.cs b/NPCs/Polterghast/Polterghast.cs index 550a5a083f..f0922925af 100644 --- a/NPCs/Polterghast/Polterghast.cs +++ b/NPCs/Polterghast/Polterghast.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Furniture.Trophies; @@ -701,6 +702,9 @@ namespace CalamityMod.NPCs.Polterghast DropHelper.DropItem(npc, ModContent.ItemType(), 5, 8); DropHelper.DropItem(npc, ModContent.ItemType(), 10, 20); + // Vanity + DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); + // Weapons DropHelper.DropItemChance(npc, ModContent.ItemType(), 4); DropHelper.DropItemChance(npc, ModContent.ItemType(), 4); diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs b/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs index 0bd8d00466..125c7215ae 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianBoss.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; using CalamityMod.Items.SummonItems; using CalamityMod.Projectiles.Boss; @@ -424,6 +425,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians public override void NPCLoot() { // Profaned Guardians have no actual drops and no treasure bag + DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); DropHelper.DropItem(npc, ModContent.ItemType()); DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !CalamityWorld.downedGuardians); DropHelper.DropResidentEvilAmmo(npc, CalamityWorld.downedGuardians, 5, 2, 1); diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index 6bec3dedd0..78f3c0cc97 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -1079,6 +1079,8 @@ namespace CalamityMod.NPCs.Providence DropHelper.DropItemCondition(npc, ModContent.ItemType(), biomeType != 2); DropHelper.DropItemCondition(npc, ModContent.ItemType(), biomeType == 2); + DropHelper.DropItemCondition(npc, ModContent.ItemType(), true, !CalamityWorld.downedProvidence); + // All other drops are contained in the bag, so they only drop directly on Normal if (!Main.expertMode) { @@ -1099,9 +1101,6 @@ namespace CalamityMod.NPCs.Providence // Vanity DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); - - // Other - DropHelper.DropItem(npc, ModContent.ItemType()); } if (Main.netMode != NetmodeID.MultiplayerClient) diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index dd68b01d8f..58d9e77c2b 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -1,6 +1,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Accessories; +using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Furniture.Trophies; @@ -660,6 +661,9 @@ namespace CalamityMod.NPCs.Ravager // Equipment DropHelper.DropItemChance(npc, ModContent.ItemType(), 3); DropHelper.DropItemChance(npc, ModContent.ItemType(), 3); + + // Vanity + DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); } // Mark Ravager as dead diff --git a/NPCs/Signus/Signus.cs b/NPCs/Signus/Signus.cs index 626c0d76cc..8e31687082 100644 --- a/NPCs/Signus/Signus.cs +++ b/NPCs/Signus/Signus.cs @@ -1,6 +1,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Accessories; +using CalamityMod.Items.Armor.Vanity; using CalamityMod.Items.LoreItems; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Furniture.Trophies; @@ -749,6 +750,7 @@ namespace CalamityMod.NPCs.Signus // Vanity DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); + DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); // Other bool lastSentinelKilled = CalamityWorld.downedSentinel1 && CalamityWorld.downedSentinel2 && !CalamityWorld.downedSentinel3; diff --git a/NPCs/SlimeGod/SlimeSpawnCorrupt2.cs b/NPCs/SlimeGod/SlimeSpawnCorrupt2.cs index 0f67833f1b..0240e52ea9 100644 --- a/NPCs/SlimeGod/SlimeSpawnCorrupt2.cs +++ b/NPCs/SlimeGod/SlimeSpawnCorrupt2.cs @@ -52,9 +52,9 @@ namespace CalamityMod.NPCs.SlimeGod } } - public override bool PreNPCLoot() + public override void NPCLoot() { - return false; + DropHelper.DropItemChance(npc, ItemID.Vitamins, Main.expertMode ? 50 : 100); } public override void OnHitPlayer(Player player, int damage, bool crit) diff --git a/NPCs/SlimeGod/SlimeSpawnCrimson.cs b/NPCs/SlimeGod/SlimeSpawnCrimson.cs index f65009d95d..a3abd8f48d 100644 --- a/NPCs/SlimeGod/SlimeSpawnCrimson.cs +++ b/NPCs/SlimeGod/SlimeSpawnCrimson.cs @@ -54,17 +54,7 @@ namespace CalamityMod.NPCs.SlimeGod public override void NPCLoot() { - if (Main.expertMode) - { - if (Main.rand.NextBool(50)) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Nazar); - } - } - else if (Main.rand.NextBool(100)) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Nazar); - } + DropHelper.DropItemChance(npc, ItemID.Nazar, Main.expertMode ? 50 : 100); } public override void OnHitPlayer(Player player, int damage, bool crit) diff --git a/NPCs/SlimeGod/SlimeSpawnCrimson2.cs b/NPCs/SlimeGod/SlimeSpawnCrimson2.cs index 49edc806ea..8d6089379f 100644 --- a/NPCs/SlimeGod/SlimeSpawnCrimson2.cs +++ b/NPCs/SlimeGod/SlimeSpawnCrimson2.cs @@ -113,17 +113,7 @@ namespace CalamityMod.NPCs.SlimeGod public override void NPCLoot() { - if (Main.expertMode) - { - if (Main.rand.NextBool(50)) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Nazar); - } - } - else if (Main.rand.NextBool(100)) - { - Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ItemID.Nazar); - } + DropHelper.DropItemChance(npc, ItemID.Nazar, Main.expertMode ? 50 : 100); } public override void OnHitPlayer(Player player, int damage, bool crit) diff --git a/NPCs/StormWeaver/StormWeaverBodyNaked.cs b/NPCs/StormWeaver/StormWeaverBodyNaked.cs index d8a5c5ce52..ee3c2ce1b3 100644 --- a/NPCs/StormWeaver/StormWeaverBodyNaked.cs +++ b/NPCs/StormWeaver/StormWeaverBodyNaked.cs @@ -258,10 +258,6 @@ namespace CalamityMod.NPCs.StormWeaver { damage /= projectile.penetrate; } - if (projectile.type == ModContent.ProjectileType()) - { - damage /= 6; - } } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/StormWeaver/StormWeaverHeadNaked.cs b/NPCs/StormWeaver/StormWeaverHeadNaked.cs index 5287e69c1e..d1b2c18a6b 100644 --- a/NPCs/StormWeaver/StormWeaverHeadNaked.cs +++ b/NPCs/StormWeaver/StormWeaverHeadNaked.cs @@ -1,9 +1,9 @@ -using CalamityMod.Items.LoreItems; +using CalamityMod.Items.Armor.Vanity; +using CalamityMod.Items.LoreItems; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Furniture.Trophies; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.World; -using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System.IO; @@ -554,10 +554,6 @@ namespace CalamityMod.NPCs.StormWeaver { damage /= projectile.penetrate; } - if (projectile.type == ModContent.ProjectileType()) - { - damage /= 6; - } } public override void HitEffect(int hitDirection, double damage) @@ -639,6 +635,7 @@ namespace CalamityMod.NPCs.StormWeaver // Vanity DropHelper.DropItemChance(npc, ModContent.ItemType(), 10); + DropHelper.DropItemChance(npc, ModContent.ItemType(), 7); // Other bool lastSentinelKilled = CalamityWorld.downedSentinel1 && !CalamityWorld.downedSentinel2 && CalamityWorld.downedSentinel3; diff --git a/NPCs/StormWeaver/StormWeaverTailNaked.cs b/NPCs/StormWeaver/StormWeaverTailNaked.cs index 86934f88db..494003ada5 100644 --- a/NPCs/StormWeaver/StormWeaverTailNaked.cs +++ b/NPCs/StormWeaver/StormWeaverTailNaked.cs @@ -246,10 +246,6 @@ namespace CalamityMod.NPCs.StormWeaver { damage /= projectile.penetrate; } - if (projectile.type == ModContent.ProjectileType()) - { - damage /= 6; - } } public override void HitEffect(int hitDirection, double damage) diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index 4ecdc82e97..9c80ec4a74 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -10,6 +10,7 @@ using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; using CalamityMod.Projectiles.Boss; using CalamityMod.Projectiles.Summon; using CalamityMod.World; @@ -2176,7 +2177,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), ModContent.ItemType(), // The Dance of Light ModContent.ItemType(), ModContent.ItemType(), - ModContent.ItemType(), ModContent.ItemType() // Voidragon + ModContent.ItemType(), ModContent.ItemType(), // Voidragon + ModContent.ItemType(), ModContent.ItemType() ); DropHelper.DropItemCondition(npc, ModContent.ItemType(), CalamityWorld.revenge); diff --git a/Projectiles/Boss/BrimstoneBarrage.cs b/Projectiles/Boss/BrimstoneBarrage.cs index 985749d919..05ca877c80 100644 --- a/Projectiles/Boss/BrimstoneBarrage.cs +++ b/Projectiles/Boss/BrimstoneBarrage.cs @@ -67,5 +67,10 @@ namespace CalamityMod.Projectiles.Boss CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); return false; } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/BrimstoneBarrage.png b/Projectiles/Boss/BrimstoneBarrage.png index ed87c1d91e..7664f14d4e 100644 Binary files a/Projectiles/Boss/BrimstoneBarrage.png and b/Projectiles/Boss/BrimstoneBarrage.png differ diff --git a/Projectiles/Boss/BrimstoneFireblast.cs b/Projectiles/Boss/BrimstoneFireblast.cs index 0f9f09d90c..5c2accc7f7 100644 --- a/Projectiles/Boss/BrimstoneFireblast.cs +++ b/Projectiles/Boss/BrimstoneFireblast.cs @@ -119,5 +119,10 @@ namespace CalamityMod.Projectiles.Boss Main.dust[num195].noGravity = true; } } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/BrimstoneFireblast.png b/Projectiles/Boss/BrimstoneFireblast.png index 2a93eb6440..c1867a5f81 100644 Binary files a/Projectiles/Boss/BrimstoneFireblast.png and b/Projectiles/Boss/BrimstoneFireblast.png differ diff --git a/Projectiles/Boss/BrimstoneGigaBlast.cs b/Projectiles/Boss/BrimstoneGigaBlast.cs index 21c0bf3e01..34f906b4c3 100644 --- a/Projectiles/Boss/BrimstoneGigaBlast.cs +++ b/Projectiles/Boss/BrimstoneGigaBlast.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Projectiles.Boss public override void SetStaticDefaults() { DisplayName.SetDefault("Brimstone Fireblast"); - Main.projFrames[projectile.type] = 6; + Main.projFrames[projectile.type] = 5; } public override void SetDefaults() @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Boss projectile.frame++; projectile.frameCounter = 0; } - if (projectile.frame > 5) + if (projectile.frame >= 5) { projectile.frame = 0; } @@ -121,5 +121,10 @@ namespace CalamityMod.Projectiles.Boss Main.dust[num195].noGravity = true; } } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/BrimstoneGigaBlast.png b/Projectiles/Boss/BrimstoneGigaBlast.png index d3c929375c..eacc109586 100644 Binary files a/Projectiles/Boss/BrimstoneGigaBlast.png and b/Projectiles/Boss/BrimstoneGigaBlast.png differ diff --git a/Projectiles/Boss/BrimstoneHellblast.cs b/Projectiles/Boss/BrimstoneHellblast.cs index 24686f3b88..dd7e35b3a8 100644 --- a/Projectiles/Boss/BrimstoneHellblast.cs +++ b/Projectiles/Boss/BrimstoneHellblast.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { projectile.frameCounter++; - if (projectile.frameCounter > 12) + if (projectile.frameCounter >= 10) { projectile.frame++; projectile.frameCounter = 0; @@ -91,5 +91,10 @@ namespace CalamityMod.Projectiles.Boss Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 235, 0f, 0f); } } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/BrimstoneHellblast.png b/Projectiles/Boss/BrimstoneHellblast.png index f9de3e2ae9..dd8e4e8aa4 100644 Binary files a/Projectiles/Boss/BrimstoneHellblast.png and b/Projectiles/Boss/BrimstoneHellblast.png differ diff --git a/Projectiles/Boss/BrimstoneHellblast2.cs b/Projectiles/Boss/BrimstoneHellblast2.cs index 05c85753ea..819ba0a176 100644 --- a/Projectiles/Boss/BrimstoneHellblast2.cs +++ b/Projectiles/Boss/BrimstoneHellblast2.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { projectile.frameCounter++; - if (projectile.frameCounter > 12) + if (projectile.frameCounter >= 10) { projectile.frame++; projectile.frameCounter = 0; @@ -74,5 +74,10 @@ namespace CalamityMod.Projectiles.Boss target.AddBuff(ModContent.BuffType(), 180); target.AddBuff(ModContent.BuffType(), 120, true); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/BrimstoneHellblast2.png b/Projectiles/Boss/BrimstoneHellblast2.png index f9de3e2ae9..917a949d4c 100644 Binary files a/Projectiles/Boss/BrimstoneHellblast2.png and b/Projectiles/Boss/BrimstoneHellblast2.png differ diff --git a/Projectiles/Boss/BrimstoneMonster.cs b/Projectiles/Boss/BrimstoneMonster.cs index 4d79564305..4ff52531ab 100644 --- a/Projectiles/Boss/BrimstoneMonster.cs +++ b/Projectiles/Boss/BrimstoneMonster.cs @@ -158,5 +158,10 @@ namespace CalamityMod.Projectiles.Boss target.AddBuff(ModContent.BuffType(), 900); target.AddBuff(ModContent.BuffType(), 300, true); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/BrimstoneWave.cs b/Projectiles/Boss/BrimstoneWave.cs index 436d94bce5..969ea8bcc1 100644 --- a/Projectiles/Boss/BrimstoneWave.cs +++ b/Projectiles/Boss/BrimstoneWave.cs @@ -84,5 +84,10 @@ namespace CalamityMod.Projectiles.Boss target.AddBuff(ModContent.BuffType(), 180); target.AddBuff(ModContent.BuffType(), 120, true); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/BrimstoneWave.png b/Projectiles/Boss/BrimstoneWave.png index 1c15b325e6..27b1111121 100644 Binary files a/Projectiles/Boss/BrimstoneWave.png and b/Projectiles/Boss/BrimstoneWave.png differ diff --git a/Projectiles/Boss/CosmicFlameBurst.cs b/Projectiles/Boss/CosmicFlameBurst.cs index 40e60abddb..0146e86a1a 100644 --- a/Projectiles/Boss/CosmicFlameBurst.cs +++ b/Projectiles/Boss/CosmicFlameBurst.cs @@ -67,5 +67,10 @@ namespace CalamityMod.Projectiles.Boss } projectile.Damage(); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/DarkEnergyBall.cs b/Projectiles/Boss/DarkEnergyBall.cs index 7bf0ffa22c..a652d58db4 100644 --- a/Projectiles/Boss/DarkEnergyBall.cs +++ b/Projectiles/Boss/DarkEnergyBall.cs @@ -66,5 +66,10 @@ namespace CalamityMod.Projectiles.Boss Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 90, 0f, 0f); } } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/DoGBeam.cs b/Projectiles/Boss/DoGBeam.cs index b9a8b7e111..b7240a1880 100644 --- a/Projectiles/Boss/DoGBeam.cs +++ b/Projectiles/Boss/DoGBeam.cs @@ -76,5 +76,10 @@ namespace CalamityMod.Projectiles.Boss } return new Color(255, 255, 255, 100); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/DoGBeamPortal.cs b/Projectiles/Boss/DoGBeamPortal.cs index ca50b85914..44860185c8 100644 --- a/Projectiles/Boss/DoGBeamPortal.cs +++ b/Projectiles/Boss/DoGBeamPortal.cs @@ -144,5 +144,10 @@ namespace CalamityMod.Projectiles.Boss } return new Color(255, 255, 255, 100); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/DoGDeath.cs b/Projectiles/Boss/DoGDeath.cs index 8aa5417547..377cb4acbb 100644 --- a/Projectiles/Boss/DoGDeath.cs +++ b/Projectiles/Boss/DoGDeath.cs @@ -48,5 +48,10 @@ namespace CalamityMod.Projectiles.Boss { return new Color(255, 255, 255, projectile.alpha); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/DoGFire.cs b/Projectiles/Boss/DoGFire.cs index 6470406d71..af7ab54a02 100644 --- a/Projectiles/Boss/DoGFire.cs +++ b/Projectiles/Boss/DoGFire.cs @@ -124,5 +124,10 @@ namespace CalamityMod.Projectiles.Boss } projectile.Damage(); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/DoGNebulaShot.cs b/Projectiles/Boss/DoGNebulaShot.cs index cbea000c30..628660c0cd 100644 --- a/Projectiles/Boss/DoGNebulaShot.cs +++ b/Projectiles/Boss/DoGNebulaShot.cs @@ -107,5 +107,10 @@ namespace CalamityMod.Projectiles.Boss } return false; } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/EssenceDust.cs b/Projectiles/Boss/EssenceDust.cs index 289579483d..fc4bb22110 100644 --- a/Projectiles/Boss/EssenceDust.cs +++ b/Projectiles/Boss/EssenceDust.cs @@ -61,5 +61,10 @@ namespace CalamityMod.Projectiles.Boss } projectile.Damage(); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/FlareBomb.cs b/Projectiles/Boss/FlareBomb.cs index 867f17ebe2..8e3b9b5075 100644 --- a/Projectiles/Boss/FlareBomb.cs +++ b/Projectiles/Boss/FlareBomb.cs @@ -140,30 +140,28 @@ namespace CalamityMod.Projectiles.Boss scaleFactor10 = 1f; } int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13AB6_cp_0 = Main.gore[num626]; - expr_13AB6_cp_0.velocity.X += 1f; - Gore expr_13AD6_cp_0 = Main.gore[num626]; - expr_13AD6_cp_0.velocity.Y += 1f; + Gore gore = Main.gore[num626]; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13B79_cp_0 = Main.gore[num626]; - expr_13B79_cp_0.velocity.X -= 1f; - Gore expr_13B99_cp_0 = Main.gore[num626]; - expr_13B99_cp_0.velocity.Y += 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13C3C_cp_0 = Main.gore[num626]; - expr_13C3C_cp_0.velocity.X += 1f; - Gore expr_13C5C_cp_0 = Main.gore[num626]; - expr_13C5C_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y -= 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13CFF_cp_0 = Main.gore[num626]; - expr_13CFF_cp_0.velocity.X -= 1f; - Gore expr_13D1F_cp_0 = Main.gore[num626]; - expr_13D1F_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y -= 1f; } } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/FlareDust.cs b/Projectiles/Boss/FlareDust.cs index 75925b061c..3614a6bcb4 100644 --- a/Projectiles/Boss/FlareDust.cs +++ b/Projectiles/Boss/FlareDust.cs @@ -92,32 +92,30 @@ namespace CalamityMod.Projectiles.Boss scaleFactor10 = 1f; } int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13AB6_cp_0 = Main.gore[num626]; - expr_13AB6_cp_0.velocity.X += 1f; - Gore expr_13AD6_cp_0 = Main.gore[num626]; - expr_13AD6_cp_0.velocity.Y += 1f; + Gore gore = Main.gore[num626]; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13B79_cp_0 = Main.gore[num626]; - expr_13B79_cp_0.velocity.X -= 1f; - Gore expr_13B99_cp_0 = Main.gore[num626]; - expr_13B99_cp_0.velocity.Y += 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13C3C_cp_0 = Main.gore[num626]; - expr_13C3C_cp_0.velocity.X += 1f; - Gore expr_13C5C_cp_0 = Main.gore[num626]; - expr_13C5C_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y -= 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13CFF_cp_0 = Main.gore[num626]; - expr_13CFF_cp_0.velocity.X -= 1f; - Gore expr_13D1F_cp_0 = Main.gore[num626]; - expr_13D1F_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y -= 1f; } projectile.damage = Main.expertMode ? 75 : 90; projectile.Damage(); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/FlareDust2.cs b/Projectiles/Boss/FlareDust2.cs index bbcaa713ce..f0c415b89b 100644 --- a/Projectiles/Boss/FlareDust2.cs +++ b/Projectiles/Boss/FlareDust2.cs @@ -107,30 +107,28 @@ namespace CalamityMod.Projectiles.Boss scaleFactor10 = 1f; } int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13AB6_cp_0 = Main.gore[num626]; - expr_13AB6_cp_0.velocity.X += 1f; - Gore expr_13AD6_cp_0 = Main.gore[num626]; - expr_13AD6_cp_0.velocity.Y += 1f; + Gore gore = Main.gore[num626]; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13B79_cp_0 = Main.gore[num626]; - expr_13B79_cp_0.velocity.X -= 1f; - Gore expr_13B99_cp_0 = Main.gore[num626]; - expr_13B99_cp_0.velocity.Y += 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13C3C_cp_0 = Main.gore[num626]; - expr_13C3C_cp_0.velocity.X += 1f; - Gore expr_13C5C_cp_0 = Main.gore[num626]; - expr_13C5C_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y -= 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13CFF_cp_0 = Main.gore[num626]; - expr_13CFF_cp_0.velocity.X -= 1f; - Gore expr_13D1F_cp_0 = Main.gore[num626]; - expr_13D1F_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y -= 1f; } } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/Flarenado.cs b/Projectiles/Boss/Flarenado.cs index 743a808b32..798cce703d 100644 --- a/Projectiles/Boss/Flarenado.cs +++ b/Projectiles/Boss/Flarenado.cs @@ -145,5 +145,10 @@ namespace CalamityMod.Projectiles.Boss Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), projectile.scale, SpriteEffects.None, 0f); return false; } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/HolyBlast.cs b/Projectiles/Boss/HolyBlast.cs index 98bef7ccd2..ed3b4d113f 100644 --- a/Projectiles/Boss/HolyBlast.cs +++ b/Projectiles/Boss/HolyBlast.cs @@ -120,5 +120,10 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 240); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/HolyBomb.cs b/Projectiles/Boss/HolyBomb.cs index d207e757d5..197a122331 100644 --- a/Projectiles/Boss/HolyBomb.cs +++ b/Projectiles/Boss/HolyBomb.cs @@ -117,5 +117,10 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 180); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/HolyFire.cs b/Projectiles/Boss/HolyFire.cs index b06c936efc..72d254ee98 100644 --- a/Projectiles/Boss/HolyFire.cs +++ b/Projectiles/Boss/HolyFire.cs @@ -111,5 +111,10 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 120); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/HolyFire2.cs b/Projectiles/Boss/HolyFire2.cs index dd46a82490..ccb584388f 100644 --- a/Projectiles/Boss/HolyFire2.cs +++ b/Projectiles/Boss/HolyFire2.cs @@ -100,5 +100,10 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 120); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/HolyFlare.cs b/Projectiles/Boss/HolyFlare.cs index 2e68e6301b..b74b3dbb9c 100644 --- a/Projectiles/Boss/HolyFlare.cs +++ b/Projectiles/Boss/HolyFlare.cs @@ -111,5 +111,10 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 120); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/HolyShot.cs b/Projectiles/Boss/HolyShot.cs index 7833e5b317..f12f442beb 100644 --- a/Projectiles/Boss/HolyShot.cs +++ b/Projectiles/Boss/HolyShot.cs @@ -89,5 +89,10 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 120); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/HolySpear.cs b/Projectiles/Boss/HolySpear.cs index ac888e608f..2fbdbc6d47 100644 --- a/Projectiles/Boss/HolySpear.cs +++ b/Projectiles/Boss/HolySpear.cs @@ -102,5 +102,10 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 120); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/Infernado.cs b/Projectiles/Boss/Infernado.cs index 3ccd59b55d..bdbaeeee6f 100644 --- a/Projectiles/Boss/Infernado.cs +++ b/Projectiles/Boss/Infernado.cs @@ -146,5 +146,10 @@ namespace CalamityMod.Projectiles.Boss Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), projectile.scale, SpriteEffects.None, 0f); return false; } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/Infernado2.cs b/Projectiles/Boss/Infernado2.cs index 52e0a441ed..a97b404bd5 100644 --- a/Projectiles/Boss/Infernado2.cs +++ b/Projectiles/Boss/Infernado2.cs @@ -141,5 +141,10 @@ namespace CalamityMod.Projectiles.Boss Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), projectile.scale, SpriteEffects.None, 0f); return false; } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/InfernadoRevenge.cs b/Projectiles/Boss/InfernadoRevenge.cs index c51fd26f67..ac365efa49 100644 --- a/Projectiles/Boss/InfernadoRevenge.cs +++ b/Projectiles/Boss/InfernadoRevenge.cs @@ -147,5 +147,10 @@ namespace CalamityMod.Projectiles.Boss { target.KillMe(PlayerDeathReason.ByOther(11), 1000.0, 0, false); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/MoltenBlast.cs b/Projectiles/Boss/MoltenBlast.cs index c8381753fb..8224f79da3 100644 --- a/Projectiles/Boss/MoltenBlast.cs +++ b/Projectiles/Boss/MoltenBlast.cs @@ -137,5 +137,10 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 180); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/MoltenBlob.cs b/Projectiles/Boss/MoltenBlob.cs index 7ec79e78e2..bb33c42184 100644 --- a/Projectiles/Boss/MoltenBlob.cs +++ b/Projectiles/Boss/MoltenBlob.cs @@ -100,5 +100,10 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 90); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/PhantomBlast.cs b/Projectiles/Boss/PhantomBlast.cs index b86ded35a1..0b599141d4 100644 --- a/Projectiles/Boss/PhantomBlast.cs +++ b/Projectiles/Boss/PhantomBlast.cs @@ -128,5 +128,10 @@ namespace CalamityMod.Projectiles.Boss Main.dust[num624].velocity *= 2f; } } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/PhantomBlast2.cs b/Projectiles/Boss/PhantomBlast2.cs index 109ab6eb61..d0301057f9 100644 --- a/Projectiles/Boss/PhantomBlast2.cs +++ b/Projectiles/Boss/PhantomBlast2.cs @@ -128,5 +128,10 @@ namespace CalamityMod.Projectiles.Boss Main.dust[num624].velocity *= 2f; } } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/PhantomGhostShot.cs b/Projectiles/Boss/PhantomGhostShot.cs index 4a6f6c4c49..48b0226b62 100644 --- a/Projectiles/Boss/PhantomGhostShot.cs +++ b/Projectiles/Boss/PhantomGhostShot.cs @@ -72,5 +72,10 @@ namespace CalamityMod.Projectiles.Boss { return new Color(100, 250, 250, projectile.alpha); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/PhantomHookShot.cs b/Projectiles/Boss/PhantomHookShot.cs index d3eed80dc7..48fa03acc9 100644 --- a/Projectiles/Boss/PhantomHookShot.cs +++ b/Projectiles/Boss/PhantomHookShot.cs @@ -72,5 +72,10 @@ namespace CalamityMod.Projectiles.Boss { return new Color(100, 250, 250, projectile.alpha); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/PhantomMine.cs b/Projectiles/Boss/PhantomMine.cs index 40ea1fd582..f2cf472631 100644 --- a/Projectiles/Boss/PhantomMine.cs +++ b/Projectiles/Boss/PhantomMine.cs @@ -64,5 +64,10 @@ namespace CalamityMod.Projectiles.Boss Main.dust[num624].velocity *= 2f; } } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/PhantomShot.cs b/Projectiles/Boss/PhantomShot.cs index 7efa9d2283..3b1a167469 100644 --- a/Projectiles/Boss/PhantomShot.cs +++ b/Projectiles/Boss/PhantomShot.cs @@ -93,5 +93,10 @@ namespace CalamityMod.Projectiles.Boss { return new Color(100, 250, 250, projectile.alpha); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/PhantomShot2.cs b/Projectiles/Boss/PhantomShot2.cs index e7804f9906..ec7bfda373 100644 --- a/Projectiles/Boss/PhantomShot2.cs +++ b/Projectiles/Boss/PhantomShot2.cs @@ -93,5 +93,10 @@ namespace CalamityMod.Projectiles.Boss { return new Color(250, 100, 100, projectile.alpha); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/ProfanedSpear.cs b/Projectiles/Boss/ProfanedSpear.cs index e750dd6462..ddcfe40e6e 100644 --- a/Projectiles/Boss/ProfanedSpear.cs +++ b/Projectiles/Boss/ProfanedSpear.cs @@ -95,5 +95,10 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 120); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/ProvidenceCrystal.cs b/Projectiles/Boss/ProvidenceCrystal.cs index b2aecb88ab..31238630d7 100644 --- a/Projectiles/Boss/ProvidenceCrystal.cs +++ b/Projectiles/Boss/ProvidenceCrystal.cs @@ -120,15 +120,16 @@ namespace CalamityMod.Projectiles.Boss float scaleFactor5 = (float)Math.Cos((double)(6.28318548f * (projectile.localAI[0] / 60f))) + 3f + 3f; for (float num286 = 0f; num286 < 4f; num286 += 1f) { - SpriteBatch arg_F907_0 = Main.spriteBatch; - Texture2D arg_F907_1 = texture2D34; - Vector2 arg_F8CE_0 = vector59; - Vector2 arg_F8BE_0 = Vector2.UnitY; - double arg_F8BE_1 = (double)(num286 * 1.57079637f); + double angle = (double)(num286 * 1.57079637f); Vector2 center = default; - arg_F907_0.Draw(arg_F907_1, arg_F8CE_0 + arg_F8BE_0.RotatedBy(arg_F8BE_1, center) * scaleFactor5, new Microsoft.Xna.Framework.Rectangle?(rectangle17), alpha5 * 0.2f, projectile.rotation, origin11, projectile.scale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(texture2D34, vector59 + Vector2.UnitY.RotatedBy(angle, center) * scaleFactor5, new Microsoft.Xna.Framework.Rectangle?(rectangle17), alpha5 * 0.2f, projectile.rotation, origin11, projectile.scale, SpriteEffects.None, 0f); } return false; } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/ProvidenceCrystalShard.cs b/Projectiles/Boss/ProvidenceCrystalShard.cs index 8f6cba393e..390d56b5f2 100644 --- a/Projectiles/Boss/ProvidenceCrystalShard.cs +++ b/Projectiles/Boss/ProvidenceCrystalShard.cs @@ -178,9 +178,9 @@ namespace CalamityMod.Projectiles.Boss Main.dust[num74].velocity = spinningpoint.RotatedBy((double)(6.28318548f * num73 / num69), default) * value5 * (0.8f + Main.rand.NextFloat() * 0.4f); Dust dust = Main.dust[num74]; dust.velocity *= Main.rand.NextFloat() * 0.8f; - Main.dust[num74].noGravity = true; - Main.dust[num74].scale = Main.rand.NextFloat() * 1f; - Main.dust[num74].fadeIn = Main.rand.NextFloat() * 2f; + dust.noGravity = true; + dust.scale = Main.rand.NextFloat() * 1f; + dust.fadeIn = Main.rand.NextFloat() * 2f; Dust dust12 = Dust.CloneDust(num74); dust = dust12; dust.scale /= 2f; @@ -195,5 +195,10 @@ namespace CalamityMod.Projectiles.Boss { return new Color(255 - projectile.alpha, 255 - projectile.alpha, 255 - projectile.alpha, 0); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/ProvidenceHolyRay.cs b/Projectiles/Boss/ProvidenceHolyRay.cs index fdcbb91bc8..45ffa4f0a1 100644 --- a/Projectiles/Boss/ProvidenceHolyRay.cs +++ b/Projectiles/Boss/ProvidenceHolyRay.cs @@ -146,11 +146,9 @@ namespace CalamityMod.Projectiles.Boss Texture2D texture2D21 = ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/ProvidenceHolyRayEnd"); float num223 = projectile.localAI[1]; //length of laser Color color44 = new Color(255, 255, 255, 0) * 0.9f; - SpriteBatch arg_ABD8_0 = Main.spriteBatch; - Texture2D arg_ABD8_1 = texture2D19; - Vector2 arg_ABD8_2 = projectile.Center - Main.screenPosition; + Vector2 vector = projectile.Center - Main.screenPosition; Rectangle? sourceRectangle2 = null; - arg_ABD8_0.Draw(arg_ABD8_1, arg_ABD8_2, sourceRectangle2, color44, projectile.rotation, texture2D19.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(texture2D19, vector, sourceRectangle2, color44, projectile.rotation, texture2D19.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); num223 -= (float)(texture2D19.Height / 2 + texture2D21.Height) * projectile.scale; Vector2 value20 = projectile.Center; value20 += projectile.velocity * projectile.scale * (float)texture2D19.Height / 2f; @@ -174,11 +172,9 @@ namespace CalamityMod.Projectiles.Boss } } } - SpriteBatch arg_AE2D_0 = Main.spriteBatch; - Texture2D arg_AE2D_1 = texture2D21; - Vector2 arg_AE2D_2 = value20 - Main.screenPosition; + Vector2 vector2 = value20 - Main.screenPosition; sourceRectangle2 = null; - arg_AE2D_0.Draw(arg_AE2D_1, arg_AE2D_2, sourceRectangle2, color44, projectile.rotation, texture2D21.Frame(1, 1, 0, 0).Top(), projectile.scale, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(texture2D21, vector2, sourceRectangle2, color44, projectile.rotation, texture2D21.Frame(1, 1, 0, 0).Top(), projectile.scale, SpriteEffects.None, 0f); return false; } @@ -207,5 +203,10 @@ namespace CalamityMod.Projectiles.Boss { target.AddBuff(ModContent.BuffType(), 300); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/RedLightningFeather.cs b/Projectiles/Boss/RedLightningFeather.cs index 791e55d6ff..b5c501b48b 100644 --- a/Projectiles/Boss/RedLightningFeather.cs +++ b/Projectiles/Boss/RedLightningFeather.cs @@ -107,5 +107,10 @@ namespace CalamityMod.Projectiles.Boss } projectile.Damage(); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/SignusScythe.cs b/Projectiles/Boss/SignusScythe.cs index 9079a0ec51..b610fc7611 100644 --- a/Projectiles/Boss/SignusScythe.cs +++ b/Projectiles/Boss/SignusScythe.cs @@ -144,5 +144,10 @@ namespace CalamityMod.Projectiles.Boss Main.dust[num624].velocity *= 2f; } } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/SkyFlare.cs b/Projectiles/Boss/SkyFlare.cs index bff98a0217..da67a400f2 100644 --- a/Projectiles/Boss/SkyFlare.cs +++ b/Projectiles/Boss/SkyFlare.cs @@ -120,5 +120,10 @@ namespace CalamityMod.Projectiles.Boss } } } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/SkyFlareRevenge.cs b/Projectiles/Boss/SkyFlareRevenge.cs index 72826aac90..8940726140 100644 --- a/Projectiles/Boss/SkyFlareRevenge.cs +++ b/Projectiles/Boss/SkyFlareRevenge.cs @@ -71,5 +71,10 @@ namespace CalamityMod.Projectiles.Boss Main.projectile[num236].netUpdate = true; } } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/YharonFireball.cs b/Projectiles/Boss/YharonFireball.cs index 6f1332749e..1e584c5e49 100644 --- a/Projectiles/Boss/YharonFireball.cs +++ b/Projectiles/Boss/YharonFireball.cs @@ -111,5 +111,10 @@ namespace CalamityMod.Projectiles.Boss Main.dust[num195].noGravity = true; } } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/Boss/YharonFireball2.cs b/Projectiles/Boss/YharonFireball2.cs index 87fe444ccd..c5dc40fb48 100644 --- a/Projectiles/Boss/YharonFireball2.cs +++ b/Projectiles/Boss/YharonFireball2.cs @@ -75,9 +75,9 @@ namespace CalamityMod.Projectiles.Boss } if (Main.rand.NextBool(16)) { - Dust expr_733B = Dust.NewDustDirect(projectile.position, projectile.width, projectile.height, 55, 0f, 0f, 200, default, 1f); - expr_733B.scale *= 0.7f; - expr_733B.velocity += projectile.velocity * 0.25f; + Dust dust = Dust.NewDustDirect(projectile.position, projectile.width, projectile.height, 55, 0f, 0f, 200, default, 1f); + dust.scale *= 0.7f; + dust.velocity += projectile.velocity * 0.25f; } } @@ -123,5 +123,10 @@ namespace CalamityMod.Projectiles.Boss } projectile.Damage(); } + + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = projectile; + } } } diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 753b5fd0bb..367d304199 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -1,5 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.CalPlayer; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Projectiles.Healing; @@ -480,13 +481,13 @@ namespace CalamityMod.Projectiles { if (setDamageValues) { - spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + spawnedPlayerMinionDamageValue = (Main.player[projectile.owner].allDamage + Main.player[projectile.owner].minionDamage - 1f); spawnedPlayerMinionProjectileDamageValue = projectile.damage; setDamageValues = false; } - if (Main.player[projectile.owner].minionDamage != spawnedPlayerMinionDamageValue) + if ((Main.player[projectile.owner].allDamage + Main.player[projectile.owner].minionDamage - 1f) != spawnedPlayerMinionDamageValue) { - int damage2 = (int)((float)spawnedPlayerMinionProjectileDamageValue / spawnedPlayerMinionDamageValue * Main.player[projectile.owner].minionDamage); + int damage2 = (int)((float)spawnedPlayerMinionProjectileDamageValue / spawnedPlayerMinionDamageValue * (Main.player[projectile.owner].allDamage + Main.player[projectile.owner].minionDamage - 1f)); projectile.damage = damage2; } } @@ -766,6 +767,7 @@ namespace CalamityMod.Projectiles } #endregion + // TODO -- there are a LOT of returns here which should be breaks or gotos out of if statements #region OnHitNPC public override void OnHitNPC(Projectile projectile, NPC target, int damage, float knockback, bool crit) { @@ -809,7 +811,8 @@ namespace CalamityMod.Projectiles Main.projectile[projectileIndex].netUpdate = true; } - if (!target.canGhostHeal) + // Spectre Damage set and Nebula set work on enemies which are "immune to lifesteal" + if (!target.canGhostHeal) { if (Main.player[projectile.owner].ghostHurt) { @@ -835,7 +838,8 @@ namespace CalamityMod.Projectiles } } - if (Main.player[projectile.owner].ghostHeal) + // Increases the degree to which Spectre Healing set contributes to the lifesteal cap + if (Main.player[projectile.owner].ghostHeal) { if (Main.player[Main.myPlayer].lifeSteal <= 0f) { @@ -851,6 +855,7 @@ namespace CalamityMod.Projectiles Main.player[Main.myPlayer].lifeSteal -= num2; } + // Increases the degree to which Vampire Knives contribute to the lifesteal cap if (projectile.type == ProjectileID.VampireKnife) { if (Main.player[Main.myPlayer].lifeSteal <= 0f) @@ -1506,6 +1511,15 @@ namespace CalamityMod.Projectiles target.AddBuff(BuffID.ShadowFlame, 300); } + // Fearmonger set's colossal life regeneration + CalamityPlayer modPlayer = Main.player[projectile.owner].Calamity(); + if(modPlayer.fearmongerSet) + { + modPlayer.fearmongerRegenFrames += 20; + if (modPlayer.fearmongerRegenFrames > 180) + modPlayer.fearmongerRegenFrames = 180; + } + if (Main.player[projectile.owner].Calamity().godSlayerSummon && Main.player[projectile.owner].Calamity().godSlayerDmg <= 0) { int num = projectile.damage / 2; @@ -1561,6 +1575,13 @@ namespace CalamityMod.Projectiles } #endregion + /*#ModifyHitPlayer + public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit) + { + target.Calamity().lastProjectileHit = ModContent.ProjectileType(); + } + #endregion*/ + #region CanDamage public override bool CanDamage(Projectile projectile) { diff --git a/Projectiles/Healing/EssenceFlame.png b/Projectiles/Healing/EssenceFlame.png index 2ef4c2dba5..3009ead213 100644 Binary files a/Projectiles/Healing/EssenceFlame.png and b/Projectiles/Healing/EssenceFlame.png differ diff --git a/Projectiles/Magic/BeastScythe.cs b/Projectiles/Magic/BeastScythe.cs new file mode 100644 index 0000000000..efc8fff34d --- /dev/null +++ b/Projectiles/Magic/BeastScythe.cs @@ -0,0 +1,229 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Magic +{ + public class BeastScythe : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Scythe"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 8; + ProjectileID.Sets.TrailingMode[projectile.type] = 1; + } + + public override void SetDefaults() + { + projectile.width = 52; + projectile.height = 52; + projectile.alpha = 255; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.netImportant = true; + projectile.penetrate = 1; + projectile.timeLeft = 600; + projectile.magic = true; + projectile.extraUpdates = 1; + projectile.tileCollide = false; + } + + public override void AI() + { + if (projectile.alpha > 0) + { + projectile.alpha -= 20; + } + if (projectile.alpha < 0) + { + projectile.alpha = 0; + } + + projectile.rotation += 0.5f; + + Lighting.AddLight(projectile.Center, 0.35f, 0f, 0.35f); + if (Main.rand.NextBool(3)) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 173, projectile.velocity.X * 0.25f, projectile.velocity.Y * 0.25f); + } + + projectile.ai[0] += 1f; + if (projectile.ai[0] <= 30f) + { + projectile.velocity *= 0.999f; + } + if (Main.myPlayer == projectile.owner && projectile.ai[0] == 30f) + { + if (Main.player[projectile.owner].channel) + { + float num115 = 20f; + Vector2 vector10 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num116 = (float)Main.mouseX + Main.screenPosition.X - vector10.X; + float num117 = (float)Main.mouseY + Main.screenPosition.Y - vector10.Y; + if (Main.player[projectile.owner].gravDir == -1f) + { + num117 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector10.Y; + } + float num118 = (float)Math.Sqrt((double)(num116 * num116 + num117 * num117)); + num118 = (float)Math.Sqrt((double)(num116 * num116 + num117 * num117)); + if (num118 > num115) + { + num118 = num115 / num118; + num116 *= num118; + num117 *= num118; + int num119 = (int)(num116 * 1000f); + int num120 = (int)(projectile.velocity.X * 1000f); + int num121 = (int)(num117 * 1000f); + int num122 = (int)(projectile.velocity.Y * 1000f); + if (num119 != num120 || num121 != num122) + { + projectile.netUpdate = true; + } + projectile.velocity.X = num116; + projectile.velocity.Y = num117; + } + else + { + int num123 = (int)(num116 * 1000f); + int num124 = (int)(projectile.velocity.X * 1000f); + int num125 = (int)(num117 * 1000f); + int num126 = (int)(projectile.velocity.Y * 1000f); + if (num123 != num124 || num125 != num126) + { + projectile.netUpdate = true; + } + projectile.velocity.X = num116; + projectile.velocity.Y = num117; + } + } + else + { + projectile.netUpdate = true; + float num127 = 20f; + Vector2 vector11 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num128 = (float)Main.mouseX + Main.screenPosition.X - vector11.X; + float num129 = (float)Main.mouseY + Main.screenPosition.Y - vector11.Y; + if (Main.player[projectile.owner].gravDir == -1f) + { + num129 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector11.Y; + } + float num130 = (float)Math.Sqrt((double)(num128 * num128 + num129 * num129)); + if (num130 == 0f || projectile.ai[0] < 0f) + { + vector11 = new Vector2(Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2), Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2)); + num128 = projectile.position.X + (float)projectile.width * 0.5f - vector11.X; + num129 = projectile.position.Y + (float)projectile.height * 0.5f - vector11.Y; + num130 = (float)Math.Sqrt((double)(num128 * num128 + num129 * num129)); + } + num130 = num127 / num130; + num128 *= num130; + num129 *= num130; + projectile.velocity.X = num128; + projectile.velocity.Y = num129; + } + } + if (projectile.ai[0] >= 30f) + { + projectile.velocity *= 1.001f; + 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)) + { + 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 = 20f; + 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; + } + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(BuffID.OnFire, 180); + if (Main.rand.NextBool(3)) + { + target.AddBuff(BuffID.ShadowFlame, 300); + } + else if (Main.rand.NextBool(2)) + { + target.AddBuff(ModContent.BuffType(), 300); + } + else + { + target.AddBuff(ModContent.BuffType(), 120); + } + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + projectile.position = projectile.Center; + projectile.width = projectile.height = 100; + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.maxPenetrate = -1; + projectile.penetrate = -1; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + projectile.damage /= 2; + projectile.Damage(); + 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, 173, 0f, 0f, 100, default, 1.5f); + } + for (int n = 0; n < 4; n++) + { + int num10 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 0, default, 2.5f); + Main.dust[num10].noGravity = true; + Main.dust[num10].velocity *= 3f; + if (flag) + { + Main.dust[num10].noLight = true; + } + num10 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 1.5f); + Main.dust[num10].velocity *= 2f; + Main.dust[num10].noGravity = true; + if (flag) + { + Main.dust[num10].noLight = true; + } + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2); + return false; + } + } +} diff --git a/Projectiles/Magic/BeastScythe.png b/Projectiles/Magic/BeastScythe.png new file mode 100644 index 0000000000..141717a2a2 Binary files /dev/null and b/Projectiles/Magic/BeastScythe.png differ diff --git a/Projectiles/Magic/SeethingDischargeBrimstoneBarrage.cs b/Projectiles/Magic/SeethingDischargeBrimstoneBarrage.cs index 38f196ab17..ddcb54418f 100644 --- a/Projectiles/Magic/SeethingDischargeBrimstoneBarrage.cs +++ b/Projectiles/Magic/SeethingDischargeBrimstoneBarrage.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Magic projectile.frame++; projectile.frameCounter = 0; } - if (projectile.frame > 3) + if (projectile.frame >= 4) { projectile.frame = 0; } diff --git a/Projectiles/Magic/SeethingDischargeBrimstoneBarrage.png b/Projectiles/Magic/SeethingDischargeBrimstoneBarrage.png index ed87c1d91e..7664f14d4e 100644 Binary files a/Projectiles/Magic/SeethingDischargeBrimstoneBarrage.png and b/Projectiles/Magic/SeethingDischargeBrimstoneBarrage.png differ diff --git a/Projectiles/Magic/SeethingDischargeBrimstoneHellblast.cs b/Projectiles/Magic/SeethingDischargeBrimstoneHellblast.cs index f5996d4e2d..658ace9db0 100644 --- a/Projectiles/Magic/SeethingDischargeBrimstoneHellblast.cs +++ b/Projectiles/Magic/SeethingDischargeBrimstoneHellblast.cs @@ -33,12 +33,12 @@ namespace CalamityMod.Projectiles.Magic public override void AI() { projectile.frameCounter++; - if (projectile.frameCounter > 12) + if (projectile.frameCounter >= 10) { projectile.frame++; projectile.frameCounter = 0; } - if (projectile.frame > 3) + if (projectile.frame >= 4) { projectile.frame = 0; } diff --git a/Projectiles/Magic/SeethingDischargeBrimstoneHellblast.png b/Projectiles/Magic/SeethingDischargeBrimstoneHellblast.png index f9de3e2ae9..dd8e4e8aa4 100644 Binary files a/Projectiles/Magic/SeethingDischargeBrimstoneHellblast.png and b/Projectiles/Magic/SeethingDischargeBrimstoneHellblast.png differ diff --git a/Projectiles/Magic/WaterStream.cs b/Projectiles/Magic/WaterStream.cs index e8fb6d8c3c..25067cab4d 100644 --- a/Projectiles/Magic/WaterStream.cs +++ b/Projectiles/Magic/WaterStream.cs @@ -21,10 +21,16 @@ namespace CalamityMod.Projectiles.Magic projectile.penetrate = 3; projectile.extraUpdates = 2; projectile.magic = true; + projectile.tileCollide = false; } public override void AI() { + projectile.ai[1]++; + if (projectile.ai[1] >= 4f) + { + projectile.tileCollide = true; + } addSprayTimer--; if (addSprayTimer <= 0) { @@ -52,13 +58,12 @@ namespace CalamityMod.Projectiles.Magic float num153 = projectile.velocity.Y / 3f * (float)num151; int num154 = 14; int num155 = Dust.NewDust(new Vector2(projectile.position.X + (float)num154, projectile.position.Y + (float)num154), projectile.width - num154 * 2, projectile.height - num154 * 2, 14, 0f, 0f, 100, new Color(0, 255, 255), 1f); - Main.dust[num155].noGravity = true; - Main.dust[num155].velocity *= 0.1f; - Main.dust[num155].velocity += projectile.velocity * 0.5f; - Dust expr_6A04_cp_0 = Main.dust[num155]; - expr_6A04_cp_0.position.X -= num152; - Dust expr_6A1F_cp_0 = Main.dust[num155]; - expr_6A1F_cp_0.position.Y -= num153; + Dust dust = Main.dust[num155]; + dust.noGravity = true; + dust.velocity *= 0.1f; + dust.velocity += projectile.velocity * 0.5f; + dust.position.X -= num152; + dust.position.Y -= num153; } if (Main.rand.NextBool(8)) { diff --git a/Projectiles/Melee/AmidiasWhirlpool.cs b/Projectiles/Melee/AmidiasWhirlpool.cs index 51abf4b492..fe476a4b9f 100644 --- a/Projectiles/Melee/AmidiasWhirlpool.cs +++ b/Projectiles/Melee/AmidiasWhirlpool.cs @@ -36,18 +36,14 @@ namespace CalamityMod.Projectiles.Melee float num100 = projectile.velocity.Y / 3f * (float)num105; int num101 = 4; int num102 = Dust.NewDust(new Vector2(projectile.position.X + (float)num101, projectile.position.Y + (float)num101), projectile.width - num101 * 2, projectile.height - num101 * 2, 33, 0f, 0f, 0, new Color(0, 142, 255), 1.5f); - Main.dust[num102].noGravity = true; - Main.dust[num102].velocity *= 0.1f; - Main.dust[num102].velocity += projectile.velocity * 0.1f; - Dust expr_47FA_cp_0 = Main.dust[num102]; - expr_47FA_cp_0.position.X -= num99; - Dust expr_4815_cp_0 = Main.dust[num102]; - expr_4815_cp_0.position.Y -= num100; + Dust dust = Main.dust[num102]; + dust.noGravity = true; + dust.velocity *= 0.1f; + dust.velocity += projectile.velocity * 0.1f; + dust.position.X -= num99; + dust.position.Y -= num100; } - float[] var_2_2DDF8_cp_0 = projectile.ai; - int var_2_2DDF8_cp_1 = 0; - float num73 = var_2_2DDF8_cp_0[var_2_2DDF8_cp_1]; - var_2_2DDF8_cp_0[var_2_2DDF8_cp_1] = num73 + 1f; + projectile.ai[0] += 1f; int num1013 = 0; if (projectile.velocity.Length() <= 8f) //4 { diff --git a/Projectiles/Melee/EssenceFlame2.png b/Projectiles/Melee/EssenceFlame2.png index 2ef4c2dba5..3009ead213 100644 Binary files a/Projectiles/Melee/EssenceFlame2.png and b/Projectiles/Melee/EssenceFlame2.png differ diff --git a/Projectiles/Melee/EssenceScythe.cs b/Projectiles/Melee/EssenceScythe.cs index 54e2427eec..eea65cb06c 100644 --- a/Projectiles/Melee/EssenceScythe.cs +++ b/Projectiles/Melee/EssenceScythe.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Melee float num473 = projectile.Center.Y; float num474 = 600f; bool flag17 = false; - for (int num475 = 0; num475 < 200; num475++) + for (int num475 = 0; num475 < Main.npc.Length; num475++) { if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1)) { diff --git a/Projectiles/Melee/ExoGladComet.cs b/Projectiles/Melee/ExoGladComet.cs new file mode 100644 index 0000000000..80ffa279c7 --- /dev/null +++ b/Projectiles/Melee/ExoGladComet.cs @@ -0,0 +1,117 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Melee +{ + public class ExoGladComet : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Comet"); + Main.projFrames[projectile.type] = 5; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 10; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void SetDefaults() + { + projectile.width = 12; + projectile.height = 12; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.melee = true; + projectile.penetrate = 1; + projectile.alpha = 50; + } + + public override void AI() + { + projectile.frameCounter++; + if (projectile.frameCounter > 5) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 4) + { + projectile.frame = 0; + } + if (projectile.timeLeft > 30 && projectile.alpha > 0) + { + projectile.alpha -= 25; + } + if (projectile.timeLeft > 30 && projectile.alpha < 128 && Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) + { + projectile.alpha = 128; + } + if (projectile.alpha < 0) + { + projectile.alpha = 0; + } + if (projectile.alpha < 40) + { + int num309 = Dust.NewDust(new Vector2(projectile.position.X - projectile.velocity.X * 4f + 2f, projectile.position.Y + 2f - projectile.velocity.Y * 4f), 8, 8, 107, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, new Color(0, 255, 255), 0.5f); + Main.dust[num309].velocity *= -0.25f; + num309 = Dust.NewDust(new Vector2(projectile.position.X - projectile.velocity.X * 4f + 2f, projectile.position.Y + 2f - projectile.velocity.Y * 4f), 8, 8, 107, projectile.oldVelocity.X, projectile.oldVelocity.Y, 100, new Color(0, 255, 255), 0.5f); + Main.dust[num309].velocity *= -0.25f; + Main.dust[num309].position -= projectile.velocity * 0.5f; + } + Lighting.AddLight(projectile.Center, 0f, 0.5f, 0.5f); + projectile.velocity *= 1.005f; + + projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt(); + projectile.rotation = projectile.velocity.ToRotation() + (projectile.spriteDirection == 1 ? 0f : MathHelper.Pi) + MathHelper.ToRadians(90) * projectile.direction; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.CursedInferno, 120); + target.AddBuff(BuffID.Frostburn, 120); + target.AddBuff(BuffID.OnFire, 120); + target.AddBuff(BuffID.Ichor, 120); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + + public override Color? GetAlpha(Color lightColor) + { + return new Color(0, 255, 255, projectile.alpha); + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(29, (int)projectile.position.X, (int)projectile.position.Y, 103, 1f, 0f); + projectile.position = projectile.Center; + projectile.width = 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 num193 = 0; num193 < 2; num193++) + { + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, new Color(0, 255, 255), 1.5f); + } + for (int num194 = 0; num194 < 20; num194++) + { + int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 0, new Color(0, 255, 255), 2.5f); + Main.dust[num195].noGravity = true; + Main.dust[num195].velocity *= 3f; + num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, new Color(0, 255, 255), 1.5f); + Main.dust[num195].velocity *= 2f; + Main.dust[num195].noGravity = true; + } + } + } +} diff --git a/Projectiles/Melee/ExoGladComet.png b/Projectiles/Melee/ExoGladComet.png new file mode 100644 index 0000000000..abdb698535 Binary files /dev/null and b/Projectiles/Melee/ExoGladComet.png differ diff --git a/Projectiles/Melee/ExoGladProj.cs b/Projectiles/Melee/ExoGladProj.cs new file mode 100644 index 0000000000..d2ebdcf12e --- /dev/null +++ b/Projectiles/Melee/ExoGladProj.cs @@ -0,0 +1,168 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + public class ExoGladProj : ModProjectile + { + private float counter = 0f; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Orb"); + } + + public override void SetDefaults() + { + projectile.width = 10; + projectile.height = 10; + projectile.friendly = true; + projectile.melee = true; + projectile.penetrate = 1; + projectile.tileCollide = false; + projectile.timeLeft = 300; + } + + public override void AI() + { + Vector2 value7 = new Vector2(5f, 10f); + counter += 1f; + if (counter == 48f) + { + counter = 0f; + } + else + { + for (int num41 = 0; num41 < 2; num41++) + { + int dustType = num41 == 0 ? 107 : 234; + if (Main.rand.NextBool(4)) + { + dustType = 269; + } + Vector2 value8 = Vector2.UnitX * -12f; + value8 = -Vector2.UnitY.RotatedBy((double)(counter * 0.1308997f + (float)num41 * 3.14159274f), default) * value7; + int num42 = Dust.NewDust(projectile.Center, 0, 0, dustType, 0f, 0f, 160, default, 1.5f); + Main.dust[num42].noGravity = true; + Main.dust[num42].position = projectile.Center + value8; + Main.dust[num42].velocity = projectile.velocity; + int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 0.8f); + Main.dust[num458].noGravity = true; + Main.dust[num458].velocity *= 0f; + } + } + + float num472 = projectile.Center.X; + float num473 = projectile.Center.Y; + float num474 = 1000f; + bool flag17 = false; + for (int num475 = 0; num475 < Main.npc.Length; num475++) + { + if (Main.npc[num475].CanBeChasedBy(projectile, false)) + { + 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 = 36f; + 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; + } + } + + public override void Kill(int timeLeft) + { + int dustType = Utils.SelectRandom(Main.rand, new int[] + { + 107, + 234, + 269 + }); + for (int k = 0; k < 4; k++) + { + int num = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, dustType, (float)(projectile.direction * 2), 0f, 150, default, 1f); + Main.dust[num].noGravity = true; + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + int type = ModContent.ProjectileType(); + int numSwords = Main.rand.Next(1,4); + float swordKB = projectile.knockBack; + for (int i = 0; i < numSwords; ++i) + { + float startOffsetX = Main.rand.NextFloat(1000f, 1400f) * (Main.rand.NextBool() ? -1f : 1f); + float startOffsetY = Main.rand.NextFloat(80f, 900f) * (Main.rand.NextBool() ? -1f : 1f); + Vector2 startPos = new Vector2(target.Center.X + startOffsetX, target.Center.Y + startOffsetY); + float dx = target.Center.X - startPos.X; + float dy = target.Center.Y - startPos.Y; + + dx += Main.rand.NextFloat(-5f, 5f); + dy += Main.rand.NextFloat(-5f, 5f); + float speed = Main.rand.NextFloat(24f, 30f); + float dist = (float)Math.Sqrt((double)(dx * dx + dy * dy)); + dist = speed / dist; + dx *= dist; + dy *= dist; + Vector2 swordVel = new Vector2(dx, dy); + float angle = Main.rand.NextFloat(MathHelper.TwoPi); + if (projectile.owner == Main.myPlayer) + { + int idx = Projectile.NewProjectile(startPos, swordVel, type, (int)((double)projectile.damage * 0.25), swordKB, projectile.owner, 0f, 0f); + Main.projectile[idx].rotation = angle; + } + } + + int spearAmt = Main.rand.Next(1,4); + for (int n = 0; n < spearAmt; n++) + { + float x = projectile.position.X + (float)Main.rand.Next(-400, 400); + float y = projectile.position.Y + (float)Main.rand.Next(800, 1000); + Vector2 vector = new Vector2(x, y); + float num13 = projectile.position.X + (float)(projectile.width / 2) - vector.X; + float num14 = projectile.position.Y + (float)(projectile.height / 2) - vector.Y; + num13 += (float)Main.rand.Next(-100, 101); + int num15 = 29; + float num16 = (float)Math.Sqrt((double)(num13 * num13 + num14 * num14)); + num16 = (float)num15 / num16; + num13 *= num16; + num14 *= num16; + int num17 = Projectile.NewProjectile(x, y, num13, num14, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.5), swordKB, projectile.owner, 0f, 0f); + } + + target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.CursedInferno, 120); + target.AddBuff(BuffID.Frostburn, 120); + target.AddBuff(BuffID.OnFire, 120); + target.AddBuff(BuffID.Ichor, 120); + } + } +} diff --git a/Projectiles/Melee/ExoGladProj.png b/Projectiles/Melee/ExoGladProj.png new file mode 100644 index 0000000000..0056fc1e24 Binary files /dev/null and b/Projectiles/Melee/ExoGladProj.png differ diff --git a/Projectiles/Melee/ExoGladSpears.cs b/Projectiles/Melee/ExoGladSpears.cs new file mode 100644 index 0000000000..3cd9a5a5ae --- /dev/null +++ b/Projectiles/Melee/ExoGladSpears.cs @@ -0,0 +1,181 @@ +using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.DamageOverTime; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.IO; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Melee +{ + public class ExoGladSpears : ModProjectile + { + private Color currentColor = Color.Black; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gladius Beam"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 7; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void SetDefaults() + { + projectile.width = 28; + projectile.height = 28; + projectile.friendly = true; + projectile.timeLeft = 600; + projectile.melee = true; + projectile.tileCollide = false; + projectile.extraUpdates = 1; + } + + public override void AI() + { + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 0.785f; + float num953 = 25f * projectile.ai[1]; //100 + float scaleFactor12 = 5f * projectile.ai[1]; //5 + float num954 = 1000f; + if (Main.player[projectile.owner].active && !Main.player[projectile.owner].dead) + { + float num472 = projectile.Center.X; + float num473 = projectile.Center.Y; + float num474 = 1000f; + bool flag17 = false; + for (int num475 = 0; num475 < Main.npc.Length; num475++) + { + if (Main.npc[num475].CanBeChasedBy(projectile, false)) + { + 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 = 9f; + 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; + } + else if (projectile.Distance(Main.player[projectile.owner].Center) > num954) + { + Vector2 vector102 = projectile.DirectionTo(Main.player[projectile.owner].Center); + if (vector102.HasNaNs()) + { + vector102 = Vector2.UnitY; + } + projectile.velocity = (projectile.velocity * (num953 - 1f) + vector102 * scaleFactor12) / num953; + } + } + else + { + if (projectile.timeLeft > 30) + { + projectile.timeLeft = 30; + } + } + + Lighting.AddLight(projectile.Center, Main.DiscoR * 0.5f / 255f, Main.DiscoG * 0.5f / 255f, Main.DiscoB * 0.5f / 255f); + if (currentColor == Color.Black) + { + int startPoint = Main.rand.Next(6); + projectile.localAI[0] = startPoint; + currentColor = GetStartingColor(startPoint); + } + Visuals(projectile, ref currentColor); + } + + internal static void Visuals(Projectile projectile, ref Color c) + { + CalamityUtils.IterateDisco(ref c, ref projectile.localAI[0], 15); + Vector3 compositeColor = 0.1f * Color.White.ToVector3() + 0.05f * c.ToVector3(); + Lighting.AddLight(projectile.Center, compositeColor); + } + + internal static Color GetStartingColor(int startPoint = 0) + { + switch (startPoint) + { + default: return new Color(1f, 0f, 0f, 0f); // Color.Red + case 1: return new Color(1f, 1f, 0f, 0f); // Color.Yellow + case 2: return new Color(0f, 1f, 0f, 0f); // Color.Green + case 3: return new Color(0f, 1f, 1f, 0f); // Color.Turquoise + case 4: return new Color(0f, 0f, 1f, 0f); // Color.Blue + case 5: return new Color(1f, 0f, 1f, 0f); // Color.Violet + } + } + + // This projectile is always fullbright. + public override Color? GetAlpha(Color lightColor) + { + return currentColor; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + + public override void Kill(int timeLeft) + { + projectile.position = projectile.Center; + projectile.width = projectile.height = 64; + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.maxPenetrate = -1; + projectile.penetrate = -1; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + projectile.Damage(); + Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 74, 1f, 0f); + int dustType = Utils.SelectRandom(Main.rand, new int[] + { + 107, + 234, + 269 + }); + for (int num193 = 0; num193 < 6; num193++) + { + Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0, 0); + } + for (int num194 = 0; num194 < 10; num194++) + { + int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0, 0); + Main.dust[num195].noGravity = true; + Main.dust[num195].velocity *= 3f; + num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0, 0); + Main.dust[num195].velocity *= 2f; + Main.dust[num195].noGravity = true; + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.CursedInferno, 120); + target.AddBuff(BuffID.Frostburn, 120); + target.AddBuff(BuffID.OnFire, 120); + target.AddBuff(BuffID.Ichor, 120); + } + } +} diff --git a/Projectiles/Melee/ExoGladSpears.png b/Projectiles/Melee/ExoGladSpears.png new file mode 100644 index 0000000000..e1c9f0323b Binary files /dev/null and b/Projectiles/Melee/ExoGladSpears.png differ diff --git a/Projectiles/Melee/ExoGladiusBeam.cs b/Projectiles/Melee/ExoGladiusBeam.cs new file mode 100644 index 0000000000..6d2f50bedf --- /dev/null +++ b/Projectiles/Melee/ExoGladiusBeam.cs @@ -0,0 +1,133 @@ +using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.DamageOverTime; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.IO; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Melee +{ + public class ExoGladiusBeam : ModProjectile + { + private int penetrationAmt = 6; + private Color currentColor = Color.Black; + public const float maxScale = 1.8f; + public bool initialized = false; + public float startYVelSign = 0f; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Gladius Beam"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 4; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void SetDefaults() + { + projectile.width = 28; + projectile.height = 28; + projectile.friendly = true; + projectile.penetrate = penetrationAmt; + projectile.timeLeft = 290; + projectile.melee = true; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 15; + projectile.extraUpdates = 1; + projectile.tileCollide = false; + } + + public override void AI() + { + if (!initialized) + { + startYVelSign = (float)Math.Sign(projectile.velocity.Y) * 0.35f; + initialized = true; + } + if (projectile.penetrate == penetrationAmt && projectile.timeLeft < 245) + { + projectile.velocity.Y -= startYVelSign; //arc on the X axis (the amount of pressure on this tiny detail made me want to tear my head off) + if (Math.Abs(projectile.velocity.X) < 30f) + { + projectile.velocity.X *= 1.04f; + } + } + if (projectile.velocity.Length() != 0) + { + projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + MathHelper.Pi / 4; + } + else + { + projectile.rotation += MathHelper.Pi / 6f / (projectile.scale * 2.5f); + } + projectile.ai[0]++; + if (projectile.ai[1] >= 0) + { + projectile.ai[1]--; + if (projectile.ai[1] == 0) + { + projectile.velocity *= -0.9f; + } + } + + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 0.785f; + Lighting.AddLight(projectile.Center, Main.DiscoR * 0.5f / 255f, Main.DiscoG * 0.5f / 255f, Main.DiscoB * 0.5f / 255f); + if (currentColor == Color.Black) + { + int startPoint = Main.rand.Next(6); + projectile.localAI[0] = startPoint; + currentColor = GetStartingColor(startPoint); + } + Visuals(projectile, ref currentColor); + } + + internal static void Visuals(Projectile projectile, ref Color c) + { + CalamityUtils.IterateDisco(ref c, ref projectile.localAI[0], 15); + Vector3 compositeColor = 0.1f * Color.White.ToVector3() + 0.05f * c.ToVector3(); + Lighting.AddLight(projectile.Center, compositeColor); + } + + internal static Color GetStartingColor(int startPoint = 0) + { + switch (startPoint) + { + default: return new Color(1f, 0f, 0f, 0f); // Color.Red + case 1: return new Color(1f, 1f, 0f, 0f); // Color.Yellow + case 2: return new Color(0f, 1f, 0f, 0f); // Color.Green + case 3: return new Color(0f, 1f, 1f, 0f); // Color.Turquoise + case 4: return new Color(0f, 0f, 1f, 0f); // Color.Blue + case 5: return new Color(1f, 0f, 1f, 0f); // Color.Violet + } + } + + // This projectile is always fullbright. + public override Color? GetAlpha(Color lightColor) + { + return currentColor; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + projectile.scale += (maxScale - 1) / (float)penetrationAmt; + projectile.ai[1] = 5 + Main.rand.Next(-2, 3); + + target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.CursedInferno, 120); + target.AddBuff(BuffID.Frostburn, 120); + target.AddBuff(BuffID.OnFire, 120); + target.AddBuff(BuffID.Ichor, 120); + } + } +} diff --git a/Projectiles/Melee/ExoGladiusBeam.png b/Projectiles/Melee/ExoGladiusBeam.png new file mode 100644 index 0000000000..e1c9f0323b Binary files /dev/null and b/Projectiles/Melee/ExoGladiusBeam.png differ diff --git a/Projectiles/Melee/UrchinBall.cs b/Projectiles/Melee/UrchinBall.cs index 147e0e0800..4eeac5a8a6 100644 --- a/Projectiles/Melee/UrchinBall.cs +++ b/Projectiles/Melee/UrchinBall.cs @@ -32,27 +32,27 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { - Vector2 vector62 = Main.player[projectile.owner].Center - projectile.Center; + Player player = Main.player[projectile.owner]; + Vector2 vector62 = player.Center - projectile.Center; projectile.rotation = vector62.ToRotation() - 1.57f; - if (Main.player[projectile.owner].dead) + if (player.dead) { projectile.Kill(); return; } - Main.player[projectile.owner].itemAnimation = 10; - Main.player[projectile.owner].itemTime = 10; - float arg_1DC8F_0 = vector62.X; + player.itemAnimation = 10; + player.itemTime = 10; if (vector62.X < 0f) { - Main.player[projectile.owner].ChangeDir(1); + player.ChangeDir(1); projectile.direction = 1; } else { - Main.player[projectile.owner].ChangeDir(-1); + player.ChangeDir(-1); projectile.direction = -1; } - Main.player[projectile.owner].itemRotation = (vector62 * -1f * (float)projectile.direction).ToRotation(); + player.itemRotation = (vector62 * -1f * (float)projectile.direction).ToRotation(); projectile.spriteDirection = (vector62.X > 0f) ? -1 : 1; if (projectile.ai[0] == 0f && vector62.Length() > 400f) { @@ -89,10 +89,7 @@ namespace CalamityMod.Projectiles.Melee return; } } - float[] var_2_1DE21_cp_0 = projectile.ai; - int var_2_1DE21_cp_1 = 1; - float num73 = var_2_1DE21_cp_0[var_2_1DE21_cp_1]; - var_2_1DE21_cp_0[var_2_1DE21_cp_1] = num73 + 1f; + projectile.ai[1] += 1f; if (projectile.ai[1] > 5f) { projectile.alpha = 0; diff --git a/Projectiles/Melee/Yoyos/MicrowaveYoyo.cs b/Projectiles/Melee/Yoyos/MicrowaveYoyo.cs index bf25cbfdf6..30d988e892 100644 --- a/Projectiles/Melee/Yoyos/MicrowaveYoyo.cs +++ b/Projectiles/Melee/Yoyos/MicrowaveYoyo.cs @@ -1,6 +1,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; @@ -11,6 +12,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public class MicrowaveYoyo : ModProjectile { private const float Radius = 100f; + private SoundEffectInstance mmmmmm = null; public override void SetStaticDefaults() { @@ -40,31 +42,49 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void AI() { - if (projectile.owner == Main.myPlayer) - { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.5f), projectile.knockBack, projectile.owner, 0f, 0f); + // Sound is done manually, so that it can loop correctly. + if (mmmmmm is null) + { + mmmmmm = ModContent.GetSound("CalamityMod/Sounds/Custom/MMMMMMMMMMMMM").CreateInstance(); + mmmmmm.IsLooped = true; + CalamityUtils.ApplySoundStats(ref mmmmmm, projectile.Center); + Main.PlaySoundInstance(mmmmmm); + } + else if(!mmmmmm.IsDisposed) + CalamityUtils.ApplySoundStats(ref mmmmmm, projectile.Center); + + // Spawn invisible but damaging aura projectile + if (projectile.owner == Main.myPlayer) + { + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.5f), projectile.knockBack, projectile.owner, 0f, 0f); + } - //dust circle - int numDust = (int)(0.2f * MathHelper.TwoPi * Radius); - float angleIncrement = MathHelper.TwoPi / (float)numDust; - Vector2 dustOffset = new Vector2(Radius, 0f); - dustOffset = dustOffset.RotatedByRandom(MathHelper.TwoPi); - for (int i = 0; i < numDust; i++) - { - dustOffset = dustOffset.RotatedBy(angleIncrement); - int dustType = Utils.SelectRandom(Main.rand, new int[] - { - ModContent.DustType(), - ModContent.DustType() - }); - int dust = Dust.NewDust(projectile.Center, 1, 1, dustType); - Main.dust[dust].position = projectile.Center + dustOffset; - Main.dust[dust].fadeIn = 1f; - Main.dust[dust].velocity *= 0.2f; - Main.dust[dust].scale = 0.1599999999f; - } - } - } + // Dust circle appears for all players, even though the aura projectile is only spawned by the owner + int numDust = (int)(0.2f * MathHelper.TwoPi * Radius); + float angleIncrement = MathHelper.TwoPi / (float)numDust; + Vector2 dustOffset = new Vector2(Radius, 0f); + dustOffset = dustOffset.RotatedByRandom(MathHelper.TwoPi); + for (int i = 0; i < numDust; i++) + { + dustOffset = dustOffset.RotatedBy(angleIncrement); + int dustType = Utils.SelectRandom(Main.rand, new int[] + { + ModContent.DustType(), + ModContent.DustType() + }); + int dust = Dust.NewDust(projectile.Center, 1, 1, dustType); + Main.dust[dust].position = projectile.Center + dustOffset; + Main.dust[dust].fadeIn = 1f; + Main.dust[dust].velocity *= 0.2f; + Main.dust[dust].scale = 0.1599999999f; + } + } + + public override void Kill(int timeLeft) + { + mmmmmm?.Stop(); + mmmmmm?.Dispose(); + } public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { diff --git a/Projectiles/Pets/RotomDex.png b/Projectiles/Pets/RotomDex.png new file mode 100644 index 0000000000..5d23518a99 Binary files /dev/null and b/Projectiles/Pets/RotomDex.png differ diff --git a/Projectiles/Pets/RotomDexGlow.png b/Projectiles/Pets/RotomDexGlow.png new file mode 100644 index 0000000000..dcc595e151 Binary files /dev/null and b/Projectiles/Pets/RotomDexGlow.png differ diff --git a/Projectiles/Pets/RotomFan.png b/Projectiles/Pets/RotomFan.png new file mode 100644 index 0000000000..2d7c5ac55b Binary files /dev/null and b/Projectiles/Pets/RotomFan.png differ diff --git a/Projectiles/Pets/RotomFanGlow.png b/Projectiles/Pets/RotomFanGlow.png new file mode 100644 index 0000000000..70dda64c23 Binary files /dev/null and b/Projectiles/Pets/RotomFanGlow.png differ diff --git a/Projectiles/Pets/RotomFrost.png b/Projectiles/Pets/RotomFrost.png new file mode 100644 index 0000000000..33c5f407e8 Binary files /dev/null and b/Projectiles/Pets/RotomFrost.png differ diff --git a/Projectiles/Pets/RotomFrostGlow.png b/Projectiles/Pets/RotomFrostGlow.png new file mode 100644 index 0000000000..83ad4be94c Binary files /dev/null and b/Projectiles/Pets/RotomFrostGlow.png differ diff --git a/Projectiles/Pets/RotomHeat.png b/Projectiles/Pets/RotomHeat.png new file mode 100644 index 0000000000..0e74de03de Binary files /dev/null and b/Projectiles/Pets/RotomHeat.png differ diff --git a/Projectiles/Pets/RotomHeatGlow.png b/Projectiles/Pets/RotomHeatGlow.png new file mode 100644 index 0000000000..c17a7f06a3 Binary files /dev/null and b/Projectiles/Pets/RotomHeatGlow.png differ diff --git a/Projectiles/Pets/RotomMow.png b/Projectiles/Pets/RotomMow.png new file mode 100644 index 0000000000..1e67d8913c Binary files /dev/null and b/Projectiles/Pets/RotomMow.png differ diff --git a/Projectiles/Pets/RotomMowGlow.png b/Projectiles/Pets/RotomMowGlow.png new file mode 100644 index 0000000000..d6e103146e Binary files /dev/null and b/Projectiles/Pets/RotomMowGlow.png differ diff --git a/Projectiles/Pets/RotomPet.cs b/Projectiles/Pets/RotomPet.cs new file mode 100644 index 0000000000..85d7d49b96 --- /dev/null +++ b/Projectiles/Pets/RotomPet.cs @@ -0,0 +1,300 @@ +using CalamityMod.CalPlayer; +using CalamityMod.Projectiles.Summon; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Pets +{ + public class RotomPet : ModProjectile + { + private int biome = 0; + private float dust = 0f; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Rotom"); + Main.projFrames[projectile.type] = 4; + Main.projPet[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.netImportant = true; + projectile.width = 30; + projectile.height = 30; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.timeLeft *= 5; + } + + public override void AI() + { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); + + if (CalamityPlayer.areThereAnyDamnBosses) + biome = 1; //dex + else if (player.ZoneBeach || player.Calamity().ZoneSunkenSea || player.Calamity().ZoneSulphur || player.Calamity().ZoneAbyss) + biome = 2; //wash + else if (player.ZoneTowerSolar || player.ZoneDesert || player.ZoneUndergroundDesert || player.ZoneUnderworldHeight || player.Calamity().ZoneCalamity) + biome = 3; //heat + else if (player.ZoneSnow || Main.snowMoon) + biome = 4; //frost + else if (player.ZoneJungle) + biome = 5; //mow + else if (player.ZoneSkyHeight || player.ZoneMeteor || player.Calamity().ZoneAstral) + biome = 6; //fan + else + biome = 0; //anything else + + if (!player.active) + { + projectile.active = false; + return; + } + if (player.dead) + { + modPlayer.rotomPet = false; + } + if (modPlayer.rotomPet) + { + projectile.timeLeft = 2; + } + + if (dust == 0f) + { + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; + int num501 = 25; + for (int num502 = 0; num502 < num501; num502++) + { + int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 132, 0f, 0f, 0, default, 1f); + Main.dust[num503].velocity *= 2f; + Main.dust[num503].scale *= 1.15f; + } + dust += 1f; + } + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + { + int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / + projectile.Calamity().spawnedPlayerMinionDamageValue * + (player.allDamage + player.minionDamage - 1f)); + projectile.damage = damage2; + } + + float num16 = 0.5f; + projectile.tileCollide = false; + int num17 = 100; + Vector2 vector3 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num18 = player.position.X + (float)(player.width / 2) - vector3.X; + float num19 = player.position.Y + (float)(player.height / 2) - vector3.Y; + num19 += (float)Main.rand.Next(-10, 21); + num18 += (float)Main.rand.Next(-10, 21); + num18 += (float)(60 * -(float)Main.player[projectile.owner].direction); + num19 -= 60f; + float num20 = (float)Math.Sqrt((double)(num18 * num18 + num19 * num19)); + float num21 = 18f; + if (num20 < (float)num17 && Main.player[projectile.owner].velocity.Y == 0f && + projectile.position.Y + (float)projectile.height <= Main.player[projectile.owner].position.Y + (float)Main.player[projectile.owner].height && + !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) + { + if (projectile.velocity.Y < -6f) + { + projectile.velocity.Y = -6f; + } + } + if (num20 > 2000f) + { + projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); + projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2); + projectile.netUpdate = true; + } + if (num20 < 50f) + { + if (Math.Abs(projectile.velocity.X) > 2f || Math.Abs(projectile.velocity.Y) > 2f) + { + projectile.velocity *= 0.99f; + } + num16 = 0.01f; + } + else + { + if (num20 < 100f) + { + num16 = 0.1f; + } + if (num20 > 300f) + { + num16 = 1f; + } + num20 = num21 / num20; + num18 *= num20; + num19 *= num20; + } + if (projectile.velocity.X < num18) + { + projectile.velocity.X = projectile.velocity.X + num16; + if (num16 > 0.05f && projectile.velocity.X < 0f) + { + projectile.velocity.X = projectile.velocity.X + num16; + } + } + if (projectile.velocity.X > num18) + { + projectile.velocity.X = projectile.velocity.X - num16; + if (num16 > 0.05f && projectile.velocity.X > 0f) + { + projectile.velocity.X = projectile.velocity.X - num16; + } + } + if (projectile.velocity.Y < num19) + { + projectile.velocity.Y = projectile.velocity.Y + num16; + if (num16 > 0.05f && projectile.velocity.Y < 0f) + { + projectile.velocity.Y = projectile.velocity.Y + num16 * 2f; + } + } + if (projectile.velocity.Y > num19) + { + projectile.velocity.Y = projectile.velocity.Y - num16; + if (num16 > 0.05f && projectile.velocity.Y > 0f) + { + projectile.velocity.Y = projectile.velocity.Y - num16 * 2f; + } + } + projectile.rotation = projectile.velocity.X * 0.05f; + if ((double) projectile.velocity.X > 0.25) + projectile.spriteDirection = projectile.direction = 1; + else if ((double) projectile.velocity.X < -0.25) + projectile.spriteDirection = projectile.direction = -1; + projectile.frameCounter++; + if (projectile.frameCounter > 6) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame >= 4) + { + projectile.frame = 0; + } + + if (projectile.owner == Main.myPlayer) + { + if (projectile.ai[0] != 0f) + { + projectile.ai[0] -= 1f; + return; + } + float num396 = projectile.position.X; + float num397 = projectile.position.Y; + float num398 = 700f; + bool flag11 = false; + if (player.HasMinionAttackTargetNPC) + { + NPC npc = Main.npc[player.MinionAttackTargetNPC]; + if (npc.CanBeChasedBy(projectile, false)) + { + float num539 = npc.Center.X + (float)(npc.width / 2); + float num540 = npc.Center.Y + (float)(npc.height / 2); + float num541 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num539) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num540); + if (num541 < num398 && Collision.CanHit(projectile.position, projectile.width, projectile.height, npc.Center, npc.width, npc.height)) + { + num396 = num539; + num397 = num540; + flag11 = true; + } + } + } + else + { + for (int num399 = 0; num399 < Main.npc.Length; num399++) + { + if (Main.npc[num399].CanBeChasedBy(projectile, true)) + { + float num400 = Main.npc[num399].Center.X + (float)(Main.npc[num399].width / 2); + float num401 = Main.npc[num399].Center.Y + (float)(Main.npc[num399].height / 2); + float num402 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num400) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num401); + if (num402 < num398 && Collision.CanHit(projectile.position, projectile.width, projectile.height, Main.npc[num399].Center, Main.npc[num399].width, Main.npc[num399].height)) + { + num398 = num402; + num396 = num400; + num397 = num401; + flag11 = true; + } + } + } + } + if (flag11) + { + float num403 = 30f; + Vector2 vector29 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num404 = num396 - vector29.X; + float num405 = num397 - vector29.Y; + float num406 = (float)Math.Sqrt((double)(num404 * num404 + num405 * num405)); + num406 = num403 / num406; + num404 *= num406; + num405 *= num406; + Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 93); + Projectile.NewProjectile(projectile.Center.X - 4f, projectile.Center.Y, num404, num405, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + projectile.ai[0] = 50f; + } + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture = Main.projectileTexture[projectile.type]; + if (biome == 1) + texture = ModContent.GetTexture("CalamityMod/Projectiles/Pets/RotomDex"); + if (biome == 2) + texture = ModContent.GetTexture("CalamityMod/Projectiles/Pets/RotomWash"); + if (biome == 3) + texture = ModContent.GetTexture("CalamityMod/Projectiles/Pets/RotomHeat"); + if (biome == 4) + texture = ModContent.GetTexture("CalamityMod/Projectiles/Pets/RotomFrost"); + if (biome == 5) + texture = ModContent.GetTexture("CalamityMod/Projectiles/Pets/RotomMow"); + if (biome == 6) + texture = ModContent.GetTexture("CalamityMod/Projectiles/Pets/RotomFan"); + int height = texture.Height / Main.projFrames[projectile.type]; + int frameHeight = height * projectile.frame; + SpriteEffects spriteEffects = SpriteEffects.None; + if (projectile.spriteDirection == -1) + spriteEffects = SpriteEffects.FlipHorizontally; + Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frameHeight, texture.Width, height)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture.Width / 2f, (float)height / 2f), projectile.scale, spriteEffects, 0f); + return false; + } + + public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture = ModContent.GetTexture("CalamityMod/Projectiles/Pets/RotomPetGlow"); + if (biome == 1) + texture = ModContent.GetTexture("CalamityMod/Projectiles/Pets/RotomDexGlow"); + if (biome == 2) + texture = ModContent.GetTexture("CalamityMod/Projectiles/Pets/RotomWashGlow"); + if (biome == 3) + texture = ModContent.GetTexture("CalamityMod/Projectiles/Pets/RotomHeatGlow"); + if (biome == 4) + texture = ModContent.GetTexture("CalamityMod/Projectiles/Pets/RotomFrostGlow"); + if (biome == 5) + texture = ModContent.GetTexture("CalamityMod/Projectiles/Pets/RotomMowGlow"); + if (biome == 6) + texture = ModContent.GetTexture("CalamityMod/Projectiles/Pets/RotomFanGlow"); + int num214 = texture.Height / Main.projFrames[projectile.type]; + int y6 = num214 * projectile.frame; + SpriteEffects spriteEffects = SpriteEffects.None; + if (projectile.spriteDirection == -1) + spriteEffects = SpriteEffects.FlipHorizontally; + + spriteBatch.Draw(texture, projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), Color.White, projectile.rotation, new Vector2((float)texture.Width / 2f, (float)num214 / 2f), projectile.scale, spriteEffects, 0f); + } + + public override bool CanDamage() + { + return false; + } + } +} diff --git a/Projectiles/Pets/RotomPet.png b/Projectiles/Pets/RotomPet.png new file mode 100644 index 0000000000..5a67fb0b64 Binary files /dev/null and b/Projectiles/Pets/RotomPet.png differ diff --git a/Projectiles/Pets/RotomPetGlow.png b/Projectiles/Pets/RotomPetGlow.png new file mode 100644 index 0000000000..ee0d6ad816 Binary files /dev/null and b/Projectiles/Pets/RotomPetGlow.png differ diff --git a/Projectiles/Pets/RotomWash.png b/Projectiles/Pets/RotomWash.png new file mode 100644 index 0000000000..c80726a28f Binary files /dev/null and b/Projectiles/Pets/RotomWash.png differ diff --git a/Projectiles/Pets/RotomWashGlow.png b/Projectiles/Pets/RotomWashGlow.png new file mode 100644 index 0000000000..cb3dc8b54c Binary files /dev/null and b/Projectiles/Pets/RotomWashGlow.png differ diff --git a/Projectiles/Pets/SirenYoung.cs b/Projectiles/Pets/SirenYoung.cs index 4612287e4b..55cb720496 100644 --- a/Projectiles/Pets/SirenYoung.cs +++ b/Projectiles/Pets/SirenYoung.cs @@ -156,10 +156,7 @@ namespace CalamityMod.Projectiles.Pets { projectile.velocity.Y = 10f; } - float[] var_2_1C896_cp_0 = projectile.ai; - int var_2_1C896_cp_1 = 1; - float num73 = var_2_1C896_cp_0[var_2_1C896_cp_1]; - var_2_1C896_cp_0[var_2_1C896_cp_1] = num73 - 1f; + projectile.ai[1] -= 1f; if (projectile.ai[1] <= 0f) { projectile.ai[1] = 0f; diff --git a/Projectiles/Pets/ThirdSage.cs b/Projectiles/Pets/ThirdSage.cs index 58ab59a61d..f005944d3f 100644 --- a/Projectiles/Pets/ThirdSage.cs +++ b/Projectiles/Pets/ThirdSage.cs @@ -2,6 +2,7 @@ using Microsoft.Xna.Framework; using System; using Terraria; +using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Pets { @@ -42,6 +43,7 @@ namespace CalamityMod.Projectiles.Pets { projectile.timeLeft = 2; } + Lighting.AddLight(projectile.Center, 0.5f, 0.1f, 0.3f); float num16 = 0.5f; projectile.tileCollide = false; int num17 = 100; diff --git a/Projectiles/Ranged/BlueExoArrow.cs b/Projectiles/Ranged/BlueExoArrow.cs index e2f0a63d22..f0fbcefce4 100644 --- a/Projectiles/Ranged/BlueExoArrow.cs +++ b/Projectiles/Ranged/BlueExoArrow.cs @@ -25,6 +25,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.extraUpdates = 2; projectile.timeLeft = 300; projectile.ranged = true; + projectile.arrow = true; } public override void AI() diff --git a/Projectiles/Ranged/BlueExoArrow2.cs b/Projectiles/Ranged/BlueExoArrow2.cs index 01d92d77e3..8edd5fd3d2 100644 --- a/Projectiles/Ranged/BlueExoArrow2.cs +++ b/Projectiles/Ranged/BlueExoArrow2.cs @@ -22,6 +22,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.timeLeft = 300; projectile.tileCollide = false; projectile.ranged = true; + projectile.arrow = true; } public override void AI() diff --git a/Projectiles/Ranged/DrataliornusExoArrow.cs b/Projectiles/Ranged/DrataliornusExoArrow.cs index 7ad9e942a8..f18b4bd10b 100644 --- a/Projectiles/Ranged/DrataliornusExoArrow.cs +++ b/Projectiles/Ranged/DrataliornusExoArrow.cs @@ -26,6 +26,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.tileCollide = false; projectile.ignoreWater = true; projectile.ranged = true; + projectile.arrow = true; } public override void AI() diff --git a/Projectiles/Ranged/DrataliornusFlame.cs b/Projectiles/Ranged/DrataliornusFlame.cs index fb574d82e9..66ac0bf7ac 100644 --- a/Projectiles/Ranged/DrataliornusFlame.cs +++ b/Projectiles/Ranged/DrataliornusFlame.cs @@ -25,6 +25,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.ignoreWater = true; projectile.tileCollide = false; projectile.ranged = true; + projectile.arrow = true; projectile.hide = true; projectile.timeLeft = 180; } diff --git a/Projectiles/Ranged/ElysianArrowProj.cs b/Projectiles/Ranged/ElysianArrowProj.cs index 7b1d08841d..04a8a55fb6 100644 --- a/Projectiles/Ranged/ElysianArrowProj.cs +++ b/Projectiles/Ranged/ElysianArrowProj.cs @@ -85,29 +85,22 @@ namespace CalamityMod.Projectiles.Ranged scaleFactor10 = 1f; } int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13AB6_cp_0 = Main.gore[num626]; - expr_13AB6_cp_0.velocity.X += 1f; - Gore expr_13AD6_cp_0 = Main.gore[num626]; - expr_13AD6_cp_0.velocity.Y += 1f; + Gore gore = Main.gore[num626]; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13B79_cp_0 = Main.gore[num626]; - expr_13B79_cp_0.velocity.X -= 1f; - Gore expr_13B99_cp_0 = Main.gore[num626]; - expr_13B99_cp_0.velocity.Y += 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13C3C_cp_0 = Main.gore[num626]; - expr_13C3C_cp_0.velocity.X += 1f; - Gore expr_13C5C_cp_0 = Main.gore[num626]; - expr_13C5C_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y -= 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13CFF_cp_0 = Main.gore[num626]; - expr_13CFF_cp_0.velocity.X -= 1f; - Gore expr_13D1F_cp_0 = Main.gore[num626]; - expr_13D1F_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y -= 1f; } float x = projectile.position.X + (float)Main.rand.Next(-400, 400); float y = projectile.position.Y - (float)Main.rand.Next(500, 800); diff --git a/Projectiles/Ranged/EssenceFire.cs b/Projectiles/Ranged/EssenceFire.cs index 7edb3889dc..5dc5c5d7e2 100644 --- a/Projectiles/Ranged/EssenceFire.cs +++ b/Projectiles/Ranged/EssenceFire.cs @@ -56,28 +56,25 @@ namespace CalamityMod.Projectiles.Ranged for (int num298 = 0; num298 < 1; num298++) { int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f); + Dust dust = Main.dust[num299]; if (Main.rand.NextBool(3)) { - Main.dust[num299].noGravity = true; - Main.dust[num299].scale *= 3f; - Dust expr_DBEF_cp_0 = Main.dust[num299]; - expr_DBEF_cp_0.velocity.X *= 2f; - Dust expr_DC0F_cp_0 = Main.dust[num299]; - expr_DC0F_cp_0.velocity.Y *= 2f; + dust.noGravity = true; + dust.scale *= 1.75f; + dust.velocity.X *= 2f; + dust.velocity.Y *= 2f; } else { - Main.dust[num299].scale *= 1.5f; + dust.scale *= 0.5f; } - Dust expr_DC74_cp_0 = Main.dust[num299]; - expr_DC74_cp_0.velocity.X *= 1.2f; - Dust expr_DC94_cp_0 = Main.dust[num299]; - expr_DC94_cp_0.velocity.Y *= 1.2f; - Main.dust[num299].scale *= num296; - Main.dust[num299].velocity += projectile.velocity; - if (!Main.dust[num299].noGravity) + dust.velocity.X *= 1.2f; + dust.velocity.Y *= 1.2f; + dust.scale *= num296; + dust.velocity += projectile.velocity; + if (!dust.noGravity) { - Main.dust[num299].velocity *= 0.5f; + dust.velocity *= 0.5f; } } } diff --git a/Projectiles/Ranged/ExoFire.cs b/Projectiles/Ranged/ExoFire.cs index 5fc3cca46a..b49155e52c 100644 --- a/Projectiles/Ranged/ExoFire.cs +++ b/Projectiles/Ranged/ExoFire.cs @@ -72,25 +72,22 @@ namespace CalamityMod.Projectiles.Ranged for (int num298 = 0; num298 < 2; num298++) { int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 0.6f); + Dust dust = Main.dust[num299]; if (Main.rand.NextBool(3)) { - Main.dust[num299].scale *= 1.5f; - Dust expr_DBEF_cp_0 = Main.dust[num299]; - expr_DBEF_cp_0.velocity.X *= 1.2f; - Dust expr_DC0F_cp_0 = Main.dust[num299]; - expr_DC0F_cp_0.velocity.Y *= 1.2f; + dust.scale *= 1.5f; + dust.velocity.X *= 1.2f; + dust.velocity.Y *= 1.2f; } else { - Main.dust[num299].scale *= 0.75f; + dust.scale *= 0.75f; } - Main.dust[num299].noGravity = true; - Dust expr_DC74_cp_0 = Main.dust[num299]; - expr_DC74_cp_0.velocity.X *= 0.8f; - Dust expr_DC94_cp_0 = Main.dust[num299]; - expr_DC94_cp_0.velocity.Y *= 0.8f; - Main.dust[num299].scale *= num296; - Main.dust[num299].velocity += projectile.velocity; + dust.noGravity = true; + dust.velocity.X *= 0.8f; + dust.velocity.Y *= 0.8f; + dust.scale *= num296; + dust.velocity += projectile.velocity; } } } diff --git a/Projectiles/Ranged/Flash.cs b/Projectiles/Ranged/Flash.cs index 0ff4fce4da..c0fe9f37b3 100644 --- a/Projectiles/Ranged/Flash.cs +++ b/Projectiles/Ranged/Flash.cs @@ -73,15 +73,14 @@ namespace CalamityMod.Projectiles.Ranged num463 *= num466; num464 *= num466; int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 264, 0f, 0f, 100, default, 2f); - Main.dust[num467].noGravity = true; - Main.dust[num467].position.X = projectile.Center.X; - Main.dust[num467].position.Y = projectile.Center.Y; - Dust expr_149DF_cp_0 = Main.dust[num467]; - expr_149DF_cp_0.position.X += (float)Main.rand.Next(-10, 11); - Dust expr_14A09_cp_0 = Main.dust[num467]; - expr_14A09_cp_0.position.Y += (float)Main.rand.Next(-10, 11); - Main.dust[num467].velocity.X = num463; - Main.dust[num467].velocity.Y = num464; + Dust dust = Main.dust[num467]; + dust.noGravity = true; + dust.position.X = projectile.Center.X; + dust.position.Y = projectile.Center.Y; + dust.position.X += (float)Main.rand.Next(-10, 11); + dust.position.Y += (float)Main.rand.Next(-10, 11); + dust.velocity.X = num463; + dust.velocity.Y = num464; num462++; } } diff --git a/Projectiles/Ranged/FlurrystormCannonShooting.cs b/Projectiles/Ranged/FlurrystormCannonShooting.cs new file mode 100644 index 0000000000..2d92db8535 --- /dev/null +++ b/Projectiles/Ranged/FlurrystormCannonShooting.cs @@ -0,0 +1,183 @@ +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Ranged +{ + public class FlurrystormCannonShooting : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Flurrystorm Cannon"); + Main.projFrames[projectile.type] = 2; + } + + public override void SetDefaults() + { + projectile.width = 58; + projectile.height = 34; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.ranged = true; + projectile.ignoreWater = true; + projectile.coldDamage = true; + } + + public override void AI() + { + Player player = Main.player[projectile.owner]; + float num = 0f; + Vector2 vector = player.RotatedRelativePoint(player.MountedCenter, true); + if (projectile.spriteDirection == -1) + { + num = 3.14159274f; + } + projectile.frameCounter++; + if (projectile.frameCounter > 4) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame >= 2) + { + projectile.frame = 0; + } + projectile.ai[0] += 1f; + int num39 = 0; + float spreadMult = 0.15f; + if (projectile.ai[0] >= 60f) + { + num39++; + } + if (projectile.ai[0] >= 120f) + { + num39++; + } + if (projectile.ai[0] >= 180f) + { + num39++; + } + if (projectile.ai[0] >= 240f) + { + num39++; + } + if (projectile.ai[0] >= 300f) + { + num39++; + } + if (projectile.ai[0] >= 360f) + { + num39++; + } + if (projectile.ai[0] >= 420f) + { + num39++; + } + if (projectile.ai[0] >= 480f) //full speed after 8 seconds + { + num39++; + } + int num40 = 24; + int num41 = 2; + projectile.ai[1] -= 1f; + bool flag15 = false; + if (projectile.ai[1] <= 0f) + { + projectile.ai[1] = (float)(num40 - num41 * num39); + flag15 = true; + } + bool flag16 = player.channel && player.HasAmmo(player.inventory[player.selectedItem], true) && !player.noItems && !player.CCed; + if (projectile.localAI[0] > 0f) + { + projectile.localAI[0] -= 1f; + } + if (projectile.soundDelay <= 0 && flag16) + { + projectile.soundDelay = num40 - num41 * num39; + if (projectile.ai[0] != 1f) + { + Main.PlaySound(SoundID.Item11, projectile.position); + } + projectile.localAI[0] = 12f; + } + if (flag15 && Main.myPlayer == projectile.owner) + { + int num42 = 14; + float scaleFactor11 = 14f; + int weaponDamage2 = player.GetWeaponDamage(player.inventory[player.selectedItem]); + float weaponKnockback2 = player.inventory[player.selectedItem].knockBack; + if (flag16) + { + player.PickAmmo(player.inventory[player.selectedItem], ref num42, ref scaleFactor11, ref flag16, ref weaponDamage2, ref weaponKnockback2, false); + weaponKnockback2 = player.GetWeaponKnockback(player.inventory[player.selectedItem], weaponKnockback2); + float scaleFactor12 = player.inventory[player.selectedItem].shootSpeed * projectile.scale; + Vector2 vector19 = vector; + Vector2 value18 = Main.screenPosition + new Vector2((float)Main.mouseX, (float)Main.mouseY) - vector19; + if (player.gravDir == -1f) + { + value18.Y = (float)(Main.screenHeight - Main.mouseY) + Main.screenPosition.Y - vector19.Y; + } + Vector2 value19 = Vector2.Normalize(value18); + if (float.IsNaN(value19.X) || float.IsNaN(value19.Y)) + { + value19 = -Vector2.UnitY; + } + value19 *= scaleFactor12; + if (value19.X != projectile.velocity.X || value19.Y != projectile.velocity.Y) + { + projectile.netUpdate = true; + } + projectile.velocity = value19 * 0.55f; + + Vector2 vector20 = Vector2.Normalize(projectile.velocity) * scaleFactor11 * (0.6f + Main.rand.NextFloat() * spreadMult); + if (float.IsNaN(vector20.X) || float.IsNaN(vector20.Y)) + { + vector20 = -Vector2.UnitY; + } + Vector2 vector21 = vector19 + Utils.RandomVector2(Main.rand, -5f, 5f); + vector20.X += (float)Main.rand.Next(-15, 16) * spreadMult; + vector20.Y += (float)Main.rand.Next(-15, 16) * spreadMult; + int snowball = Projectile.NewProjectile(vector21.X, vector21.Y, vector20.X, vector20.Y, num42, weaponDamage2, weaponKnockback2, projectile.owner, 0f, 0f); + Main.projectile[snowball].noDropItem = true; + Main.projectile[snowball].Calamity().forceRanged = true; + Main.projectile[snowball].thrown = false; + Main.projectile[snowball].extraUpdates += Main.rand.Next(0,2); + + if (Main.rand.NextBool(5)) //ice chunk + { + Vector2 vector2 = Vector2.Normalize(projectile.velocity) * scaleFactor11 * (0.6f + Main.rand.NextFloat() * 0.8f); + if (float.IsNaN(vector2.X) || float.IsNaN(vector2.Y)) + { + vector2 = -Vector2.UnitY; + } + float speedY = vector2.Y; + Vector2 vector3 = vector19 + Utils.RandomVector2(Main.rand, -15f, 15f); + int iceChunk = Projectile.NewProjectile(vector3.X, vector3.Y, vector2.X, vector2.Y, ModContent.ProjectileType(), (int)((double)weaponDamage2 * 1.5), (int)((double)weaponKnockback2 * 1.5), projectile.owner, 0.0f, speedY); + Main.projectile[iceChunk].extraUpdates += num39 / 2; //0 to 2 + } + } + else + { + projectile.Kill(); + } + } + projectile.position = player.RotatedRelativePoint(player.MountedCenter, true) - projectile.Size / 2f; + projectile.rotation = projectile.velocity.ToRotation() + num; + projectile.spriteDirection = projectile.direction; + projectile.timeLeft = 2; + player.ChangeDir(projectile.direction); + player.heldProj = projectile.whoAmI; + 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)); + } + + public override bool CanDamage() + { + return false; + } + } +} diff --git a/Projectiles/Ranged/FlurrystormCannonShooting.png b/Projectiles/Ranged/FlurrystormCannonShooting.png new file mode 100644 index 0000000000..546fc4bcea Binary files /dev/null and b/Projectiles/Ranged/FlurrystormCannonShooting.png differ diff --git a/Projectiles/Ranged/FlurrystormIceChunk.cs b/Projectiles/Ranged/FlurrystormIceChunk.cs new file mode 100644 index 0000000000..014731bf71 --- /dev/null +++ b/Projectiles/Ranged/FlurrystormIceChunk.cs @@ -0,0 +1,75 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Buffs.StatDebuffs; + +namespace CalamityMod.Projectiles.Ranged +{ + public class FlurrystormIceChunk : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ice Chunk"); + } + + public override void SetDefaults() + { + projectile.width = 14; + projectile.height = 14; + projectile.aiStyle = 1; + projectile.friendly = true; + projectile.ranged = true; + projectile.coldDamage = true; + projectile.penetrate = 1; + } + + public override void AI() + { + //icicle dust + if (Main.rand.NextBool(2)) + { + int index2 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 68, projectile.velocity.X, projectile.velocity.Y, 0, default, 1.1f); + Main.dust[index2].noGravity = true; + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(BuffID.Frostburn, 300); + target.AddBuff(ModContent.BuffType(), 60); + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(SoundID.Item27, projectile.position); + for (int index1 = 0; index1 < 5; ++index1) + { + int index2 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 68, 0f, 0f, 0, default, 1f); + Main.dust[index2].noGravity = true; + Main.dust[index2].velocity *= 1.5f; + Main.dust[index2].scale *= 0.9f; + } + int split = 0; + while (split < 3) + { + //Calculate the velocity of the projectile + float shardspeedX = -projectile.velocity.X * Main.rand.NextFloat(.5f, .7f) + Main.rand.NextFloat(-3f, 3f); + float shardspeedY = -projectile.velocity.Y * Main.rand.Next(50, 70) * 0.01f + Main.rand.Next(-8, 9) * 0.2f; + //Prevents the projectile speed from being too low + if (shardspeedX < 2f && shardspeedX > -2f) + { + shardspeedX += -projectile.velocity.X; + } + if (shardspeedY > 2f && shardspeedY < 2f) + { + shardspeedY += -projectile.velocity.Y; + } + + //Spawn the projectile + Projectile.NewProjectile(projectile.position.X + shardspeedX, projectile.position.Y + shardspeedY, shardspeedX, shardspeedY, ModContent.ProjectileType(), (int)(projectile.damage * 0.3), 2f, projectile.owner); + split += 1; + } + } + } +} diff --git a/Projectiles/Ranged/FlurrystormIceChunk.png b/Projectiles/Ranged/FlurrystormIceChunk.png new file mode 100644 index 0000000000..00b1ef9ae1 Binary files /dev/null and b/Projectiles/Ranged/FlurrystormIceChunk.png differ diff --git a/Projectiles/Ranged/FlurrystormIceShard.cs b/Projectiles/Ranged/FlurrystormIceShard.cs new file mode 100644 index 0000000000..49dabaea4b --- /dev/null +++ b/Projectiles/Ranged/FlurrystormIceShard.cs @@ -0,0 +1,54 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Buffs.StatDebuffs; + +namespace CalamityMod.Projectiles.Ranged +{ + public class FlurrystormIceShard : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ice Shard"); + } + + public override void SetDefaults() + { + projectile.friendly = true; + projectile.width = 10; + projectile.height = 10; + projectile.ranged = true; + projectile.coldDamage = true; + } + + public override void AI() + { + //Rotation and gravity + projectile.rotation += 0.6f * projectile.direction; + projectile.velocity.Y = projectile.velocity.Y + 0.27f; + if (projectile.velocity.Y > 16f) + { + projectile.velocity.Y = 16f; + } + + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(BuffID.Frostburn, 180); + target.AddBuff(ModContent.BuffType(), 30); + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(SoundID.Item27, projectile.position); + //Dust effect + int splash = 0; + while (splash < 4) + { + Dust.NewDust(projectile.position, projectile.width, projectile.height, 68, -projectile.velocity.X * 0.15f, -projectile.velocity.Y * 0.10f, 150, default, 0.9f); + splash += 1; + } + } + } +} diff --git a/Projectiles/Ranged/FlurrystormIceShard.png b/Projectiles/Ranged/FlurrystormIceShard.png new file mode 100644 index 0000000000..198f04ee07 Binary files /dev/null and b/Projectiles/Ranged/FlurrystormIceShard.png differ diff --git a/Projectiles/Ranged/GoliathRocket.cs b/Projectiles/Ranged/GoliathRocket.cs index 43b3926cab..a89296a262 100644 --- a/Projectiles/Ranged/GoliathRocket.cs +++ b/Projectiles/Ranged/GoliathRocket.cs @@ -167,29 +167,22 @@ namespace CalamityMod.Projectiles.Ranged scaleFactor10 = 1f; } int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13AB6_cp_0 = Main.gore[num626]; - expr_13AB6_cp_0.velocity.X += 1f; - Gore expr_13AD6_cp_0 = Main.gore[num626]; - expr_13AD6_cp_0.velocity.Y += 1f; + Gore gore = Main.gore[num626]; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13B79_cp_0 = Main.gore[num626]; - expr_13B79_cp_0.velocity.X -= 1f; - Gore expr_13B99_cp_0 = Main.gore[num626]; - expr_13B99_cp_0.velocity.Y += 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13C3C_cp_0 = Main.gore[num626]; - expr_13C3C_cp_0.velocity.X += 1f; - Gore expr_13C5C_cp_0 = Main.gore[num626]; - expr_13C5C_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y -= 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13CFF_cp_0 = Main.gore[num626]; - expr_13CFF_cp_0.velocity.X -= 1f; - Gore expr_13D1F_cp_0 = Main.gore[num626]; - expr_13D1F_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y -= 1f; } } diff --git a/Projectiles/Ranged/GreenExoArrow.cs b/Projectiles/Ranged/GreenExoArrow.cs index f7696ec20c..ad7cc5969f 100644 --- a/Projectiles/Ranged/GreenExoArrow.cs +++ b/Projectiles/Ranged/GreenExoArrow.cs @@ -24,6 +24,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.extraUpdates = 2; projectile.timeLeft = 300; projectile.ranged = true; + projectile.arrow = true; } public override void AI() diff --git a/Projectiles/Ranged/HalleysComet.cs b/Projectiles/Ranged/HalleysComet.cs index 1bc14b85a6..fa16faba6b 100644 --- a/Projectiles/Ranged/HalleysComet.cs +++ b/Projectiles/Ranged/HalleysComet.cs @@ -54,29 +54,26 @@ namespace CalamityMod.Projectiles.Ranged for (int num298 = 0; num298 < 3; num298++) { int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 1, default, 1f); - if (Main.rand.Next(3) == 0) - { - Main.dust[num299].noGravity = true; - Main.dust[num299].scale *= 3f; - Dust expr_DBEF_cp_0 = Main.dust[num299]; - expr_DBEF_cp_0.velocity.X *= 2f; - Dust expr_DC0F_cp_0 = Main.dust[num299]; - expr_DC0F_cp_0.velocity.Y *= 2f; - } - else - { - Main.dust[num299].scale *= 1.5f; - } - Dust expr_DC74_cp_0 = Main.dust[num299]; - expr_DC74_cp_0.velocity.X *= 1.2f; - Dust expr_DC94_cp_0 = Main.dust[num299]; - expr_DC94_cp_0.velocity.Y *= 1.2f; - Main.dust[num299].scale *= num296; - Main.dust[num299].velocity += projectile.velocity; - if (!Main.dust[num299].noGravity) - { - Main.dust[num299].velocity *= 0.5f; - } + Dust dust = Main.dust[num299]; + if (Main.rand.NextBool(3)) + { + dust.noGravity = true; + dust.scale *= 1.75f; + dust.velocity.X *= 2f; + dust.velocity.Y *= 2f; + } + else + { + dust.scale *= 0.5f; + } + dust.velocity.X *= 1.2f; + dust.velocity.Y *= 1.2f; + dust.scale *= num296; + dust.velocity += projectile.velocity; + if (!dust.noGravity) + { + dust.velocity *= 0.5f; + } } } else diff --git a/Projectiles/Ranged/HiveBomb.cs b/Projectiles/Ranged/HiveBomb.cs index 1dab363d75..7e85e42d49 100644 --- a/Projectiles/Ranged/HiveBomb.cs +++ b/Projectiles/Ranged/HiveBomb.cs @@ -167,29 +167,22 @@ namespace CalamityMod.Projectiles.Ranged scaleFactor10 = 1f; } int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13AB6_cp_0 = Main.gore[num626]; - expr_13AB6_cp_0.velocity.X += 1f; - Gore expr_13AD6_cp_0 = Main.gore[num626]; - expr_13AD6_cp_0.velocity.Y += 1f; + Gore gore = Main.gore[num626]; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13B79_cp_0 = Main.gore[num626]; - expr_13B79_cp_0.velocity.X -= 1f; - Gore expr_13B99_cp_0 = Main.gore[num626]; - expr_13B99_cp_0.velocity.Y += 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13C3C_cp_0 = Main.gore[num626]; - expr_13C3C_cp_0.velocity.X += 1f; - Gore expr_13C5C_cp_0 = Main.gore[num626]; - expr_13C5C_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y -= 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13CFF_cp_0 = Main.gore[num626]; - expr_13CFF_cp_0.velocity.X -= 1f; - Gore expr_13D1F_cp_0 = Main.gore[num626]; - expr_13D1F_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y -= 1f; } } diff --git a/Projectiles/Ranged/HiveMissile.cs b/Projectiles/Ranged/HiveMissile.cs index 8e83d29327..3238e57621 100644 --- a/Projectiles/Ranged/HiveMissile.cs +++ b/Projectiles/Ranged/HiveMissile.cs @@ -167,29 +167,22 @@ namespace CalamityMod.Projectiles.Ranged scaleFactor10 = 1f; } int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13AB6_cp_0 = Main.gore[num626]; - expr_13AB6_cp_0.velocity.X += 1f; - Gore expr_13AD6_cp_0 = Main.gore[num626]; - expr_13AD6_cp_0.velocity.Y += 1f; + Gore gore = Main.gore[num626]; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13B79_cp_0 = Main.gore[num626]; - expr_13B79_cp_0.velocity.X -= 1f; - Gore expr_13B99_cp_0 = Main.gore[num626]; - expr_13B99_cp_0.velocity.Y += 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13C3C_cp_0 = Main.gore[num626]; - expr_13C3C_cp_0.velocity.X += 1f; - Gore expr_13C5C_cp_0 = Main.gore[num626]; - expr_13C5C_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y -= 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13CFF_cp_0 = Main.gore[num626]; - expr_13CFF_cp_0.velocity.X -= 1f; - Gore expr_13D1F_cp_0 = Main.gore[num626]; - expr_13D1F_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y -= 1f; } } } diff --git a/Projectiles/Ranged/MagnomalyAura.cs b/Projectiles/Ranged/MagnomalyAura.cs new file mode 100644 index 0000000000..d1d36497f1 --- /dev/null +++ b/Projectiles/Ranged/MagnomalyAura.cs @@ -0,0 +1,45 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Ranged +{ + public class MagnomalyAura : ModProjectile + { + private int radius = 100; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Magnomaly Aura"); + } + + public override void SetDefaults() + { + projectile.CloneDefaults(ProjectileID.SoulDrain); + aiType = 476; + projectile.magic = false; + projectile.ranged = true; + projectile.usesIDStaticNPCImmunity = true; + projectile.idStaticNPCHitCooldown = 10; + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + float dist1 = Vector2.Distance(projectile.Center, targetHitbox.TopLeft()); + float dist2 = Vector2.Distance(projectile.Center, targetHitbox.TopRight()); + float dist3 = Vector2.Distance(projectile.Center, targetHitbox.BottomLeft()); + float dist4 = Vector2.Distance(projectile.Center, targetHitbox.BottomRight()); + + float minDist = dist1; + if (dist2 < minDist) + minDist = dist2; + if (dist3 < minDist) + minDist = dist3; + if (dist4 < minDist) + minDist = dist4; + + return minDist <= radius; + } + } +} diff --git a/Projectiles/Ranged/MagnomalyAura.png b/Projectiles/Ranged/MagnomalyAura.png new file mode 100644 index 0000000000..df1dd57993 Binary files /dev/null and b/Projectiles/Ranged/MagnomalyAura.png differ diff --git a/Projectiles/Ranged/MagnomalyBeam.cs b/Projectiles/Ranged/MagnomalyBeam.cs new file mode 100644 index 0000000000..1b9e4a27b7 --- /dev/null +++ b/Projectiles/Ranged/MagnomalyBeam.cs @@ -0,0 +1,118 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; + +namespace CalamityMod.Projectiles.Ranged +{ + public class MagnomalyBeam : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Beam"); + } + + public override void SetDefaults() + { + projectile.width = 5; + projectile.height = 5; + projectile.friendly = true; + projectile.ranged = true; + projectile.alpha = 255; + projectile.penetrate = 1; + projectile.extraUpdates = 5; + projectile.timeLeft = 300; + projectile.tileCollide = false; + } + + public override void AI() + { + if (projectile.ai[1] == 1f) + { + projectile.ai[1] = 0f; + } + if (projectile.alpha > 0) + { + projectile.alpha -= 25; + } + if (projectile.alpha < 0) + { + projectile.alpha = 0; + } + Lighting.AddLight(projectile.Center, Main.DiscoR * 0.5f / 255f, Main.DiscoG * 0.5f / 255f, Main.DiscoB * 0.5f / 255f); + float num55 = 100f; + float num56 = 2f; //3 + if (projectile.ai[1] == 0f) + { + projectile.localAI[0] += num56; + if (projectile.localAI[0] > num55) + { + projectile.localAI[0] = num55; + } + } + else + { + projectile.localAI[0] -= num56; + if (projectile.localAI[0] <= 0f) + { + projectile.Kill(); + } + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Color color25 = Lighting.GetColor((int)((double)projectile.position.X + (double)projectile.width * 0.5) / 16, (int)(((double)projectile.position.Y + (double)projectile.height * 0.5) / 16.0)); + int num147 = 0; + int num148 = 0; + float num149 = (float)(Main.projectileTexture[projectile.type].Width - projectile.width) * 0.5f + (float)projectile.width * 0.5f; + SpriteEffects spriteEffects = SpriteEffects.None; + if (projectile.spriteDirection == -1) + { + spriteEffects = SpriteEffects.FlipHorizontally; + } + Rectangle value6 = new Rectangle((int)Main.screenPosition.X - 500, (int)Main.screenPosition.Y - 500, Main.screenWidth + 1000, Main.screenHeight + 1000); + if (projectile.getRect().Intersects(value6)) + { + Vector2 value7 = new Vector2(projectile.position.X - Main.screenPosition.X + num149 + (float)num148, projectile.position.Y - Main.screenPosition.Y + (float)(projectile.height / 2) + projectile.gfxOffY); + float num162 = 100f; + float scaleFactor = 2f; + if (projectile.ai[1] == 1f) + { + num162 = (float)(int)projectile.localAI[0]; + } + for (int num163 = 1; num163 <= (int)projectile.localAI[0]; num163++) + { + Vector2 value8 = Vector2.Normalize(projectile.velocity) * (float)num163 * scaleFactor; + Color color29 = projectile.GetAlpha(color25); + color29 *= (num162 - (float)num163) / num162; + color29.A = 0; + Main.spriteBatch.Draw(Main.projectileTexture[projectile.type], value7 - value8, null, color29, projectile.rotation, new Vector2(num149, (float)(projectile.height / 2 + num147)), projectile.scale, spriteEffects, 0f); + } + } + return false; + } + + public override Color? GetAlpha(Color lightColor) + { + return new Color(0, 250, 75, projectile.alpha); + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.CursedInferno, 120); + target.AddBuff(BuffID.Frostburn, 120); + target.AddBuff(BuffID.OnFire, 120); + target.AddBuff(BuffID.Ichor, 120); + } + } +} diff --git a/Projectiles/Ranged/MagnomalyBeam.png b/Projectiles/Ranged/MagnomalyBeam.png new file mode 100644 index 0000000000..d2fb806a1a Binary files /dev/null and b/Projectiles/Ranged/MagnomalyBeam.png differ diff --git a/Projectiles/Ranged/MagnomalyExplosion.cs b/Projectiles/Ranged/MagnomalyExplosion.cs new file mode 100644 index 0000000000..15be9c170c --- /dev/null +++ b/Projectiles/Ranged/MagnomalyExplosion.cs @@ -0,0 +1,45 @@ +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; +namespace CalamityMod.Projectiles.Ranged +{ + public class MagnomalyExplosion : ModProjectile + { + public override void SetStaticDefaults() //don't remove this projectile + { + DisplayName.SetDefault("Explosion"); + } + + public override void SetDefaults() + { + projectile.width = 192; + projectile.height = 192; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.ranged = true; + projectile.penetrate = -1; + projectile.timeLeft = 5; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = -1; + projectile.alpha = 255; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.CursedInferno, 120); + target.AddBuff(BuffID.Frostburn, 120); + target.AddBuff(BuffID.OnFire, 120); + target.AddBuff(BuffID.Ichor, 120); + } + } +} diff --git a/Projectiles/Ranged/MagnomalyExplosion.png b/Projectiles/Ranged/MagnomalyExplosion.png new file mode 100644 index 0000000000..3cb685553d Binary files /dev/null and b/Projectiles/Ranged/MagnomalyExplosion.png differ diff --git a/Projectiles/Ranged/MagnomalyRocket.cs b/Projectiles/Ranged/MagnomalyRocket.cs new file mode 100644 index 0000000000..acdb6f4045 --- /dev/null +++ b/Projectiles/Ranged/MagnomalyRocket.cs @@ -0,0 +1,219 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Ranged +{ + public class MagnomalyRocket : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Nuke"); + Main.projFrames[projectile.type] = 4; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void SetDefaults() + { + projectile.width = 22; + projectile.height = 22; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.timeLeft = 300; + projectile.ranged = true; + projectile.tileCollide = false; + } + + public override void AI() + { + //Animation + projectile.frameCounter++; + if (projectile.frameCounter > 7) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame >= 4) + { + projectile.frame = 0; + } + + //Rotation + projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt(); + projectile.rotation = projectile.velocity.ToRotation() + (projectile.spriteDirection == 1 ? 0f : MathHelper.Pi) + MathHelper.ToRadians(90) * projectile.direction; + + int num297 = Main.rand.NextBool(2) ? 107 : 234; + if (Main.rand.NextBool(4)) + { + num297 = 269; + } + if (projectile.owner == Main.myPlayer) + { + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.5f), (int)((double)projectile.knockBack * 0.5f), projectile.owner, 0f, 0f); + } + if (projectile.owner == Main.myPlayer && projectile.timeLeft <= 3) + { + projectile.ai[1] = 0f; + 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 = 1000; + projectile.height = 1000; + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.knockBack = 30f; + } + else + { + float num247 = projectile.velocity.X * 0.5f; + float num248 = projectile.velocity.Y * 0.5f; + if (Main.rand.NextBool(2)) + { + int num249 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, num297, 0f, 0f, 100, default, 0.5f); + Main.dust[num249].scale *= (float)Main.rand.Next(10) * 0.1f; + Main.dust[num249].velocity *= 0.2f; + Main.dust[num249].noGravity = true; + } + else + { + int dust2 = Dust.NewDust(new Vector2(projectile.position.X + 3f + num247, projectile.position.Y + 3f + num248) - projectile.velocity * 0.5f, projectile.width - 8, projectile.height - 8, num297, 0f, 0f, 100, default, 0.25f); + Main.dust[dust2].fadeIn = 1f + (float)Main.rand.Next(5) * 0.1f; + Main.dust[dust2].velocity *= 0.05f; + Main.dust[dust2].noGravity = true; + } + } + float num472 = projectile.Center.X; + float num473 = projectile.Center.Y; + float num474 = 600f; + bool flag17 = false; + for (int num475 = 0; num475 < Main.npc.Length; 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 = 16f; + 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; + } + } + + public override void Kill(int timeLeft) + { + projectile.position = projectile.Center; + projectile.width = projectile.height = 192; + 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.Center.X, (int)projectile.Center.Y, 14); + //DO NOT REMOVE THIS PROJECTILE + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + + int num298 = Main.rand.NextBool(2) ? 107 : 234; + if (Main.rand.NextBool(4)) + { + num298 = 269; + } + for (int num621 = 0; num621 < 30; num621++) + { + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num298, 0f, 0f, 100, default, 1f); + Main.dust[num622].velocity *= 3f; + Main.dust[num622].noGravity = true; + if (Main.rand.NextBool(2)) + { + Main.dust[num622].scale = 0.5f; + Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + } + } + for (int num623 = 0; num623 < 40; num623++) + { + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num298, 0f, 0f, 100, default, 0.5f); + Main.dust[num624].noGravity = true; + Main.dust[num624].velocity *= 5f; + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num298, 0f, 0f, 100, default, 0.75f); + Main.dust[num624].velocity *= 2f; + } + for (int num625 = 0; num625 < 10; num625++) + { + float scaleFactor10 = 0.33f; + if (num625 == 1) + { + scaleFactor10 = 0.66f; + } + if (num625 == 2) + { + scaleFactor10 = 1f; + } + int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); + Gore gore = Main.gore[num626]; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y += 1f; + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y += 1f; + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y -= 1f; + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y -= 1f; + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + float random = Main.rand.Next(30, 90); + float spread = random * 0.0174f; + double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y) - spread / 2; + double deltaAngle = spread / 8f; + for (int i = 0; i < 4; i++) + { + double offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; + int proj1 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), projectile.damage / 5, projectile.knockBack / 5, projectile.owner, 0f, 1f); + int proj2 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), projectile.damage / 5, projectile.knockBack / 5, projectile.owner, 0f, 1f); + } + target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.CursedInferno, 120); + target.AddBuff(BuffID.Frostburn, 120); + target.AddBuff(BuffID.OnFire, 120); + target.AddBuff(BuffID.Ichor, 120); + } + } +} diff --git a/Projectiles/Ranged/MagnomalyRocket.png b/Projectiles/Ranged/MagnomalyRocket.png new file mode 100644 index 0000000000..e142269afa Binary files /dev/null and b/Projectiles/Ranged/MagnomalyRocket.png differ diff --git a/Projectiles/Ranged/MeowFire.cs b/Projectiles/Ranged/MeowFire.cs index 36c605c65e..a1fa5a27c1 100644 --- a/Projectiles/Ranged/MeowFire.cs +++ b/Projectiles/Ranged/MeowFire.cs @@ -46,29 +46,26 @@ namespace CalamityMod.Projectiles.Ranged for (int num298 = 0; num298 < 2; num298++) { int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f); - if (Main.rand.NextBool(3)) - { - Main.dust[num299].noGravity = true; - Main.dust[num299].scale *= 1.75f; - Dust expr_DBEF_cp_0 = Main.dust[num299]; - expr_DBEF_cp_0.velocity.X *= 2f; - Dust expr_DC0F_cp_0 = Main.dust[num299]; - expr_DC0F_cp_0.velocity.Y *= 2f; - } - else - { - Main.dust[num299].scale *= 0.5f; - } - Dust expr_DC74_cp_0 = Main.dust[num299]; - expr_DC74_cp_0.velocity.X *= 1.2f; - Dust expr_DC94_cp_0 = Main.dust[num299]; - expr_DC94_cp_0.velocity.Y *= 1.2f; - Main.dust[num299].scale *= num296; - Main.dust[num299].velocity += projectile.velocity; - if (!Main.dust[num299].noGravity) - { - Main.dust[num299].velocity *= 0.5f; - } + Dust dust = Main.dust[num299]; + if (Main.rand.NextBool(3)) + { + dust.noGravity = true; + dust.scale *= 1.75f; + dust.velocity.X *= 2f; + dust.velocity.Y *= 2f; + } + else + { + dust.scale *= 0.5f; + } + dust.velocity.X *= 1.2f; + dust.velocity.Y *= 1.2f; + dust.scale *= num296; + dust.velocity += projectile.velocity; + if (!dust.noGravity) + { + dust.velocity *= 0.5f; + } } } else diff --git a/Projectiles/Ranged/MeowFire2.cs b/Projectiles/Ranged/MeowFire2.cs index 19ca13e98c..1071ccd125 100644 --- a/Projectiles/Ranged/MeowFire2.cs +++ b/Projectiles/Ranged/MeowFire2.cs @@ -46,29 +46,26 @@ namespace CalamityMod.Projectiles.Ranged for (int num298 = 0; num298 < 2; num298++) { int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f); - if (Main.rand.NextBool(3)) - { - Main.dust[num299].noGravity = true; - Main.dust[num299].scale *= 1.75f; - Dust expr_DBEF_cp_0 = Main.dust[num299]; - expr_DBEF_cp_0.velocity.X *= 2f; - Dust expr_DC0F_cp_0 = Main.dust[num299]; - expr_DC0F_cp_0.velocity.Y *= 2f; - } - else - { - Main.dust[num299].scale *= 0.5f; - } - Dust expr_DC74_cp_0 = Main.dust[num299]; - expr_DC74_cp_0.velocity.X *= 1.2f; - Dust expr_DC94_cp_0 = Main.dust[num299]; - expr_DC94_cp_0.velocity.Y *= 1.2f; - Main.dust[num299].scale *= num296; - Main.dust[num299].velocity += projectile.velocity; - if (!Main.dust[num299].noGravity) - { - Main.dust[num299].velocity *= 0.5f; - } + Dust dust = Main.dust[num299]; + if (Main.rand.NextBool(3)) + { + dust.noGravity = true; + dust.scale *= 1.75f; + dust.velocity.X *= 2f; + dust.velocity.Y *= 2f; + } + else + { + dust.scale *= 0.5f; + } + dust.velocity.X *= 1.2f; + dust.velocity.Y *= 1.2f; + dust.scale *= num296; + dust.velocity += projectile.velocity; + if (!dust.noGravity) + { + dust.velocity *= 0.5f; + } } } else diff --git a/Projectiles/Ranged/MiniRocket.cs b/Projectiles/Ranged/MiniRocket.cs index fa2699ca74..d08d796817 100644 --- a/Projectiles/Ranged/MiniRocket.cs +++ b/Projectiles/Ranged/MiniRocket.cs @@ -137,29 +137,22 @@ namespace CalamityMod.Projectiles.Ranged scaleFactor10 = 1f; } int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13AB6_cp_0 = Main.gore[num626]; - expr_13AB6_cp_0.velocity.X += 1f; - Gore expr_13AD6_cp_0 = Main.gore[num626]; - expr_13AD6_cp_0.velocity.Y += 1f; + Gore gore = Main.gore[num626]; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13B79_cp_0 = Main.gore[num626]; - expr_13B79_cp_0.velocity.X -= 1f; - Gore expr_13B99_cp_0 = Main.gore[num626]; - expr_13B99_cp_0.velocity.Y += 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13C3C_cp_0 = Main.gore[num626]; - expr_13C3C_cp_0.velocity.X += 1f; - Gore expr_13C5C_cp_0 = Main.gore[num626]; - expr_13C5C_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y -= 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13CFF_cp_0 = Main.gore[num626]; - expr_13CFF_cp_0.velocity.X -= 1f; - Gore expr_13D1F_cp_0 = Main.gore[num626]; - expr_13D1F_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y -= 1f; } } } diff --git a/Projectiles/Ranged/MistArrow.cs b/Projectiles/Ranged/MistArrow.cs index a69dd15880..aefe0a8777 100644 --- a/Projectiles/Ranged/MistArrow.cs +++ b/Projectiles/Ranged/MistArrow.cs @@ -24,6 +24,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.aiStyle = 1; projectile.timeLeft = 300; aiType = 1; + projectile.arrow = true; projectile.coldDamage = true; } diff --git a/Projectiles/Ranged/MortarRoundProj.cs b/Projectiles/Ranged/MortarRoundProj.cs index c646d1e0c6..d6b6798f9f 100644 --- a/Projectiles/Ranged/MortarRoundProj.cs +++ b/Projectiles/Ranged/MortarRoundProj.cs @@ -117,29 +117,22 @@ namespace CalamityMod.Projectiles.Ranged scaleFactor10 = 1f; } int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13AB6_cp_0 = Main.gore[num626]; - expr_13AB6_cp_0.velocity.X += 1f; - Gore expr_13AD6_cp_0 = Main.gore[num626]; - expr_13AD6_cp_0.velocity.Y += 1f; + Gore gore = Main.gore[num626]; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13B79_cp_0 = Main.gore[num626]; - expr_13B79_cp_0.velocity.X -= 1f; - Gore expr_13B99_cp_0 = Main.gore[num626]; - expr_13B99_cp_0.velocity.Y += 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13C3C_cp_0 = Main.gore[num626]; - expr_13C3C_cp_0.velocity.X += 1f; - Gore expr_13C5C_cp_0 = Main.gore[num626]; - expr_13C5C_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y -= 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13CFF_cp_0 = Main.gore[num626]; - expr_13CFF_cp_0.velocity.X -= 1f; - Gore expr_13D1F_cp_0 = Main.gore[num626]; - expr_13D1F_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y -= 1f; } if (projectile.owner == Main.myPlayer) { diff --git a/Projectiles/Ranged/NapalmArrowProj.cs b/Projectiles/Ranged/NapalmArrowProj.cs index 1573edffc6..2a70aef7b9 100644 --- a/Projectiles/Ranged/NapalmArrowProj.cs +++ b/Projectiles/Ranged/NapalmArrowProj.cs @@ -69,29 +69,22 @@ namespace CalamityMod.Projectiles.Ranged scaleFactor10 = 1f; } int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13AB6_cp_0 = Main.gore[num626]; - expr_13AB6_cp_0.velocity.X += 1f; - Gore expr_13AD6_cp_0 = Main.gore[num626]; - expr_13AD6_cp_0.velocity.Y += 1f; + Gore gore = Main.gore[num626]; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13B79_cp_0 = Main.gore[num626]; - expr_13B79_cp_0.velocity.X -= 1f; - Gore expr_13B99_cp_0 = Main.gore[num626]; - expr_13B99_cp_0.velocity.Y += 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13C3C_cp_0 = Main.gore[num626]; - expr_13C3C_cp_0.velocity.X += 1f; - Gore expr_13C5C_cp_0 = Main.gore[num626]; - expr_13C5C_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y -= 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13CFF_cp_0 = Main.gore[num626]; - expr_13CFF_cp_0.velocity.X -= 1f; - Gore expr_13D1F_cp_0 = Main.gore[num626]; - expr_13D1F_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y -= 1f; } if (projectile.owner == Main.myPlayer) { diff --git a/Projectiles/Ranged/NorfleetExplosion.cs b/Projectiles/Ranged/NorfleetExplosion.cs index ec66b8a16b..87f017b579 100644 --- a/Projectiles/Ranged/NorfleetExplosion.cs +++ b/Projectiles/Ranged/NorfleetExplosion.cs @@ -73,15 +73,14 @@ namespace CalamityMod.Projectiles.Ranged num463 *= num466; num464 *= num466; int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(2) ? 221 : 244, 0f, 0f, 100, default, 2f); - Main.dust[num467].noGravity = true; - Main.dust[num467].position.X = projectile.Center.X; - Main.dust[num467].position.Y = projectile.Center.Y; - Dust expr_149DF_cp_0 = Main.dust[num467]; - expr_149DF_cp_0.position.X += (float)Main.rand.Next(-10, 11); - Dust expr_14A09_cp_0 = Main.dust[num467]; - expr_14A09_cp_0.position.Y += (float)Main.rand.Next(-10, 11); - Main.dust[num467].velocity.X = num463; - Main.dust[num467].velocity.Y = num464; + Dust dust = Main.dust[num467]; + dust.noGravity = true; + dust.position.X = projectile.Center.X; + dust.position.Y = projectile.Center.Y; + dust.position.X += (float)Main.rand.Next(-10, 11); + dust.position.Y += (float)Main.rand.Next(-10, 11); + dust.velocity.X = num463; + dust.velocity.Y = num464; num462++; } } diff --git a/Projectiles/Ranged/Nuke.cs b/Projectiles/Ranged/Nuke.cs index 09b58084f4..66223f9067 100644 --- a/Projectiles/Ranged/Nuke.cs +++ b/Projectiles/Ranged/Nuke.cs @@ -163,29 +163,22 @@ namespace CalamityMod.Projectiles.Ranged scaleFactor10 = 1f; } int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13AB6_cp_0 = Main.gore[num626]; - expr_13AB6_cp_0.velocity.X += 1f; - Gore expr_13AD6_cp_0 = Main.gore[num626]; - expr_13AD6_cp_0.velocity.Y += 1f; + Gore gore = Main.gore[num626]; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13B79_cp_0 = Main.gore[num626]; - expr_13B79_cp_0.velocity.X -= 1f; - Gore expr_13B99_cp_0 = Main.gore[num626]; - expr_13B99_cp_0.velocity.Y += 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13C3C_cp_0 = Main.gore[num626]; - expr_13C3C_cp_0.velocity.X += 1f; - Gore expr_13C5C_cp_0 = Main.gore[num626]; - expr_13C5C_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y -= 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13CFF_cp_0 = Main.gore[num626]; - expr_13CFF_cp_0.velocity.X -= 1f; - Gore expr_13D1F_cp_0 = Main.gore[num626]; - expr_13D1F_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y -= 1f; } } diff --git a/Projectiles/Ranged/OrangeExoArrow.cs b/Projectiles/Ranged/OrangeExoArrow.cs index ac446e109e..194b0bc52a 100644 --- a/Projectiles/Ranged/OrangeExoArrow.cs +++ b/Projectiles/Ranged/OrangeExoArrow.cs @@ -24,6 +24,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.extraUpdates = 2; projectile.timeLeft = 300; projectile.ranged = true; + projectile.arrow = true; } public override void AI() diff --git a/Projectiles/Ranged/PlagueExplosionFriendly.cs b/Projectiles/Ranged/PlagueExplosionFriendly.cs index a0983cad45..175aa0b15d 100644 --- a/Projectiles/Ranged/PlagueExplosionFriendly.cs +++ b/Projectiles/Ranged/PlagueExplosionFriendly.cs @@ -72,15 +72,14 @@ namespace CalamityMod.Projectiles.Ranged num463 *= num466; num464 *= num466; int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 89, 0f, 0f, 100, default, 0.5f); - Main.dust[num467].noGravity = true; - Main.dust[num467].position.X = projectile.Center.X; - Main.dust[num467].position.Y = projectile.Center.Y; - Dust expr_149DF_cp_0 = Main.dust[num467]; - expr_149DF_cp_0.position.X += (float)Main.rand.Next(-10, 11); - Dust expr_14A09_cp_0 = Main.dust[num467]; - expr_14A09_cp_0.position.Y += (float)Main.rand.Next(-10, 11); - Main.dust[num467].velocity.X = num463; - Main.dust[num467].velocity.Y = num464; + Dust dust = Main.dust[num467]; + dust.noGravity = true; + dust.position.X = projectile.Center.X; + dust.position.Y = projectile.Center.Y; + dust.position.X += (float)Main.rand.Next(-10, 11); + dust.position.Y += (float)Main.rand.Next(-10, 11); + dust.velocity.X = num463; + dust.velocity.Y = num464; num462++; } } diff --git a/Projectiles/Ranged/PlasmaExplosion.cs b/Projectiles/Ranged/PlasmaExplosion.cs index ec686b203c..f0c37e9c49 100644 --- a/Projectiles/Ranged/PlasmaExplosion.cs +++ b/Projectiles/Ranged/PlasmaExplosion.cs @@ -79,15 +79,14 @@ namespace CalamityMod.Projectiles.Ranged num464 *= num466; int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, projectile.ai[1] == 1f ? 173 : 221, 0f, 0f, 100, default, 2f); - Main.dust[num467].noGravity = true; - Main.dust[num467].position.X = projectile.Center.X; - Main.dust[num467].position.Y = projectile.Center.Y; - Dust expr_149DF_cp_0 = Main.dust[num467]; - expr_149DF_cp_0.position.X += (float)Main.rand.Next(-10, 11); - Dust expr_14A09_cp_0 = Main.dust[num467]; - expr_14A09_cp_0.position.Y += (float)Main.rand.Next(-10, 11); - Main.dust[num467].velocity.X = num463; - Main.dust[num467].velocity.Y = num464; + Dust dust = Main.dust[num467]; + dust.noGravity = true; + dust.position.X = projectile.Center.X; + dust.position.Y = projectile.Center.Y; + dust.position.X += (float)Main.rand.Next(-10, 11); + dust.position.Y += (float)Main.rand.Next(-10, 11); + dust.velocity.X = num463; + dust.velocity.Y = num464; num462++; } return; diff --git a/Projectiles/Ranged/RubberMortarRoundProj.cs b/Projectiles/Ranged/RubberMortarRoundProj.cs index f01f7888c8..0ffb7898b3 100644 --- a/Projectiles/Ranged/RubberMortarRoundProj.cs +++ b/Projectiles/Ranged/RubberMortarRoundProj.cs @@ -117,29 +117,22 @@ namespace CalamityMod.Projectiles.Ranged scaleFactor10 = 1f; } int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13AB6_cp_0 = Main.gore[num626]; - expr_13AB6_cp_0.velocity.X += 1f; - Gore expr_13AD6_cp_0 = Main.gore[num626]; - expr_13AD6_cp_0.velocity.Y += 1f; + Gore gore = Main.gore[num626]; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13B79_cp_0 = Main.gore[num626]; - expr_13B79_cp_0.velocity.X -= 1f; - Gore expr_13B99_cp_0 = Main.gore[num626]; - expr_13B99_cp_0.velocity.Y += 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13C3C_cp_0 = Main.gore[num626]; - expr_13C3C_cp_0.velocity.X += 1f; - Gore expr_13C5C_cp_0 = Main.gore[num626]; - expr_13C5C_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y -= 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13CFF_cp_0 = Main.gore[num626]; - expr_13CFF_cp_0.velocity.X -= 1f; - Gore expr_13D1F_cp_0 = Main.gore[num626]; - expr_13D1F_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y -= 1f; } if (projectile.owner == Main.myPlayer) { @@ -292,29 +285,22 @@ namespace CalamityMod.Projectiles.Ranged scaleFactor10 = 1f; } int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13AB6_cp_0 = Main.gore[num626]; - expr_13AB6_cp_0.velocity.X += 1f; - Gore expr_13AD6_cp_0 = Main.gore[num626]; - expr_13AD6_cp_0.velocity.Y += 1f; + Gore gore = Main.gore[num626]; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13B79_cp_0 = Main.gore[num626]; - expr_13B79_cp_0.velocity.X -= 1f; - Gore expr_13B99_cp_0 = Main.gore[num626]; - expr_13B99_cp_0.velocity.Y += 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13C3C_cp_0 = Main.gore[num626]; - expr_13C3C_cp_0.velocity.X += 1f; - Gore expr_13C5C_cp_0 = Main.gore[num626]; - expr_13C5C_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y -= 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13CFF_cp_0 = Main.gore[num626]; - expr_13CFF_cp_0.velocity.X -= 1f; - Gore expr_13D1F_cp_0 = Main.gore[num626]; - expr_13D1F_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y -= 1f; } if (projectile.owner == Main.myPlayer) { diff --git a/Projectiles/Ranged/SandWater.cs b/Projectiles/Ranged/SandWater.cs index 1e5270f144..1b6d886569 100644 --- a/Projectiles/Ranged/SandWater.cs +++ b/Projectiles/Ranged/SandWater.cs @@ -47,15 +47,14 @@ namespace CalamityMod.Projectiles.Ranged num463 *= num466; num464 *= num466; int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 33, 0f, 0f, 100, default, 0.6f); - Main.dust[num467].noGravity = true; - Main.dust[num467].position.X = projectile.Center.X; - Main.dust[num467].position.Y = projectile.Center.Y; - Dust expr_149DF_cp_0 = Main.dust[num467]; - expr_149DF_cp_0.position.X += (float)Main.rand.Next(-10, 11); - Dust expr_14A09_cp_0 = Main.dust[num467]; - expr_14A09_cp_0.position.Y += (float)Main.rand.Next(-10, 11); - Main.dust[num467].velocity.X = num463; - Main.dust[num467].velocity.Y = num464; + Dust dust2 = Main.dust[num467]; + dust2.noGravity = true; + dust2.position.X = projectile.Center.X; + dust2.position.Y = projectile.Center.Y; + dust2.position.X += (float)Main.rand.Next(-10, 11); + dust2.position.Y += (float)Main.rand.Next(-10, 11); + dust2.velocity.X = num463; + dust2.velocity.Y = num464; } } } diff --git a/Projectiles/Ranged/SeasSearingBubble.cs b/Projectiles/Ranged/SeasSearingBubble.cs index 7a71e9c7c6..9f32010a8b 100644 --- a/Projectiles/Ranged/SeasSearingBubble.cs +++ b/Projectiles/Ranged/SeasSearingBubble.cs @@ -49,13 +49,12 @@ namespace CalamityMod.Projectiles.Ranged float num100 = projectile.velocity.Y / 3f * (float)num105; int num101 = 4; int num102 = Dust.NewDust(new Vector2(projectile.position.X + (float)num101, projectile.position.Y + (float)num101), projectile.width - num101 * 2, projectile.height - num101 * 2, 202, 0f, 0f, 150, new Color(60, Main.DiscoG, 190), 1.2f); - Main.dust[num102].noGravity = true; - Main.dust[num102].velocity *= 0.1f; - Main.dust[num102].velocity += projectile.velocity * 0.1f; - Dust expr_47FA_cp_0 = Main.dust[num102]; - expr_47FA_cp_0.position.X -= num99; - Dust expr_4815_cp_0 = Main.dust[num102]; - expr_4815_cp_0.position.Y -= num100; + Dust dust = Main.dust[num102]; + dust.noGravity = true; + dust.velocity *= 0.1f; + dust.velocity += projectile.velocity * 0.1f; + dust.position.X -= num99; + dust.position.Y -= num100; } if (Main.rand.NextBool(10)) { diff --git a/Projectiles/Ranged/ShadeFire.cs b/Projectiles/Ranged/ShadeFire.cs index 3e0bd58a5c..5752a3a62a 100644 --- a/Projectiles/Ranged/ShadeFire.cs +++ b/Projectiles/Ranged/ShadeFire.cs @@ -51,28 +51,25 @@ namespace CalamityMod.Projectiles.Ranged for (int num298 = 0; num298 < 3; num298++) { int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f); + Dust dust = Main.dust[num299]; if (Main.rand.NextBool(3)) { - Main.dust[num299].noGravity = true; - Main.dust[num299].scale *= 1.75f; - Dust expr_DBEF_cp_0 = Main.dust[num299]; - expr_DBEF_cp_0.velocity.X *= 2f; - Dust expr_DC0F_cp_0 = Main.dust[num299]; - expr_DC0F_cp_0.velocity.Y *= 2f; + dust.noGravity = true; + dust.scale *= 1.75f; + dust.velocity.X *= 2f; + dust.velocity.Y *= 2f; } else { - Main.dust[num299].scale *= 0.5f; + dust.scale *= 0.5f; } - Dust expr_DC74_cp_0 = Main.dust[num299]; - expr_DC74_cp_0.velocity.X *= 1.2f; - Dust expr_DC94_cp_0 = Main.dust[num299]; - expr_DC94_cp_0.velocity.Y *= 1.2f; - Main.dust[num299].scale *= num296; - Main.dust[num299].velocity += projectile.velocity; - if (!Main.dust[num299].noGravity) + dust.velocity.X *= 1.2f; + dust.velocity.Y *= 1.2f; + dust.scale *= num296; + dust.velocity += projectile.velocity; + if (!dust.noGravity) { - Main.dust[num299].velocity *= 0.5f; + dust.velocity *= 0.5f; } } } diff --git a/Projectiles/Ranged/Shockblast.cs b/Projectiles/Ranged/Shockblast.cs index 482a84ac27..62d2575a5e 100644 --- a/Projectiles/Ranged/Shockblast.cs +++ b/Projectiles/Ranged/Shockblast.cs @@ -71,15 +71,14 @@ namespace CalamityMod.Projectiles.Ranged num463 *= num466; num464 *= num466; int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 185, 0f, 0f, 100, default, 1f); - Main.dust[num467].noGravity = true; - Main.dust[num467].position.X = projectile.Center.X; - Main.dust[num467].position.Y = projectile.Center.Y; - Dust expr_149DF_cp_0 = Main.dust[num467]; - expr_149DF_cp_0.position.X += (float)Main.rand.Next(-10, 11); - Dust expr_14A09_cp_0 = Main.dust[num467]; - expr_14A09_cp_0.position.Y += (float)Main.rand.Next(-10, 11); - Main.dust[num467].velocity.X = num463; - Main.dust[num467].velocity.Y = num464; + Dust dust = Main.dust[num467]; + dust.noGravity = true; + dust.position.X = projectile.Center.X; + dust.position.Y = projectile.Center.Y; + dust.position.X += (float)Main.rand.Next(-10, 11); + dust.position.Y += (float)Main.rand.Next(-10, 11); + dust.velocity.X = num463; + dust.velocity.Y = num464; num462++; } } diff --git a/Projectiles/Ranged/Sickness.cs b/Projectiles/Ranged/Sickness.cs index b3dcdac270..3b7b269511 100644 --- a/Projectiles/Ranged/Sickness.cs +++ b/Projectiles/Ranged/Sickness.cs @@ -72,15 +72,14 @@ namespace CalamityMod.Projectiles.Ranged num463 *= num466; num464 *= num466; int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 107, 0f, 0f, 100, default, 0.5f); - Main.dust[num467].noGravity = true; - Main.dust[num467].position.X = projectile.Center.X; - Main.dust[num467].position.Y = projectile.Center.Y; - Dust expr_149DF_cp_0 = Main.dust[num467]; - expr_149DF_cp_0.position.X += (float)Main.rand.Next(-10, 11); - Dust expr_14A09_cp_0 = Main.dust[num467]; - expr_14A09_cp_0.position.Y += (float)Main.rand.Next(-10, 11); - Main.dust[num467].velocity.X = num463; - Main.dust[num467].velocity.Y = num464; + Dust dust = Main.dust[num467]; + dust.noGravity = true; + dust.position.X = projectile.Center.X; + dust.position.Y = projectile.Center.Y; + dust.position.X += (float)Main.rand.Next(-10, 11); + dust.position.Y += (float)Main.rand.Next(-10, 11); + dust.velocity.X = num463; + dust.velocity.Y = num464; num462++; } } diff --git a/Projectiles/Ranged/SparkSpreaderFire.cs b/Projectiles/Ranged/SparkSpreaderFire.cs index 64438f3eba..4fede1d4eb 100644 --- a/Projectiles/Ranged/SparkSpreaderFire.cs +++ b/Projectiles/Ranged/SparkSpreaderFire.cs @@ -63,26 +63,23 @@ namespace CalamityMod.Projectiles.Ranged for (int num298 = 0; num298 < 2; num298++) { int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 10, default, 0.75f); + Dust dust = Main.dust[num299]; if (Main.rand.Next(3) == 0) { - Main.dust[num299].noGravity = true; - Main.dust[num299].scale *= 1.75f; - Dust expr_DBEF_cp_0 = Main.dust[num299]; - expr_DBEF_cp_0.velocity.X *= 2f; - Dust expr_DC0F_cp_0 = Main.dust[num299]; - expr_DC0F_cp_0.velocity.Y *= 2f; + dust.noGravity = true; + dust.scale *= 1.75f; + dust.velocity.X *= 2f; + dust.velocity.Y *= 2f; } else { - Main.dust[num299].noGravity = true; - Main.dust[num299].scale *= 0.5f; + dust.noGravity = true; + dust.scale *= 0.5f; } - Dust expr_DC74_cp_0 = Main.dust[num299]; - expr_DC74_cp_0.velocity.X *= 1.2f; - Dust expr_DC94_cp_0 = Main.dust[num299]; - expr_DC94_cp_0.velocity.Y *= 1.2f; - Main.dust[num299].scale *= num296; - Main.dust[num299].velocity += projectile.velocity; + dust.velocity.X *= 1.2f; + dust.velocity.Y *= 1.2f; + dust.scale *= num296; + dust.velocity += projectile.velocity; } } } diff --git a/Projectiles/Ranged/TealExoArrow.cs b/Projectiles/Ranged/TealExoArrow.cs index 5d65e49ba3..d687aaa5df 100644 --- a/Projectiles/Ranged/TealExoArrow.cs +++ b/Projectiles/Ranged/TealExoArrow.cs @@ -26,6 +26,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.ranged = true; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 1; + projectile.arrow = true; } public override void AI() diff --git a/Projectiles/Ranged/TelluricGlareProj.cs b/Projectiles/Ranged/TelluricGlareProj.cs index c6ae8c51a8..ccc94595a8 100644 --- a/Projectiles/Ranged/TelluricGlareProj.cs +++ b/Projectiles/Ranged/TelluricGlareProj.cs @@ -21,6 +21,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.penetrate = -1; projectile.aiStyle = 1; projectile.timeLeft = 300; + projectile.arrow = true; aiType = 1; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 1; diff --git a/Projectiles/Ranged/TerraFireGreen.cs b/Projectiles/Ranged/TerraFireGreen.cs index 17fdf64285..edd9f08b6b 100644 --- a/Projectiles/Ranged/TerraFireGreen.cs +++ b/Projectiles/Ranged/TerraFireGreen.cs @@ -53,28 +53,25 @@ namespace CalamityMod.Projectiles.Ranged for (int num298 = 0; num298 < 3; num298++) { int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 0.75f); + Dust dust = Main.dust[num299]; if (Main.rand.NextBool(3)) { - Main.dust[num299].noGravity = true; - Main.dust[num299].scale *= 2f; - Dust expr_DBEF_cp_0 = Main.dust[num299]; - expr_DBEF_cp_0.velocity.X *= 2f; - Dust expr_DC0F_cp_0 = Main.dust[num299]; - expr_DC0F_cp_0.velocity.Y *= 2f; + dust.noGravity = true; + dust.scale *= 2f; + dust.velocity.X *= 2f; + dust.velocity.Y *= 2f; } else { - Main.dust[num299].scale *= 0.75f; + dust.scale *= 0.75f; } - Dust expr_DC74_cp_0 = Main.dust[num299]; - expr_DC74_cp_0.velocity.X *= 1.2f; - Dust expr_DC94_cp_0 = Main.dust[num299]; - expr_DC94_cp_0.velocity.Y *= 1.2f; - Main.dust[num299].scale *= num296; - Main.dust[num299].velocity += projectile.velocity; - if (!Main.dust[num299].noGravity) + dust.velocity.X *= 1.2f; + dust.velocity.Y *= 1.2f; + dust.scale *= num296; + dust.velocity += projectile.velocity; + if (!dust.noGravity) { - Main.dust[num299].velocity *= 0.5f; + dust.velocity *= 0.5f; } } } diff --git a/Projectiles/Ranged/TerraFireGreen2.cs b/Projectiles/Ranged/TerraFireGreen2.cs index ecff82594e..3418b20107 100644 --- a/Projectiles/Ranged/TerraFireGreen2.cs +++ b/Projectiles/Ranged/TerraFireGreen2.cs @@ -52,26 +52,23 @@ namespace CalamityMod.Projectiles.Ranged for (int num298 = 0; num298 < 2; num298++) { int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 0.75f); + Dust dust = Main.dust[num299]; if (Main.rand.NextBool(3)) { - Main.dust[num299].noGravity = true; - Main.dust[num299].scale *= 1.75f; - Dust expr_DBEF_cp_0 = Main.dust[num299]; - expr_DBEF_cp_0.velocity.X *= 2f; - Dust expr_DC0F_cp_0 = Main.dust[num299]; - expr_DC0F_cp_0.velocity.Y *= 2f; + dust.noGravity = true; + dust.scale *= 1.75f; + dust.velocity.X *= 2f; + dust.velocity.Y *= 2f; } else { - Main.dust[num299].noGravity = true; - Main.dust[num299].scale *= 0.5f; + dust.noGravity = true; + dust.scale *= 0.5f; } - Dust expr_DC74_cp_0 = Main.dust[num299]; - expr_DC74_cp_0.velocity.X *= 1.2f; - Dust expr_DC94_cp_0 = Main.dust[num299]; - expr_DC94_cp_0.velocity.Y *= 1.2f; - Main.dust[num299].scale *= num296; - Main.dust[num299].velocity += projectile.velocity; + dust.velocity.X *= 1.2f; + dust.velocity.Y *= 1.2f; + dust.scale *= num296; + dust.velocity += projectile.velocity; } } } diff --git a/Projectiles/Ranged/TorrentialArrow.cs b/Projectiles/Ranged/TorrentialArrow.cs index 4d1415faca..6a9a4a8324 100644 --- a/Projectiles/Ranged/TorrentialArrow.cs +++ b/Projectiles/Ranged/TorrentialArrow.cs @@ -23,6 +23,7 @@ namespace CalamityMod.Projectiles.Ranged projectile.ranged = true; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 1; + projectile.arrow = true; } public override void AI() diff --git a/Projectiles/Rogue/AlphaVirusProjectile.cs b/Projectiles/Rogue/AlphaVirusProjectile.cs index 60b358d3a7..0002a9aae4 100644 --- a/Projectiles/Rogue/AlphaVirusProjectile.cs +++ b/Projectiles/Rogue/AlphaVirusProjectile.cs @@ -2,6 +2,7 @@ using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using CalamityMod.NPCs.StormWeaver; using Terraria; using Terraria.ModLoader; @@ -87,6 +88,11 @@ namespace CalamityMod.Projectiles.Rogue public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) { + if (target.type == ModContent.NPCType() || target.type == ModContent.NPCType() || target.type == ModContent.NPCType()) + { + damage /= 5; + } + float dist1 = Vector2.Distance(projectile.Center, target.Hitbox.TopLeft()); float dist2 = Vector2.Distance(projectile.Center, target.Hitbox.TopRight()); float dist3 = Vector2.Distance(projectile.Center, target.Hitbox.BottomLeft()); diff --git a/Projectiles/Rogue/BallisticPoisonBombProj.cs b/Projectiles/Rogue/BallisticPoisonBombProj.cs index 740f68efa4..e855c52f52 100644 --- a/Projectiles/Rogue/BallisticPoisonBombProj.cs +++ b/Projectiles/Rogue/BallisticPoisonBombProj.cs @@ -164,29 +164,22 @@ namespace CalamityMod.Projectiles.Rogue scaleFactor10 = 1f; } int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13AB6_cp_0 = Main.gore[num626]; - expr_13AB6_cp_0.velocity.X += 1f; - Gore expr_13AD6_cp_0 = Main.gore[num626]; - expr_13AD6_cp_0.velocity.Y += 1f; + Gore gore = Main.gore[num626]; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13B79_cp_0 = Main.gore[num626]; - expr_13B79_cp_0.velocity.X -= 1f; - Gore expr_13B99_cp_0 = Main.gore[num626]; - expr_13B99_cp_0.velocity.Y += 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13C3C_cp_0 = Main.gore[num626]; - expr_13C3C_cp_0.velocity.X += 1f; - Gore expr_13C5C_cp_0 = Main.gore[num626]; - expr_13C5C_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y -= 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13CFF_cp_0 = Main.gore[num626]; - expr_13CFF_cp_0.velocity.X -= 1f; - Gore expr_13D1F_cp_0 = Main.gore[num626]; - expr_13D1F_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y -= 1f; } } diff --git a/Projectiles/Rogue/BrackishWaterBlast.cs b/Projectiles/Rogue/BrackishWaterBlast.cs index 3c0cddf230..8049f1d6cc 100644 --- a/Projectiles/Rogue/BrackishWaterBlast.cs +++ b/Projectiles/Rogue/BrackishWaterBlast.cs @@ -87,15 +87,14 @@ namespace CalamityMod.Projectiles.Rogue num463 *= num466; num464 *= num466; int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, randomDust, 0f, 0f, 100, default, 0.5f); - Main.dust[num467].noGravity = true; - Main.dust[num467].position.X = projectile.Center.X; - Main.dust[num467].position.Y = projectile.Center.Y; - Dust expr_149DF_cp_0 = Main.dust[num467]; - expr_149DF_cp_0.position.X += (float)Main.rand.Next(-10, 11); - Dust expr_14A09_cp_0 = Main.dust[num467]; - expr_14A09_cp_0.position.Y += (float)Main.rand.Next(-10, 11); - Main.dust[num467].velocity.X = num463; - Main.dust[num467].velocity.Y = num464; + Dust dust = Main.dust[num467]; + dust.noGravity = true; + dust.position.X = projectile.Center.X; + dust.position.Y = projectile.Center.Y; + dust.position.X += (float)Main.rand.Next(-10, 11); + dust.position.Y += (float)Main.rand.Next(-10, 11); + dust.velocity.X = num463; + dust.velocity.Y = num464; num462++; } } diff --git a/Projectiles/Rogue/CelestialReaperProjectile.cs b/Projectiles/Rogue/CelestialReaperProjectile.cs index 1866d0657d..39b9736c8f 100644 --- a/Projectiles/Rogue/CelestialReaperProjectile.cs +++ b/Projectiles/Rogue/CelestialReaperProjectile.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.NPCs.NormalNPCs; using Microsoft.Xna.Framework; using System; using Terraria; @@ -52,12 +53,22 @@ namespace CalamityMod.Projectiles.Rogue } } } - public override bool? CanHitNPC(NPC target) => HomingCooldown == 0 && !target.townNPC - && target.type != NPCID.DD2EterniaCrystal && !target.immortal && !target.dontTakeDamage; + + public override bool CanDamage() + { + return HomingCooldown == 0; + } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { HomingCooldown = 25; projectile.velocity *= -0.75f; //bounce off of enemy + + //prevent dummy exploits + if (target.type == NPCID.TargetDummy || target.type == ModContent.NPCType()) + { + projectile.Kill(); + } } public override void Kill(int timeLeft) { diff --git a/Projectiles/Rogue/CraniumSmasherExplosive.cs b/Projectiles/Rogue/CraniumSmasherExplosive.cs index dbf8e41133..6dfa64e1a3 100644 --- a/Projectiles/Rogue/CraniumSmasherExplosive.cs +++ b/Projectiles/Rogue/CraniumSmasherExplosive.cs @@ -58,23 +58,18 @@ namespace CalamityMod.Projectiles.Rogue scaleFactor10 = 1f; } int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13AB6_cp_0 = Main.gore[num626]; - expr_13AB6_cp_0.velocity.X += 1f; - Gore expr_13AD6_cp_0 = Main.gore[num626]; - expr_13AD6_cp_0.velocity.Y += 1f; + Gore gore = Main.gore[num626]; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13B79_cp_0 = Main.gore[num626]; - expr_13B79_cp_0.velocity.X -= 1f; - Gore expr_13B99_cp_0 = Main.gore[num626]; - expr_13B99_cp_0.velocity.Y += 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13C3C_cp_0 = Main.gore[num626]; - expr_13C3C_cp_0.velocity.X += 1f; - Gore expr_13C5C_cp_0 = Main.gore[num626]; - expr_13C5C_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y -= 1f; } for (int num194 = 0; num194 < 25; num194++) { diff --git a/Projectiles/Rogue/DragonShit.cs b/Projectiles/Rogue/DragonShit.cs index 383ea3a3db..6161435a3f 100644 --- a/Projectiles/Rogue/DragonShit.cs +++ b/Projectiles/Rogue/DragonShit.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Projectiles.Rogue projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = -1; projectile.Calamity().rogue = true; - cooldownSlot = 1; } public override void AI() @@ -117,29 +116,22 @@ namespace CalamityMod.Projectiles.Rogue scaleFactor10 = 1f; } int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13AB6_cp_0 = Main.gore[num626]; - expr_13AB6_cp_0.velocity.X += 1f; - Gore expr_13AD6_cp_0 = Main.gore[num626]; - expr_13AD6_cp_0.velocity.Y += 1f; + Gore gore = Main.gore[num626]; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13B79_cp_0 = Main.gore[num626]; - expr_13B79_cp_0.velocity.X -= 1f; - Gore expr_13B99_cp_0 = Main.gore[num626]; - expr_13B99_cp_0.velocity.Y += 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13C3C_cp_0 = Main.gore[num626]; - expr_13C3C_cp_0.velocity.X += 1f; - Gore expr_13C5C_cp_0 = Main.gore[num626]; - expr_13C5C_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y -= 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13CFF_cp_0 = Main.gore[num626]; - expr_13CFF_cp_0.velocity.X -= 1f; - Gore expr_13D1F_cp_0 = Main.gore[num626]; - expr_13D1F_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y -= 1f; } projectile.Damage(); } diff --git a/Projectiles/Rogue/DukesDecapitatorProj.cs b/Projectiles/Rogue/DukesDecapitatorProj.cs index 38e0c94f8b..d795b8305a 100644 --- a/Projectiles/Rogue/DukesDecapitatorProj.cs +++ b/Projectiles/Rogue/DukesDecapitatorProj.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.ID; using Terraria.ModLoader; using CalamityMod.CalPlayer; @@ -16,6 +17,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { DisplayName.SetDefault("Decapitator"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 6; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; } public override void SetDefaults() @@ -77,5 +80,11 @@ namespace CalamityMod.Projectiles.Rogue Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 49, projectile.velocity.X * 0.25f, projectile.velocity.Y * 0.25f, 0, new Color(255, 255, 255), 0.75f); } } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } } } diff --git a/Projectiles/Rogue/DuneHopperProjectile.cs b/Projectiles/Rogue/DuneHopperProjectile.cs index ca4e5498b4..d18a466d48 100644 --- a/Projectiles/Rogue/DuneHopperProjectile.cs +++ b/Projectiles/Rogue/DuneHopperProjectile.cs @@ -7,6 +7,7 @@ namespace CalamityMod.Projectiles.Rogue { public class DuneHopperProjectile : ModProjectile { + public override void SetStaticDefaults() { DisplayName.SetDefault("Scourge"); @@ -59,7 +60,7 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2); + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], projectile.Calamity().stealthStrike ? 4 : 2); return false; } } diff --git a/Projectiles/Rogue/FeatherKnifeProjectile.cs b/Projectiles/Rogue/FeatherKnifeProjectile.cs index a8ff94b936..30942b9c84 100644 --- a/Projectiles/Rogue/FeatherKnifeProjectile.cs +++ b/Projectiles/Rogue/FeatherKnifeProjectile.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -7,6 +8,8 @@ namespace CalamityMod.Projectiles.Rogue { public class FeatherKnifeProjectile : ModProjectile { + private int featherTimer = 35; + public override void SetStaticDefaults() { DisplayName.SetDefault("Knife"); @@ -17,35 +20,12 @@ namespace CalamityMod.Projectiles.Rogue projectile.width = 12; projectile.height = 12; projectile.friendly = true; - projectile.penetrate = 2; - projectile.aiStyle = 2; + projectile.aiStyle = 2; projectile.timeLeft = 600; aiType = 48; projectile.Calamity().rogue = true; } - 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 bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { Texture2D tex = Main.projectileTexture[projectile.type]; @@ -53,9 +33,27 @@ namespace CalamityMod.Projectiles.Rogue return false; } + public override void AI() + { + if (featherTimer == 0) + { + if (projectile.owner == Main.myPlayer) + { + Projectile.NewProjectile(projectile.position, new Vector2(projectile.velocity.X / 20, 2), ModContent.ProjectileType(), (int)((double)projectile.damage * 0.4), projectile.knockBack, projectile.owner); + } + featherTimer = 35; + } + featherTimer--; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + Projectile.NewProjectile(projectile.position, new Vector2(projectile.velocity.X / 20, 2), ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner); + } + public override void Kill(int timeLeft) { - if (Main.rand.NextBool(2)) + if (Main.rand.NextBool(2) && !projectile.Calamity().stealthStrike) { Item.NewItem((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height, ModContent.ItemType()); } diff --git a/Projectiles/Rogue/GodsParanoiaProj.cs b/Projectiles/Rogue/GodsParanoiaProj.cs index 93dd511324..a47f751f5b 100644 --- a/Projectiles/Rogue/GodsParanoiaProj.cs +++ b/Projectiles/Rogue/GodsParanoiaProj.cs @@ -85,10 +85,7 @@ namespace CalamityMod.Projectiles.Rogue } int num988 = 15; bool flag55 = false; - float[] var_2_2CB4E_cp_0 = projectile.localAI; - int var_2_2CB4E_cp_1 = 0; - float num73 = var_2_2CB4E_cp_0[var_2_2CB4E_cp_1]; - var_2_2CB4E_cp_0[var_2_2CB4E_cp_1] = num73 + 1f; + projectile.localAI[0] += 1f; if (projectile.localAI[0] % 30f == 0f) { flag55 = true; @@ -115,7 +112,7 @@ namespace CalamityMod.Projectiles.Rogue float pcy = projectile.Center.Y; float var1 = 800f; bool flag = false; - for (int npcvar = 0; npcvar < 200; npcvar++) + for (int npcvar = 0; npcvar < Main.npc.Length; npcvar++) { if (Main.npc[npcvar].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[npcvar].Center, 1, 1)) { @@ -160,7 +157,7 @@ namespace CalamityMod.Projectiles.Rogue Rectangle myRect = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height); if (projectile.owner == Main.myPlayer) { - for (int i = 0; i < 200; i++) + for (int i = 0; i < Main.npc.Length; i++) { if (Main.npc[i].active && !Main.npc[i].dontTakeDamage && ((projectile.friendly && (!Main.npc[i].friendly || projectile.type == 318 || (Main.npc[i].type == 22 && projectile.owner < 255 && Main.player[projectile.owner].killGuide) || (Main.npc[i].type == 54 && projectile.owner < 255 && Main.player[projectile.owner].killClothier))) || diff --git a/Projectiles/Rogue/HeavenfallenStardiskBoomerang.cs b/Projectiles/Rogue/HeavenfallenStardiskBoomerang.cs index ed1f862b92..261daf12f5 100644 --- a/Projectiles/Rogue/HeavenfallenStardiskBoomerang.cs +++ b/Projectiles/Rogue/HeavenfallenStardiskBoomerang.cs @@ -12,6 +12,7 @@ namespace CalamityMod.Projectiles.Rogue public class HeavenfallenStardiskBoomerang : ModProjectile { private bool explode = false; + private int stealth = 0; public override void SetStaticDefaults() { @@ -35,6 +36,33 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { + if (projectile.Calamity().stealthStrike) + { + stealth++; + if (stealth >= 5) //every 5 ticks + { + stealth = 0; + if (Main.rand.Next(2) == 0) + { + int spearAmt = Main.rand.Next(1, 4); //1 to 3 energy + for (int n = 0; n < spearAmt; n++) + { + float x = projectile.position.X + (float)Main.rand.Next(-400, 400); + float y = projectile.position.Y - (float)Main.rand.Next(500, 800); + Vector2 vector = new Vector2(x, y); + float num13 = projectile.position.X + (float)(projectile.width / 2) - vector.X; + float num14 = projectile.position.Y + (float)(projectile.height / 2) - vector.Y; + num13 += (float)Main.rand.Next(-100, 101); + int num15 = 29; + float num16 = (float)Math.Sqrt((double)(num13 * num13 + num14 * num14)); + num16 = (float)num15 / num16; + num13 *= num16; + num14 *= num16; + Projectile.NewProjectile(x, y, num13, num14, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.4), projectile.knockBack, projectile.owner, 0f, 0f); + } + } + } + } if (projectile.alpha > 0) { projectile.alpha -= 20; diff --git a/Projectiles/Rogue/LatcherMineProjectile.cs b/Projectiles/Rogue/LatcherMineProjectile.cs index 740954a951..360eb8cd87 100644 --- a/Projectiles/Rogue/LatcherMineProjectile.cs +++ b/Projectiles/Rogue/LatcherMineProjectile.cs @@ -208,7 +208,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.position.X = projectile.position.X - (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); projectile.Damage(); - for (int i = 0; i < (projectile.Calamity().stealthStrike ? 8 : 5); i++) + for (int i = 0; i < (projectile.Calamity().stealthStrike ? 7 : 4); i++) { if (Main.rand.NextBool(2) && projectile.Calamity().stealthStrike) { @@ -221,11 +221,11 @@ namespace CalamityMod.Projectiles.Rogue Vector2 fireVelocity = (Vector2.UnitY * (-16f + Main.rand.NextFloat(-3, 12f))).RotatedByRandom((double)MathHelper.ToRadians(40f)); int fireIndex = Projectile.NewProjectile(projectile.Top, fireVelocity, Main.rand.Next(ProjectileID.MolotovFire, ProjectileID.MolotovFire3 + 1), - projectile.damage / 2, 1f, projectile.owner); + projectile.damage / 3, 1f, projectile.owner); Main.projectile[fireIndex].Calamity().forceRogue = true; Main.projectile[fireIndex].penetrate = -1; Main.projectile[fireIndex].usesLocalNPCImmunity = true; - Main.projectile[fireIndex].localNPCHitCooldown = 10; + Main.projectile[fireIndex].localNPCHitCooldown = -2; } } } diff --git a/Projectiles/Rogue/LuminousStrikerProj.cs b/Projectiles/Rogue/LuminousStrikerProj.cs index 1662b770df..5f91aaf29f 100644 --- a/Projectiles/Rogue/LuminousStrikerProj.cs +++ b/Projectiles/Rogue/LuminousStrikerProj.cs @@ -17,6 +17,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { DisplayName.SetDefault("Luminous Striker"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 6; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; } public override void SetDefaults() @@ -45,7 +47,6 @@ namespace CalamityMod.Projectiles.Rogue Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 176, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 0.785f; - projectile.spriteDirection = ((projectile.velocity.X > 0f) ? -1 : 1); if (shardRainTimer == 0) { @@ -62,10 +63,9 @@ namespace CalamityMod.Projectiles.Rogue } } - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) { - Texture2D tex = Main.projectileTexture[projectile.type]; - spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); return false; } diff --git a/Projectiles/Rogue/LunarKunaiProj.cs b/Projectiles/Rogue/LunarKunaiProj.cs index 316342d342..c66d6406bd 100644 --- a/Projectiles/Rogue/LunarKunaiProj.cs +++ b/Projectiles/Rogue/LunarKunaiProj.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -16,6 +17,8 @@ namespace CalamityMod.Projectiles.Rogue { DisplayName.SetDefault("Kunai"); Main.projFrames[projectile.type] = 2; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 4; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; } public override void SetDefaults() @@ -90,6 +93,8 @@ namespace CalamityMod.Projectiles.Rogue projectile.position.X = projectile.position.X - (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); projectile.damage /= 4; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; for (int num194 = 0; num194 < 10; num194++) { int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 229, 0f, 0f, 0, default, 1.5f); @@ -112,5 +117,11 @@ namespace CalamityMod.Projectiles.Rogue } } } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } } } diff --git a/Projectiles/Rogue/MeteorFistProj.cs b/Projectiles/Rogue/MeteorFistProj.cs index 3215dda15d..cadbf31485 100644 --- a/Projectiles/Rogue/MeteorFistProj.cs +++ b/Projectiles/Rogue/MeteorFistProj.cs @@ -136,29 +136,22 @@ namespace CalamityMod.Projectiles.Rogue scaleFactor10 = 1f; } int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 0.5f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13AB6_cp_0 = Main.gore[num626]; - expr_13AB6_cp_0.velocity.X += 1f; - Gore expr_13AD6_cp_0 = Main.gore[num626]; - expr_13AD6_cp_0.velocity.Y += 1f; + Gore gore = Main.gore[num626]; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 0.5f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13B79_cp_0 = Main.gore[num626]; - expr_13B79_cp_0.velocity.X -= 1f; - Gore expr_13B99_cp_0 = Main.gore[num626]; - expr_13B99_cp_0.velocity.Y += 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 0.5f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13C3C_cp_0 = Main.gore[num626]; - expr_13C3C_cp_0.velocity.X += 1f; - Gore expr_13C5C_cp_0 = Main.gore[num626]; - expr_13C5C_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y -= 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 0.5f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13CFF_cp_0 = Main.gore[num626]; - expr_13CFF_cp_0.velocity.X -= 1f; - Gore expr_13D1F_cp_0 = Main.gore[num626]; - expr_13D1F_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y -= 1f; } } diff --git a/Projectiles/Rogue/PlaguenadeProj.cs b/Projectiles/Rogue/PlaguenadeProj.cs index aab46b0ee6..0211e6e3b5 100644 --- a/Projectiles/Rogue/PlaguenadeProj.cs +++ b/Projectiles/Rogue/PlaguenadeProj.cs @@ -71,16 +71,19 @@ namespace CalamityMod.Projectiles.Rogue { if (projectile.owner == Main.myPlayer) { - int num3; - for (int num639 = 0; num639 < 20; num639 = num3 + 1) + for (int num639 = 0; num639 < (projectile.Calamity().stealthStrike ? 28 : 20); num639++) { float speedX = (float)Main.rand.Next(-35, 36) * 0.02f; float speedY = (float)Main.rand.Next(-35, 36) * 0.02f; Projectile.NewProjectile(projectile.position.X, projectile.position.Y, speedX, speedY, ModContent.ProjectileType(), Main.player[projectile.owner].beeDamage(projectile.damage), Main.player[projectile.owner].beeKB(0f), Main.myPlayer, 0f, 0f); - num3 = num639; } } Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + if (projectile.Calamity().stealthStrike) + { + projectile.position = projectile.Center; + projectile.width = projectile.height = 75; + } projectile.position.X = projectile.position.X - (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); projectile.maxPenetrate = -1; @@ -118,29 +121,22 @@ namespace CalamityMod.Projectiles.Rogue scaleFactor10 = 1f; } int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13AB6_cp_0 = Main.gore[num626]; - expr_13AB6_cp_0.velocity.X += 1f; - Gore expr_13AD6_cp_0 = Main.gore[num626]; - expr_13AD6_cp_0.velocity.Y += 1f; + Gore gore = Main.gore[num626]; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13B79_cp_0 = Main.gore[num626]; - expr_13B79_cp_0.velocity.X -= 1f; - Gore expr_13B99_cp_0 = Main.gore[num626]; - expr_13B99_cp_0.velocity.Y += 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13C3C_cp_0 = Main.gore[num626]; - expr_13C3C_cp_0.velocity.X += 1f; - Gore expr_13C5C_cp_0 = Main.gore[num626]; - expr_13C5C_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y -= 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13CFF_cp_0 = Main.gore[num626]; - expr_13CFF_cp_0.velocity.X -= 1f; - Gore expr_13D1F_cp_0 = Main.gore[num626]; - expr_13D1F_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y -= 1f; } } diff --git a/Projectiles/Rogue/RegulusEnergy.cs b/Projectiles/Rogue/RegulusEnergy.cs new file mode 100644 index 0000000000..8d19eb0c78 --- /dev/null +++ b/Projectiles/Rogue/RegulusEnergy.cs @@ -0,0 +1,126 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Dusts; +using CalamityMod.Buffs.DamageOverTime; + +namespace CalamityMod.Projectiles.Rogue +{ + public class RegulusEnergy : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Regulus Energy"); + } + + public override void SetDefaults() + { + projectile.width = 8; + projectile.height = 8; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.tileCollide = false; + projectile.Calamity().rogue = true; + } + + public override void AI() + { + int num154 = 14; + int coolDust; + projectile.ai[0] += 1; + if (projectile.ai[0] % 2 == 0) + { + if (projectile.ai[0] % 4 == 0) + { + coolDust = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num154 * 2, projectile.height - num154 * 2, ModContent.DustType(), 0f, 0f, 100, default, 1.5f); + } + else + { + coolDust = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num154 * 2, projectile.height - num154 * 2, ModContent.DustType(), 0f, 0f, 100, default, 1.5f); + } + Main.dust[coolDust].noGravity = true; + Main.dust[coolDust].velocity *= 0.1f; + Main.dust[coolDust].velocity += projectile.velocity * 0.5f; + } + if (projectile.ai[0] < 90) + { + projectile.velocity.X *= 0.98f; + projectile.velocity.Y *= 0.98f; + } + else + { + projectile.extraUpdates = 1; + + float num472 = projectile.Center.X; + float num473 = projectile.Center.Y; + float num474 = 500f; + bool flag17 = false; + + for (int num475 = 0; num475 < 200; num475++) + { + if (Main.npc[num475].CanBeChasedBy(projectile, false)) + { + 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 = 12f; + 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; + } + else + projectile.Kill(); + } + + projectile.rotation += 0.25f; + } + + public override bool CanDamage() + { + return projectile.ai[0] >= 90; + } + + public override void Kill(int timeLeft) + { + projectile.position = projectile.Center; + projectile.width = projectile.height = 24; + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + int num226 = 36; + for (int num227 = 0; num227 < num226; num227++) + { + Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; + Vector2 vector7 = vector6 - projectile.Center; + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, ModContent.DustType(), vector7.X * 0.5f, vector7.Y * 0.5f, 100, default, 0.75f); + Main.dust[num228].noGravity = true; + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 60); + } + } +} diff --git a/Projectiles/Rogue/RegulusEnergy.png b/Projectiles/Rogue/RegulusEnergy.png new file mode 100644 index 0000000000..0056fc1e24 Binary files /dev/null and b/Projectiles/Rogue/RegulusEnergy.png differ diff --git a/Projectiles/Rogue/RegulusRiotProj.cs b/Projectiles/Rogue/RegulusRiotProj.cs new file mode 100644 index 0000000000..af588d197c --- /dev/null +++ b/Projectiles/Rogue/RegulusRiotProj.cs @@ -0,0 +1,190 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Dusts; +using CalamityMod.Buffs.DamageOverTime; + +namespace CalamityMod.Projectiles.Rogue +{ + public class RegulusRiotProj : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Regulus Riot"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 2; + } + + public override void SetDefaults() + { + projectile.width = 28; + projectile.height = 28; + projectile.friendly = true; + projectile.penetrate = 3; + projectile.extraUpdates = 1; + projectile.alpha = 255; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.Calamity().rogue = true; + projectile.usesIDStaticNPCImmunity = true; + projectile.idStaticNPCHitCooldown = 15; + } + + public override void AI() + { + if (projectile.alpha > 0) + { + projectile.alpha -= 20; + } + if (projectile.alpha < 0) + { + projectile.alpha = 0; + } + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, ModContent.DustType(), 0f, 0f, 100, default, 1f); + Main.dust[num469].noGravity = true; + Main.dust[num469].velocity *= 0f; + num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, ModContent.DustType(), 0f, 0f, 100, default, 1f); + Main.dust[num469].noGravity = true; + Main.dust[num469].velocity *= 0f; + projectile.ai[0] += 1f; + int num1013 = 0; + if (projectile.velocity.Length() <= 8f) //4 + { + num1013 = 1; + } + if (num1013 == 0) + { + projectile.rotation -= 0.104719758f; + + if (projectile.ai[0] >= 30f) + { + projectile.extraUpdates = 2; + projectile.velocity *= 0.98f; + projectile.rotation -= 0.0174532924f; + } + if (projectile.velocity.Length() < 8.2f) //4.1 + { + projectile.velocity.Normalize(); + projectile.velocity *= 4f; + projectile.ai[0] = 0f; + projectile.extraUpdates = 1; + } + } + else if (num1013 == 1) + { + int num3; + projectile.rotation -= 0.104719758f; + Vector2 vector145 = projectile.Center; + float num1015 = 300f; + bool flag59 = false; + int num1016 = 0; + if (projectile.ai[1] == 0f) + { + for (int num1017 = 0; num1017 < 200; num1017 = num3 + 1) + { + if (Main.npc[num1017].CanBeChasedBy(projectile, false)) + { + Vector2 center13 = Main.npc[num1017].Center; + if (projectile.Distance(center13) < num1015) + { + num1015 = projectile.Distance(center13); + vector145 = center13; + flag59 = true; + num1016 = num1017; + } + } + num3 = num1017; + } + if (flag59) + { + if (projectile.ai[1] != (float)(num1016 + 1)) + { + projectile.netUpdate = true; + } + projectile.ai[1] = (float)(num1016 + 1); + } + flag59 = false; + } + if (projectile.ai[1] != 0f) + { + int num1018 = (int)(projectile.ai[1] - 1f); + if (Main.npc[num1018].active && Main.npc[num1018].CanBeChasedBy(projectile, true) && projectile.Distance(Main.npc[num1018].Center) < 1000f) + { + flag59 = true; + vector145 = Main.npc[num1018].Center; + } + } + if (!projectile.friendly) + { + flag59 = false; + } + if (flag59) + { + float num1019 = 24f; + int num1020 = 10; + Vector2 vector146 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num1021 = vector145.X - vector146.X; + float num1022 = vector145.Y - vector146.Y; + float num1023 = (float)Math.Sqrt((double)(num1021 * num1021 + num1022 * num1022)); + num1023 = num1019 / num1023; + num1021 *= num1023; + num1022 *= num1023; + projectile.velocity.X = (projectile.velocity.X * (float)(num1020 - 1) + num1021) / (float)num1020; + projectile.velocity.Y = (projectile.velocity.Y * (float)(num1020 - 1) + num1022) / (float)num1020; + } + } + if (projectile.ai[0] >= 180f) + { + projectile.Kill(); + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 180); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2); + return false; + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(SoundID.Item10, projectile.position); + for (int i = 0; i < 10; i++) + { + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, ModContent.DustType(), 0f, 0f, 100, default, 1.5f); + Main.dust[num469].noGravity = true; + Main.dust[num469].velocity *= 0f; + } + for (int i = 0; i < 10; i++) + { + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, ModContent.DustType(), 0f, 0f, 100, default, 1.5f); + Main.dust[num469].noGravity = true; + Main.dust[num469].velocity *= 0f; + } + if (projectile.Calamity().stealthStrike) + { + if (projectile.owner == Main.myPlayer) + { + float spread = 60f * 0.0174f; + double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y) - spread / 2; + double deltaAngle = spread / 6f; + double offsetAngle; + int i; + for (i = 0; i < 3; i++) + { + offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 2f), (float)(Math.Cos(offsetAngle) * 2f), ModContent.ProjectileType(), (int)((double)projectile.damage * 0.4), projectile.knockBack, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 2f), (float)(-Math.Cos(offsetAngle) * 2f), ModContent.ProjectileType(), (int)((double)projectile.damage * 0.4), projectile.knockBack, projectile.owner, 0f, 0f); + } + } + } + } + } +} diff --git a/Projectiles/Rogue/RegulusRiotProj.png b/Projectiles/Rogue/RegulusRiotProj.png new file mode 100644 index 0000000000..923bd363b8 Binary files /dev/null and b/Projectiles/Rogue/RegulusRiotProj.png differ diff --git a/Projectiles/Rogue/SandslasherProj.cs b/Projectiles/Rogue/SandslasherProj.cs index 3299a67441..2eacb292f5 100644 --- a/Projectiles/Rogue/SandslasherProj.cs +++ b/Projectiles/Rogue/SandslasherProj.cs @@ -13,6 +13,8 @@ namespace CalamityMod.Projectiles.Rogue public override void SetStaticDefaults() { DisplayName.SetDefault("Sandslasher"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 6; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; } public override void SetDefaults() @@ -61,5 +63,11 @@ namespace CalamityMod.Projectiles.Rogue Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 85, projectile.velocity.X * 0.25f, projectile.velocity.Y * 0.25f, 0, default, 1f); } } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } } } diff --git a/Projectiles/Rogue/ScarletBlast.cs b/Projectiles/Rogue/ScarletBlast.cs index f2784c04a9..66a66e47e6 100644 --- a/Projectiles/Rogue/ScarletBlast.cs +++ b/Projectiles/Rogue/ScarletBlast.cs @@ -78,15 +78,14 @@ namespace CalamityMod.Projectiles.Rogue num463 *= num466; num464 *= num466; int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 130, 0f, 0f, 100, default, 1.25f); - Main.dust[num467].noGravity = true; - Main.dust[num467].position.X = projectile.Center.X; - Main.dust[num467].position.Y = projectile.Center.Y; - Dust expr_149DF_cp_0 = Main.dust[num467]; - expr_149DF_cp_0.position.X += (float)Main.rand.Next(-10, 11); - Dust expr_14A09_cp_0 = Main.dust[num467]; - expr_14A09_cp_0.position.Y += (float)Main.rand.Next(-10, 11); - Main.dust[num467].velocity.X = num463; - Main.dust[num467].velocity.Y = num464; + Dust dust = Main.dust[num467]; + dust.noGravity = true; + dust.position.X = projectile.Center.X; + dust.position.Y = projectile.Center.Y; + dust.position.X += (float)Main.rand.Next(-10, 11); + dust.position.Y += (float)Main.rand.Next(-10, 11); + dust.velocity.X = num463; + dust.velocity.Y = num464; num462++; } } diff --git a/Projectiles/Rogue/ScourgeoftheDesertProj.cs b/Projectiles/Rogue/ScourgeoftheDesertProj.cs index 125246990d..c86a7c6749 100644 --- a/Projectiles/Rogue/ScourgeoftheDesertProj.cs +++ b/Projectiles/Rogue/ScourgeoftheDesertProj.cs @@ -1,12 +1,17 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; +using Terraria; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Rogue { public class ScourgeoftheDesertProj : ModProjectile { + private int StealthDamageCap = 0; + private int BaseDamage = 0; + public override void SetStaticDefaults() { DisplayName.SetDefault("Scourge"); @@ -25,8 +30,28 @@ namespace CalamityMod.Projectiles.Rogue projectile.Calamity().rogue = true; } + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (projectile.Calamity().stealthStrike) + { + if (StealthDamageCap == 0) + { + BaseDamage = damage; + } + + projectile.damage = (int)((BaseDamage * ((StealthDamageCap > 10 ? 10 : StealthDamageCap) * 20) / 100) + BaseDamage); //20% damage boost per hit, max of 200% + StealthDamageCap++; + } + } + public override void AI() { + if (projectile.Calamity().stealthStrike) + { + projectile.penetrate = 20 - StealthDamageCap; + projectile.velocity.Y *= 1.025f; + Dust.NewDust(projectile.position, projectile.width, projectile.height, 32); + } projectile.velocity.X *= 1.025f; projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 2.355f; if (projectile.spriteDirection == -1) diff --git a/Projectiles/Rogue/SeafoamBombProj.cs b/Projectiles/Rogue/SeafoamBombProj.cs index 57c3543028..f62ae6ce8d 100644 --- a/Projectiles/Rogue/SeafoamBombProj.cs +++ b/Projectiles/Rogue/SeafoamBombProj.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Rogue public override void Kill(int timeLeft) { projectile.position = projectile.Center; - projectile.width = projectile.height = 128; + projectile.width = projectile.height = projectile.Calamity().stealthStrike ? 256 : 128; projectile.position.X = projectile.position.X - (float)(projectile.width / 2); projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); projectile.maxPenetrate = -1; @@ -39,8 +39,15 @@ namespace CalamityMod.Projectiles.Rogue projectile.localNPCHitCooldown = 10; projectile.Damage(); Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.4), 0f, projectile.owner, 0f, 0f); - for (int num625 = 0; num625 < 3; num625++) + + for (int i = 0; i < (projectile.Calamity().stealthStrike ? 5 : 1); i++) + { + float posX = projectile.Center.X + (projectile.Calamity().stealthStrike ? Main.rand.Next(-50, 51) : 0); + float posY = projectile.Center.Y + (projectile.Calamity().stealthStrike ? Main.rand.Next(-50, 51) : 0); + Projectile.NewProjectile(posX, posY, 0f, 0f, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.4), 0f, projectile.owner, 0f, 0f); + } + + for (int num625 = 0; num625 < (projectile.Calamity().stealthStrike ? 6 : 3); num625++) { float scaleFactor10 = 0.33f; if (num625 == 1) @@ -52,23 +59,18 @@ namespace CalamityMod.Projectiles.Rogue scaleFactor10 = 1f; } int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13AB6_cp_0 = Main.gore[num626]; - expr_13AB6_cp_0.velocity.X += 1f; - Gore expr_13AD6_cp_0 = Main.gore[num626]; - expr_13AD6_cp_0.velocity.Y += 1f; + Gore gore = Main.gore[num626]; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13B79_cp_0 = Main.gore[num626]; - expr_13B79_cp_0.velocity.X -= 1f; - Gore expr_13B99_cp_0 = Main.gore[num626]; - expr_13B99_cp_0.velocity.Y += 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13C3C_cp_0 = Main.gore[num626]; - expr_13C3C_cp_0.velocity.X += 1f; - Gore expr_13C5C_cp_0 = Main.gore[num626]; - expr_13C5C_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y -= 1f; } } } diff --git a/Projectiles/Rogue/ShatteredSun2.cs b/Projectiles/Rogue/ShatteredSun2.cs deleted file mode 100644 index b7f51939e0..0000000000 --- a/Projectiles/Rogue/ShatteredSun2.cs +++ /dev/null @@ -1,86 +0,0 @@ -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Rogue -{ - public class ShatteredSun2 : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Shattered Sun"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 4; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - } - - public override void SetDefaults() - { - projectile.width = 56; - projectile.height = 56; - projectile.friendly = true; - projectile.penetrate = 3; - projectile.timeLeft = 300; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 15; - projectile.Calamity().rogue = true; - } - - public override void AI() - { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 2.355f; - if (projectile.spriteDirection == -1) - { - projectile.rotation -= 1.57f; - } - projectile.ai[1] += 1f; - if (projectile.ai[1] == 8f) - { - int numProj = 2; - float rotation = MathHelper.ToRadians(10); - if (projectile.owner == Main.myPlayer) - { - for (int i = 0; i < numProj; i++) - { - Vector2 perturbedSpeed = new Vector2(projectile.velocity.X, projectile.velocity.Y).RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1))); - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.5f), projectile.knockBack, projectile.owner, 0f, 0f); - } - projectile.active = false; - } - } - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - if (projectile.timeLeft > 299) - return false; - - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); - return false; - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); - } - - public override bool OnTileCollide(Vector2 oldVelocity) - { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); - return true; - } - - public override void Kill(int timeLeft) - { - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); - for (int k = 0; k < 5; k++) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 246, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f, 0, default, 1f); - } - } - } -} diff --git a/Projectiles/Rogue/ShatteredSun2.png b/Projectiles/Rogue/ShatteredSun2.png deleted file mode 100644 index 95bfbda427..0000000000 Binary files a/Projectiles/Rogue/ShatteredSun2.png and /dev/null differ diff --git a/Projectiles/Rogue/ShatteredSun3.cs b/Projectiles/Rogue/ShatteredSun3.cs deleted file mode 100644 index 42bf1b87a6..0000000000 --- a/Projectiles/Rogue/ShatteredSun3.cs +++ /dev/null @@ -1,101 +0,0 @@ -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Rogue -{ - public class ShatteredSun3 : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Shattered Sun"); - ProjectileID.Sets.TrailCacheLength[projectile.type] = 4; - ProjectileID.Sets.TrailingMode[projectile.type] = 0; - } - - public override void SetDefaults() - { - projectile.width = 56; - projectile.height = 56; - projectile.friendly = true; - projectile.penetrate = 1; - projectile.timeLeft = 300; - projectile.Calamity().rogue = true; - } - - public override void AI() - { - projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 2.355f; - if (projectile.spriteDirection == -1) - { - projectile.rotation -= 1.57f; - } - float centerX = projectile.Center.X; - float centerY = projectile.Center.Y; - float num474 = 750f; - bool homeIn = false; - for (int i = 0; i < 200; i++) - { - if (Main.npc[i].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[i].Center, 1, 1)) - { - float num476 = Main.npc[i].position.X + (float)(Main.npc[i].width / 2); - float num477 = Main.npc[i].position.Y + (float)(Main.npc[i].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; - centerX = num476; - centerY = num477; - homeIn = true; - } - } - } - if (homeIn) - { - float num483 = 20f; - Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); - float num484 = centerX - vector35.X; - float num485 = centerY - 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 * 15f + num484) / 16f; - projectile.velocity.Y = (projectile.velocity.Y * 15f + num485) / 16f; - } - } - - public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) - { - if (projectile.timeLeft > 299) - return false; - - CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); - return false; - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); - } - - public override bool OnTileCollide(Vector2 oldVelocity) - { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); - Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); - return true; - } - - public override void Kill(int timeLeft) - { - for (int k = 0; k < 5; k++) - { - Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 246, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f, 0, default, 1f); - } - } - } -} diff --git a/Projectiles/Rogue/ShatteredSun3.png b/Projectiles/Rogue/ShatteredSun3.png deleted file mode 100644 index 95bfbda427..0000000000 Binary files a/Projectiles/Rogue/ShatteredSun3.png and /dev/null differ diff --git a/Projectiles/Rogue/ShatteredSunFireball.cs b/Projectiles/Rogue/ShatteredSunFireball.cs new file mode 100644 index 0000000000..09773911cd --- /dev/null +++ b/Projectiles/Rogue/ShatteredSunFireball.cs @@ -0,0 +1,218 @@ +using CalamityMod.Buffs.DamageOverTime; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class ShatteredSunFireball : ModProjectile + { + int counter = 0; + float multiplier = 1f; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Flare"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 2; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + Main.projFrames[projectile.type] = 3; + } + + public override void SetDefaults() + { + projectile.width = 42; + projectile.height = 42; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.extraUpdates = 1; + projectile.penetrate = 1; + projectile.Calamity().rogue = true; + projectile.tileCollide = false; + projectile.timeLeft = 500; + } + + public override void AI() + { + counter++; + if (counter == 20 && !projectile.Calamity().stealthStrike) + { + projectile.tileCollide = true; + } + if (counter % 5 == 0) + { + multiplier -= 0.05f; + } + projectile.frameCounter++; + if (projectile.frameCounter > 8) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 2) + { + projectile.frame = 0; + } + + projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f; + + Lighting.AddLight(projectile.Center, 0.7f, 0.3f, 0f); + 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 = 20f; + 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; + } + float num633 = 700f; + Vector2 vector46 = projectile.position; + bool flag25 = false; + for (int num645 = 0; num645 < 200; num645++) + { + NPC nPC2 = Main.npc[num645]; + if (nPC2.CanBeChasedBy(projectile, false)) + { + float num646 = Vector2.Distance(nPC2.Center, projectile.Center); + if (!flag25) + { + num633 = num646; + vector46 = nPC2.Center; + flag25 = true; + } + } + } + if (flag25 && projectile.ai[0] == 0f) + { + Vector2 vector47 = vector46 - projectile.Center; + float num648 = vector47.Length(); + vector47.Normalize(); + if (num648 > 200f) + { + float scaleFactor2 = 8f; + vector47 *= scaleFactor2; + projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; + } + else + { + float num649 = 4f; + vector47 *= -num649; + projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; + } + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + damage = (int)((double)damage * multiplier); + if (projectile.Calamity().stealthStrike) + { + int numProj = 3; + float rotation = MathHelper.ToRadians(10); + if (projectile.owner == Main.myPlayer) + { + int spread = 6; + for (int i = 0; i < numProj; i++) + { + Vector2 perturbedspeed = new Vector2(projectile.velocity.X, projectile.velocity.Y + Main.rand.Next(-3, 4)).RotatedBy(MathHelper.ToRadians(spread)); + Vector2 position = Main.player[projectile.owner].position; + Projectile.NewProjectile(position.X, position.Y - 10, perturbedspeed.X, perturbedspeed.Y, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.3), 1f, projectile.owner, 0f, 0f); + spread -= Main.rand.Next(2, 6); + } + projectile.active = false; + } + } + target.AddBuff(ModContent.BuffType(), 180); + } + + public override void Kill(int timeLeft) + { + + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14); + projectile.position.X = projectile.position.X + (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y + (float)(projectile.height / 2); + projectile.width = projectile.height = 200; + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + for (int num621 = 0; num621 < 4; num621++) + { + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + Main.dust[num622].velocity *= 3f; + if (Main.rand.NextBool(2)) + { + Main.dust[num622].scale = 0.5f; + Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + } + } + for (int num623 = 0; num623 < 12; num623++) + { + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f); + Main.dust[num624].noGravity = true; + Main.dust[num624].velocity *= 5f; + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f); + Main.dust[num624].velocity *= 2f; + } + for (int num625 = 0; num625 < 3; num625++) + { + float scaleFactor10 = 0.33f; + if (num625 == 1) + { + scaleFactor10 = 0.66f; + } + if (num625 == 2) + { + scaleFactor10 = 1f; + } + int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); + Gore gore = Main.gore[num626]; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y += 1f; + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y += 1f; + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y -= 1f; + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y -= 1f; + } + } + } +} diff --git a/Projectiles/Rogue/ShatteredSunFireball.png b/Projectiles/Rogue/ShatteredSunFireball.png new file mode 100644 index 0000000000..ca9b1d8ac6 Binary files /dev/null and b/Projectiles/Rogue/ShatteredSunFireball.png differ diff --git a/Projectiles/Rogue/ShatteredSunKnife.cs b/Projectiles/Rogue/ShatteredSunKnife.cs index e6b6337304..8082b784e9 100644 --- a/Projectiles/Rogue/ShatteredSunKnife.cs +++ b/Projectiles/Rogue/ShatteredSunKnife.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.width = 56; projectile.height = 56; projectile.friendly = true; - projectile.penetrate = 3; + projectile.penetrate = 4; projectile.timeLeft = 300; projectile.alpha = 255; projectile.tileCollide = false; @@ -48,18 +48,40 @@ namespace CalamityMod.Projectiles.Rogue projectile.tileCollide = false; } - if (projectile.ai[1] == 12f) + if (projectile.ai[1] == 25f) { - int numProj = 2; + int numProj = 5; float rotation = MathHelper.ToRadians(10); if (projectile.owner == Main.myPlayer) { + int spread = 6; for (int i = 0; i < numProj; i++) { - Vector2 perturbedSpeed = new Vector2(projectile.velocity.X, projectile.velocity.Y).RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1))); - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, perturbedSpeed.X, perturbedSpeed.Y, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + Vector2 perturbedspeed = new Vector2(projectile.velocity.X, projectile.velocity.Y + Main.rand.Next(-3, 4)).RotatedBy(MathHelper.ToRadians(spread)); + int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, perturbedspeed.X * 0.8f, perturbedspeed.Y * 0.8f, ModContent.ProjectileType(), (int)((double)projectile.damage * 1.5), 1f, projectile.owner, 0f, 0f); + Main.projectile[proj].Calamity().stealthStrike = projectile.Calamity().stealthStrike; + spread -= Main.rand.Next(2, 6); } + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27); projectile.active = false; + for (int num621 = 0; num621 < 8; num621++) + { + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, 2f); + Main.dust[num622].velocity *= 3f; + if (Main.rand.NextBool(2)) + { + //Main.dust[num622].scale = 0.5f; + Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + } + } + for (int num623 = 0; num623 < 16; num623++) + { + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, 3f); + Main.dust[num624].noGravity = true; + Main.dust[num624].velocity *= 5f; + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, 2f); + Main.dust[num624].velocity *= 2f; + } } } } diff --git a/Projectiles/Rogue/Stormfrontspark.cs b/Projectiles/Rogue/Stormfrontspark.cs index 67da4a6f6f..c169a3b711 100644 --- a/Projectiles/Rogue/Stormfrontspark.cs +++ b/Projectiles/Rogue/Stormfrontspark.cs @@ -24,24 +24,21 @@ namespace CalamityMod.Projectiles.Rogue { projectile.rotation += projectile.velocity.X * 0.1f; int num199 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 246, 0f, 0f, 100, new Color(255, Main.DiscoG, 53), 1f); - Dust expr_8976_cp_0 = Main.dust[num199]; - expr_8976_cp_0.position.X -= 2f; - Dust expr_8994_cp_0 = Main.dust[num199]; - expr_8994_cp_0.position.Y += 2f; - Main.dust[num199].scale += (float)Main.rand.Next(50) * 0.01f; - Main.dust[num199].noGravity = true; - Dust expr_89E7_cp_0 = Main.dust[num199]; - expr_89E7_cp_0.velocity.Y -= 2f; + Dust dust = Main.dust[num199]; + dust.position.X -= 2f; + dust.position.Y += 2f; + dust.scale += (float)Main.rand.Next(50) * 0.01f; + dust.noGravity = true; + dust.velocity.Y -= 2f; if (Main.rand.NextBool(2)) { int num200 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 246, 0f, 0f, 100, new Color(255, Main.DiscoG, 53), 1f); - Dust expr_8A4E_cp_0 = Main.dust[num200]; - expr_8A4E_cp_0.position.X -= 2f; - Dust expr_8A6C_cp_0 = Main.dust[num200]; - expr_8A6C_cp_0.position.Y += 2f; - Main.dust[num200].scale += 0.3f + (float)Main.rand.Next(50) * 0.01f; - Main.dust[num200].noGravity = true; - Main.dust[num200].velocity *= 0.1f; + Dust dust2 = Main.dust[num200]; + dust2.position.X -= 2f; + dust2.position.Y += 2f; + dust2.scale += 0.3f + (float)Main.rand.Next(50) * 0.01f; + dust2.noGravity = true; + dust2.velocity *= 0.1f; } if ((double)projectile.velocity.Y < 0.25 && (double)projectile.velocity.Y > 0.15) { diff --git a/Projectiles/Rogue/SupernovaBomb.cs b/Projectiles/Rogue/SupernovaBomb.cs new file mode 100644 index 0000000000..2a765c4096 --- /dev/null +++ b/Projectiles/Rogue/SupernovaBomb.cs @@ -0,0 +1,196 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Rogue +{ + public class SupernovaBomb : ModProjectile + { + private int stealthTimer = 8; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Supernova Bomb"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 5; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void SetDefaults() + { + projectile.width = 34; + projectile.height = 34; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.timeLeft = 200; + projectile.tileCollide = true; + projectile.Calamity().rogue = true; + } + + public override void AI() + { + //dust and lighting + int num298 = Main.rand.NextBool(2) ? 107 : 234; + if (Main.rand.NextBool(4)) + { + num298 = 269; + } + if (Main.rand.NextBool(6)) + { + Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, num298, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f); + } + Lighting.AddLight(projectile.Center, Main.DiscoR * 0.5f / 255f, Main.DiscoG * 0.5f / 255f, Main.DiscoB * 0.5f / 255f); + + //velocity + projectile.ai[0] += 1f; + if (projectile.ai[0] > 10f) + { + projectile.ai[0] = 10f; + if (projectile.velocity.Y == 0f && projectile.velocity.X != 0f) + { + projectile.velocity.X = projectile.velocity.X * 0.97f; + if ((double)projectile.velocity.X > -0.01 && (double)projectile.velocity.X < 0.01) + { + projectile.velocity.X = 0f; + projectile.netUpdate = true; + } + } + projectile.velocity.Y = projectile.velocity.Y + 0.2f; + } + + //rotation + projectile.rotation += projectile.velocity.X * 0.1f; + + //stealth strike + if (projectile.Calamity().stealthStrike == true) + { + stealthTimer--; + if (stealthTimer == 0) + { + if (projectile.owner == Main.myPlayer) + { + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, projectile.velocity.X * 0f, 2f, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.8), projectile.knockBack, projectile.owner, 0f, 0f); + } + stealthTimer = 8; + } + } + } + + public override void Kill(int timeLeft) + { + projectile.position = projectile.Center; + projectile.width = projectile.height = 128; + 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.Center.X, (int)projectile.Center.Y, 14); + + //spawn projectiles + int num251 = Main.rand.Next(3, 5); + if (projectile.owner == Main.myPlayer) + { + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + 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; + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), (int)((double)projectile.damage * 0.5), 0f, projectile.owner, 0f, 0f); + } + float spread = 60f * 0.0174f; + double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y) - spread / 2; + double deltaAngle = spread / 6f; + double offsetAngle; + int i; + for (i = 0; i < 3; i++) + { + offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 2f), (float)(Math.Cos(offsetAngle) * 2f), ModContent.ProjectileType(), (int)((double)projectile.damage * 0.4), projectile.knockBack, projectile.owner, 0f, 0f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 2f), (float)(-Math.Cos(offsetAngle) * 2f), ModContent.ProjectileType(), (int)((double)projectile.damage * 0.4), projectile.knockBack, projectile.owner, 0f, 0f); + } + } + + //dust effects + int num298 = Main.rand.NextBool(2) ? 107 : 234; + if (Main.rand.NextBool(4)) + { + num298 = 269; + } + for (int num621 = 0; num621 < 5; num621++) + { + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num298, 0f, 0f, 100, default, 2f); + Main.dust[num622].velocity *= 3f; + if (Main.rand.NextBool(2)) + { + Main.dust[num622].scale = 0.5f; + Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + } + } + for (int num623 = 0; num623 < 9; num623++) + { + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 3f); + Main.dust[num624].noGravity = true; + Main.dust[num624].velocity *= 5f; + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default, 2f); + Main.dust[num624].velocity *= 2f; + } + + //gore cloud effects + for (int num625 = 0; num625 < 3; num625++) + { + float scaleFactor10 = 0.33f; + if (num625 == 1) + { + scaleFactor10 = 0.66f; + } + if (num625 == 2) + { + scaleFactor10 = 1f; + } + int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); + Gore gore = Main.gore[num626]; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y += 1f; + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y += 1f; + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y -= 1f; + num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y -= 1f; + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.CursedInferno, 120); + target.AddBuff(BuffID.Frostburn, 120); + target.AddBuff(BuffID.OnFire, 120); + target.AddBuff(BuffID.Ichor, 120); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + } +} diff --git a/Projectiles/Rogue/SupernovaBomb.png b/Projectiles/Rogue/SupernovaBomb.png new file mode 100644 index 0000000000..d4aa9c8ad8 Binary files /dev/null and b/Projectiles/Rogue/SupernovaBomb.png differ diff --git a/Projectiles/Rogue/SupernovaBoom.cs b/Projectiles/Rogue/SupernovaBoom.cs new file mode 100644 index 0000000000..d6caa1311b --- /dev/null +++ b/Projectiles/Rogue/SupernovaBoom.cs @@ -0,0 +1,112 @@ +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; +namespace CalamityMod.Projectiles.Rogue +{ + public class SupernovaBoom : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Explosion"); + } + + public override void SetDefaults() + { + projectile.width = 400; + projectile.height = 400; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.Calamity().rogue = true; + projectile.penetrate = -1; + projectile.timeLeft = 5; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 1; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, Main.DiscoR * 0.5f / 255f, Main.DiscoG * 0.5f / 255f, Main.DiscoB * 0.5f / 255f); + bool flag15 = false; + bool flag16 = false; + if (projectile.velocity.X < 0f && projectile.position.X < projectile.ai[0]) + { + flag15 = true; + } + if (projectile.velocity.X > 0f && projectile.position.X > projectile.ai[0]) + { + flag15 = true; + } + if (projectile.velocity.Y < 0f && projectile.position.Y < projectile.ai[1]) + { + flag16 = true; + } + if (projectile.velocity.Y > 0f && projectile.position.Y > projectile.ai[1]) + { + flag16 = true; + } + if (flag15 && flag16) + { + projectile.Kill(); + } + float num461 = 25f; + if (projectile.ai[0] > 180f) + { + num461 -= (projectile.ai[0] - 180f) / 2f; + } + if (num461 <= 0f) + { + num461 = 0f; + projectile.Kill(); + } + num461 *= 0.7f; + projectile.ai[0] += 4f; + int num462 = 0; + while ((float)num462 < num461) + { + float num463 = (float)Main.rand.Next(-40, 41); + float num464 = (float)Main.rand.Next(-40, 41); + float num465 = (float)Main.rand.Next(12, 36); + float num466 = (float)Math.Sqrt((double)(num463 * num463 + num464 * num464)); + num466 = num465 / num466; + num463 *= num466; + num464 *= num466; + int dustType = Utils.SelectRandom(Main.rand, new int[] + { + 107, + 234, + 269 + }); + int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, + dustType, 0f, 0f, 100, default, 2f); + Dust dust = Main.dust[num467]; + dust.noGravity = true; + dust.position.X = projectile.Center.X; + dust.position.Y = projectile.Center.Y; + dust.position.X += (float)Main.rand.Next(-10, 11); + dust.position.Y += (float)Main.rand.Next(-10, 11); + dust.velocity.X = num463; + dust.velocity.Y = num464; + num462++; + } + return; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.CursedInferno, 120); + target.AddBuff(BuffID.Frostburn, 120); + target.AddBuff(BuffID.OnFire, 120); + target.AddBuff(BuffID.Ichor, 120); + } + } +} diff --git a/Projectiles/Rogue/SupernovaBoom.png b/Projectiles/Rogue/SupernovaBoom.png new file mode 100644 index 0000000000..d0ac21fbc0 Binary files /dev/null and b/Projectiles/Rogue/SupernovaBoom.png differ diff --git a/Projectiles/Rogue/SupernovaHoming.cs b/Projectiles/Rogue/SupernovaHoming.cs new file mode 100644 index 0000000000..e618733d48 --- /dev/null +++ b/Projectiles/Rogue/SupernovaHoming.cs @@ -0,0 +1,131 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.DamageOverTime; + +namespace CalamityMod.Projectiles.Rogue +{ + public class SupernovaHoming : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Supernova Energy"); + } + + public override void SetDefaults() + { + projectile.width = 8; + projectile.height = 8; + projectile.friendly = true; + projectile.penetrate = 1; + projectile.tileCollide = false; + projectile.Calamity().rogue = true; + } + + public override void AI() + { + int num154 = 14; + int num298 = Main.rand.NextBool(2) ? 107 : 234; + if (Main.rand.NextBool(4)) + { + num298 = 269; + } + projectile.ai[0] += 1; + if (projectile.ai[0] % 2 == 0) + { + int coolDust = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num154 * 2, projectile.height - num154 * 2, num298, 0f, 0f, 100, default, 1.5f); + Main.dust[coolDust].noGravity = true; + Main.dust[coolDust].velocity *= 0.1f; + Main.dust[coolDust].velocity += projectile.velocity * 0.5f; + } + if (projectile.ai[0] < 90) + { + projectile.velocity.X *= 0.98f; + projectile.velocity.Y *= 0.98f; + } + else + { + projectile.extraUpdates = 1; + + float num472 = projectile.Center.X; + float num473 = projectile.Center.Y; + float num474 = 500f; + bool flag17 = false; + + for (int num475 = 0; num475 < Main.npc.Length; num475++) + { + if (Main.npc[num475].CanBeChasedBy(projectile, false)) + { + 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 = 12f; + 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; + } + else + projectile.Kill(); + } + + projectile.rotation += 0.25f; + } + + public override bool CanDamage() + { + return projectile.ai[0] >= 90; + } + + public override void Kill(int timeLeft) + { + projectile.position = projectile.Center; + projectile.width = projectile.height = 24; + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + int num226 = 36; + for (int num227 = 0; num227 < num226; num227++) + { + Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; + Vector2 vector7 = vector6 - projectile.Center; + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 234, vector7.X * 0.5f, vector7.Y * 0.5f, 100, default, 0.75f); + Main.dust[num228].noGravity = true; + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.CursedInferno, 120); + target.AddBuff(BuffID.Frostburn, 120); + target.AddBuff(BuffID.OnFire, 120); + target.AddBuff(BuffID.Ichor, 120); + } + } +} diff --git a/Projectiles/Rogue/SupernovaHoming.png b/Projectiles/Rogue/SupernovaHoming.png new file mode 100644 index 0000000000..0056fc1e24 Binary files /dev/null and b/Projectiles/Rogue/SupernovaHoming.png differ diff --git a/Projectiles/Rogue/SupernovaSpike.cs b/Projectiles/Rogue/SupernovaSpike.cs new file mode 100644 index 0000000000..89f0d54553 --- /dev/null +++ b/Projectiles/Rogue/SupernovaSpike.cs @@ -0,0 +1,134 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.DamageOverTime; + +namespace CalamityMod.Projectiles.Rogue +{ + public class SupernovaSpike : ModProjectile + { + private Color currentColor = Color.Black; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Spike"); + } + + public override void SetDefaults() + { + projectile.width = 10; + projectile.height = 10; + projectile.alpha = 255; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.penetrate = 3; + projectile.alpha = 255; + projectile.extraUpdates = 2; + projectile.aiStyle = 93; + aiType = 514; + projectile.Calamity().rogue = true; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 5; + } + + public override void AI() + { + projectile.alpha -= 10; + if (projectile.alpha < 0) + { + projectile.alpha = 0; + } + int num298 = Main.rand.NextBool(2) ? 107 : 234; + if (Main.rand.NextBool(4)) + { + num298 = 269; + } + projectile.localAI[1] += 1f; + if (projectile.localAI[1] > 4f) + { + int num469 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num298, 0f, 0f, 100, default, 0.75f); + Main.dust[num469].noGravity = true; + Main.dust[num469].velocity *= 0f; + } + if (currentColor == Color.Black) + { + int startPoint = Main.rand.Next(6); + projectile.localAI[0] = startPoint; + currentColor = GetStartingColor(startPoint); + } + Visuals(projectile, ref currentColor); + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.CursedInferno, 120); + target.AddBuff(BuffID.Frostburn, 120); + target.AddBuff(BuffID.OnFire, 120); + target.AddBuff(BuffID.Ichor, 120); + } + + internal static void Visuals(Projectile projectile, ref Color c) + { + CalamityUtils.IterateDisco(ref c, ref projectile.localAI[0], 15); + Vector3 compositeColor = 0.1f * Color.White.ToVector3() + 0.05f * c.ToVector3(); + Lighting.AddLight(projectile.Center, compositeColor); + } + + internal static Color GetStartingColor(int startPoint = 0) + { + switch (startPoint) + { + default: return new Color(1f, 0f, 0f, 0f); // Color.Red + case 1: return new Color(1f, 1f, 0f, 0f); // Color.Yellow + case 2: return new Color(0f, 1f, 0f, 0f); // Color.Green + case 3: return new Color(0f, 1f, 1f, 0f); // Color.Turquoise + case 4: return new Color(0f, 0f, 1f, 0f); // Color.Blue + case 5: return new Color(1f, 0f, 1f, 0f); // Color.Violet + } + } + + // This projectile is always fullbright. + public override Color? GetAlpha(Color lightColor) + { + return currentColor; + } + + public override void Kill(int timeLeft) + { + projectile.position = projectile.Center; + projectile.width = projectile.height = 32; + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + int num298 = Main.rand.NextBool(2) ? 107 : 234; + if (Main.rand.NextBool(4)) + { + num298 = 269; + } + for (int num621 = 0; num621 < 2; num621++) + { + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num298, 0f, 0f, 100, default, 1.2f); + Main.dust[num622].velocity *= 3f; + if (Main.rand.NextBool(2)) + { + Main.dust[num622].scale = 0.5f; + Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + } + } + for (int num623 = 0; num623 < 2; num623++) + { + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1.7f); + Main.dust[num624].noGravity = true; + Main.dust[num624].velocity *= 5f; + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, new Color(Main.DiscoR, 203, 103), 1f); + Main.dust[num624].velocity *= 2f; + } + } + } +} diff --git a/Projectiles/Rogue/SupernovaSpike.png b/Projectiles/Rogue/SupernovaSpike.png new file mode 100644 index 0000000000..586b8e6639 Binary files /dev/null and b/Projectiles/Rogue/SupernovaSpike.png differ diff --git a/Projectiles/Rogue/TheSyringeCinder.cs b/Projectiles/Rogue/TheSyringeCinder.cs index cbafde2d45..b10793366f 100644 --- a/Projectiles/Rogue/TheSyringeCinder.cs +++ b/Projectiles/Rogue/TheSyringeCinder.cs @@ -84,25 +84,22 @@ namespace CalamityMod.Projectiles.Rogue if (Main.rand.NextBool(4)) { int num199 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 89, 0f, 0f, 100, default, 1f); - Dust expr_8976_cp_0 = Main.dust[num199]; - expr_8976_cp_0.position.X -= 2f; - Dust expr_8994_cp_0 = Main.dust[num199]; - expr_8994_cp_0.position.Y += 2f; - Main.dust[num199].scale += (float)Main.rand.Next(50) * 0.01f; - Main.dust[num199].noGravity = true; - Dust expr_89E7_cp_0 = Main.dust[num199]; - expr_89E7_cp_0.velocity.Y -= 2f; + Dust dust = Main.dust[num199]; + dust.position.X -= 2f; + dust.position.Y += 2f; + dust.scale += (float)Main.rand.Next(50) * 0.01f; + dust.noGravity = true; + dust.velocity.Y -= 2f; } if (Main.rand.NextBool(10)) { int num200 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 89, 0f, 0f, 100, default, 1f); - Dust expr_8A4E_cp_0 = Main.dust[num200]; - expr_8A4E_cp_0.position.X -= 2f; - Dust expr_8A6C_cp_0 = Main.dust[num200]; - expr_8A6C_cp_0.position.Y += 2f; - Main.dust[num200].scale += 0.3f + (float)Main.rand.Next(50) * 0.01f; - Main.dust[num200].noGravity = true; - Main.dust[num200].velocity *= 0.1f; + Dust dust = Main.dust[num200]; + dust.position.X -= 2f; + dust.position.Y += 2f; + dust.scale += 0.3f + (float)Main.rand.Next(50) * 0.01f; + dust.noGravity = true; + dust.velocity *= 0.1f; } if ((double)projectile.velocity.Y < 0.25 && (double)projectile.velocity.Y > 0.15) { diff --git a/Projectiles/Rogue/TotalityFire.cs b/Projectiles/Rogue/TotalityFire.cs index 93596b39e6..4a5c406334 100644 --- a/Projectiles/Rogue/TotalityFire.cs +++ b/Projectiles/Rogue/TotalityFire.cs @@ -87,25 +87,22 @@ namespace CalamityMod.Projectiles.Rogue if (Main.rand.NextBool(4)) { int num199 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, 0f, 0f, 100, default, 1f); - Dust expr_8976_cp_0 = Main.dust[num199]; - expr_8976_cp_0.position.X -= 2f; - Dust expr_8994_cp_0 = Main.dust[num199]; - expr_8994_cp_0.position.Y += 2f; - Main.dust[num199].scale += (float)Main.rand.Next(50) * 0.01f; - Main.dust[num199].noGravity = true; - Dust expr_89E7_cp_0 = Main.dust[num199]; - expr_89E7_cp_0.velocity.Y -= 2f; + Dust dust = Main.dust[num199]; + dust.position.X -= 2f; + dust.position.Y += 2f; + dust.scale += (float)Main.rand.Next(50) * 0.01f; + dust.noGravity = true; + dust.velocity.Y -= 2f; } if (Main.rand.NextBool(10)) { int num200 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 6, 0f, 0f, 100, default, 1f); - Dust expr_8A4E_cp_0 = Main.dust[num200]; - expr_8A4E_cp_0.position.X -= 2f; - Dust expr_8A6C_cp_0 = Main.dust[num200]; - expr_8A6C_cp_0.position.Y += 2f; - Main.dust[num200].scale += 0.3f + (float)Main.rand.Next(50) * 0.01f; - Main.dust[num200].noGravity = true; - Main.dust[num200].velocity *= 0.1f; + Dust dust = Main.dust[num200]; + dust.position.X -= 2f; + dust.position.Y += 2f; + dust.scale += 0.3f + (float)Main.rand.Next(50) * 0.01f; + dust.noGravity = true; + dust.velocity *= 0.1f; } if ((double)projectile.velocity.Y < 0.25 && (double)projectile.velocity.Y > 0.15) { diff --git a/Projectiles/Rogue/UmbraphileBoom.cs b/Projectiles/Rogue/UmbraphileBoom.cs index 0e9c4a1400..493fd021ab 100644 --- a/Projectiles/Rogue/UmbraphileBoom.cs +++ b/Projectiles/Rogue/UmbraphileBoom.cs @@ -75,15 +75,14 @@ namespace CalamityMod.Projectiles.Rogue num463 *= num466; num464 *= num466; int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 1f); - Main.dust[num467].noGravity = true; - Main.dust[num467].position.X = projectile.Center.X; - Main.dust[num467].position.Y = projectile.Center.Y; - Dust expr_149DF_cp_0 = Main.dust[num467]; - expr_149DF_cp_0.position.X += (float)Main.rand.Next(-10, 11); - Dust expr_14A09_cp_0 = Main.dust[num467]; - expr_14A09_cp_0.position.Y += (float)Main.rand.Next(-10, 11); - Main.dust[num467].velocity.X = num463; - Main.dust[num467].velocity.Y = num464; + Dust dust = Main.dust[num467]; + dust.noGravity = true; + dust.position.X = projectile.Center.X; + dust.position.Y = projectile.Center.Y; + dust.position.X += (float)Main.rand.Next(-10, 11); + dust.position.Y += (float)Main.rand.Next(-10, 11); + dust.velocity.X = num463; + dust.velocity.Y = num464; num462++; } return; diff --git a/Projectiles/Summon/ApexShark.cs b/Projectiles/Summon/ApexShark.cs new file mode 100644 index 0000000000..5cfbc78dad --- /dev/null +++ b/Projectiles/Summon/ApexShark.cs @@ -0,0 +1,297 @@ +using CalamityMod.Buffs.Summon; +using CalamityMod.CalPlayer; +using CalamityMod.Projectiles.Typeless; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Summon +{ + public class ApexShark : ModProjectile + { + private int HitCooldown = 0; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ancient Mineral Shark"); + Main.projFrames[projectile.type] = 8; + ProjectileID.Sets.MinionSacrificable[projectile.type] = true; + ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.width = 40; + projectile.height = 40; + projectile.netImportant = true; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.minionSlots = 1f; + projectile.timeLeft = 18000; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.timeLeft *= 5; + projectile.minion = true; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 20; + } + + public override void AI() + { + if (HitCooldown > 0) + HitCooldown--; + Player player = Main.player[projectile.owner]; + if (projectile.localAI[0] == 0f) + { + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; + int num226 = 36; + for (int num227 = 0; num227 < num226; num227++) + { + Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f; + vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center; + Vector2 vector7 = vector6 - projectile.Center; + int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 67, vector7.X * 1.75f, vector7.Y * 1.75f, 100, default, 1.1f); + Main.dust[num228].noGravity = true; + Main.dust[num228].velocity = vector7; + } + projectile.localAI[0]++; + } + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + { + int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / + projectile.Calamity().spawnedPlayerMinionDamageValue * + (player.allDamage + player.minionDamage - 1f)); + projectile.damage = damage2; + } + projectile.frameCounter++; + if (projectile.frameCounter > 6) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 7) + { + projectile.frame = 0; + } + float num633 = 700f; + float num634 = 1000f; + float num635 = 2200f; + float num636 = 150f; + bool flag64 = projectile.type == ModContent.ProjectileType(); + + CalamityPlayer modPlayer = player.Calamity(); + player.AddBuff(ModContent.BuffType(), 3600); + if (flag64) + { + if (player.dead) + { + modPlayer.apexShark = false; + } + if (modPlayer.apexShark) + { + projectile.timeLeft = 2; + } + } + float num637 = 0.05f; + for (int num638 = 0; num638 < 1000; num638++) + { + bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); + if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && + flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) + { + if (projectile.position.X < Main.projectile[num638].position.X) + { + projectile.velocity.X = projectile.velocity.X - num637; + } + else + { + projectile.velocity.X = projectile.velocity.X + num637; + } + if (projectile.position.Y < Main.projectile[num638].position.Y) + { + projectile.velocity.Y = projectile.velocity.Y - num637; + } + else + { + projectile.velocity.Y = projectile.velocity.Y + num637; + } + } + } + bool flag24 = false; + if (projectile.ai[0] == 2f) + { + projectile.ai[1] += 1f; + projectile.extraUpdates = 1; + if (projectile.ai[1] > 60f) + { + projectile.ai[1] = 1f; + projectile.ai[0] = 0f; + projectile.extraUpdates = 0; + projectile.numUpdates = 0; + projectile.netUpdate = true; + } + else + { + flag24 = true; + } + } + if (flag24) + { + return; + } + Vector2 vector46 = projectile.position; + bool flag25 = false; + if (player.HasMinionAttackTargetNPC) + { + NPC npc = Main.npc[player.MinionAttackTargetNPC]; + if (npc.CanBeChasedBy(projectile, false)) + { + float num646 = Vector2.Distance(npc.Center, projectile.Center); + if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) + { + num633 = num646; + vector46 = npc.Center; + flag25 = true; + } + } + } + else + { + for (int num645 = 0; num645 < 200; num645++) + { + NPC nPC2 = Main.npc[num645]; + if (nPC2.CanBeChasedBy(projectile, false)) + { + float num646 = Vector2.Distance(nPC2.Center, projectile.Center); + if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25) + { + num633 = num646; + vector46 = nPC2.Center; + flag25 = true; + } + } + } + } + float num647 = num634; + if (flag25) + { + num647 = num635; + } + if (Vector2.Distance(player.Center, projectile.Center) > num647) + { + projectile.ai[0] = 1f; + projectile.netUpdate = true; + } + if (flag25 && projectile.ai[0] == 0f) + { + Vector2 vector47 = vector46 - projectile.Center; + float num648 = vector47.Length(); + vector47.Normalize(); + if (num648 > 200f) + { + float scaleFactor2 = 13f; //8 + vector47 *= scaleFactor2; + projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; + } + else + { + float num649 = 6f; + vector47 *= -num649; + projectile.velocity = (projectile.velocity * 40f + vector47) / 41f; + } + } + else + { + bool flag26 = false; + if (!flag26) + { + flag26 = projectile.ai[0] == 1f; + } + float num650 = 10f; + if (flag26) + { + num650 = 21f; + } + Vector2 center2 = projectile.Center; + Vector2 vector48 = player.Center - center2 + new Vector2(0f, -60f); + float num651 = vector48.Length(); + if (num651 > 200f && num650 < 8f) + { + num650 = 1f; + } + if (num651 < num636 && flag26 && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) + { + projectile.ai[0] = 0f; + projectile.netUpdate = true; + } + if (num651 > 2000f) + { + projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); + projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2); + projectile.netUpdate = true; + } + if (num651 > 70f) + { + vector48.Normalize(); + vector48 *= num650; + projectile.velocity = (projectile.velocity * 40f + vector48) / 41f; + } + else if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) + { + projectile.velocity.X = -0.15f; + projectile.velocity.Y = -0.05f; + } + } + projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt(); + projectile.rotation = projectile.velocity.ToRotation() + (projectile.spriteDirection == 1 ? 0f : MathHelper.Pi); + if (projectile.ai[1] > 0f) + { + projectile.ai[1] += (float)Main.rand.Next(1, 4); + } + if (projectile.ai[1] > 60f) + { + projectile.ai[1] = 0f; + projectile.netUpdate = true; + } + if (projectile.ai[0] == 0f) + { + if (projectile.ai[1] == 0f && flag25 && num633 < 500f) + { + projectile.ai[1] += 1f; + if (Main.myPlayer == projectile.owner) + { + projectile.ai[0] = 2f; + Vector2 value20 = vector46 - projectile.Center; + value20.Normalize(); + projectile.velocity = value20 * 13f; //8 + projectile.netUpdate = true; + } + } + } + + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 70, 0.5f); + projectile.velocity = new Vector2(0f, 5f).RotatedBy(projectile.velocity.ToRotation() + 1.5f); + int sand = Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(projectile.damage * 0.7f), (int)(projectile.knockBack * 0.7f), projectile.owner, 0f, 0f); + Main.projectile[sand].Center = projectile.Center; + projectile.netUpdate = true; + HitCooldown = 20; + + } + + public override bool? CanHitNPC(NPC target) + { + if (HitCooldown == 0 && !target.townNPC && target.type != NPCID.DD2EterniaCrystal && !target.immortal && !target.dontTakeDamage) + { + return true; + } + return false; + } + } +} diff --git a/Projectiles/Summon/ApexShark.png b/Projectiles/Summon/ApexShark.png new file mode 100644 index 0000000000..1d2efce76d Binary files /dev/null and b/Projectiles/Summon/ApexShark.png differ diff --git a/Projectiles/Summon/AquaticStarMinion.cs b/Projectiles/Summon/AquaticStarMinion.cs index f4c31d4573..ad73e587cf 100644 --- a/Projectiles/Summon/AquaticStarMinion.cs +++ b/Projectiles/Summon/AquaticStarMinion.cs @@ -1,6 +1,7 @@ using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; +using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -37,9 +38,11 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); if (dust == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 36; for (int num227 = 0; num227 < num226; num227++) @@ -54,17 +57,15 @@ namespace CalamityMod.Projectiles.Summon } dust += 1f; } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } projectile.rotation += projectile.velocity.X * 0.04f; bool flag64 = projectile.type == ModContent.ProjectileType(); - Player player = Main.player[projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); player.AddBuff(ModContent.BuffType(), 3600); if (flag64) { @@ -77,6 +78,30 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft = 2; } } + float SAImovement = 0.05f; + for (int num638 = 0; num638 < Main.projectile.Length; num638++) + { + bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); + if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) + { + if (projectile.position.X < Main.projectile[num638].position.X) + { + projectile.velocity.X -= SAImovement; + } + else + { + projectile.velocity.X += SAImovement; + } + if (projectile.position.Y < Main.projectile[num638].position.Y) + { + projectile.velocity.Y -= SAImovement; + } + else + { + projectile.velocity.Y += SAImovement; + } + } + } } public override bool OnTileCollide(Vector2 oldVelocity) diff --git a/Projectiles/Summon/AstralProbeRound.cs b/Projectiles/Summon/AstralProbeRound.cs index 870461dc81..8e64c28a1f 100644 --- a/Projectiles/Summon/AstralProbeRound.cs +++ b/Projectiles/Summon/AstralProbeRound.cs @@ -55,12 +55,13 @@ namespace CalamityMod.Projectiles.Summon float num473 = projectile.Center.Y; float num474 = 1200f; bool flag17 = false; - for (int target = 0; target < 200; target++) + if (Main.player[projectile.owner].HasMinionAttackTargetNPC) { - if (Main.npc[target].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[target].Center, 1, 1)) - { - float num476 = Main.npc[target].position.X + (float)(Main.npc[target].width / 2); - float num477 = Main.npc[target].position.Y + (float)(Main.npc[target].height / 2); + NPC npc = Main.npc[Main.player[projectile.owner].MinionAttackTargetNPC]; + if (npc.CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, npc.Center, 1, 1)) + { + float num476 = npc.position.X + (float)(npc.width / 2); + float num477 = npc.position.Y + (float)(npc.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) { @@ -71,6 +72,25 @@ namespace CalamityMod.Projectiles.Summon } } } + else + { + for (int target = 0; target < Main.npc.Length; target++) + { + if (Main.npc[target].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[target].Center, 1, 1)) + { + float num476 = Main.npc[target].position.X + (float)(Main.npc[target].width / 2); + float num477 = Main.npc[target].position.Y + (float)(Main.npc[target].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 = 17f; diff --git a/Projectiles/Summon/AstralProbeSummon.cs b/Projectiles/Summon/AstralProbeSummon.cs index 89f4b22da8..6a5d85aea6 100644 --- a/Projectiles/Summon/AstralProbeSummon.cs +++ b/Projectiles/Summon/AstralProbeSummon.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Summon CalamityPlayer modPlayer = player.Calamity(); if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = player.minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 36; for (int num227 = 0; num227 < num226; num227++) @@ -54,11 +54,11 @@ namespace CalamityMod.Projectiles.Summon } projectile.localAI[0] += 1f; } - if (player.minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - player.minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } bool flag64 = projectile.type == ModContent.ProjectileType(); @@ -74,10 +74,10 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft = 2; } } - float num633 = 700f; + float num633 = 1000f; float num634 = 1300f; float num635 = 2600f; - float num636 = 600f; + float num636 = 700f; Vector2 vector46 = projectile.position; bool flag25 = false; if (player.HasMinionAttackTargetNPC) @@ -95,7 +95,7 @@ namespace CalamityMod.Projectiles.Summon } else { - for (int num645 = 0; num645 < 200; num645++) + for (int num645 = 0; num645 < Main.npc.Length; num645++) { NPC nPC2 = Main.npc[num645]; if (nPC2.CanBeChasedBy(projectile, false)) @@ -155,9 +155,9 @@ namespace CalamityMod.Projectiles.Summon } if (projectile.ai[1] > 0f) { - projectile.ai[1] += (float)Main.rand.Next(1, 4); + projectile.ai[1] += (float)Main.rand.Next(1, 3); } - if (projectile.ai[1] > 90f) + if (projectile.ai[1] > 80f) { projectile.ai[1] = 0f; projectile.netUpdate = true; diff --git a/Projectiles/Summon/BlackHawkSummon.cs b/Projectiles/Summon/BlackHawkSummon.cs index a03e5110a6..aa864041ba 100644 --- a/Projectiles/Summon/BlackHawkSummon.cs +++ b/Projectiles/Summon/BlackHawkSummon.cs @@ -63,9 +63,11 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 36; for (int num227 = 0; num227 < num226; num227++) @@ -79,11 +81,11 @@ namespace CalamityMod.Projectiles.Summon } projectile.localAI[0] += 1f; } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } projectile.frameCounter++; @@ -101,8 +103,6 @@ namespace CalamityMod.Projectiles.Summon float num635 = 2600f; float num636 = 600f; bool flag64 = projectile.type == ModContent.ProjectileType(); - Player player = Main.player[projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); player.AddBuff(ModContent.BuffType(), 3600); if (flag64) { diff --git a/Projectiles/Summon/BloodClotMinion.cs b/Projectiles/Summon/BloodClotMinion.cs index dbc9d4a8a3..5253dc3789 100644 --- a/Projectiles/Summon/BloodClotMinion.cs +++ b/Projectiles/Summon/BloodClotMinion.cs @@ -36,9 +36,11 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 36; for (int num227 = 0; num227 < num226; num227++) @@ -53,11 +55,11 @@ namespace CalamityMod.Projectiles.Summon } projectile.localAI[0] += 1f; } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } int num1262 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 5, 0f, 0f, 0, default, 1f); @@ -75,8 +77,6 @@ namespace CalamityMod.Projectiles.Summon projectile.frame = 0; } bool flag64 = projectile.type == ModContent.ProjectileType(); - Player player = Main.player[projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); player.AddBuff(ModContent.BuffType(), 3600); if (flag64) { diff --git a/Projectiles/Summon/BrimstoneElementalMinion.cs b/Projectiles/Summon/BrimstoneElementalMinion.cs index 749cf2a5f1..7c4659fba1 100644 --- a/Projectiles/Summon/BrimstoneElementalMinion.cs +++ b/Projectiles/Summon/BrimstoneElementalMinion.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Summon dust--; if (dust >= 0) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num501 = 50; for (int num502 = 0; num502 < num501; num502++) @@ -76,11 +76,11 @@ namespace CalamityMod.Projectiles.Summon Main.dust[num503].scale *= 1.15f; } } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } projectile.frameCounter++; diff --git a/Projectiles/Summon/BrimstoneFireSummon.cs b/Projectiles/Summon/BrimstoneFireSummon.cs index 46c9a092dc..bb8c3a5170 100644 --- a/Projectiles/Summon/BrimstoneFireSummon.cs +++ b/Projectiles/Summon/BrimstoneFireSummon.cs @@ -49,24 +49,21 @@ namespace CalamityMod.Projectiles.Summon for (int num298 = 0; num298 < 1; num298++) { int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 1f); + Dust dust = Main.dust[num299]; if (Main.rand.NextBool(3)) { - Main.dust[num299].noGravity = true; - Main.dust[num299].scale *= 3f; - Dust expr_DBEF_cp_0 = Main.dust[num299]; - expr_DBEF_cp_0.velocity.X *= 2f; - Dust expr_DC0F_cp_0 = Main.dust[num299]; - expr_DC0F_cp_0.velocity.Y *= 2f; + dust.noGravity = true; + dust.scale *= 3f; + dust.velocity.X *= 2f; + dust.velocity.Y *= 2f; } else { - Main.dust[num299].scale *= 1.5f; + dust.scale *= 1.5f; } - Dust expr_DC74_cp_0 = Main.dust[num299]; - expr_DC74_cp_0.velocity.X *= 1.2f; - Dust expr_DC94_cp_0 = Main.dust[num299]; - expr_DC94_cp_0.velocity.Y *= 1.2f; - Main.dust[num299].scale *= num296; + dust.velocity.X *= 1.2f; + dust.velocity.Y *= 1.2f; + dust.scale *= num296; } } } diff --git a/Projectiles/Summon/BrittleStarMinion.cs b/Projectiles/Summon/BrittleStarMinion.cs index 03bb75fe97..6da5585179 100644 --- a/Projectiles/Summon/BrittleStarMinion.cs +++ b/Projectiles/Summon/BrittleStarMinion.cs @@ -1,6 +1,7 @@ using CalamityMod.Buffs.Summon; using CalamityMod.CalPlayer; using Microsoft.Xna.Framework; +using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -37,9 +38,11 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); if (dust == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 36; for (int num227 = 0; num227 < num226; num227++) @@ -54,17 +57,15 @@ namespace CalamityMod.Projectiles.Summon } dust += 1f; } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } projectile.rotation += projectile.velocity.X * 0.04f; bool flag64 = projectile.type == ModContent.ProjectileType(); - Player player = Main.player[projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); player.AddBuff(ModContent.BuffType(), 3600); if (flag64) { @@ -77,6 +78,30 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft = 2; } } + float SAImovement = 0.05f; + for (int num638 = 0; num638 < Main.projectile.Length; num638++) + { + bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType(); + if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width) + { + if (projectile.position.X < Main.projectile[num638].position.X) + { + projectile.velocity.X -= SAImovement; + } + else + { + projectile.velocity.X += SAImovement; + } + if (projectile.position.Y < Main.projectile[num638].position.Y) + { + projectile.velocity.Y -= SAImovement; + } + else + { + projectile.velocity.Y += SAImovement; + } + } + } } public override bool OnTileCollide(Vector2 oldVelocity) diff --git a/Projectiles/Summon/CalamariMinion.cs b/Projectiles/Summon/CalamariMinion.cs index 04e3104f46..d9a2980921 100644 --- a/Projectiles/Summon/CalamariMinion.cs +++ b/Projectiles/Summon/CalamariMinion.cs @@ -38,9 +38,11 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); if (projectile.localAI[1] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; //66% = 1.66 + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); //66% = 1.66 projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; //300 * 1.66 = 498 (new value) int num226 = 36; for (int num227 = 0; num227 < num226; num227++) @@ -55,11 +57,11 @@ namespace CalamityMod.Projectiles.Summon } projectile.localAI[1] += 1f; } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) //15% = 1.15 != 1.66 + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) //15% = 1.15 != 1.66 { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / //498 projectile.Calamity().spawnedPlayerMinionDamageValue * //1.66 498 / 1.66 = 300 (original value) - Main.player[projectile.owner].minionDamage); //300 * 1.15 = 345 (new value) + (player.allDamage + player.minionDamage - 1f)); //300 * 1.15 = 345 (new value) projectile.damage = damage2; } projectile.frameCounter++; @@ -73,8 +75,6 @@ namespace CalamityMod.Projectiles.Summon projectile.frame = 0; } bool flag64 = projectile.type == ModContent.ProjectileType(); - Player player = Main.player[projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); player.AddBuff(ModContent.BuffType(), 3600); if (flag64) { diff --git a/Projectiles/Summon/Calamitamini.cs b/Projectiles/Summon/Calamitamini.cs index a888264dd8..06127bbb68 100644 --- a/Projectiles/Summon/Calamitamini.cs +++ b/Projectiles/Summon/Calamitamini.cs @@ -35,9 +35,11 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 36; for (int num227 = 0; num227 < num226; num227++) @@ -51,11 +53,11 @@ namespace CalamityMod.Projectiles.Summon } projectile.localAI[0] += 1f; } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } float num633 = 700f; @@ -63,8 +65,6 @@ namespace CalamityMod.Projectiles.Summon float num635 = 2400f; float num636 = 150f; bool flag64 = projectile.type == ModContent.ProjectileType(); - Player player = Main.player[projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); player.AddBuff(ModContent.BuffType(), 3600); if (flag64) { diff --git a/Projectiles/Summon/Cataclymini.cs b/Projectiles/Summon/Cataclymini.cs index d3aaf51551..828bb70d71 100644 --- a/Projectiles/Summon/Cataclymini.cs +++ b/Projectiles/Summon/Cataclymini.cs @@ -35,9 +35,11 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 36; for (int num227 = 0; num227 < num226; num227++) @@ -51,11 +53,11 @@ namespace CalamityMod.Projectiles.Summon } projectile.localAI[0] += 1f; } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } float num633 = 700f; @@ -63,8 +65,6 @@ namespace CalamityMod.Projectiles.Summon float num635 = 2400f; float num636 = 150f; bool flag64 = projectile.type == ModContent.ProjectileType(); - Player player = Main.player[projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); if (flag64) { if (player.dead) diff --git a/Projectiles/Summon/Catastromini.cs b/Projectiles/Summon/Catastromini.cs index 099a4f8993..131f50bde1 100644 --- a/Projectiles/Summon/Catastromini.cs +++ b/Projectiles/Summon/Catastromini.cs @@ -35,9 +35,11 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 36; for (int num227 = 0; num227 < num226; num227++) @@ -51,11 +53,11 @@ namespace CalamityMod.Projectiles.Summon } projectile.localAI[0] += 1f; } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } float num633 = 700f; @@ -63,8 +65,6 @@ namespace CalamityMod.Projectiles.Summon float num635 = 2400f; float num636 = 150f; bool flag64 = projectile.type == ModContent.ProjectileType(); - Player player = Main.player[projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); if (flag64) { if (player.dead) diff --git a/Projectiles/Summon/ChaosSpirit.cs b/Projectiles/Summon/ChaosSpirit.cs index 50edec7e2a..6b501625e8 100644 --- a/Projectiles/Summon/ChaosSpirit.cs +++ b/Projectiles/Summon/ChaosSpirit.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Summon dust--; if (dust >= 0) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num501 = 50; for (int num502 = 0; num502 < num501; num502++) @@ -68,11 +68,11 @@ namespace CalamityMod.Projectiles.Summon Main.dust[num503].scale *= 1.15f; } } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 1f / 255f, (255 - projectile.alpha) * 0.35f / 255f, (255 - projectile.alpha) * 0f / 255f); diff --git a/Projectiles/Summon/CloudElementalMinion.cs b/Projectiles/Summon/CloudElementalMinion.cs index f9eb471959..f01761b558 100644 --- a/Projectiles/Summon/CloudElementalMinion.cs +++ b/Projectiles/Summon/CloudElementalMinion.cs @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Summon dust--; if (dust >= 0) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num501 = 50; for (int num502 = 0; num502 < num501; num502++) @@ -75,11 +75,11 @@ namespace CalamityMod.Projectiles.Summon Main.dust[num503].scale *= 1.15f; } } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } if ((double)Math.Abs(projectile.velocity.X) > 0.2) diff --git a/Projectiles/Summon/CorroslimeMinion.cs b/Projectiles/Summon/CorroslimeMinion.cs index 49ee748ec0..1e31876622 100644 --- a/Projectiles/Summon/CorroslimeMinion.cs +++ b/Projectiles/Summon/CorroslimeMinion.cs @@ -47,9 +47,11 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); if (dust == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 16; for (int num227 = 0; num227 < num226; num227++) @@ -64,16 +66,14 @@ namespace CalamityMod.Projectiles.Summon } dust += 1f; } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } bool flag64 = projectile.type == ModContent.ProjectileType(); - Player player = Main.player[projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); player.AddBuff(ModContent.BuffType(), 3600); if (flag64) { diff --git a/Projectiles/Summon/CorroslimeMinion.png b/Projectiles/Summon/CorroslimeMinion.png index d0dcacd82a..fb4316512d 100644 Binary files a/Projectiles/Summon/CorroslimeMinion.png and b/Projectiles/Summon/CorroslimeMinion.png differ diff --git a/Projectiles/Summon/CorruptionSlimeGodMinion.cs b/Projectiles/Summon/CorruptionSlimeGodMinion.cs index 75ebeca570..32b1c9e266 100644 --- a/Projectiles/Summon/CorruptionSlimeGodMinion.cs +++ b/Projectiles/Summon/CorruptionSlimeGodMinion.cs @@ -45,9 +45,11 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); if (dust == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 16; for (int num227 = 0; num227 < num226; num227++) @@ -62,16 +64,14 @@ namespace CalamityMod.Projectiles.Summon } dust += 1f; } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } bool flag64 = projectile.type == ModContent.ProjectileType(); - Player player = Main.player[projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); player.AddBuff(ModContent.BuffType(), 3600); if (!modPlayer.slimeGod) { diff --git a/Projectiles/Summon/CosmicEnergySpiral.cs b/Projectiles/Summon/CosmicEnergySpiral.cs index 3612674bc3..a1b6b0e40d 100644 --- a/Projectiles/Summon/CosmicEnergySpiral.cs +++ b/Projectiles/Summon/CosmicEnergySpiral.cs @@ -37,23 +37,23 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); Lighting.AddLight((int)projectile.Center.X / 16, (int)projectile.Center.Y / 16, (float)Main.DiscoR / 255f, (float)Main.DiscoG / 255f, (float)Main.DiscoB / 255f); if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; projectile.localAI[0] += 1f; } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } bool flag64 = projectile.type == ModContent.ProjectileType(); - Player player = Main.player[projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); player.AddBuff(ModContent.BuffType(), 3600); if (flag64) { diff --git a/Projectiles/Summon/CosmilampMinion.cs b/Projectiles/Summon/CosmilampMinion.cs index 84bb6a189d..52c01574a5 100644 --- a/Projectiles/Summon/CosmilampMinion.cs +++ b/Projectiles/Summon/CosmilampMinion.cs @@ -36,9 +36,11 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 36; for (int num227 = 0; num227 < num226; num227++) @@ -53,11 +55,11 @@ namespace CalamityMod.Projectiles.Summon } projectile.localAI[0] += 1f; } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.75f / 255f, (255 - projectile.alpha) * 0f / 255f, (255 - projectile.alpha) * 0f / 255f); @@ -69,8 +71,6 @@ namespace CalamityMod.Projectiles.Summon Main.dust[num1262].scale = 0.7f; Main.dust[num1262].noGravity = true; bool flag64 = projectile.type == ModContent.ProjectileType(); - Player player = Main.player[projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); player.AddBuff(ModContent.BuffType(), 3600); if (flag64) { diff --git a/Projectiles/Summon/CrimslimeMinion.cs b/Projectiles/Summon/CrimslimeMinion.cs index 75de987fcd..ecd56b7e7f 100644 --- a/Projectiles/Summon/CrimslimeMinion.cs +++ b/Projectiles/Summon/CrimslimeMinion.cs @@ -47,9 +47,11 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); if (dust == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 16; for (int num227 = 0; num227 < num226; num227++) @@ -64,16 +66,14 @@ namespace CalamityMod.Projectiles.Summon } dust += 1f; } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } bool flag64 = projectile.type == ModContent.ProjectileType(); - Player player = Main.player[projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); player.AddBuff(ModContent.BuffType(), 3600); if (flag64) { diff --git a/Projectiles/Summon/CrimslimeMinion.png b/Projectiles/Summon/CrimslimeMinion.png index f829626fbe..fb9d5d4372 100644 Binary files a/Projectiles/Summon/CrimslimeMinion.png and b/Projectiles/Summon/CrimslimeMinion.png differ diff --git a/Projectiles/Summon/CrimsonSlimeGodMinion.cs b/Projectiles/Summon/CrimsonSlimeGodMinion.cs index 3c5abb1da5..19af50781e 100644 --- a/Projectiles/Summon/CrimsonSlimeGodMinion.cs +++ b/Projectiles/Summon/CrimsonSlimeGodMinion.cs @@ -45,9 +45,11 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); if (dust == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 16; for (int num227 = 0; num227 < num226; num227++) @@ -62,16 +64,14 @@ namespace CalamityMod.Projectiles.Summon } dust += 1f; } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } bool flag64 = projectile.type == ModContent.ProjectileType(); - Player player = Main.player[projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); player.AddBuff(ModContent.BuffType(), 3600); if (!modPlayer.slimeGod) { diff --git a/Projectiles/Summon/DaedalusCrystal.cs b/Projectiles/Summon/DaedalusCrystal.cs index bbeabe542f..5debaff6aa 100644 --- a/Projectiles/Summon/DaedalusCrystal.cs +++ b/Projectiles/Summon/DaedalusCrystal.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Summon dust--; if (dust >= 0) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num501 = 50; for (int num502 = 0; num502 < num501; num502++) @@ -67,11 +67,11 @@ namespace CalamityMod.Projectiles.Summon Main.dust[num503].scale *= 1.15f; } } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.35f / 255f, (255 - projectile.alpha) * 0f / 255f, (255 - projectile.alpha) * 0.75f / 255f); diff --git a/Projectiles/Summon/DankCreeperMinion.cs b/Projectiles/Summon/DankCreeperMinion.cs index 18a1f4e93d..4762dddf7a 100644 --- a/Projectiles/Summon/DankCreeperMinion.cs +++ b/Projectiles/Summon/DankCreeperMinion.cs @@ -38,9 +38,11 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 36; for (int num227 = 0; num227 < num226; num227++) @@ -55,16 +57,14 @@ namespace CalamityMod.Projectiles.Summon } projectile.localAI[0] += 1f; } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } bool flag64 = projectile.type == ModContent.ProjectileType(); - Player player = Main.player[projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); player.AddBuff(ModContent.BuffType(), 3600); if (flag64) { diff --git a/Projectiles/Summon/Dreadmine.cs b/Projectiles/Summon/Dreadmine.cs index b474ccb67a..b87bed6826 100644 --- a/Projectiles/Summon/Dreadmine.cs +++ b/Projectiles/Summon/Dreadmine.cs @@ -122,20 +122,39 @@ namespace CalamityMod.Projectiles.Summon bool flag49 = false; Vector2 center12 = new Vector2(0f, 0f); float num948 = 600f; - for (int num949 = 0; num949 < 200; num949++) + if (Main.player[projectile.owner].HasMinionAttackTargetNPC) { - if (Main.npc[num949].CanBeChasedBy(projectile, false)) + NPC npc = Main.npc[Main.player[projectile.owner].MinionAttackTargetNPC]; + if (npc.CanBeChasedBy(projectile, false)) { - float num950 = Main.npc[num949].position.X + (float)(Main.npc[num949].width / 2); - float num951 = Main.npc[num949].position.Y + (float)(Main.npc[num949].height / 2); - float num952 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num950) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num951); - if (num952 < num948) - { - num948 = num952; - center12 = Main.npc[num949].Center; - flag49 = true; - } - } + float num950 = npc.position.X + (float)(npc.width / 2); + float num951 = npc.position.Y + (float)(npc.height / 2); + float num952 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num950) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num951); + if (num952 < num948) + { + num948 = num952; + center12 = npc.Center; + flag49 = true; + } + } + } + else + { + for (int num949 = 0; num949 < Main.npc.Length; num949++) + { + if (Main.npc[num949].CanBeChasedBy(projectile, false)) + { + float num950 = Main.npc[num949].position.X + (float)(Main.npc[num949].width / 2); + float num951 = Main.npc[num949].position.Y + (float)(Main.npc[num949].height / 2); + float num952 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num950) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num951); + if (num952 < num948) + { + num948 = num952; + center12 = Main.npc[num949].Center; + flag49 = true; + } + } + } } if (flag49) { @@ -193,29 +212,22 @@ namespace CalamityMod.Projectiles.Summon scaleFactor10 = 1f; } int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13AB6_cp_0 = Main.gore[num626]; - expr_13AB6_cp_0.velocity.X += 1f; - Gore expr_13AD6_cp_0 = Main.gore[num626]; - expr_13AD6_cp_0.velocity.Y += 1f; + Gore gore = Main.gore[num626]; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13B79_cp_0 = Main.gore[num626]; - expr_13B79_cp_0.velocity.X -= 1f; - Gore expr_13B99_cp_0 = Main.gore[num626]; - expr_13B99_cp_0.velocity.Y += 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13C3C_cp_0 = Main.gore[num626]; - expr_13C3C_cp_0.velocity.X += 1f; - Gore expr_13C5C_cp_0 = Main.gore[num626]; - expr_13C5C_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y -= 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13CFF_cp_0 = Main.gore[num626]; - expr_13CFF_cp_0.velocity.X -= 1f; - Gore expr_13D1F_cp_0 = Main.gore[num626]; - expr_13D1F_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y -= 1f; } } } diff --git a/Projectiles/Summon/DreadmineTurret.cs b/Projectiles/Summon/DreadmineTurret.cs index 60a965a29d..40799af0d4 100644 --- a/Projectiles/Summon/DreadmineTurret.cs +++ b/Projectiles/Summon/DreadmineTurret.cs @@ -27,17 +27,18 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + Player player = Main.player[projectile.owner]; if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; projectile.localAI[0] += 1f; } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } projectile.frameCounter++; @@ -60,7 +61,7 @@ namespace CalamityMod.Projectiles.Summon if (Main.rand.NextBool(15)) { int num = 0; - for (int i = 0; i < 1000; i++) + for (int i = 0; i < Main.projectile.Length; i++) { if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == ModContent.ProjectileType()) { diff --git a/Projectiles/Summon/ElementalAxeMinion.cs b/Projectiles/Summon/ElementalAxeMinion.cs index 8c131cd2d1..e8a29c54ae 100644 --- a/Projectiles/Summon/ElementalAxeMinion.cs +++ b/Projectiles/Summon/ElementalAxeMinion.cs @@ -38,22 +38,22 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; projectile.localAI[0] += 1f; } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } bool flag64 = projectile.type == ModContent.ProjectileType(); - Player player = Main.player[projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); player.AddBuff(ModContent.BuffType(), 3600); if (flag64) { diff --git a/Projectiles/Summon/EndoBeam.cs b/Projectiles/Summon/EndoBeam.cs new file mode 100644 index 0000000000..4fa5b3f423 --- /dev/null +++ b/Projectiles/Summon/EndoBeam.cs @@ -0,0 +1,205 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.IO; +using Terraria; +using Terraria.Enums; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Summon +{ + public class EndoBeam : ModProjectile + { + // For if this laser should stop firing if it hits a tile + private static bool LaserTileCollision = false; + + // How long this laser can exist before it is deleted. Just go with int.MaxValue if it's killed manually + private const int timeToExist = 70; + + // Pretty self explanatory + private const float maximumLength = 1600f; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ray"); + } + + public override void SetDefaults() + { + projectile.width = 22; + projectile.height = 22; + projectile.friendly = true; + projectile.alpha = 255; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.timeLeft = timeToExist; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + } + + // Netcode for sending and receiving shit + // localAI[0] is the timer, localAI[1] is the laser length + + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(projectile.localAI[0]); + writer.Write(projectile.localAI[1]); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + projectile.localAI[0] = reader.ReadSingle(); + projectile.localAI[1] = reader.ReadSingle(); + } + + public override void AI() + { + //To spawn, use: + //Vector2 directionVector = Vector2.Normalize(spawningPoint - destination); + //int damage = 1000; + //float angularChange = MathHelper.Pi / 180f; + //Projectile.NewProjectile(projectile.Center, directionVector, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, angularChange, (float)projectile.whoAmI); + Projectile body = Main.projectile[(int)projectile.ai[1]]; + if (body.type != ModContent.ProjectileType() || !body.active) + projectile.Kill(); + + if (projectile.velocity.HasNaNs() || projectile.velocity == Vector2.Zero) + { + projectile.velocity = -Vector2.UnitY; + } + + if (Main.projectile[(int)projectile.ai[1]].active) + { + projectile.Center = Main.projectile[(int)projectile.ai[1]].Center; + } + + if (projectile.velocity.HasNaNs() || projectile.velocity == Vector2.Zero) + { + projectile.velocity = -Vector2.UnitY; + } + + // How fat the laser is + float laserSize = 1f; + + projectile.localAI[0] += 1f; + if (projectile.localAI[0] >= timeToExist) + { + projectile.Kill(); + return; + } + + // Causes the effect where the laser appears to expand/contract at the beginning and end of its life + projectile.scale = (float)Math.Sin((double)(projectile.localAI[0] * MathHelper.Pi / timeToExist)) * 10f * laserSize; + if (projectile.scale > laserSize) + { + projectile.scale = laserSize; + } + + // The heart of the "sweeping rotation" part of the laser + // Basically converts the velocity to a rotation, increments some value to that rotation, + // and then converts the rotation to a velocity + float velocityAsRotation = projectile.velocity.ToRotation(); + velocityAsRotation += projectile.ai[0]; + projectile.rotation = velocityAsRotation - MathHelper.PiOver2; + projectile.velocity = velocityAsRotation.ToRotationVector2(); + + Vector2 samplingPoint = projectile.Center; + + float[] samples = new float[3]; + + float determinedLength = 0f; + if (LaserTileCollision) + { + Collision.LaserScan(samplingPoint, projectile.velocity, projectile.width * projectile.scale, maximumLength, samples); + for (int i = 0; i < samples.Length; i++) + { + determinedLength += samples[i]; + } + determinedLength /= 3f; + } + else + { + determinedLength = maximumLength; + } + + float lerpDelta = 0.5f; + projectile.localAI[1] = MathHelper.Lerp(projectile.localAI[1], determinedLength, lerpDelta); + + DelegateMethods.v3_1 = new Vector3(0.3f, 0.65f, 0.7f); + Utils.PlotTileLine(projectile.Center, projectile.Center + projectile.velocity * projectile.localAI[1], (float)projectile.width * projectile.scale, new Utils.PerLinePoint(DelegateMethods.CastLight)); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + if (projectile.velocity == Vector2.Zero) + { + return false; + } + Texture2D laserTailTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/LaserBegin"); + Texture2D laserBodyTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/LaserMid"); + Texture2D laserHeadTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/LaserEnd"); + float laserLength = projectile.localAI[1]; + Color drawColor = new Color(1f, 1f, 1f) * 0.9f; + + // Laser tail logic + + Main.spriteBatch.Draw(laserTailTexture, projectile.Center - Main.screenPosition, null, drawColor, projectile.rotation, laserTailTexture.Size() / 2f, projectile.scale, SpriteEffects.None, 0f); + + // Laser body logic + + laserLength -= (float)(laserTailTexture.Height / 2 + laserHeadTexture.Height) * projectile.scale; + Vector2 centerDelta = projectile.Center; + centerDelta += projectile.velocity * projectile.scale * (float)laserTailTexture.Height / 2f; + if (laserLength > 0f) + { + float laserLengthDelta = 0f; + Rectangle sourceRectangle = new Rectangle(0, 16 * (projectile.timeLeft / 3 % 5), laserBodyTexture.Width, 16); + while (laserLengthDelta + 1f < laserLength) + { + if (laserLength - laserLengthDelta < (float)sourceRectangle.Height) + { + sourceRectangle.Height = (int)(laserLength - laserLengthDelta); + } + Main.spriteBatch.Draw(laserBodyTexture, centerDelta - Main.screenPosition, new Rectangle?(sourceRectangle), drawColor, projectile.rotation, new Vector2((float)(sourceRectangle.Width / 2), 0f), projectile.scale, SpriteEffects.None, 0f); + laserLengthDelta += (float)sourceRectangle.Height * projectile.scale; + centerDelta += projectile.velocity * (float)sourceRectangle.Height * projectile.scale; + sourceRectangle.Y += 16; + if (sourceRectangle.Y + sourceRectangle.Height > laserBodyTexture.Height) + { + sourceRectangle.Y = 0; + } + } + } + + // Laser head logic + + Main.spriteBatch.Draw(laserHeadTexture, centerDelta - Main.screenPosition, null, drawColor, projectile.rotation, laserHeadTexture.Frame(1, 1, 0, 0).Top(), projectile.scale, SpriteEffects.None, 0f); + return false; + } + + public override void CutTiles() + { + DelegateMethods.tilecut_0 = TileCuttingContext.AttackProjectile; + Vector2 unit = projectile.velocity; + Utils.PlotTileLine(projectile.Center, projectile.Center + unit * projectile.localAI[1], (float)projectile.width * projectile.scale, new Utils.PerLinePoint(DelegateMethods.CutTiles)); + } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + if (projHitbox.Intersects(targetHitbox)) + { + return true; + } + float value = 0f; + if (Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), projectile.Center, projectile.Center + projectile.velocity * projectile.localAI[1], 22f * projectile.scale, ref value)) + { + return true; + } + return false; + } + + public override void OnHitPlayer(Player target, int damage, bool crit) + { + target.AddBuff(ModLoader.GetMod("CalamityMod").BuffType("GodSlayerInferno"), 300); + } + } +} diff --git a/Projectiles/Summon/EndoBeam.png b/Projectiles/Summon/EndoBeam.png new file mode 100644 index 0000000000..61eebb9472 Binary files /dev/null and b/Projectiles/Summon/EndoBeam.png differ diff --git a/Projectiles/Summon/EndoCooperBody.cs b/Projectiles/Summon/EndoCooperBody.cs new file mode 100644 index 0000000000..3503b0f4fa --- /dev/null +++ b/Projectiles/Summon/EndoCooperBody.cs @@ -0,0 +1,391 @@ +using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.Summon; +using CalamityMod.CalPlayer; +using CalamityMod.Projectiles.Magic; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Summon +{ + public class EndoCooperBody : ModProjectile + { + private int AttackMode = 0; + private int LimbID = 0; + private int laserdirection = 1; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ascened Cooper"); + ProjectileID.Sets.MinionSacrificable[projectile.type] = true; + ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 6; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void SetDefaults() + { + projectile.minion = true; + projectile.minionSlots = 10f; + projectile.netImportant = true; + projectile.width = 90; + projectile.height = 90; + projectile.timeLeft = 18000; + projectile.timeLeft *= 5; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + projectile.extraUpdates = 1; + } + + public override void AI() + { + //dust + if (Main.rand.NextBool(15)) + { + int dusttype = Main.rand.NextBool(2) ? 68 : 67; + if (Main.rand.NextBool(4)) + { + dusttype = 80; + } + int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, dusttype , projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 50, default, 0.6f); + Main.dust[dust].noGravity = true; + + } + //Apply the buff + bool flag64 = projectile.type == ModContent.ProjectileType(); + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); + player.AddBuff(ModContent.BuffType(), 3600); + if (flag64) + { + if (player.dead) + { + modPlayer.endoCooper = false; + } + if (modPlayer.endoCooper) + { + projectile.timeLeft = 2; + } + } + + //Spawn effects + if (projectile.localAI[0] == 0f) + { + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; + AttackMode = (int)projectile.ai[0]; + LimbID = (int)projectile.ai[1]; + projectile.ai[0] = 0f; + projectile.ai[1] = 0f; + projectile.localAI[0] += 1f; + for (int i = 0; i < 60; i++) + { + int dusttype = Main.rand.NextBool(2) ? 68 : 67; + if (Main.rand.NextBool(4)) + { + dusttype = 80; + } + Vector2 dspeed = new Vector2(Main.rand.NextFloat(-7f, 7f), Main.rand.NextFloat(-7f, 7f)); + int dust = Dust.NewDust(projectile.Center, 1, 1, dusttype, dspeed.X, dspeed.Y, 50, default, 0.8f); + Main.dust[dust].noGravity = true; + } + } + + //Damage Update + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + { + int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / + projectile.Calamity().spawnedPlayerMinionDamageValue * (player.allDamage + player.minionDamage - 1f)); + projectile.damage = damage2; + } + //Variables + float mindistance = 700f; + float longdistance = AttackMode != 2 ? 1300f : 1200f; + float longestdistance = AttackMode != 2 ? 2600f : 2500f; + float idledistance = AttackMode != 2 ? 600f : 400f; + float SAImovement = 0.05f; + float chasespeed1 = 30f; + float chasespeed2 = 18f; + float firerate = 30f; + + Projectile limbs = Main.projectile[LimbID]; + + switch (AttackMode) + { + case 0: chasespeed1 = 29f; + chasespeed2 = 16f; + firerate = 60f; + break; + case 1: chasespeed1 = 24f; + chasespeed2 = 12f; + firerate = 200f; + + break; + case 2: chasespeed1 = 32f; + chasespeed2 = 20f; + firerate = 30f; + break; + case 3: chasespeed1 = 34f; + chasespeed2 = 21f; + firerate = 30f; + break; + } + + if (limbs.type != ModContent.ProjectileType() || !limbs.active) + projectile.Kill(); + + for (int num638 = 0; num638 < Main.projectile.Length; num638++) + { + Projectile proj = Main.projectile[num638]; + bool flag23 = proj.type == ModContent.ProjectileType(); + bool limbsfind = proj.type == ModContent.ProjectileType(); + if (num638 != projectile.whoAmI && proj.active && proj.owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - proj.position.X) + Math.Abs(projectile.position.Y - proj.position.Y) < (float)projectile.width) + { + if (projectile.position.X < Main.projectile[num638].position.X) + { + projectile.velocity.X -= SAImovement; + } + else + { + projectile.velocity.X += SAImovement; + } + if (projectile.position.Y < Main.projectile[num638].position.Y) + { + projectile.velocity.Y -= SAImovement; + } + else + { + projectile.velocity.Y += SAImovement; + } + } + } + bool flag24 = false; + if (projectile.ai[0] == 2f) + { + projectile.ai[1] += 1f; + projectile.extraUpdates = 2; + if (projectile.ai[1] > 30f) + { + projectile.ai[1] = 1f; + projectile.ai[0] = 0f; + projectile.extraUpdates = 1; + projectile.numUpdates = 0; + projectile.netUpdate = true; + } + else + { + flag24 = true; + } + } + if (flag24) + { + return; + } + Vector2 objectivepos = projectile.position; + bool gotoenemy = false; + if (player.HasMinionAttackTargetNPC) + { + NPC npc = Main.npc[player.MinionAttackTargetNPC]; + if (npc.CanBeChasedBy(projectile, false)) + { + float disttoobjective = Vector2.Distance(npc.Center, projectile.Center); + if ((Vector2.Distance(projectile.Center, objectivepos) > disttoobjective && disttoobjective < mindistance) || !gotoenemy) + { + + mindistance = disttoobjective; + objectivepos = npc.Center; + gotoenemy = true; + } + } + } + else + { + for (int num645 = 0; num645 < 200; num645++) + { + NPC nPC2 = Main.npc[num645]; + if (nPC2.CanBeChasedBy(projectile, false)) + { + float disttoobjective = Vector2.Distance(nPC2.Center, projectile.Center); + if ((Vector2.Distance(projectile.Center, objectivepos) > disttoobjective && disttoobjective < mindistance) || !gotoenemy) + { + + mindistance = disttoobjective; + objectivepos = nPC2.Center; + gotoenemy = true; + } + } + } + } + float maxdisttoenemy = longdistance; + if (gotoenemy) + { + maxdisttoenemy = longestdistance; + } + if (Vector2.Distance(player.Center, projectile.Center) > maxdisttoenemy) + { + projectile.ai[0] = 1f; + projectile.netUpdate = true; + } + if (gotoenemy && projectile.ai[0] == 0f) + { + Vector2 speedtoenemy = objectivepos - projectile.Center; + float disttospeed = speedtoenemy.Length(); + speedtoenemy.Normalize(); + float stopdistance = AttackMode == 3 ? 120f : 200f; + if (disttospeed > stopdistance) + { + float scaleFactor2 = chasespeed1; //8 + speedtoenemy *= scaleFactor2; + projectile.velocity = (projectile.velocity * 40f + speedtoenemy) / 41f; + } + else + { + float scalefactor3 = chasespeed2; //4 + speedtoenemy *= -scalefactor3; + projectile.velocity = (projectile.velocity * 40f + speedtoenemy) / 41f; //41 + } + } + else + { + bool gotoplayer = false; + if (!gotoplayer) + { + gotoplayer = projectile.ai[0] == 1f; + } + float speedtoplayer = 8f; + if (gotoplayer) + { + speedtoplayer = 16f; + } + Vector2 center2 = projectile.Center; + Vector2 playerpos = player.Center - center2 + new Vector2(0f, -60f); + float lenghttoplayer = playerpos.Length(); + if (lenghttoplayer > 200f && speedtoplayer < 8f) + { + speedtoplayer = 10f; + } + if (lenghttoplayer < idledistance && gotoplayer && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height)) + { + projectile.ai[0] = 0f; + projectile.netUpdate = true; + } + if (lenghttoplayer > 2700f) + { + projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2); + projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2); + projectile.netUpdate = true; + } + if (lenghttoplayer > 70f) + { + playerpos.Normalize(); + playerpos *= speedtoplayer; + projectile.velocity = (projectile.velocity * 40f + playerpos) / 41f; + } + else if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f) + { + projectile.velocity.X = -0.15f; + projectile.velocity.Y = -0.05f; + } + + } + + if (projectile.ai[1] > 0f) + { + projectile.ai[1] += (float)Main.rand.Next(1, 4); + } + if (projectile.ai[1] > firerate) + { + projectile.ai[1] = 0f; + projectile.netUpdate = true; + } + if (projectile.ai[0] == 0f) + { + if (projectile.ai[1] == 0f && gotoenemy && mindistance < 600f) + { + + projectile.ai[1] += 1f; + if (Main.myPlayer == projectile.owner) + { + switch (AttackMode) + { + case 0: + Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 15); + Vector2 aimlaser = objectivepos - projectile.Center; + aimlaser.Normalize(); + aimlaser = aimlaser.RotatedBy(MathHelper.ToRadians(30 * -laserdirection)); + float angularChange = (MathHelper.Pi / 180f) * 1.1f * laserdirection; + //aimlaser *= 12f; + Projectile.NewProjectile(projectile.Center, aimlaser, ModContent.ProjectileType(), projectile.damage, 0f, projectile.owner, angularChange, (float)projectile.whoAmI); + laserdirection *= -1; + break; + + case 1: //Kill limbs + if (limbs.ai[0] == 0f) + { + limbs.ai[0] = 1f; + } + //Respawn limbs + else if (limbs.ai[0] == 2f) + { + limbs.ai[0] = 3f; + } + projectile.netUpdate = true; + break; + + case 2: projectile.ai[0] = 2f; + Vector2 aimtoenemy = objectivepos - projectile.Center; + aimtoenemy.Normalize(); + projectile.velocity = aimtoenemy * 18f; + projectile.netUpdate = true; + break; + case 3: limbs.ai[0] = 4f; + projectile.netUpdate = true; + break; + default:break; + } + } + } + } + if (limbs.ai[0] == 2f && projectile.ai[1] == 0f) + { + projectile.ai[1] += 1f; + limbs.ai[0] = 3f; + projectile.netUpdate = true; + } + + //Tilting and change directions + projectile.spriteDirection = projectile.direction; + projectile.rotation = projectile.velocity.X * 0.07f; + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + + public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) + { + Rectangle frame = new Rectangle(0, 0, Main.projectileTexture[projectile.type].Width, Main.projectileTexture[projectile.type].Height); + spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Projectiles/Summon/EndoCooperBody_Glow"), projectile.Center - Main.screenPosition, frame, Color.LightSkyBlue, projectile.rotation, projectile.Size / 2, 1f, SpriteEffects.None, 0f); + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 90); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 180); + } + + public override bool CanDamage() + { + return AttackMode == 2; + } + } +} diff --git a/Projectiles/Summon/EndoCooperBody.png b/Projectiles/Summon/EndoCooperBody.png new file mode 100644 index 0000000000..5cbb58f959 Binary files /dev/null and b/Projectiles/Summon/EndoCooperBody.png differ diff --git a/Projectiles/Summon/EndoCooperBody_Glow.png b/Projectiles/Summon/EndoCooperBody_Glow.png new file mode 100644 index 0000000000..36859dbc1b Binary files /dev/null and b/Projectiles/Summon/EndoCooperBody_Glow.png differ diff --git a/Projectiles/Summon/EndoCooperLimbs.cs b/Projectiles/Summon/EndoCooperLimbs.cs new file mode 100644 index 0000000000..a161da7f0a --- /dev/null +++ b/Projectiles/Summon/EndoCooperLimbs.cs @@ -0,0 +1,208 @@ +using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Buffs.Summon; +using CalamityMod.CalPlayer; +using CalamityMod.Projectiles.Ranged; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Summon +{ + public class EndoCooperLimbs : ModProjectile + { + private int AttackMode = 0; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ascened Cooper"); + ProjectileID.Sets.MinionSacrificable[projectile.type] = true; + ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; + ProjectileID.Sets.TrailCacheLength[projectile.type] = 6; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + } + + public override void SetDefaults() + { + projectile.minion = true; + projectile.minionSlots = 0f; + projectile.netImportant = true; + projectile.width = 90; + projectile.height = 90; + projectile.timeLeft = 18000; + projectile.timeLeft *= 5; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.friendly = true; + projectile.penetrate = -1; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + projectile.extraUpdates = 1; + } + + public override void AI() + { + Projectile body = Main.projectile[(int)projectile.ai[1]]; + //Apply the buff + bool flag64 = projectile.type == ModContent.ProjectileType(); + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); + player.AddBuff(ModContent.BuffType(), 3600); + + if (flag64) + { + if (player.dead) + { + modPlayer.endoCooper = false; + } + if (modPlayer.endoCooper) + { + projectile.timeLeft = 2; + } + } + + //Spawn effects + if (projectile.localAI[0] == 0f) + { + projectile.Calamity().spawnedPlayerMinionDamageValue = player.minionDamage; + projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; + projectile.localAI[0] += 1f; + AttackMode = (int)projectile.ai[0]; + projectile.ai[0] = 0f; + + SpawnDust(); + } + + //Rotation + if (AttackMode == 3) + { + projectile.rotation += 0.02f; + } + else + { + float rotateratio = 0.007f; + float rotation = (Math.Abs(body.velocity.X) + Math.Abs(body.velocity.Y)) * rotateratio; + projectile.rotation += rotation * body.direction; + } + + //Damage Update + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + { + int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / + projectile.Calamity().spawnedPlayerMinionDamageValue * (player.allDamage + player.minionDamage - 1f)); + projectile.damage = damage2; + } + + //Keep the limbs in place + + if (body.type != ModContent.ProjectileType() || !body.active) + projectile.Kill(); + projectile.Center = body.Center; + + //"Destroy" limbs + if (projectile.ai[0] == 1f && AttackMode == 1) + { + projectile.alpha = 255; + SpawnShards(); + projectile.ai[0] = 2f; + projectile.netUpdate = true; + } + //Respawn limbs + if (projectile.ai[0] == 3f) + { + SpawnDust(); + projectile.alpha = 255; + projectile.ai[0] = 0f; + } + //Flames + if (projectile.ai[0] == 4f) + { + SpawnFlames(); + projectile.ai[0] = 0f; + } + + + } + + public override void Kill(int timeLeft) + { + SpawnDust(); + Main.PlaySound(SoundID.NPCHit5, projectile.Center); + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + if (projectile.ai[0] == 2f) + return false; + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + + public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) + { + if (projectile.ai[0] == 2f) + return; + Rectangle frame = new Rectangle(0, 0, Main.projectileTexture[projectile.type].Width, Main.projectileTexture[projectile.type].Height); + spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Projectiles/Summon/EndoCooperLimbs_Glow"), projectile.Center - Main.screenPosition, frame, Color.LightSkyBlue, projectile.rotation, projectile.Size / 2, 1f, SpriteEffects.None, 0f); + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 90); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 180); + } + + public override bool CanDamage() + { + return AttackMode == 2; + } + + private void SpawnShards() + { + SpawnDust(); + Main.PlaySound(SoundID.NPCHit5, projectile.Center); + if (AttackMode == 1) + { + for (int i = 0; i < 360; i += 60) + { + float dmgmult = 0.8f; + Vector2 pspeed1 = new Vector2(Main.rand.NextFloat(3f, 8f), Main.rand.NextFloat(3f, 8f)).RotatedBy(MathHelper.ToRadians(i + 20 + MathHelper.ToDegrees(projectile.rotation))); + Projectile.NewProjectile(projectile.Center, pspeed1, ModContent.ProjectileType(), (int)(projectile.damage * dmgmult), 1f, projectile.owner, 0f, 0f); + Vector2 pspeed2 = pspeed1.RotatedBy(MathHelper.ToRadians(Main.rand.Next(5, 13))) * Main.rand.NextFloat(0.6f, 1.3f); + Projectile.NewProjectile(projectile.Center, pspeed2, ModContent.ProjectileType(), (int)(projectile.damage * dmgmult), 1f, projectile.owner, 0f, 0f); + Vector2 pspeed3 = pspeed1.RotatedBy(MathHelper.ToRadians(Main.rand.Next(-12, -1))) * Main.rand.NextFloat(0.6f, 1.3f); + Projectile.NewProjectile(projectile.Center, pspeed3, ModContent.ProjectileType(), (int)(projectile.damage * dmgmult), 1f, projectile.owner, 0f, 0f); + } + } + } + + private void SpawnDust() + { + for (int i = 0; i < 50; i++) + { + int dusttype = Main.rand.NextBool(2) ? 68 : 67; + if (Main.rand.NextBool(4)) + { + dusttype = 80; + } + Vector2 dspeed = new Vector2(Main.rand.NextFloat(-7f, 7f), Main.rand.NextFloat(-7f, 7f)); + int dust = Dust.NewDust(projectile.Center, 1, 1, dusttype, dspeed.X, dspeed.Y, 50, default, 1.1f); + Main.dust[dust].noGravity = true; + } + } + + private void SpawnFlames() + { + Main.PlaySound(SoundID.Item34, projectile.Center); + + for (int i = 0; i < 360; i += 60) + { + float dmgmult = 0.9f; + Vector2 pspeed1 = new Vector2(0.9f, 0.9f).RotatedBy(MathHelper.ToRadians(i + 20 + MathHelper.ToDegrees(projectile.rotation))); + int flame = Projectile.NewProjectile(projectile.Center, pspeed1, ModContent.ProjectileType(), (int)(projectile.damage * dmgmult), 1f, projectile.owner, 0f, 0f); + } + } + } +} diff --git a/Projectiles/Summon/EndoCooperLimbs.png b/Projectiles/Summon/EndoCooperLimbs.png new file mode 100644 index 0000000000..840e833cd4 Binary files /dev/null and b/Projectiles/Summon/EndoCooperLimbs.png differ diff --git a/Projectiles/Summon/EndoCooperLimbs_Glow.png b/Projectiles/Summon/EndoCooperLimbs_Glow.png new file mode 100644 index 0000000000..54625be77c Binary files /dev/null and b/Projectiles/Summon/EndoCooperLimbs_Glow.png differ diff --git a/Projectiles/Summon/EndoFire.cs b/Projectiles/Summon/EndoFire.cs new file mode 100644 index 0000000000..028d833e4e --- /dev/null +++ b/Projectiles/Summon/EndoFire.cs @@ -0,0 +1,110 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Summon +{ + public class EndoFire : ModProjectile + { + public bool speedXChoice = false; + public bool speedYChoice = false; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Endo Fire"); + } + + public override void SetDefaults() + { + projectile.width = 22; + projectile.height = 22; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.minion = true; + projectile.minionSlots = 0f; + projectile.penetrate = -1; + projectile.extraUpdates = 10; + projectile.usesIDStaticNPCImmunity = true; + projectile.idStaticNPCHitCooldown = 5; + projectile.timeLeft = 300; + projectile.tileCollide = false; + } + + public override void AI() + { + float speedX = 1f; + float speedY = 1f; + if (!speedXChoice) + { + speedX = Main.rand.NextBool(2) ? 1.03f : 0.97f; + speedXChoice = true; + } + if (!speedYChoice) + { + speedY = Main.rand.NextBool(2) ? 1.03f : 0.97f; + speedYChoice = true; + } + projectile.velocity.X *= speedX; + projectile.velocity.X *= speedY; + if (projectile.ai[0] > 20f) + { + float num296 = 1f; + if (projectile.ai[0] == 21f) + { + num296 = 0.25f; + } + else if (projectile.ai[0] == 22f) + { + num296 = 0.5f; + } + else if (projectile.ai[0] == 23f) + { + num296 = 0.75f; + } + projectile.ai[0] += 1f; + int num297 = Main.rand.NextBool(2) ? 68 : 67; + if (Main.rand.NextBool(4)) + { + num297 = 80; + } + if (Main.rand.NextBool(2)) + { + + int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.2f, projectile.velocity.Y * 0.2f, 100, default, 0.8f); + Dust dust = Main.dust[num299]; + if (Main.rand.NextBool(3)) + { + dust.scale *= 1.5f; + dust.velocity.X *= 1.2f; + dust.velocity.Y *= 1.2f; + } + else + { + dust.scale *= 0.85f; + } + dust.noGravity = true; + dust.velocity.X *= 0.8f; + dust.velocity.Y *= 0.8f; + dust.scale *= num296; + dust.velocity += projectile.velocity; + dust.noLight = true; + + } + } + else + { + projectile.ai[0] += 1f; + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 90); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 180); + } + } +} diff --git a/Projectiles/Summon/EndoFire.png b/Projectiles/Summon/EndoFire.png new file mode 100644 index 0000000000..04c5646fde Binary files /dev/null and b/Projectiles/Summon/EndoFire.png differ diff --git a/Projectiles/Summon/EndoIceShard.cs b/Projectiles/Summon/EndoIceShard.cs new file mode 100644 index 0000000000..6e93c51bf6 --- /dev/null +++ b/Projectiles/Summon/EndoIceShard.cs @@ -0,0 +1,138 @@ +using CalamityMod.Buffs.StatDebuffs; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Summon +{ + public class EndoIceShard : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Endo Ice Shard"); + ProjectileID.Sets.TrailCacheLength[projectile.type] = 4; + ProjectileID.Sets.TrailingMode[projectile.type] = 0; + ProjectileID.Sets.MinionSacrificable[projectile.type] = true; + ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.friendly = true; + projectile.width = 14; + projectile.height = 14; + projectile.minion = true; + projectile.minionSlots = 0f; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.extraUpdates = 1; + projectile.alpha = 255; + projectile.timeLeft = 240; + } + + public override void AI() + { + projectile.rotation = projectile.velocity.ToRotation() + MathHelper.PiOver2; + Lighting.AddLight(projectile.Center, new Vector3(46, 203, 255) * (1.2f / 255)); + projectile.ai[0]++; + projectile.ai[1]++; + if (projectile.ai[0] >= 30f) + { + Vector2 dspeed = projectile.velocity * Main.rand.NextFloat(0.3f,0.6f); + int dust = Dust.NewDust(projectile.Center, 1, 1, 67, dspeed.X, dspeed.Y, 50, default, 1.2f); + Main.dust[dust].noGravity = true; + projectile.ai[0] = 0f; + } + + //Homing + if (projectile.ai[1] > 20f) + HomingAI(); + //Fade in + if (projectile.alpha > 0) + { + projectile.alpha -= 15; + } + if (projectile.alpha < 0) + { + projectile.alpha = 0; + } + } + + private void HomingAI() + { + Player player = Main.player[projectile.owner]; + int targetIdx = -1; + float maxHomingRange = 800f; + bool hasHomingTarget = false; + if (player.HasMinionAttackTargetNPC) + { + NPC npc = Main.npc[player.MinionAttackTargetNPC]; + if (npc.CanBeChasedBy(projectile, false)) + { + float dist = (projectile.Center - npc.Center).Length(); + if (dist < maxHomingRange) + { + targetIdx = player.MinionAttackTargetNPC; + maxHomingRange = dist; + hasHomingTarget = true; + } + } + } + else + { + for (int i = 0; i < Main.npc.Length; ++i) + { + NPC npc = Main.npc[i]; + if (npc == null || !npc.active) + continue; + + if (npc.CanBeChasedBy(projectile, false)) + { + float dist = (projectile.Center - npc.Center).Length(); + if (dist < maxHomingRange) + { + targetIdx = i; + maxHomingRange = dist; + hasHomingTarget = true; + } + } + } + } + + // Home in on said closest NPC. + if (hasHomingTarget) + { + NPC target = Main.npc[targetIdx]; + Vector2 homingVector = (target.Center - projectile.Center).SafeNormalize(Vector2.Zero) * 32f; + float homingRatio = 40f; + projectile.velocity = (projectile.velocity * homingRatio + homingVector) / (homingRatio + 1f); + } + } + + public override void Kill(int timeLeft) + { + Main.PlaySound(SoundID.Item27, projectile.position); + for (int i = 0; i < 10; i++) + { + Vector2 dspeed = new Vector2(Main.rand.NextFloat(-7f, 7f), Main.rand.NextFloat(-7f, 7f)); + int dust = Dust.NewDust(projectile.Center, 1, 1, 67, dspeed.X, dspeed.Y, 50, default, 1.2f); + Main.dust[dust].noGravity = true; + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1); + return false; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 90); + target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(BuffID.Frostburn, 180); + } + } +} diff --git a/Projectiles/Summon/EndoIceShard.png b/Projectiles/Summon/EndoIceShard.png new file mode 100644 index 0000000000..1483cc315b Binary files /dev/null and b/Projectiles/Summon/EndoIceShard.png differ diff --git a/Projectiles/Summon/FungalClumpMinion.cs b/Projectiles/Summon/FungalClumpMinion.cs index 70e05eb586..010c8a2f6d 100644 --- a/Projectiles/Summon/FungalClumpMinion.cs +++ b/Projectiles/Summon/FungalClumpMinion.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Summon } if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 36; for (int num227 = 0; num227 < num226; num227++) @@ -72,11 +72,11 @@ namespace CalamityMod.Projectiles.Summon } projectile.localAI[0] += 1f; } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } if (Main.rand.NextBool(16)) diff --git a/Projectiles/Summon/GhostlyMine.cs b/Projectiles/Summon/GhostlyMine.cs index 1d5ffef5b6..cc5fdea48d 100644 --- a/Projectiles/Summon/GhostlyMine.cs +++ b/Projectiles/Summon/GhostlyMine.cs @@ -31,24 +31,24 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + Player player = Main.player[projectile.owner]; if (start) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; Main.PlaySound(SoundID.Item20, projectile.position); projectile.ai[1] = projectile.ai[0]; start = false; } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } Vector2 direction = Main.player[projectile.owner].Center - projectile.Center; direction.Normalize(); - Player player = Main.player[projectile.owner]; double deg = (double)projectile.ai[1]; double rad = deg * (Math.PI / 180); double dist = 550; diff --git a/Projectiles/Summon/GigaFlareFriendly.cs b/Projectiles/Summon/GigaFlareFriendly.cs index 82431bb178..20368424ec 100644 --- a/Projectiles/Summon/GigaFlareFriendly.cs +++ b/Projectiles/Summon/GigaFlareFriendly.cs @@ -139,29 +139,22 @@ namespace CalamityMod.Projectiles.Summon scaleFactor10 = 1f; } int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13AB6_cp_0 = Main.gore[num626]; - expr_13AB6_cp_0.velocity.X += 1f; - Gore expr_13AD6_cp_0 = Main.gore[num626]; - expr_13AD6_cp_0.velocity.Y += 1f; + Gore gore = Main.gore[num626]; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13B79_cp_0 = Main.gore[num626]; - expr_13B79_cp_0.velocity.X -= 1f; - Gore expr_13B99_cp_0 = Main.gore[num626]; - expr_13B99_cp_0.velocity.Y += 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13C3C_cp_0 = Main.gore[num626]; - expr_13C3C_cp_0.velocity.X += 1f; - Gore expr_13C5C_cp_0 = Main.gore[num626]; - expr_13C5C_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y -= 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13CFF_cp_0 = Main.gore[num626]; - expr_13CFF_cp_0.velocity.X -= 1f; - Gore expr_13D1F_cp_0 = Main.gore[num626]; - expr_13D1F_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y -= 1f; } } diff --git a/Projectiles/Summon/GladiatorSword.cs b/Projectiles/Summon/GladiatorSword.cs index 8dd8da0058..55dfc9ba81 100644 --- a/Projectiles/Summon/GladiatorSword.cs +++ b/Projectiles/Summon/GladiatorSword.cs @@ -36,6 +36,19 @@ namespace CalamityMod.Projectiles.Summon bool flag64 = projectile.type == ModContent.ProjectileType(); Player player = Main.player[projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); + if (projectile.localAI[0] == 0f) + { + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; + projectile.localAI[0] += 1f; + } + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + { + int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / + projectile.Calamity().spawnedPlayerMinionDamageValue * + (player.allDamage + player.minionDamage - 1f)); + projectile.damage = damage2; + } if (!modPlayer.gladiatorSword) { projectile.active = false; diff --git a/Projectiles/Summon/GladiatorSword2.cs b/Projectiles/Summon/GladiatorSword2.cs index 635748b40d..96ec5c1231 100644 --- a/Projectiles/Summon/GladiatorSword2.cs +++ b/Projectiles/Summon/GladiatorSword2.cs @@ -36,6 +36,19 @@ namespace CalamityMod.Projectiles.Summon bool flag64 = projectile.type == ModContent.ProjectileType(); Player player = Main.player[projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); + if (projectile.localAI[0] == 0f) + { + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; + projectile.localAI[0] += 1f; + } + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + { + int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / + projectile.Calamity().spawnedPlayerMinionDamageValue * + (player.allDamage + player.minionDamage - 1f)); + projectile.damage = damage2; + } if (!modPlayer.gladiatorSword) { projectile.active = false; diff --git a/Projectiles/Summon/HermitCrabMinion.cs b/Projectiles/Summon/HermitCrabMinion.cs index 3b1a515799..173e5d5aed 100644 --- a/Projectiles/Summon/HermitCrabMinion.cs +++ b/Projectiles/Summon/HermitCrabMinion.cs @@ -43,9 +43,11 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); if (spawnDust) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num501 = 20; for (int num502 = 0; num502 < num501; num502++) @@ -56,16 +58,14 @@ namespace CalamityMod.Projectiles.Summon } spawnDust = false; } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } bool flag64 = projectile.type == ModContent.ProjectileType(); - Player player = Main.player[projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); player.AddBuff(ModContent.BuffType(), 3600); if (flag64) { diff --git a/Projectiles/Summon/HerringMinion.cs b/Projectiles/Summon/HerringMinion.cs index ca4bd8171a..8e5c9a284e 100644 --- a/Projectiles/Summon/HerringMinion.cs +++ b/Projectiles/Summon/HerringMinion.cs @@ -38,9 +38,11 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); if (dust > 0) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 36; for (int num227 = 0; num227 < num226; num227++) @@ -54,11 +56,11 @@ namespace CalamityMod.Projectiles.Summon } dust--; } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } if ((double)Math.Abs(projectile.velocity.X) > 0.2) @@ -81,8 +83,6 @@ namespace CalamityMod.Projectiles.Summon float num635 = 1200f; float num636 = 150f; bool flag64 = projectile.type == ModContent.ProjectileType(); - Player player = Main.player[projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); player.AddBuff(ModContent.BuffType(), 3600); if (flag64) { diff --git a/Projectiles/Summon/Hive.cs b/Projectiles/Summon/Hive.cs index c1f7fccf33..4df4872d23 100644 --- a/Projectiles/Summon/Hive.cs +++ b/Projectiles/Summon/Hive.cs @@ -25,17 +25,18 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + Player player = Main.player[projectile.owner]; if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; projectile.localAI[0] += 1f; } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } diff --git a/Projectiles/Summon/IceClasperMinion.cs b/Projectiles/Summon/IceClasperMinion.cs index 60686bd35f..49d682d0fe 100644 --- a/Projectiles/Summon/IceClasperMinion.cs +++ b/Projectiles/Summon/IceClasperMinion.cs @@ -39,9 +39,11 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); if (dust > 0) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 36; for (int num227 = 0; num227 < num226; num227++) @@ -55,11 +57,11 @@ namespace CalamityMod.Projectiles.Summon } dust--; } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } projectile.frameCounter++; @@ -78,8 +80,6 @@ namespace CalamityMod.Projectiles.Summon float num635 = 2200f; float num636 = 150f; bool flag64 = projectile.type == ModContent.ProjectileType(); - Player player = Main.player[projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); player.AddBuff(ModContent.BuffType(), 3600); if (flag64) { diff --git a/Projectiles/Summon/IceSentry.cs b/Projectiles/Summon/IceSentry.cs index a9b9bf231f..cf62376a6b 100644 --- a/Projectiles/Summon/IceSentry.cs +++ b/Projectiles/Summon/IceSentry.cs @@ -31,17 +31,18 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + Player player = Main.player[projectile.owner]; if (setDamage) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; setDamage = false; } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } diff --git a/Projectiles/Summon/LanternFlame.cs b/Projectiles/Summon/LanternFlame.cs new file mode 100644 index 0000000000..48ed31a2fb --- /dev/null +++ b/Projectiles/Summon/LanternFlame.cs @@ -0,0 +1,141 @@ +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Summon +{ + public class LanternFlame : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Flame"); + Main.projFrames[projectile.type] = 4; + } + + public override void SetDefaults() + { + projectile.width = 20; + projectile.height = 20; + projectile.friendly = true; + projectile.minion = true; + projectile.penetrate = 1; + projectile.timeLeft = 600; + projectile.alpha = 255; + projectile.tileCollide = false; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.5f / 255f, (255 - projectile.alpha) * 0f / 255f, (255 - projectile.alpha) * 0.65f / 255f); + projectile.frameCounter++; + if (projectile.frameCounter > 4) + { + projectile.frame++; + projectile.frameCounter = 0; + } + if (projectile.frame > 3) + { + projectile.frame = 0; + } + + if (projectile.alpha > 0) + { + projectile.alpha -= 10; + } + if (projectile.alpha <= 25) + { + float num472 = projectile.Center.X; + float num473 = projectile.Center.Y; + float num474 = 700f; + bool flag17 = false; + if (Main.player[projectile.owner].HasMinionAttackTargetNPC) + { + NPC npc = Main.npc[Main.player[projectile.owner].MinionAttackTargetNPC]; + if (npc.CanBeChasedBy(projectile, false)) + { + float num950 = npc.position.X + (float)(npc.width / 2); + float num951 = npc.position.Y + (float)(npc.height / 2); + float num952 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num950) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num951); + if (num952 < num474) + { + num474 = num952; + num472 = num950; + num473 = num951; + flag17 = true; + } + } + } + else + { + for (int num475 = 0; num475 < Main.npc.Length; num475++) + { + if (Main.npc[num475].CanBeChasedBy(projectile, false)) + { + 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 = 16f; + 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; + } + } + } + + public override void Kill(int timeLeft) + { + projectile.position = projectile.Center; + projectile.width = projectile.height = 48; + projectile.position.X = projectile.position.X - (float)(projectile.width / 2); + projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2); + projectile.maxPenetrate = -1; + projectile.penetrate = -1; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + projectile.Damage(); + Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 74); + for (int num621 = 0; num621 < 10; num621++) + { + int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 2f); + Main.dust[num622].velocity *= 3f; + if (Main.rand.NextBool(2)) + { + Main.dust[num622].scale = 0.5f; + Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; + } + } + for (int num623 = 0; num623 < 15; num623++) + { + int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 3f); + Main.dust[num624].noGravity = true; + Main.dust[num624].velocity *= 5f; + num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 100, default, 2f); + Main.dust[num624].velocity *= 2f; + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(BuffID.ShadowFlame, 180); + } + } +} diff --git a/Projectiles/Summon/LanternFlame.png b/Projectiles/Summon/LanternFlame.png new file mode 100644 index 0000000000..3009ead213 Binary files /dev/null and b/Projectiles/Summon/LanternFlame.png differ diff --git a/Projectiles/Summon/LanternSoul.cs b/Projectiles/Summon/LanternSoul.cs new file mode 100644 index 0000000000..5614f44c37 --- /dev/null +++ b/Projectiles/Summon/LanternSoul.cs @@ -0,0 +1,85 @@ +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Summon +{ + public class LanternSoul : ModProjectile + { + public float count = 0; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Lantern"); + } + + public override void SetDefaults() + { + projectile.width = 26; + projectile.height = 26; + projectile.ignoreWater = true; + projectile.tileCollide = false; + projectile.sentry = true; + projectile.timeLeft = Projectile.SentryLifeTime; + projectile.penetrate = -1; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.5f / 255f, (255 - projectile.alpha) * 0f / 255f, (255 - projectile.alpha) * 0.65f / 255f); + Player player = Main.player[projectile.owner]; + if (projectile.localAI[0] == 0f) + { + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; + projectile.localAI[0] += 1f; + } + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + { + int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / + projectile.Calamity().spawnedPlayerMinionDamageValue * + (player.allDamage + player.minionDamage - 1f)); + projectile.damage = damage2; + } + + projectile.velocity = new Vector2(0f, (float)Math.Sin((double)(6.28318548f * projectile.ai[0] / 300f)) * 0.5f); + projectile.ai[0] += 1f; + if (projectile.ai[0] >= 300f) + { + projectile.ai[0] = 0f; + projectile.netUpdate = true; + } + + int num = 0; + for (int i = 0; i < Main.projectile.Length; i++) + { + if (Main.projectile[i].active && Main.projectile[i].owner == Main.myPlayer && Main.projectile[i].type == ModContent.ProjectileType()) + { + num++; + } + } + if (num < 20) + { + projectile.ai[1] += (float)Main.rand.Next(2,6) + 1f; + if (projectile.ai[1] >= 75f) + { + projectile.ai[1] = 0f; + projectile.netUpdate = true; + if (projectile.owner == Main.myPlayer) + { + float startOffsetX = Main.rand.NextFloat(15f, 200f) * (Main.rand.NextBool() ? -1f : 1f); + float startOffsetY = Main.rand.NextFloat(15f, 200f) * (Main.rand.NextBool() ? -1f : 1f); + Vector2 startPos = new Vector2(projectile.position.X + startOffsetX, projectile.position.Y + startOffsetY); + Vector2 speed = new Vector2(0f, 0f); + Projectile.NewProjectile(startPos, speed, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f); + } + } + } + } + + public override bool CanDamage() + { + return false; + } + } +} diff --git a/Projectiles/Summon/LanternSoul.png b/Projectiles/Summon/LanternSoul.png new file mode 100644 index 0000000000..335f855c50 Binary files /dev/null and b/Projectiles/Summon/LanternSoul.png differ diff --git a/Projectiles/Summon/LuxorsGiftSummon.cs b/Projectiles/Summon/LuxorsGiftSummon.cs index 726e6e3f2a..f862f5a4f6 100644 --- a/Projectiles/Summon/LuxorsGiftSummon.cs +++ b/Projectiles/Summon/LuxorsGiftSummon.cs @@ -39,9 +39,11 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); if (dust > 0) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 36; for (int num227 = 0; num227 < num226; num227++) @@ -55,11 +57,11 @@ namespace CalamityMod.Projectiles.Summon } dust--; } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } if (projectile.localAI[0] == 0f) @@ -87,8 +89,6 @@ namespace CalamityMod.Projectiles.Summon float num635 = 2200f; float num636 = 150f; bool flag64 = projectile.type == ModContent.ProjectileType(); - Player player = Main.player[projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); if (flag64) { if (!modPlayer.luxorsGift || player.dead) diff --git a/Projectiles/Summon/MiniGuardianAttack.cs b/Projectiles/Summon/MiniGuardianAttack.cs index 6989e25951..55282fa852 100644 --- a/Projectiles/Summon/MiniGuardianAttack.cs +++ b/Projectiles/Summon/MiniGuardianAttack.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Projectiles.Summon projectile.timeLeft = 2; } if (!modPlayer.pArtifact || (!modPlayer.tarraSummon && !modPlayer.bloodflareSummon && - !modPlayer.godSlayerSummon && !modPlayer.silvaSummon && !modPlayer.dsSetBonus && !modPlayer.omegaBlueSet)) + !modPlayer.godSlayerSummon && !modPlayer.silvaSummon && !modPlayer.dsSetBonus && !modPlayer.omegaBlueSet && !modPlayer.fearmongerSet)) { projectile.active = false; return; diff --git a/Projectiles/Summon/MiniSandShark.cs b/Projectiles/Summon/MiniSandShark.cs index c2a7f2485e..c89d8d9cfb 100644 --- a/Projectiles/Summon/MiniSandShark.cs +++ b/Projectiles/Summon/MiniSandShark.cs @@ -73,6 +73,7 @@ namespace CalamityMod.Projectiles.Summon projectile.penetrate = -1; projectile.usesLocalNPCImmunity = true; projectile.localNPCHitCooldown = 10; + projectile.damage /= 2; projectile.Damage(); Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14); int num226 = 36; diff --git a/Projectiles/Summon/PhantomGuy.cs b/Projectiles/Summon/PhantomGuy.cs index 3a42517e19..3854420a48 100644 --- a/Projectiles/Summon/PhantomGuy.cs +++ b/Projectiles/Summon/PhantomGuy.cs @@ -34,9 +34,11 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 36; for (int num227 = 0; num227 < num226; num227++) @@ -50,20 +52,14 @@ namespace CalamityMod.Projectiles.Summon } projectile.localAI[0] += 1f; } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } - float num633 = 700f; - float num634 = 1300f; - float num635 = 2600f; - float num636 = 600f; bool flag64 = projectile.type == ModContent.ProjectileType(); - Player player = Main.player[projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); player.AddBuff(ModContent.BuffType(), 3600); if (flag64) { @@ -100,6 +96,10 @@ namespace CalamityMod.Projectiles.Summon } } } + float num633 = 700f; + float num634 = 1300f; + float num635 = 2600f; + float num636 = 600f; Vector2 vector46 = projectile.position; bool flag25 = false; if (player.HasMinionAttackTargetNPC) diff --git a/Projectiles/Summon/PinkButterfly.cs b/Projectiles/Summon/PinkButterfly.cs index 89704cbe82..ef097a87b5 100644 --- a/Projectiles/Summon/PinkButterfly.cs +++ b/Projectiles/Summon/PinkButterfly.cs @@ -35,9 +35,11 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 36; for (int num227 = 0; num227 < num226; num227++) @@ -50,11 +52,11 @@ namespace CalamityMod.Projectiles.Summon } projectile.localAI[0] += 1f; } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } if ((double)Math.Abs(projectile.velocity.X) > 0.2) @@ -78,8 +80,6 @@ namespace CalamityMod.Projectiles.Summon float num635 = 2400f; float num636 = 150f; bool flag64 = projectile.type == ModContent.ProjectileType(); - Player player = Main.player[projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); player.AddBuff(ModContent.BuffType(), 3600); if (flag64) { diff --git a/Projectiles/Summon/PlantSummon.cs b/Projectiles/Summon/PlantSummon.cs index f76c8f79de..c99c46bf6c 100644 --- a/Projectiles/Summon/PlantSummon.cs +++ b/Projectiles/Summon/PlantSummon.cs @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Summon if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = player.minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 36; for (int num227 = 0; num227 < num226; num227++) @@ -93,11 +93,11 @@ namespace CalamityMod.Projectiles.Summon } projectile.localAI[0] += 1f; } - if (player.minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - player.minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } @@ -469,5 +469,10 @@ namespace CalamityMod.Projectiles.Summon { target.AddBuff(BuffID.Poisoned, 300); } + + public override bool CanDamage() + { + return enraged == true; + } } } diff --git a/Projectiles/Summon/ProfanedEnergy.cs b/Projectiles/Summon/ProfanedEnergy.cs index 4a06b0e5fe..84b56e475d 100644 --- a/Projectiles/Summon/ProfanedEnergy.cs +++ b/Projectiles/Summon/ProfanedEnergy.cs @@ -30,6 +30,7 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + Player player = Main.player[projectile.owner]; projectile.frameCounter++; if (projectile.frameCounter > 6) { @@ -42,7 +43,7 @@ namespace CalamityMod.Projectiles.Summon } if (count == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20); for (int num621 = 0; num621 < 5; num621++) @@ -65,11 +66,11 @@ namespace CalamityMod.Projectiles.Summon } count += 1f; } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } if (projectile.owner == Main.myPlayer) diff --git a/Projectiles/Summon/PurpleButterfly.cs b/Projectiles/Summon/PurpleButterfly.cs index 3734f311e2..3f6190db3e 100644 --- a/Projectiles/Summon/PurpleButterfly.cs +++ b/Projectiles/Summon/PurpleButterfly.cs @@ -37,9 +37,11 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); if (dust > 0) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 36; for (int num227 = 0; num227 < num226; num227++) @@ -52,11 +54,11 @@ namespace CalamityMod.Projectiles.Summon } dust--; } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } if ((double)Math.Abs(projectile.velocity.X) > 0.2) @@ -80,8 +82,6 @@ namespace CalamityMod.Projectiles.Summon float num635 = 1600f; float num636 = 150f; bool flag64 = projectile.type == ModContent.ProjectileType(); - Player player = Main.player[projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); player.AddBuff(ModContent.BuffType(), 3600); if (flag64) { diff --git a/Projectiles/Summon/ReaverOrb.cs b/Projectiles/Summon/ReaverOrb.cs index e627c18ef4..4af1757d4b 100644 --- a/Projectiles/Summon/ReaverOrb.cs +++ b/Projectiles/Summon/ReaverOrb.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Summon dust--; if (dust >= 0) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num501 = 50; for (int num502 = 0; num502 < num501; num502++) @@ -67,11 +67,11 @@ namespace CalamityMod.Projectiles.Summon Main.dust[num503].scale *= 1.15f; } } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0f / 255f, (255 - projectile.alpha) * 1f / 255f, (255 - projectile.alpha) * 0f / 255f); diff --git a/Projectiles/Summon/RotomBeam.cs b/Projectiles/Summon/RotomBeam.cs new file mode 100644 index 0000000000..efdd64b4de --- /dev/null +++ b/Projectiles/Summon/RotomBeam.cs @@ -0,0 +1,56 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Summon +{ + public class RotomBeam : ModProjectile + { + private int counter = 0; + + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Beam"); + } + + public override void SetDefaults() + { + projectile.width = 4; + projectile.height = 4; + projectile.friendly = true; + projectile.minion = true; + projectile.minionSlots = 0f; + projectile.penetrate = 1; + projectile.extraUpdates = 100; + projectile.timeLeft = 200; + } + + public override void AI() + { + if (counter > 3) + { + for (int num447 = 0; num447 < 4; num447++) + { + Vector2 vector33 = projectile.position; + vector33 -= projectile.velocity * ((float)num447 * 0.25f); + projectile.alpha = 255; + int num448 = Dust.NewDust(vector33, 1, 1, 132, 0f, 0f, 0, default, 1f); + Main.dust[num448].position = vector33; + Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f; + Main.dust[num448].velocity *= 0.2f; + Main.dust[num448].noGravity = true; + } + } + else + counter++; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + if (Main.rand.NextBool(3)) + { + target.AddBuff(BuffID.Electrified, 60); + } + } + } +} diff --git a/Projectiles/Summon/RotomBeam.png b/Projectiles/Summon/RotomBeam.png new file mode 100644 index 0000000000..15e8775737 Binary files /dev/null and b/Projectiles/Summon/RotomBeam.png differ diff --git a/Projectiles/Summon/SandElementalHealer.cs b/Projectiles/Summon/SandElementalHealer.cs index 13883e164a..3758c8334f 100644 --- a/Projectiles/Summon/SandElementalHealer.cs +++ b/Projectiles/Summon/SandElementalHealer.cs @@ -66,7 +66,7 @@ namespace CalamityMod.Projectiles.Summon dust--; if (dust >= 0) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num501 = 50; for (int num502 = 0; num502 < num501; num502++) @@ -76,11 +76,11 @@ namespace CalamityMod.Projectiles.Summon Main.dust[num503].scale *= 1.15f; } } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } projectile.frameCounter++; diff --git a/Projectiles/Summon/SandElementalMinion.cs b/Projectiles/Summon/SandElementalMinion.cs index 8b6f14977d..8addf7b032 100644 --- a/Projectiles/Summon/SandElementalMinion.cs +++ b/Projectiles/Summon/SandElementalMinion.cs @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Summon dust--; if (dust >= 0) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num501 = 50; for (int num502 = 0; num502 < num501; num502++) @@ -75,11 +75,11 @@ namespace CalamityMod.Projectiles.Summon Main.dust[num503].scale *= 1.15f; } } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } if ((double)Math.Abs(projectile.velocity.X) > 0.2) diff --git a/Projectiles/Summon/SandnadoMinion.cs b/Projectiles/Summon/SandnadoMinion.cs index 3dbe764321..2928fa39f7 100644 --- a/Projectiles/Summon/SandnadoMinion.cs +++ b/Projectiles/Summon/SandnadoMinion.cs @@ -38,9 +38,11 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); if (projectile.localAI[1] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 36; for (int num227 = 0; num227 < num226; num227++) @@ -55,16 +57,14 @@ namespace CalamityMod.Projectiles.Summon } projectile.localAI[1] += 1f; } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } bool flag64 = projectile.type == ModContent.ProjectileType(); - Player player = Main.player[projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); player.AddBuff(ModContent.BuffType(), 3600); if (flag64) { diff --git a/Projectiles/Summon/Shellfish.cs b/Projectiles/Summon/Shellfish.cs index ee3ba65681..922b667f11 100644 --- a/Projectiles/Summon/Shellfish.cs +++ b/Projectiles/Summon/Shellfish.cs @@ -44,9 +44,11 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); if (spawnDust) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num501 = 20; for (int num502 = 0; num502 < num501; num502++) @@ -58,8 +60,6 @@ namespace CalamityMod.Projectiles.Summon spawnDust = false; } bool flag64 = projectile.type == ModContent.ProjectileType(); - Player player = Main.player[projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); player.AddBuff(ModContent.BuffType(), 3600); if (flag64) { @@ -85,11 +85,11 @@ namespace CalamityMod.Projectiles.Summon if (projectile.ai[0] == 0f) { projectile.damage = 70; - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } float[] var0 = projectile.ai; diff --git a/Projectiles/Summon/SilvaCrystal.cs b/Projectiles/Summon/SilvaCrystal.cs index c191e3be0e..24ca27a1b5 100644 --- a/Projectiles/Summon/SilvaCrystal.cs +++ b/Projectiles/Summon/SilvaCrystal.cs @@ -35,22 +35,22 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); if (projectile.localAI[1] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; projectile.localAI[1] += 1f; } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } bool flag64 = projectile.type == ModContent.ProjectileType(); - Player player = Main.player[projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); if (!modPlayer.silvaSummon) { projectile.active = false; @@ -100,20 +100,14 @@ namespace CalamityMod.Projectiles.Summon dust34.position = projectile.Center + Vector2.UnitY.RotatedByRandom(6.2831854820251465) * (4f * Main.rand.NextFloat() + 26f); dust34.scale = 0.5f; } - float[] var_2_31123_cp_0 = projectile.localAI; - int var_2_31123_cp_1 = 0; - float num73 = var_2_31123_cp_0[var_2_31123_cp_1]; - var_2_31123_cp_0[var_2_31123_cp_1] = num73 + 1f; + projectile.localAI[0] += 1f; if (projectile.localAI[0] >= 60f) { projectile.localAI[0] = 0f; } if (projectile.ai[0] < 0f) { - float[] var_2_31169_cp_0 = projectile.ai; - int var_2_31169_cp_1 = 0; - float num730 = var_2_31169_cp_0[var_2_31169_cp_1]; - var_2_31169_cp_0[var_2_31169_cp_1] = num730 + 1f; + projectile.ai[0] += 1f; } if (projectile.ai[0] == 0f) { @@ -168,10 +162,7 @@ namespace CalamityMod.Projectiles.Summon projectile.netUpdate = true; return; } - float[] var_2_31390_cp_0 = projectile.ai; - int var_2_31390_cp_1 = 0; - float num731 = var_2_31390_cp_0[var_2_31390_cp_1]; - var_2_31390_cp_0[var_2_31390_cp_1] = num731 + 1f; + projectile.ai[0] += 1f; if (projectile.ai[0] >= 5f) { Vector2 vector154 = projectile.DirectionTo(Main.npc[num1079].Center); diff --git a/Projectiles/Summon/SilvaCrystalExplosion.cs b/Projectiles/Summon/SilvaCrystalExplosion.cs index 75f99ddff2..b75e8a408f 100644 --- a/Projectiles/Summon/SilvaCrystalExplosion.cs +++ b/Projectiles/Summon/SilvaCrystalExplosion.cs @@ -20,6 +20,7 @@ namespace CalamityMod.Projectiles.Summon projectile.tileCollide = false; projectile.ignoreWater = true; projectile.timeLeft = 900; + projectile.minion = true; } public override void AI() diff --git a/Projectiles/Summon/SiriusBeam.cs b/Projectiles/Summon/SiriusBeam.cs new file mode 100644 index 0000000000..277dde9f12 --- /dev/null +++ b/Projectiles/Summon/SiriusBeam.cs @@ -0,0 +1,55 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; +using CalamityMod.Buffs.DamageOverTime; + +namespace CalamityMod.Projectiles.Summon +{ + public class SiriusBeam : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Beam"); + } + + public override void SetDefaults() + { + projectile.width = 4; + projectile.height = 4; + projectile.friendly = true; + projectile.minion = true; + projectile.minionSlots = 0f; + projectile.extraUpdates = 100; + projectile.timeLeft = 1000; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + projectile.tileCollide = false; + } + + public override void AI() + { + projectile.localAI[0] += 1f; + if (projectile.localAI[0] > 9f) + { + for (int num447 = 0; num447 < 4; num447++) + { + Vector2 vector33 = projectile.position; + vector33 -= projectile.velocity * ((float)num447 * 0.25f); + projectile.alpha = 255; + int num448 = Dust.NewDust(vector33, 1, 1, 20, 0f, 0f, 0, default, 1f); + Main.dust[num448].position = vector33; + Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f; + Main.dust[num448].velocity *= 0.2f; + Main.dust[num448].noGravity = true; + } + } + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 300); + float x4 = Main.rgbToHsl(new Color(103, 203, Main.DiscoB)).X; + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), projectile.damage, projectile.knockBack, projectile.owner, x4, (float)projectile.whoAmI); + } + } +} diff --git a/Projectiles/Summon/SiriusBeam.png b/Projectiles/Summon/SiriusBeam.png new file mode 100644 index 0000000000..15e8775737 Binary files /dev/null and b/Projectiles/Summon/SiriusBeam.png differ diff --git a/Projectiles/Summon/SiriusExplosion.cs b/Projectiles/Summon/SiriusExplosion.cs new file mode 100644 index 0000000000..53ade646db --- /dev/null +++ b/Projectiles/Summon/SiriusExplosion.cs @@ -0,0 +1,237 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; +using CalamityMod.Buffs.DamageOverTime; +namespace CalamityMod.Projectiles.Summon +{ + public class SiriusExplosion : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Explosion"); + } + + public override void SetDefaults() + { + projectile.width = 14; + projectile.height = 14; + projectile.alpha = 255; + projectile.penetrate = 1; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.timeLeft = 900; + projectile.minion = true; + } + + public override void AI() + { + Color newColor2 = Main.hslToRgb(0.5f, 1f, projectile.ai[0]); + int num978 = (int)projectile.ai[1]; + if (num978 < 0 || num978 >= 1000 || (!Main.projectile[num978].active && Main.projectile[num978].type != ModContent.ProjectileType())) + { + projectile.ai[1] = -1f; + } + else + { + DelegateMethods.v3_1 = newColor2.ToVector3() * 0.5f; + Utils.PlotTileLine(projectile.Center, Main.projectile[num978].Center, 8f, new Utils.PerLinePoint(DelegateMethods.CastLight)); + } + if (projectile.localAI[0] == 0f) + { + projectile.localAI[0] = Main.rand.NextFloat() * 0.8f + 0.8f; + projectile.direction = (Main.rand.Next(2) > 0) ? 1 : -1; + } + projectile.rotation = projectile.localAI[1] / 40f * 6.28318548f * (float)projectile.direction; + if (projectile.alpha > 0) + { + projectile.alpha -= 8; + } + if (projectile.alpha < 0) + { + projectile.alpha = 0; + } + if (projectile.alpha == 0) + { + Lighting.AddLight(projectile.Center, newColor2.ToVector3() * 0.5f); + } + int num3; + for (int num979 = 0; num979 < 2; num979 = num3 + 1) + { + if (Main.rand.NextBool(10)) + { + Vector2 value55 = Vector2.UnitY.RotatedBy((double)((float)num979 * 3.14159274f), default).RotatedBy((double)projectile.rotation, default); + Dust dust24 = Main.dust[Dust.NewDust(projectile.Center, 0, 0, 267, 0f, 0f, 225, newColor2, 1.5f)]; + dust24.noGravity = true; + dust24.noLight = true; + dust24.scale = projectile.Opacity * projectile.localAI[0]; + dust24.position = projectile.Center; + dust24.velocity = value55 * 2.5f; + } + num3 = num979; + } + for (int num980 = 0; num980 < 2; num980 = num3 + 1) + { + if (Main.rand.NextBool(10)) + { + Vector2 value56 = Vector2.UnitY.RotatedBy((double)((float)num980 * 3.14159274f), default); + Dust dust25 = Main.dust[Dust.NewDust(projectile.Center, 0, 0, 267, 0f, 0f, 225, newColor2, 1.5f)]; + dust25.noGravity = true; + dust25.noLight = true; + dust25.scale = projectile.Opacity * projectile.localAI[0]; + dust25.position = projectile.Center; + dust25.velocity = value56 * 2.5f; + } + num3 = num980; + } + if (Main.rand.NextBool(10)) + { + float scaleFactor13 = 1f + Main.rand.NextFloat() * 2f; + float fadeIn = 1f + Main.rand.NextFloat(); + float num981 = 1f + Main.rand.NextFloat(); + Vector2 vector136 = Utils.RandomVector2(Main.rand, -1f, 1f); + if (vector136 != Vector2.Zero) + { + vector136.Normalize(); + } + vector136 *= 20f + Main.rand.NextFloat() * 100f; + Vector2 vector137 = projectile.Center + vector136; + Point point3 = vector137.ToTileCoordinates(); + bool flag52 = true; + if (!WorldGen.InWorld(point3.X, point3.Y, 0)) + { + flag52 = false; + } + if (flag52 && WorldGen.SolidTile(point3.X, point3.Y)) + { + flag52 = false; + } + if (flag52) + { + Dust dust26 = Main.dust[Dust.NewDust(vector137, 0, 0, 267, 0f, 0f, 127, newColor2, 1f)]; + dust26.noGravity = true; + dust26.position = vector137; + dust26.velocity = -Vector2.UnitY * scaleFactor13 * (Main.rand.NextFloat() * 0.9f + 1.6f); + dust26.fadeIn = fadeIn; + dust26.scale = num981; + dust26.noLight = true; + Dust dust27 = Dust.CloneDust(dust26); + Dust dust = dust27; + dust.scale *= 0.65f; + dust = dust27; + dust.fadeIn *= 0.65f; + dust27.color = new Color(255, 255, 255, 255); + } + } + projectile.scale = projectile.Opacity / 2f * projectile.localAI[0]; + projectile.velocity = Vector2.Zero; + projectile.localAI[1] += 1f; + if (projectile.localAI[1] >= 60f) + { + projectile.Kill(); + return; + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + Color color25 = Lighting.GetColor((int)((double)projectile.position.X + (double)projectile.width * 0.5) / 16, (int)(((double)projectile.position.Y + (double)projectile.height * 0.5) / 16.0)); + Vector2 vector59 = projectile.position + new Vector2((float)projectile.width, (float)projectile.height) / 2f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition; + Texture2D texture2D34 = Main.projectileTexture[projectile.type]; + Rectangle rectangle17 = texture2D34.Frame(1, Main.projFrames[projectile.type], 0, projectile.frame); + Color alpha5 = projectile.GetAlpha(color25); + Vector2 origin11 = rectangle17.Size() / 2f; + Color color60 = Main.hslToRgb(0.5f, 1f, projectile.ai[0]).MultiplyRGBA(new Color(255, 255, 255, 0)); + Main.spriteBatch.Draw(texture2D34, vector59, new Microsoft.Xna.Framework.Rectangle?(rectangle17), color60, projectile.rotation, origin11, projectile.scale * 2f, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(texture2D34, vector59, new Microsoft.Xna.Framework.Rectangle?(rectangle17), color60, 0f, origin11, projectile.scale * 2f, SpriteEffects.None, 0f); + if (projectile.ai[1] != -1f && projectile.Opacity > 0.3f) + { + Vector2 vector61 = Main.projectile[(int)projectile.ai[1]].Center - projectile.Center; + Vector2 vector62 = new Vector2(1f, vector61.Length() / (float)texture2D34.Height); + float rotation27 = vector61.ToRotation() + 1.57079637f; + float num279 = MathHelper.Distance(30f, projectile.localAI[1]) / 20f; + num279 = MathHelper.Clamp(num279, 0f, 1f); + if (num279 > 0f) + { + Main.spriteBatch.Draw(texture2D34, vector59 + vector61 / 2f, new Microsoft.Xna.Framework.Rectangle?(rectangle17), color60 * num279, rotation27, origin11, vector62, SpriteEffects.None, 0f); + Main.spriteBatch.Draw(texture2D34, vector59 + vector61 / 2f, new Microsoft.Xna.Framework.Rectangle?(rectangle17), alpha5 * num279, rotation27, origin11, vector62 / 2f, SpriteEffects.None, 0f); + } + } + return false; + } + + public override void Kill(int timeLeft) + { + Vector2 spinningpoint = new Vector2(0f, -3f).RotatedByRandom(3.1415927410125732); + float num69 = (float)Main.rand.Next(7, 13); + Vector2 value5 = new Vector2(2.1f, 2f); + Color newColor = Main.hslToRgb(0.5f, 1f, projectile.ai[0]); + newColor.A = 255; + float num72; + for (float num70 = 0f; num70 < num69; num70 = num72 + 1f) + { + int num71 = Dust.NewDust(projectile.Center, 0, 0, 267, 0f, 0f, 0, newColor, 1f); + Main.dust[num71].position = projectile.Center; + Main.dust[num71].velocity = spinningpoint.RotatedBy((double)(6.28318548f * num70 / num69), default) * value5 * (0.8f + Main.rand.NextFloat() * 0.4f); + Main.dust[num71].noGravity = true; + Main.dust[num71].scale = 2f; + Main.dust[num71].fadeIn = Main.rand.NextFloat() * 2f; + Dust dust11 = Dust.CloneDust(num71); + Dust dust = dust11; + dust.scale /= 2f; + dust = dust11; + dust.fadeIn /= 2f; + dust11.color = new Color(255, 255, 255, 255); + num72 = num70; + } + for (float num73 = 0f; num73 < num69; num73 = num72 + 1f) + { + int num74 = Dust.NewDust(projectile.Center, 0, 0, 267, 0f, 0f, 0, newColor, 1f); + Main.dust[num74].position = projectile.Center; + Main.dust[num74].velocity = spinningpoint.RotatedBy((double)(6.28318548f * num73 / num69), default) * value5 * (0.8f + Main.rand.NextFloat() * 0.4f); + Dust dust = Main.dust[num74]; + dust.velocity *= Main.rand.NextFloat() * 0.8f; + Main.dust[num74].noGravity = true; + Main.dust[num74].scale = Main.rand.NextFloat() * 1f; + Main.dust[num74].fadeIn = Main.rand.NextFloat() * 2f; + Dust dust12 = Dust.CloneDust(num74); + dust = dust12; + dust.scale /= 2f; + dust = dust12; + dust.fadeIn /= 2f; + dust12.color = new Color(255, 255, 255, 255); + num72 = num73; + } + if (Main.myPlayer == projectile.owner) + { + projectile.friendly = true; + int width = projectile.width; + int height2 = projectile.height; + int num75 = projectile.penetrate; + projectile.position = projectile.Center; + projectile.width = projectile.height = 60; + projectile.Center = projectile.position; + projectile.penetrate = -1; + projectile.maxPenetrate = -1; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + projectile.Damage(); + projectile.penetrate = num75; + projectile.position = projectile.Center; + projectile.width = width; + projectile.height = height2; + projectile.Center = projectile.position; + } + } + + public override Color? GetAlpha(Color lightColor) + { + return new Color(255 - projectile.alpha, 255 - projectile.alpha, 255 - projectile.alpha, 0); + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 120); + } + } +} diff --git a/Projectiles/Summon/SiriusExplosion.png b/Projectiles/Summon/SiriusExplosion.png new file mode 100644 index 0000000000..0968156e79 Binary files /dev/null and b/Projectiles/Summon/SiriusExplosion.png differ diff --git a/Projectiles/Summon/SiriusMinion.cs b/Projectiles/Summon/SiriusMinion.cs new file mode 100644 index 0000000000..1a16aec682 --- /dev/null +++ b/Projectiles/Summon/SiriusMinion.cs @@ -0,0 +1,163 @@ +using CalamityMod.Buffs.Summon; +using CalamityMod.CalPlayer; +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Projectiles.Summon +{ + public class SiriusMinion : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sirius"); + ProjectileID.Sets.MinionSacrificable[projectile.type] = true; + ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true; + } + + public override void SetDefaults() + { + projectile.width = 38; + projectile.height = 50; + projectile.netImportant = true; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.minionSlots = 1f; + projectile.timeLeft = 18000; + projectile.penetrate = -1; + projectile.tileCollide = false; + projectile.timeLeft *= 5; + projectile.minion = true; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, 1f, 0.5f, 5f); + bool flag64 = projectile.type == ModContent.ProjectileType(); + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); + player.AddBuff(ModContent.BuffType(), 3600); + if (flag64) + { + if (player.dead) + { + modPlayer.sirius = false; + } + if (modPlayer.sirius) + { + projectile.timeLeft = 2; + } + } + projectile.minionSlots = projectile.ai[0]; + projectile.position.X = player.Center.X - (float)(projectile.width / 2); + projectile.position.Y = player.Center.Y - (float)(projectile.height / 2) + player.gfxOffY - 60f; + if (player.gravDir == -1f) + { + projectile.position.Y = projectile.position.Y + 150f; + projectile.rotation = 3.14f; + } + else + { + projectile.rotation = 0f; + } + projectile.position.X = (float)(int)projectile.position.X; + projectile.position.Y = (float)(int)projectile.position.Y; + float num395 = (float)Main.mouseTextColor / 200f - 0.35f; + num395 *= 0.2f; + projectile.scale = num395 + 0.95f; + if (projectile.localAI[0] == 0f) + { + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); + projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; + int num501 = 50; + for (int num502 = 0; num502 < num501; num502++) + { + int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 20, 0f, 0f, 0, default, 1f); + Main.dust[num503].velocity *= 2f; + Main.dust[num503].scale *= 1.15f; + } + projectile.localAI[0] += 1f; + } + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) + { + int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / + projectile.Calamity().spawnedPlayerMinionDamageValue * + (player.allDamage + player.minionDamage - 1f)); + projectile.damage = damage2; + } + if (projectile.owner == Main.myPlayer) + { + if (projectile.ai[1] != 0f) + { + projectile.ai[1] -= 1f; + return; + } + float num396 = projectile.position.X; + float num397 = projectile.position.Y; + float minDistance = 7000f; + bool flag11 = false; + if (player.HasMinionAttackTargetNPC) + { + NPC npc = Main.npc[player.MinionAttackTargetNPC]; + if (npc.CanBeChasedBy(projectile, false)) + { + float num539 = npc.position.X + (float)(npc.width / 2); + float num540 = npc.position.Y + (float)(npc.height / 2); + float num541 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num539) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num540); + if (num541 < minDistance) + { + num396 = num539; + num397 = num540; + flag11 = true; + } + } + } + else + { + for (int num399 = 0; num399 < Main.npc.Length; num399++) + { + if (Main.npc[num399].CanBeChasedBy(projectile, true)) + { + float num400 = Main.npc[num399].position.X + (float)(Main.npc[num399].width / 2); + float num401 = Main.npc[num399].position.Y + (float)(Main.npc[num399].height / 2); + float num402 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num400) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num401); + if (num402 < minDistance) + { + minDistance = num402; + num396 = num400; + num397 = num401; + flag11 = true; + } + } + } + } + if (flag11) + { + float num403 = 35f; + Vector2 vector29 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f); + float num404 = num396 - vector29.X; + float num405 = num397 - vector29.Y; + float num406 = (float)Math.Sqrt((double)(num404 * num404 + num405 * num405)); + num406 = num403 / num406; + num404 *= num406; + num405 *= num406; + float damageMult = ((float)Math.Log(projectile.ai[0], MathHelper.E)) + 1f; + int beam = Projectile.NewProjectile(projectile.Center.X - 4f, projectile.Center.Y, num404, num405, ModContent.ProjectileType(), (int)(projectile.damage * damageMult), projectile.knockBack, projectile.owner); + Main.projectile[beam].penetrate = (int)projectile.ai[0]; + projectile.ai[1] = 30f; + } + } + } + + public override Color? GetAlpha(Color lightColor) + { + return new Color(200, 200, 200, 200); + } + + public override bool CanDamage() + { + return false; + } + } +} diff --git a/Projectiles/Summon/SiriusMinion.png b/Projectiles/Summon/SiriusMinion.png new file mode 100644 index 0000000000..a2b6f1bc7d Binary files /dev/null and b/Projectiles/Summon/SiriusMinion.png differ diff --git a/Projectiles/Summon/SolarGod.cs b/Projectiles/Summon/SolarGod.cs index bec599a9f0..f309a8d32d 100644 --- a/Projectiles/Summon/SolarGod.cs +++ b/Projectiles/Summon/SolarGod.cs @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Summon projectile.scale = num395 + 0.95f; if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num501 = 50; for (int num502 = 0; num502 < num501; num502++) @@ -78,11 +78,11 @@ namespace CalamityMod.Projectiles.Summon } projectile.localAI[0] += 1f; } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } if (projectile.owner == Main.myPlayer) diff --git a/Projectiles/Summon/SolarPixie.cs b/Projectiles/Summon/SolarPixie.cs index 0a20e4e057..75c9101fe4 100644 --- a/Projectiles/Summon/SolarPixie.cs +++ b/Projectiles/Summon/SolarPixie.cs @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Summon projectile.scale = num395 + 0.95f; if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num501 = 25; for (int num502 = 0; num502 < num501; num502++) @@ -78,11 +78,11 @@ namespace CalamityMod.Projectiles.Summon } projectile.localAI[0] += 1f; } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } if (projectile.owner == Main.myPlayer) diff --git a/Projectiles/Summon/SonOfYharon.cs b/Projectiles/Summon/SonOfYharon.cs index d8e938c9a6..9b4a72694c 100644 --- a/Projectiles/Summon/SonOfYharon.cs +++ b/Projectiles/Summon/SonOfYharon.cs @@ -38,9 +38,11 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + Player player = Main.player[projectile.owner]; + CalamityPlayer modPlayer = player.Calamity(); if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num501 = 100; for (int num502 = 0; num502 < num501; num502++) @@ -51,11 +53,11 @@ namespace CalamityMod.Projectiles.Summon } projectile.localAI[0] += 1f; } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } if ((double)Math.Abs(projectile.velocity.X) > 0.2) @@ -70,8 +72,6 @@ namespace CalamityMod.Projectiles.Summon num *= Main.essScale; Lighting.AddLight(projectile.Center, 1.2f * num, 0.8f * num, 0f * num); bool flag64 = projectile.type == ModContent.ProjectileType(); - Player player = Main.player[projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); player.AddBuff(ModContent.BuffType(), 3600); if (flag64) { diff --git a/Projectiles/Summon/Spikecrag.cs b/Projectiles/Summon/Spikecrag.cs index 218edaaaa2..49c2f4af62 100644 --- a/Projectiles/Summon/Spikecrag.cs +++ b/Projectiles/Summon/Spikecrag.cs @@ -28,17 +28,18 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + Player player = Main.player[projectile.owner]; if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; projectile.localAI[0] += 1f; } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } diff --git a/Projectiles/Summon/Urchin.cs b/Projectiles/Summon/Urchin.cs index aed6e2ce91..c2b5f909cb 100644 --- a/Projectiles/Summon/Urchin.cs +++ b/Projectiles/Summon/Urchin.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Summon dust--; if (dust >= 0) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num501 = 50; for (int num502 = 0; num502 < num501; num502++) @@ -66,11 +66,11 @@ namespace CalamityMod.Projectiles.Summon Main.dust[num503].scale *= 1.15f; } } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } float num395 = (float)Main.mouseTextColor / 200f - 0.35f; diff --git a/Projectiles/Summon/Valkyrie.cs b/Projectiles/Summon/Valkyrie.cs index 12583f20f7..879e81e5a3 100644 --- a/Projectiles/Summon/Valkyrie.cs +++ b/Projectiles/Summon/Valkyrie.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Summon } if (projectile.localAI[0] == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num501 = 30; for (int num502 = 0; num502 < num501; num502++) @@ -69,11 +69,11 @@ namespace CalamityMod.Projectiles.Summon } projectile.localAI[0] += 1f; } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } if ((double)Math.Abs(projectile.velocity.X) > 0.2) diff --git a/Projectiles/Summon/WaterElementalMinion.cs b/Projectiles/Summon/WaterElementalMinion.cs index 248a4ea62d..0ecc658d6c 100644 --- a/Projectiles/Summon/WaterElementalMinion.cs +++ b/Projectiles/Summon/WaterElementalMinion.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Summon } if (dust > 0) { - projectile.Calamity().spawnedPlayerMinionDamageValue = Main.player[projectile.owner].minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num501 = 50; for (int num502 = 0; num502 < num501; num502++) @@ -68,11 +68,11 @@ namespace CalamityMod.Projectiles.Summon } dust--; } - if (Main.player[projectile.owner].minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - Main.player[projectile.owner].minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } Lighting.AddLight(projectile.Center, 0f, 0.25f, 1.5f); diff --git a/Projectiles/Summon/WulfrumDroid.cs b/Projectiles/Summon/WulfrumDroid.cs index 64c5bdbcbb..e794f3e4fd 100644 --- a/Projectiles/Summon/WulfrumDroid.cs +++ b/Projectiles/Summon/WulfrumDroid.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Summon CalamityPlayer modPlayer = player.Calamity(); if (dust == 0f) { - projectile.Calamity().spawnedPlayerMinionDamageValue = player.minionDamage; + projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f); projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage; int num226 = 36; for (int num227 = 0; num227 < num226; num227++) @@ -58,11 +58,11 @@ namespace CalamityMod.Projectiles.Summon } dust += 1f; } - if (player.minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue) + if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) { int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue / projectile.Calamity().spawnedPlayerMinionDamageValue * - player.minionDamage); + (player.allDamage + player.minionDamage - 1f)); projectile.damage = damage2; } projectile.frameCounter++; @@ -202,9 +202,9 @@ namespace CalamityMod.Projectiles.Summon } projectile.rotation = projectile.velocity.X * 0.05f; if ((double) projectile.velocity.X > 0.0) - projectile.spriteDirection = projectile.direction = -1; - else if ((double) projectile.velocity.X < 0.0) projectile.spriteDirection = projectile.direction = 1; + else if ((double) projectile.velocity.X < 0.0) + projectile.spriteDirection = projectile.direction = -1; if ((double) projectile.ai[1] > 0.0) projectile.ai[1] += (float) Main.rand.Next(1, 4); if ((double) projectile.ai[1] > 90.0) diff --git a/Projectiles/Typeless/BloodBombExplosion.cs b/Projectiles/Typeless/BloodBombExplosion.cs index 4251dab8b8..246613730b 100644 --- a/Projectiles/Typeless/BloodBombExplosion.cs +++ b/Projectiles/Typeless/BloodBombExplosion.cs @@ -77,15 +77,14 @@ namespace CalamityMod.Projectiles.Typeless num463 *= num466; num464 *= num466; int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, 0f, 0f, 100, default, 1.8f); - Main.dust[num467].noGravity = true; - Main.dust[num467].position.X = projectile.Center.X; - Main.dust[num467].position.Y = projectile.Center.Y; - Dust expr_149DF_cp_0 = Main.dust[num467]; - expr_149DF_cp_0.position.X += (float)Main.rand.Next(-10, 11); - Dust expr_14A09_cp_0 = Main.dust[num467]; - expr_14A09_cp_0.position.Y += (float)Main.rand.Next(-10, 11); - Main.dust[num467].velocity.X = num463; - Main.dust[num467].velocity.Y = num464; + Dust dust = Main.dust[num467]; + dust.noGravity = true; + dust.position.X = projectile.Center.X; + dust.position.Y = projectile.Center.Y; + dust.position.X += (float)Main.rand.Next(-10, 11); + dust.position.Y += (float)Main.rand.Next(-10, 11); + dust.velocity.X = num463; + dust.velocity.Y = num464; num462++; } return; diff --git a/Projectiles/Typeless/ChaosBlaze.cs b/Projectiles/Typeless/ChaosBlaze.cs index de4ce8c603..88741ca645 100644 --- a/Projectiles/Typeless/ChaosBlaze.cs +++ b/Projectiles/Typeless/ChaosBlaze.cs @@ -78,15 +78,14 @@ namespace CalamityMod.Projectiles.Typeless num463 *= num466; num464 *= num466; int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 127, 0f, 0f, 100, default, 1.5f); - Main.dust[num467].noGravity = true; - Main.dust[num467].position.X = projectile.Center.X; - Main.dust[num467].position.Y = projectile.Center.Y; - Dust expr_149DF_cp_0 = Main.dust[num467]; - expr_149DF_cp_0.position.X += (float)Main.rand.Next(-10, 11); - Dust expr_14A09_cp_0 = Main.dust[num467]; - expr_14A09_cp_0.position.Y += (float)Main.rand.Next(-10, 11); - Main.dust[num467].velocity.X = num463; - Main.dust[num467].velocity.Y = num464; + Dust dust = Main.dust[num467]; + dust.noGravity = true; + dust.position.X = projectile.Center.X; + dust.position.Y = projectile.Center.Y; + dust.position.X += (float)Main.rand.Next(-10, 11); + dust.position.Y += (float)Main.rand.Next(-10, 11); + dust.velocity.X = num463; + dust.velocity.Y = num464; num462++; } } diff --git a/Projectiles/Typeless/ChaosGeyser.cs b/Projectiles/Typeless/ChaosGeyser.cs index d2504f2b21..80178c22e7 100644 --- a/Projectiles/Typeless/ChaosGeyser.cs +++ b/Projectiles/Typeless/ChaosGeyser.cs @@ -59,24 +59,21 @@ namespace CalamityMod.Projectiles.Typeless } projectile.rotation += projectile.velocity.X * 0.1f; int num199 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 127, 0f, 0f, 100, default, 1f); - Dust expr_8976_cp_0 = Main.dust[num199]; - expr_8976_cp_0.position.X -= 2f; - Dust expr_8994_cp_0 = Main.dust[num199]; - expr_8994_cp_0.position.Y += 2f; - Main.dust[num199].scale += (float)Main.rand.Next(50) * 0.01f; - Main.dust[num199].noGravity = true; - Dust expr_89E7_cp_0 = Main.dust[num199]; - expr_89E7_cp_0.velocity.Y -= 16f; + Dust dust = Main.dust[num199]; + dust.position.X -= 2f; + dust.position.Y += 2f; + dust.scale += (float)Main.rand.Next(50) * 0.01f; + dust.noGravity = true; + dust.velocity.Y -= 16f; if (Main.rand.NextBool(2)) { int num200 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 127, 0f, 0f, 100, default, 1f); - Dust expr_8A4E_cp_0 = Main.dust[num200]; - expr_8A4E_cp_0.position.X -= 2f; - Dust expr_8A6C_cp_0 = Main.dust[num200]; - expr_8A6C_cp_0.position.Y += 2f; - Main.dust[num200].scale += 0.3f + (float)Main.rand.Next(50) * 0.01f; - Main.dust[num200].noGravity = true; - Main.dust[num200].velocity *= 0.8f; + Dust dust2 = Main.dust[num200]; + dust2.position.X -= 2f; + dust2.position.Y += 2f; + dust2.scale += 0.3f + (float)Main.rand.Next(50) * 0.01f; + dust2.noGravity = true; + dust2.velocity *= 0.8f; } if ((double)projectile.velocity.Y < 0.25 && (double)projectile.velocity.Y > 0.15) { diff --git a/Projectiles/Typeless/DragonDust.cs b/Projectiles/Typeless/DragonDust.cs index e46f1230c1..31dce97f79 100644 --- a/Projectiles/Typeless/DragonDust.cs +++ b/Projectiles/Typeless/DragonDust.cs @@ -70,15 +70,14 @@ namespace CalamityMod.Projectiles.Typeless num463 *= num466; num464 *= num466; int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1.5f); - Main.dust[num467].noGravity = true; - Main.dust[num467].position.X = projectile.Center.X; - Main.dust[num467].position.Y = projectile.Center.Y; - Dust expr_149DF_cp_0 = Main.dust[num467]; - expr_149DF_cp_0.position.X += (float)Main.rand.Next(-10, 11); - Dust expr_14A09_cp_0 = Main.dust[num467]; - expr_14A09_cp_0.position.Y += (float)Main.rand.Next(-10, 11); - Main.dust[num467].velocity.X = num463; - Main.dust[num467].velocity.Y = num464; + Dust dust = Main.dust[num467]; + dust.noGravity = true; + dust.position.X = projectile.Center.X; + dust.position.Y = projectile.Center.Y; + dust.position.X += (float)Main.rand.Next(-10, 11); + dust.position.Y += (float)Main.rand.Next(-10, 11); + dust.velocity.X = num463; + dust.velocity.Y = num464; num462++; } } diff --git a/Projectiles/Typeless/GodSlayerBlaze.cs b/Projectiles/Typeless/GodSlayerBlaze.cs index 0408f02a73..a1b3a03a59 100644 --- a/Projectiles/Typeless/GodSlayerBlaze.cs +++ b/Projectiles/Typeless/GodSlayerBlaze.cs @@ -59,17 +59,16 @@ namespace CalamityMod.Projectiles.Typeless num463 *= num466; num464 *= num466; int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, scale); + Dust dust = Main.dust[num467]; if (dustType != 173) - Main.dust[num467].color = new Color(255, 255, 255, 0); - Main.dust[num467].noGravity = true; - Main.dust[num467].position.X = projectile.Center.X; - Main.dust[num467].position.Y = projectile.Center.Y; - Dust expr_149DF_cp_0 = Main.dust[num467]; - expr_149DF_cp_0.position.X += (float)Main.rand.Next(-10, 11); - Dust expr_14A09_cp_0 = Main.dust[num467]; - expr_14A09_cp_0.position.Y += (float)Main.rand.Next(-10, 11); - Main.dust[num467].velocity.X = num463; - Main.dust[num467].velocity.Y = num464; + dust.color = new Color(255, 255, 255, 0); + dust.noGravity = true; + dust.position.X = projectile.Center.X; + dust.position.Y = projectile.Center.Y; + dust.position.X += (float)Main.rand.Next(-10, 11); + dust.position.Y += (float)Main.rand.Next(-10, 11); + dust.velocity.X = num463; + dust.velocity.Y = num464; num462++; } } diff --git a/Projectiles/Typeless/GodSlayerShrapnel.cs b/Projectiles/Typeless/GodSlayerShrapnel.cs index 87ecc2dd4b..ca8fa650df 100644 --- a/Projectiles/Typeless/GodSlayerShrapnel.cs +++ b/Projectiles/Typeless/GodSlayerShrapnel.cs @@ -55,24 +55,21 @@ namespace CalamityMod.Projectiles.Typeless Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 13); } int num199 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 173, 0f, 0f, 100, default, 0.5f); - Dust expr_8976_cp_0 = Main.dust[num199]; - expr_8976_cp_0.position.X -= 2f; - Dust expr_8994_cp_0 = Main.dust[num199]; - expr_8994_cp_0.position.Y += 2f; - Main.dust[num199].scale += (float)Main.rand.Next(50) * 0.01f; - Main.dust[num199].noGravity = true; - Dust expr_89E7_cp_0 = Main.dust[num199]; - expr_89E7_cp_0.velocity.Y -= 2f; + Dust dust = Main.dust[num199]; + dust.position.X -= 2f; + dust.position.Y += 2f; + dust.scale += (float)Main.rand.Next(50) * 0.01f; + dust.noGravity = true; + dust.velocity.Y -= 2f; if (Main.rand.NextBool(2)) { int num200 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 173, 0f, 0f, 100, default, 0.5f); - Dust expr_8A4E_cp_0 = Main.dust[num200]; - expr_8A4E_cp_0.position.X -= 2f; - Dust expr_8A6C_cp_0 = Main.dust[num200]; - expr_8A6C_cp_0.position.Y += 2f; - Main.dust[num200].scale += 0.3f + (float)Main.rand.Next(50) * 0.01f; - Main.dust[num200].noGravity = true; - Main.dust[num200].velocity *= 0.1f; + Dust dust2 = Main.dust[num200]; + dust2.position.X -= 2f; + dust2.position.Y += 2f; + dust2.scale += 0.3f + (float)Main.rand.Next(50) * 0.01f; + dust2.noGravity = true; + dust2.velocity *= 0.1f; } if ((double)projectile.velocity.Y < 0.25 && (double)projectile.velocity.Y > 0.15) { diff --git a/Projectiles/Typeless/GoldenGunProj.cs b/Projectiles/Typeless/GoldenGunProj.cs index fde2b8659e..59e0aab675 100644 --- a/Projectiles/Typeless/GoldenGunProj.cs +++ b/Projectiles/Typeless/GoldenGunProj.cs @@ -92,41 +92,33 @@ namespace CalamityMod.Projectiles.Typeless for (int num362 = 0; num362 < 100; num362 = num3 + 1) { int num363 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 170, 0f, 0f, 75, default, 1.2f); - Dust dust; + Dust dust = Main.dust[num363]; if (Main.rand.NextBool(2)) { - dust = Main.dust[num363]; dust.alpha += 25; } if (Main.rand.NextBool(2)) { - dust = Main.dust[num363]; dust.alpha += 25; } if (Main.rand.NextBool(2)) { - dust = Main.dust[num363]; dust.alpha += 25; } if (Main.rand.NextBool(2)) { - Main.dust[num363].scale = 0.6f; + dust.scale = 0.6f; } else { - Main.dust[num363].noGravity = true; + dust.noGravity = true; } - dust = Main.dust[num363]; dust.velocity *= 0.3f; - dust = Main.dust[num363]; dust.velocity += projectile.velocity; - dust = Main.dust[num363]; dust.velocity *= 1f + (float)Main.rand.Next(-100, 101) * 0.01f; - Dust expr_C6F7_cp_0_cp_0 = Main.dust[num363]; - expr_C6F7_cp_0_cp_0.velocity.X += (float)Main.rand.Next(-50, 51) * 0.015f; - Dust expr_C726_cp_0_cp_0 = Main.dust[num363]; - expr_C726_cp_0_cp_0.velocity.Y += (float)Main.rand.Next(-50, 51) * 0.015f; - Main.dust[num363].position = projectile.Center; + dust.velocity.X += (float)Main.rand.Next(-50, 51) * 0.015f; + dust.velocity.Y += (float)Main.rand.Next(-50, 51) * 0.015f; + dust.position = projectile.Center; num3 = num362; } } diff --git a/Projectiles/Typeless/HolyEruption.cs b/Projectiles/Typeless/HolyEruption.cs index 48a1c43fad..f9b2fb1401 100644 --- a/Projectiles/Typeless/HolyEruption.cs +++ b/Projectiles/Typeless/HolyEruption.cs @@ -53,24 +53,21 @@ namespace CalamityMod.Projectiles.Typeless } projectile.rotation += projectile.velocity.X * 0.1f; int num199 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 244, 0f, 0f, 100, default, 1f); - Dust expr_8976_cp_0 = Main.dust[num199]; - expr_8976_cp_0.position.X -= 2f; - Dust expr_8994_cp_0 = Main.dust[num199]; - expr_8994_cp_0.position.Y += 2f; - Main.dust[num199].scale += (float)Main.rand.Next(50) * 0.01f; - Main.dust[num199].noGravity = true; - Dust expr_89E7_cp_0 = Main.dust[num199]; - expr_89E7_cp_0.velocity.Y -= 16f; + Dust dust = Main.dust[num199]; + dust.position.X -= 2f; + dust.position.Y += 2f; + dust.scale += (float)Main.rand.Next(50) * 0.01f; + dust.noGravity = true; + dust.velocity.Y -= 16f; if (Main.rand.NextBool(2)) { int num200 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 246, 0f, 0f, 100, default, 1f); - Dust expr_8A4E_cp_0 = Main.dust[num200]; - expr_8A4E_cp_0.position.X -= 2f; - Dust expr_8A6C_cp_0 = Main.dust[num200]; - expr_8A6C_cp_0.position.Y += 2f; - Main.dust[num200].scale += 0.3f + (float)Main.rand.Next(50) * 0.01f; - Main.dust[num200].noGravity = true; - Main.dust[num200].velocity *= 0.8f; + Dust dust2 = Main.dust[num200]; + dust2.position.X -= 2f; + dust2.position.Y += 2f; + dust2.scale += 0.3f + (float)Main.rand.Next(50) * 0.01f; + dust2.noGravity = true; + dust2.velocity *= 0.8f; } if ((double)projectile.velocity.Y < 0.25 && (double)projectile.velocity.Y > 0.15) { diff --git a/Projectiles/Typeless/ReaverBlast.cs b/Projectiles/Typeless/ReaverBlast.cs index de61231b68..149cb978db 100644 --- a/Projectiles/Typeless/ReaverBlast.cs +++ b/Projectiles/Typeless/ReaverBlast.cs @@ -72,15 +72,14 @@ namespace CalamityMod.Projectiles.Typeless num463 *= num466; num464 *= num466; int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 74, 0f, 0f, 100, default, 1f); - Main.dust[num467].noGravity = true; - Main.dust[num467].position.X = projectile.Center.X; - Main.dust[num467].position.Y = projectile.Center.Y; - Dust expr_149DF_cp_0 = Main.dust[num467]; - expr_149DF_cp_0.position.X += (float)Main.rand.Next(-10, 11); - Dust expr_14A09_cp_0 = Main.dust[num467]; - expr_14A09_cp_0.position.Y += (float)Main.rand.Next(-10, 11); - Main.dust[num467].velocity.X = num463; - Main.dust[num467].velocity.Y = num464; + Dust dust = Main.dust[num467]; + dust.noGravity = true; + dust.position.X = projectile.Center.X; + dust.position.Y = projectile.Center.Y; + dust.position.X += (float)Main.rand.Next(-10, 11); + dust.position.Y += (float)Main.rand.Next(-10, 11); + dust.velocity.X = num463; + dust.velocity.Y = num464; num462++; } return; diff --git a/Projectiles/Typeless/SabatonSlam.cs b/Projectiles/Typeless/SabatonSlam.cs index 9f8a6f36d5..9215978a84 100644 --- a/Projectiles/Typeless/SabatonSlam.cs +++ b/Projectiles/Typeless/SabatonSlam.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Projectiles.Typeless { public override void SetDefaults() { - projectile.width = 50; + projectile.width = 10; projectile.height = 50; projectile.friendly = true; projectile.timeLeft = 300; diff --git a/Projectiles/Typeless/SabatonSlam.png b/Projectiles/Typeless/SabatonSlam.png index 73557dc730..dd0a1e7735 100644 Binary files a/Projectiles/Typeless/SabatonSlam.png and b/Projectiles/Typeless/SabatonSlam.png differ diff --git a/Projectiles/Typeless/SandExplosion.cs b/Projectiles/Typeless/SandExplosion.cs new file mode 100644 index 0000000000..6c016942cd --- /dev/null +++ b/Projectiles/Typeless/SandExplosion.cs @@ -0,0 +1,40 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Typeless +{ + public class SandExplosion : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Sand"); + } + + public override void SetDefaults() + { + projectile.width = 64; + projectile.height = 64; + projectile.timeLeft = 1; + projectile.friendly = true; + projectile.tileCollide = false; + projectile.penetrate = -1; + projectile.maxPenetrate = -1; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + } + + public override void AI() + { + for (int i = 0; i <= 360; i += 6) + { + Vector2 dustspeed = new Vector2(5f, 5f).RotatedBy(MathHelper.ToRadians(i)); + float size = Main.rand.NextFloat(1.1f, 1.6f); + int d = Dust.NewDust(projectile.Center, projectile.width, projectile.height, 85, dustspeed.X, dustspeed.Y, 0, default, size); + Main.dust[d].noGravity = true; + Main.dust[d].position = projectile.Center; + } + } + } +} diff --git a/Projectiles/Typeless/SandExplosion.png b/Projectiles/Typeless/SandExplosion.png new file mode 100644 index 0000000000..6ea4de3903 Binary files /dev/null and b/Projectiles/Typeless/SandExplosion.png differ diff --git a/Projectiles/Typeless/SkyFlareFriendly.cs b/Projectiles/Typeless/SkyFlareFriendly.cs index ee16adf028..3b7ddd7e6c 100644 --- a/Projectiles/Typeless/SkyFlareFriendly.cs +++ b/Projectiles/Typeless/SkyFlareFriendly.cs @@ -89,29 +89,22 @@ namespace CalamityMod.Projectiles.Typeless scaleFactor10 = 1f; } int num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13AB6_cp_0 = Main.gore[num626]; - expr_13AB6_cp_0.velocity.X += 1f; - Gore expr_13AD6_cp_0 = Main.gore[num626]; - expr_13AD6_cp_0.velocity.Y += 1f; + Gore gore = Main.gore[num626]; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13B79_cp_0 = Main.gore[num626]; - expr_13B79_cp_0.velocity.X -= 1f; - Gore expr_13B99_cp_0 = Main.gore[num626]; - expr_13B99_cp_0.velocity.Y += 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y += 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13C3C_cp_0 = Main.gore[num626]; - expr_13C3C_cp_0.velocity.X += 1f; - Gore expr_13C5C_cp_0 = Main.gore[num626]; - expr_13C5C_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X += 1f; + gore.velocity.Y -= 1f; num626 = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(61, 64), 1f); - Main.gore[num626].velocity *= scaleFactor10; - Gore expr_13CFF_cp_0 = Main.gore[num626]; - expr_13CFF_cp_0.velocity.X -= 1f; - Gore expr_13D1F_cp_0 = Main.gore[num626]; - expr_13D1F_cp_0.velocity.Y -= 1f; + gore.velocity *= scaleFactor10; + gore.velocity.X -= 1f; + gore.velocity.Y -= 1f; } } } diff --git a/Projectiles/Typeless/StandingFire.cs b/Projectiles/Typeless/StandingFire.cs index 2f39574bc2..22495b3327 100644 --- a/Projectiles/Typeless/StandingFire.cs +++ b/Projectiles/Typeless/StandingFire.cs @@ -56,24 +56,21 @@ namespace CalamityMod.Projectiles.Typeless Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 13); } int num199 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 235, 0f, 0f, 100, default, 1f); - Dust expr_8976_cp_0 = Main.dust[num199]; - expr_8976_cp_0.position.X -= 2f; - Dust expr_8994_cp_0 = Main.dust[num199]; - expr_8994_cp_0.position.Y += 2f; - Main.dust[num199].scale += (float)Main.rand.Next(50) * 0.01f; - Main.dust[num199].noGravity = true; - Dust expr_89E7_cp_0 = Main.dust[num199]; - expr_89E7_cp_0.velocity.Y -= 2f; + Dust dust = Main.dust[num199]; + dust.position.X -= 2f; + dust.position.Y += 2f; + dust.scale += (float)Main.rand.Next(50) * 0.01f; + dust.noGravity = true; + dust.velocity.Y -= 2f; if (Main.rand.NextBool(2)) { int num200 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 235, 0f, 0f, 100, default, 1f); - Dust expr_8A4E_cp_0 = Main.dust[num200]; - expr_8A4E_cp_0.position.X -= 2f; - Dust expr_8A6C_cp_0 = Main.dust[num200]; - expr_8A6C_cp_0.position.Y += 2f; - Main.dust[num200].scale += 0.3f + (float)Main.rand.Next(50) * 0.01f; - Main.dust[num200].noGravity = true; - Main.dust[num200].velocity *= 0.1f; + Dust dust2 = Main.dust[num200]; + dust2.position.X -= 2f; + dust2.position.Y += 2f; + dust2.scale += 0.3f + (float)Main.rand.Next(50) * 0.01f; + dust2.noGravity = true; + dust2.velocity *= 0.1f; } if ((double)projectile.velocity.Y < 0.25 && (double)projectile.velocity.Y > 0.15) { diff --git a/Projectiles/Typeless/TeslaAura.cs b/Projectiles/Typeless/TeslaAura.cs index 5b00cc49ea..ceac146712 100644 --- a/Projectiles/Typeless/TeslaAura.cs +++ b/Projectiles/Typeless/TeslaAura.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Typeless projectile.timeLeft *= 5; projectile.penetrate = -1; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 20; + projectile.localNPCHitCooldown = 25; } public override void AI() diff --git a/Projectiles/Typeless/UnstableSpark.cs b/Projectiles/Typeless/UnstableSpark.cs index bdc347c229..c5cc444bff 100644 --- a/Projectiles/Typeless/UnstableSpark.cs +++ b/Projectiles/Typeless/UnstableSpark.cs @@ -52,24 +52,21 @@ namespace CalamityMod.Projectiles.Typeless } projectile.rotation += projectile.velocity.X * 0.1f; int num199 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 206, 0f, 0f, 100, default, 0.5f); - Dust expr_8976_cp_0 = Main.dust[num199]; - expr_8976_cp_0.position.X -= 2f; - Dust expr_8994_cp_0 = Main.dust[num199]; - expr_8994_cp_0.position.Y += 2f; - Main.dust[num199].scale += (float)Main.rand.Next(50) * 0.01f; - Main.dust[num199].noGravity = true; - Dust expr_89E7_cp_0 = Main.dust[num199]; - expr_89E7_cp_0.velocity.Y -= 2f; + Dust dust = Main.dust[num199]; + dust.position.X -= 2f; + dust.position.Y += 2f; + dust.scale += (float)Main.rand.Next(50) * 0.01f; + dust.noGravity = true; + dust.velocity.Y -= 2f; if (Main.rand.NextBool(2)) { int num200 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 206, 0f, 0f, 100, default, 0.5f); - Dust expr_8A4E_cp_0 = Main.dust[num200]; - expr_8A4E_cp_0.position.X -= 2f; - Dust expr_8A6C_cp_0 = Main.dust[num200]; - expr_8A6C_cp_0.position.Y += 2f; - Main.dust[num200].scale += 0.3f + (float)Main.rand.Next(50) * 0.01f; - Main.dust[num200].noGravity = true; - Main.dust[num200].velocity *= 0.1f; + Dust dust2 = Main.dust[num200]; + dust2.position.X -= 2f; + dust2.position.Y += 2f; + dust2.scale += 0.3f + (float)Main.rand.Next(50) * 0.01f; + dust2.noGravity = true; + dust2.velocity *= 0.1f; } if ((double)projectile.velocity.Y < 0.25 && (double)projectile.velocity.Y > 0.15) { diff --git a/Projectiles/Typeless/XerocBlast.cs b/Projectiles/Typeless/XerocBlast.cs index 9cfb1b6ead..f2efc595f9 100644 --- a/Projectiles/Typeless/XerocBlast.cs +++ b/Projectiles/Typeless/XerocBlast.cs @@ -72,15 +72,14 @@ namespace CalamityMod.Projectiles.Typeless num463 *= num466; num464 *= num466; int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 58, 0f, 0f, 100, default, 1f); - Main.dust[num467].noGravity = true; - Main.dust[num467].position.X = projectile.Center.X; - Main.dust[num467].position.Y = projectile.Center.Y; - Dust expr_149DF_cp_0 = Main.dust[num467]; - expr_149DF_cp_0.position.X += (float)Main.rand.Next(-10, 11); - Dust expr_14A09_cp_0 = Main.dust[num467]; - expr_14A09_cp_0.position.Y += (float)Main.rand.Next(-10, 11); - Main.dust[num467].velocity.X = num463; - Main.dust[num467].velocity.Y = num464; + Dust dust = Main.dust[num467]; + dust.noGravity = true; + dust.position.X = projectile.Center.X; + dust.position.Y = projectile.Center.Y; + dust.position.X += (float)Main.rand.Next(-10, 11); + dust.position.Y += (float)Main.rand.Next(-10, 11); + dust.velocity.X = num463; + dust.velocity.Y = num464; num462++; } } diff --git a/Projectiles/Typeless/XerocFire.cs b/Projectiles/Typeless/XerocFire.cs index 298e7fd0c1..f723260082 100644 --- a/Projectiles/Typeless/XerocFire.cs +++ b/Projectiles/Typeless/XerocFire.cs @@ -52,24 +52,21 @@ namespace CalamityMod.Projectiles.Typeless } projectile.rotation += projectile.velocity.X * 0.1f; int num199 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 58, 0f, 0f, 100, default, 0.75f); - Dust expr_8976_cp_0 = Main.dust[num199]; - expr_8976_cp_0.position.X -= 2f; - Dust expr_8994_cp_0 = Main.dust[num199]; - expr_8994_cp_0.position.Y += 2f; - Main.dust[num199].scale += (float)Main.rand.Next(50) * 0.01f; - Main.dust[num199].noGravity = true; - Dust expr_89E7_cp_0 = Main.dust[num199]; - expr_89E7_cp_0.velocity.Y -= 2f; + Dust dust = Main.dust[num199]; + dust.position.X -= 2f; + dust.position.Y += 2f; + dust.scale += (float)Main.rand.Next(50) * 0.01f; + dust.noGravity = true; + dust.velocity.Y -= 2f; if (Main.rand.NextBool(2)) { int num200 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 58, 0f, 0f, 100, default, 0.75f); - Dust expr_8A4E_cp_0 = Main.dust[num200]; - expr_8A4E_cp_0.position.X -= 2f; - Dust expr_8A6C_cp_0 = Main.dust[num200]; - expr_8A6C_cp_0.position.Y += 2f; - Main.dust[num200].scale += 0.3f + (float)Main.rand.Next(50) * 0.01f; - Main.dust[num200].noGravity = true; - Main.dust[num200].velocity *= 0.1f; + Dust dust2 = Main.dust[num200]; + dust2.position.X -= 2f; + dust2.position.Y += 2f; + dust2.scale += 0.3f + (float)Main.rand.Next(50) * 0.01f; + dust2.noGravity = true; + dust2.velocity *= 0.1f; } if ((double)projectile.velocity.Y < 0.25 && (double)projectile.velocity.Y > 0.15) { diff --git a/Sounds/Custom/MMMMMMMMMMMMM.cs b/Sounds/Custom/MMMMMMMMMMMMM.cs new file mode 100644 index 0000000000..956a90296b --- /dev/null +++ b/Sounds/Custom/MMMMMMMMMMMMM.cs @@ -0,0 +1,19 @@ +using Microsoft.Xna.Framework.Audio; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Sounds.Custom +{ + public class MMMMMMMMMMMMM : ModSound + { + public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) + { + soundInstance = sound.CreateInstance(); + soundInstance.Volume = volume * 1f; + soundInstance.Pan = pan; + soundInstance.IsLooped = true; + Main.PlaySoundInstance(soundInstance); + return soundInstance; + } + } +} diff --git a/Sounds/Custom/MMMMMMMMMMMMM.ogg b/Sounds/Custom/MMMMMMMMMMMMM.ogg new file mode 100644 index 0000000000..d91492184d Binary files /dev/null and b/Sounds/Custom/MMMMMMMMMMMMM.ogg differ diff --git a/Tiles/CalamityGlobalTile.cs b/Tiles/CalamityGlobalTile.cs index 287c2cee96..690ee48ddf 100644 --- a/Tiles/CalamityGlobalTile.cs +++ b/Tiles/CalamityGlobalTile.cs @@ -181,64 +181,64 @@ namespace CalamityMod.Tiles { if (Main.rand.NextBool(10)) { - int expr_B64 = WorldGen.genRand.Next(15); - if (expr_B64 == 0) + int pot = WorldGen.genRand.Next(15); + if (pot == 0) { Item.NewItem(i * 16, j * 16, 16, 16, 296, 1, false, 0, false, false); } - if (expr_B64 == 1) + if (pot == 1) { Item.NewItem(i * 16, j * 16, 16, 16, 294, 1, false, 0, false, false); } - if (expr_B64 == 2) + if (pot == 2) { Item.NewItem(i * 16, j * 16, 16, 16, 298, 1, false, 0, false, false); } - if (expr_B64 == 3) + if (pot == 3) { Item.NewItem(i * 16, j * 16, 16, 16, 302, 1, false, 0, false, false); } - if (expr_B64 == 4) + if (pot == 4) { Item.NewItem(i * 16, j * 16, 16, 16, 288, 1, false, 0, false, false); } - if (expr_B64 == 5) + if (pot == 5) { Item.NewItem(i * 16, j * 16, 16, 16, 305, 1, false, 0, false, false); } - if (expr_B64 == 6) + if (pot == 6) { Item.NewItem(i * 16, j * 16, 16, 16, 289, 1, false, 0, false, false); } - if (expr_B64 == 7) + if (pot == 7) { Item.NewItem(i * 16, j * 16, 16, 16, 302, 1, false, 0, false, false); } - if (expr_B64 == 8) + if (pot == 8) { Item.NewItem(i * 16, j * 16, 16, 16, ModContent.ItemType(), 1, false, 0, false, false); } - if (expr_B64 == 9) + if (pot == 9) { Item.NewItem(i * 16, j * 16, 16, 16, 291, 1, false, 0, false, false); } - if (expr_B64 == 10) + if (pot == 10) { Item.NewItem(i * 16, j * 16, 16, 16, 2346, 1, false, 0, false, false); } - if (expr_B64 == 11) + if (pot == 11) { Item.NewItem(i * 16, j * 16, 16, 16, 2323, 1, false, 0, false, false); } - if (expr_B64 == 12) + if (pot == 12) { Item.NewItem(i * 16, j * 16, 16, 16, 2327, 1, false, 0, false, false); } - if (expr_B64 == 13) + if (pot == 13) { Item.NewItem(i * 16, j * 16, 16, 16, 2345, 1, false, 0, false, false); } - if (expr_B64 == 14) + if (pot == 14) { Item.NewItem(i * 16, j * 16, 16, 16, 2348, 1, false, 0, false, false); } @@ -341,64 +341,64 @@ namespace CalamityMod.Tiles { if (Main.rand.NextBool(15)) { - int expr_B64 = WorldGen.genRand.Next(15); - if (expr_B64 == 0) + int pot = WorldGen.genRand.Next(15); + if (pot == 0) { Item.NewItem(i * 16, j * 16, 16, 16, 296, 1, false, 0, false, false); } - if (expr_B64 == 1) + if (pot == 1) { Item.NewItem(i * 16, j * 16, 16, 16, 294, 1, false, 0, false, false); } - if (expr_B64 == 2) + if (pot == 2) { Item.NewItem(i * 16, j * 16, 16, 16, 298, 1, false, 0, false, false); } - if (expr_B64 == 3) + if (pot == 3) { Item.NewItem(i * 16, j * 16, 16, 16, 302, 1, false, 0, false, false); } - if (expr_B64 == 4) + if (pot == 4) { Item.NewItem(i * 16, j * 16, 16, 16, 288, 1, false, 0, false, false); } - if (expr_B64 == 5) + if (pot == 5) { Item.NewItem(i * 16, j * 16, 16, 16, 305, 1, false, 0, false, false); } - if (expr_B64 == 6) + if (pot == 6) { Item.NewItem(i * 16, j * 16, 16, 16, 289, 1, false, 0, false, false); } - if (expr_B64 == 7) + if (pot == 7) { Item.NewItem(i * 16, j * 16, 16, 16, 302, 1, false, 0, false, false); } - if (expr_B64 == 8) + if (pot == 8) { Item.NewItem(i * 16, j * 16, 16, 16, ModContent.ItemType(), 1, false, 0, false, false); } - if (expr_B64 == 9) + if (pot == 9) { Item.NewItem(i * 16, j * 16, 16, 16, 291, 1, false, 0, false, false); } - if (expr_B64 == 10) + if (pot == 10) { Item.NewItem(i * 16, j * 16, 16, 16, 2346, 1, false, 0, false, false); } - if (expr_B64 == 11) + if (pot == 11) { Item.NewItem(i * 16, j * 16, 16, 16, 2323, 1, false, 0, false, false); } - if (expr_B64 == 12) + if (pot == 12) { Item.NewItem(i * 16, j * 16, 16, 16, 2327, 1, false, 0, false, false); } - if (expr_B64 == 13) + if (pot == 13) { Item.NewItem(i * 16, j * 16, 16, 16, 2345, 1, false, 0, false, false); } - if (expr_B64 == 14) + if (pot == 14) { Item.NewItem(i * 16, j * 16, 16, 16, 2348, 1, false, 0, false, false); } diff --git a/Tiles/Furniture/CraftingStations/DraedonsForge.cs b/Tiles/Furniture/CraftingStations/DraedonsForge.cs index bb67a6ee2e..43b65c7039 100644 --- a/Tiles/Furniture/CraftingStations/DraedonsForge.cs +++ b/Tiles/Furniture/CraftingStations/DraedonsForge.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Tiles.Furniture.CraftingStations AddMapEntry(new Color(0, 255, 0), name); disableSmartCursor = true; adjTiles = new int[] { TileID.Anvils, TileID.Furnaces, TileID.WorkBenches, TileID.LunarCraftingStation, - TileID.MythrilAnvil, TileID.AdamantiteForge, TileID.Hellforge }; + TileID.MythrilAnvil, TileID.AdamantiteForge, TileID.Hellforge, TileID.DemonAltar }; } public override void KillMultiTile(int i, int j, int frameX, int frameY) diff --git a/Utilities/CalamityRecipes.cs b/Utilities/CalamityRecipes.cs index 0bbf1f85c8..a215a45a9a 100644 --- a/Utilities/CalamityRecipes.cs +++ b/Utilities/CalamityRecipes.cs @@ -409,6 +409,15 @@ namespace CalamityMod r.AddTile(TileID.Bookcases); r.SetResult(ItemID.WaterBolt); r.AddRecipe(); + + //Slime Staff + r = GetNewRecipe(); + r.AddIngredient(ItemID.Wood, 6); + r.AddIngredient(ItemID.Gel, 40); + r.AddIngredient(ItemID.PinkGel, 10); + r.AddTile(TileID.Anvils); + r.SetResult(ItemID.SlimeStaff); + r.AddRecipe(); } #endregion diff --git a/Utilities/CalamityUtils.cs b/Utilities/CalamityUtils.cs index 4b5c4e93b4..bd9c05f2e5 100644 --- a/Utilities/CalamityUtils.cs +++ b/Utilities/CalamityUtils.cs @@ -18,6 +18,7 @@ using CalamityMod.Tiles.Ores; using CalamityMod.Tiles.SunkenSea; using CalamityMod.World; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Graphics; using System; using System.Collections.Generic; @@ -2065,6 +2066,66 @@ namespace CalamityMod return result.ToString(); } + /// + /// Calculates the sound volume and panning for a sound which is played at the specified location in the game world.
+ /// Note that sound does not play on dedicated servers or during world generation. + ///
+ /// The position the sound is emitting from. If either X or Y is -1, the sound does not fade with distance. + /// Whether the sound is considered ambient, which makes it use the ambient sound slider in the options. Defaults to false. + /// Volume and pan, in that order. Volume is always between 0 and 1. Pan is always between -1 and 1. + public static (float, float) CalculateSoundStats(Vector2 soundPos, bool ambient = false) + { + float volume = 0f; + float pan = 0f; + + if (soundPos.X == -1f || soundPos.Y == -1f) + volume = 1f; + else if (WorldGen.gen || Main.dedServ || Main.netMode == NetmodeID.Server) + volume = 0f; + else + { + float topLeftX = Main.screenPosition.X - Main.screenWidth * 2f; + float topLeftY = Main.screenPosition.Y - Main.screenHeight * 2f; + + // Sounds cannot be heard from more than ~2.5 screens away. + // This rectangle is 5x5 screens centered on the current screen center position. + Rectangle audibleArea = new Rectangle((int)topLeftX, (int)topLeftY, Main.screenWidth * 5, Main.screenHeight * 5); + Rectangle soundHitbox = new Rectangle((int)soundPos.X, (int)soundPos.Y, 1, 1); + Vector2 screenCenter = Main.screenPosition + new Vector2(Main.screenWidth * 0.5f, Main.screenHeight * 0.5f); + if (audibleArea.Intersects(soundHitbox)) + { + pan = (soundPos.X - screenCenter.X) / (Main.screenWidth * 0.5f); + float dist = Vector2.Distance(soundPos, screenCenter); + volume = 1f - (dist / (Main.screenWidth * 1.5f)); + } + } + + pan = MathHelper.Clamp(pan, -1f, 1f); + volume = MathHelper.Clamp(volume, 0f, 1f); + if (ambient) + volume = Main.gameInactive ? 0f : volume * Main.ambientVolume; + else + volume *= Main.soundVolume; + + // This is actually done by vanilla. I guess if the sound volume gets corrupted during gameplay, you can't blast your eardrums out. + volume = MathHelper.Clamp(volume, 0f, 1f); + return (volume, pan); + } + + /// + /// Convenience function to utilize CalculateSoundStats immediately on an existing sound effect.
+ /// This allows updating a looping sound every single frame to have the correct volume and pan, even if the player drags the audio sliders around. + ///
+ /// The SoundEffectInstance which is having its values updated. + /// The position the sound is emitting from. If either X or Y is -1, the sound does not fade with distance. + /// Whether the sound is considered ambient, which makes it use the ambient sound slider in the options. Defaults to false. + public static void ApplySoundStats(ref SoundEffectInstance sfx, Vector2 soundPos, bool ambient = false) + { + if (sfx is null || sfx.IsDisposed) + return; + (sfx.Volume, sfx.Pan) = CalculateSoundStats(soundPos, ambient); + } + public static void StartSandstorm() { typeof(Terraria.GameContent.Events.Sandstorm).GetMethod("StartSandstorm", BindingFlags.Static | BindingFlags.NonPublic).Invoke(null, null); diff --git a/World/SunkenSea.cs b/World/SunkenSea.cs index fc51b51489..a1b9d7a5aa 100644 --- a/World/SunkenSea.cs +++ b/World/SunkenSea.cs @@ -128,10 +128,10 @@ namespace CalamityMod.World } for (int num7 = 0; num7 < list.Count; num7++) { - foreach (Point expr_205 in list[num7]) + foreach (Point point2 in list[num7]) { - int x = expr_205.X; - int y = expr_205.Y; + int x = point2.X; + int y = point2.Y; if (array2[x, y] == -1) { break; diff --git a/World/WorldGenerationMethods.cs b/World/WorldGenerationMethods.cs index e3dd921a67..87bd9b010d 100644 --- a/World/WorldGenerationMethods.cs +++ b/World/WorldGenerationMethods.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Accessories; +using CalamityMod.Items.Materials; using CalamityMod.Items.Mounts; using CalamityMod.Items.Pets; using CalamityMod.Items.Placeables.Furniture; @@ -34,44 +35,50 @@ namespace CalamityMod.World { public class WorldGenerationMethods : ModWorld { - #region BiomeChests + #region Dungeon Biome Chests public static void GenerateBiomeChests(GenerationProgress progress) { + progress.Message = "Calamity Mod: Biome Chests"; + // Get dungeon size field infos. These fields are private for some reason int MinX = (int)typeof(WorldGen).GetField("dMinX", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null) + 25; int MaxX = (int)typeof(WorldGen).GetField("dMaxX", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null) - 25; int MaxY = (int)typeof(WorldGen).GetField("dMaxY", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null) - 25; - int[] ChestTypes = new int[] { ModContent.TileType() }; - int[] ItemTypes = new int[] { ModContent.ItemType() }; - progress.Message = "Calamity Mod: Biome Chests"; + int[] ChestTypes = { ModContent.TileType() }; + int[] ItemTypes = { ModContent.ItemType() }; + int[] ChestStyles = { 1 }; // Astral Chest generates in style 1, which is locked - int rounds = 1; - for (int i = 0; i < ChestTypes.Length * rounds; i++) + for (int i = 0; i < ChestTypes.Length; ++i) { Chest chest = null; int attempts = 0; + + // Try 1000 times to place the chest somewhere in the dungeon. + // The placement algorithm ensures that if it tries to appear in midair, it is moved down to the floor. while (chest == null && attempts < 1000) { attempts++; int x = WorldGen.genRand.Next(MinX, MaxX); int y = WorldGen.genRand.Next((int)Main.worldSurface, MaxY); if (Main.wallDungeon[Main.tile[x, y].wall] && !Main.tile[x, y].active()) - { - chest = AddChestWithDefaultLoot(x, y, (ushort)ChestTypes[i % ChestTypes.Length], 1, 1); - } + chest = AddChestWithLoot(x, y, (ushort)ChestTypes[i], tileStyle: ChestStyles[i]); } + + // If a chest was placed, force its first item to be the unique Biome Chest weapon. if (chest != null) { - chest.item[0].SetDefaults(ItemTypes[i % ChestTypes.Length]); + chest.item[0].SetDefaults(ItemTypes[i]); chest.item[0].Prefix(-1); } } } - internal static Chest AddChestWithDefaultLoot(int i, int j, ushort type = TileID.Containers, uint emptySlots = 1, int Style = 0) + private static Chest AddChestWithLoot(int i, int j, ushort type = TileID.Containers, uint startingSlot = 1, int tileStyle = 0) { - Chest chest = null; + int chestIndex = -1; + + // Slide downwards on the Y axis trying to find the floor beneath the empty position initially picked while (j < Main.maxTilesY - 210) { if (!WorldGen.SolidTile(i, j)) @@ -79,94 +86,88 @@ namespace CalamityMod.World j++; continue; } - int chestIndex = WorldGen.PlaceChest(i - 1, j - 1, type, false, Style); - if (chestIndex < 0) - { - break; - } - chest = Main.chest[chestIndex]; - uint itemIndex = emptySlots; - while (itemIndex == emptySlots) - { - bool AstralChest = type == ModContent.TileType(); - int cItem; - cItem = WorldGen.genRand.NextBool() ? WorldGen.goldBar : WorldGen.silverBar; - int addAmount = 0; - if (AstralChest) - addAmount = 4; - chest.item[itemIndex].SetDefaults(cItem, false); - chest.item[itemIndex].stack = WorldGen.genRand.Next(3 + addAmount, 11 + addAmount * 2); - itemIndex++; - if (WorldGen.genRand.NextBool()) - { - cItem = ItemID.HolyArrow; - int addAmount2 = 0; - if (AstralChest) - addAmount2 = 25; - chest.item[itemIndex].SetDefaults(cItem, false); - chest.item[itemIndex].stack = WorldGen.genRand.Next(25 + addAmount2, 51 + addAmount2 * 2); - itemIndex++; - } - if (AstralChest) - { - chest.item[itemIndex].SetDefaults(ModContent.ItemType(), false); - chest.item[itemIndex].stack = WorldGen.genRand.Next(3, 6); - itemIndex++; - } - if (WorldGen.genRand.NextBool()) - { - int[] items = new int[] { - ItemID.SpelunkerPotion, ItemID.FeatherfallPotion, ItemID.NightOwlPotion, - ItemID.WaterWalkingPotion, ItemID.ArcheryPotion, ItemID.GravitationPotion - }; - if (AstralChest) - { - items[1] = ModContent.ItemType(); - items[4] = ItemID.ShinePotion; - items[5] = ItemID.HunterPotion; - } - chest.item[itemIndex].SetDefaults(WorldGen.genRand.Next(items), false); - chest.item[itemIndex].stack = WorldGen.genRand.Next(1, 3); - itemIndex++; - } - if (WorldGen.genRand.NextBool()) - { - int[] items = new int[] { - ItemID.ThornsPotion, ItemID.WaterWalkingPotion, ItemID.InvisibilityPotion, - ItemID.ManaRegenerationPotion, ItemID.TeleportationPotion, ItemID.TrapsightPotion, ItemID.TrapsightPotion // yes, dangersense potions have double the chance as other potions in vanilla for some reason - }; - if (AstralChest) - { - items[1] = ItemID.MagicPowerPotion; - items[2] = ModContent.ItemType(); - items[5] = ModContent.ItemType(); - } - chest.item[itemIndex].SetDefaults(WorldGen.genRand.Next(items), false); - chest.item[itemIndex].stack = WorldGen.genRand.Next(1, 3); - itemIndex++; - } - if (WorldGen.genRand.NextBool()) - { - cItem = ItemID.RecallPotion; - int addAmount2 = 0; - if (AstralChest) - { - cItem = ItemID.BouncyDynamite; - addAmount2 = 2; - } - chest.item[itemIndex].SetDefaults(cItem, false); - chest.item[itemIndex].stack = WorldGen.genRand.Next(1, 3) * addAmount2; - itemIndex++; - } - if (AstralChest) - addAmount = 2; - chest.item[itemIndex].SetDefaults(ItemID.GoldCoin, false); - chest.item[itemIndex].stack = WorldGen.genRand.Next(1, 3) * addAmount; - itemIndex++; - } + + // If there are already 1,000 chests in the world and this one fails to place, just give up. + chestIndex = WorldGen.PlaceChest(i - 1, j - 1, type, false, tileStyle); + break; } + + if (chestIndex < 0) + return null; + Chest chest = Main.chest[chestIndex]; + PlaceLootInChest(ref chest, type, startingSlot); return chest; } + + private static void PlaceLootInChest(ref Chest chest, ushort type, uint startingSlot) + { + uint itemIndex = startingSlot; + + void PutItemInChest(ref Chest c, int id, int minQuantity = 0, int maxQuantity = 0, bool condition = true) + { + if (!condition) + return; + c.item[itemIndex].SetDefaults(id, false); + + // Don't set quantity unless quantity is specified + if(minQuantity > 0) + { + // Max quantity cannot be less than min quantity. It's zero if not specified, meaning you get exactly minQuantity. + if (maxQuantity < minQuantity) + maxQuantity = minQuantity; + c.item[itemIndex].stack = WorldGen.genRand.Next(minQuantity, maxQuantity + 1); + } + itemIndex++; + } + + // Astral Chest has completely different loot in it + if (type == ModContent.TileType()) + { + PutItemInChest(ref chest, ModContent.ItemType(), 30, 80); + PutItemInChest(ref chest, ModContent.ItemType(), 10, 14); + PutItemInChest(ref chest, ModContent.ItemType(), 8); + PutItemInChest(ref chest, ModContent.ItemType(), 3, 5); + PutItemInChest(ref chest, ItemID.FallenStar, 12, 30); + + // Gold Coins don't stack above 100, so this efficiently lets you stuff over a platinum into a chest + int goldCoins = WorldGen.genRand.Next(30, 120); + if (goldCoins > 100) + { + PutItemInChest(ref chest, ItemID.PlatinumCoin); + goldCoins -= 100; + } + PutItemInChest(ref chest, ItemID.GoldCoin, goldCoins); + } + + // Default loot + else + { + // Silver, Tungsten, Gold or Platinum bars (following worldgen choice) + int barID = WorldGen.genRand.NextBool() ? WorldGen.goldBar : WorldGen.silverBar; + PutItemInChest(ref chest, barID, 3, 10); + + // 50% chance of 25-50 Holy Arrows + PutItemInChest(ref chest, ItemID.HolyArrow, 25, 50, WorldGen.genRand.NextBool()); + + // 50% chance of 1 or 2 of the following potions + int[] potions = new int[] { + ItemID.SpelunkerPotion, ItemID.FeatherfallPotion, ItemID.NightOwlPotion, + ItemID.WaterWalkingPotion, ItemID.ArcheryPotion, ItemID.GravitationPotion + }; + PutItemInChest(ref chest, WorldGen.genRand.Next(potions), 1, 2, WorldGen.genRand.NextBool()); + + // 50% chance of 1 or 2 of the following potions + // Yes, in vanilla, Dangersense Potions have double the chance to appear. + potions = new int[] { + ItemID.ThornsPotion, ItemID.WaterWalkingPotion, ItemID.InvisibilityPotion, + ItemID.ManaRegenerationPotion, ItemID.TeleportationPotion, ItemID.TrapsightPotion, ItemID.TrapsightPotion + }; + + PutItemInChest(ref chest, WorldGen.genRand.Next(potions), 1, 2, WorldGen.genRand.NextBool()); + PutItemInChest(ref chest, ItemID.RecallPotion, 1, 2, WorldGen.genRand.NextBool()); + PutItemInChest(ref chest, ItemID.GoldCoin, 1, 2); + } + } #endregion #region New Temple @@ -195,7 +196,7 @@ namespace CalamityMod.World public static void GenNewTemple(int x, int y) { - Rectangle[] array = new Rectangle[40]; + Rectangle[] array = new Rectangle[200]; float num = (float)(Main.maxTilesX / 4200); int num2 = WorldGen.genRand.Next((int)(num * 12f), (int)(num * 16f)); int num3 = 1; @@ -2742,10 +2743,10 @@ namespace CalamityMod.World int num22 = i + (num2 / 2 + 1) * -num; WorldGen.PlaceTile(num22, num7 - 1, 14, true, false, -1, WorldGen.crimson ? 1 : 8); //table WorldGen.PlaceTile(num22 - 2, num7 - 1, 15, true, false, 0, WorldGen.crimson ? 2 : 11); //chair - Tile expr_510 = Main.tile[num22 - 2, num7 - 1]; - expr_510.frameX += 18; - Tile expr_531 = Main.tile[num22 - 2, num7 - 2]; - expr_531.frameX += 18; + Tile tile = Main.tile[num22 - 2, num7 - 1]; + tile.frameX += 18; + Tile tile2 = Main.tile[num22 - 2, num7 - 2]; + tile2.frameX += 18; WorldGen.PlaceTile(num22 + 2, num7 - 1, 15, true, false, 0, WorldGen.crimson ? 2 : 11); //chair } #endregion @@ -3124,10 +3125,10 @@ namespace CalamityMod.World int num22 = i + (num2 / 2 + 1) * -num; WorldGen.PlaceTile(num22, num7 - 1, 14, true, false, -1, 13); //table WorldGen.PlaceTile(num22 - 2, num7 - 1, 15, true, false, 0, 16); //chair - Tile expr_510 = Main.tile[num22 - 2, num7 - 1]; - expr_510.frameX += 18; - Tile expr_531 = Main.tile[num22 - 2, num7 - 2]; - expr_531.frameX += 18; + Tile tile = Main.tile[num22 - 2, num7 - 1]; + tile.frameX += 18; + Tile tile2 = Main.tile[num22 - 2, num7 - 2]; + tile2.frameX += 18; WorldGen.PlaceTile(num22 + 2, num7 - 1, 15, true, false, 0, 16); //chair } #endregion