diff --git a/CalamityMod.cs b/CalamityMod.cs index 7816a03db1..319e017183 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -1106,7 +1106,6 @@ namespace CalamityMod NPCID.CultistDragonHead, NPCID.AncientCultistSquidhead, NPCID.AncientLight, - NPCID.AncientDoom, NPCID.Butcher, NPCID.Psycho, NPCID.DeadlySphere, diff --git a/Items/Weapons/FlameburstShortsword.cs b/Items/Weapons/FlameburstShortsword.cs index cfbdb6bebc..bb03200bc5 100644 --- a/Items/Weapons/FlameburstShortsword.cs +++ b/Items/Weapons/FlameburstShortsword.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Items.Weapons { if (target.life <= (target.lifeMax * 0.5f)) { - Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, 612, (int)((float)item.damage * player.meleeDamage), knockback, player.whoAmI, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); + Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, mod.ProjectileType("FuckYou"), (int)((float)item.damage * player.meleeDamage), knockback, player.whoAmI, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); } } } diff --git a/Items/Weapons/InfernaCutter.cs b/Items/Weapons/InfernaCutter.cs index e9dbdd5502..f31c9630fa 100644 --- a/Items/Weapons/InfernaCutter.cs +++ b/Items/Weapons/InfernaCutter.cs @@ -121,7 +121,7 @@ namespace CalamityMod.Items.Weapons { if (crit) { - Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, 612, (int)((float)item.damage * player.meleeDamage), knockback, player.whoAmI, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); + Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, mod.ProjectileType("FuckYou"), (int)((float)item.damage * player.meleeDamage), knockback, player.whoAmI, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); } target.AddBuff(BuffID.OnFire, 300); target.AddBuff(mod.BuffType("BrimstoneFlames"), 300); diff --git a/Items/Weapons/MantisClaws.cs b/Items/Weapons/MantisClaws.cs index bc9aae75b0..7198236076 100644 --- a/Items/Weapons/MantisClaws.cs +++ b/Items/Weapons/MantisClaws.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Items.Weapons public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { - Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, 612, 0, knockback, player.whoAmI, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); + Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, mod.ProjectileType("FuckYou"), 0, knockback, player.whoAmI, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); } } } diff --git a/Items/Weapons/PhoenixBlade.cs b/Items/Weapons/PhoenixBlade.cs index d55fad47e2..c47ce761ad 100644 --- a/Items/Weapons/PhoenixBlade.cs +++ b/Items/Weapons/PhoenixBlade.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Items.Weapons { if (target.life <= 0) { - Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, 612, damage, knockback, player.whoAmI, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); + Projectile.NewProjectile(target.Center.X, target.Center.Y, 0f, 0f, mod.ProjectileType("FuckYou"), damage, knockback, player.whoAmI, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); float randomSpeedX = (float)Main.rand.Next(5); float randomSpeedY = (float)Main.rand.Next(3, 7); Projectile.NewProjectile(target.Center.X, target.Center.Y, -randomSpeedX, -randomSpeedY, mod.ProjectileType("PhoenixHeal"), item.damage, knockback, player.whoAmI); diff --git a/NPCs/CalamityGlobalAI.cs b/NPCs/CalamityGlobalAI.cs index 97d25782fb..ef4d0b6722 100644 --- a/NPCs/CalamityGlobalAI.cs +++ b/NPCs/CalamityGlobalAI.cs @@ -10413,7 +10413,7 @@ namespace CalamityMod.NPCs (phase4 ? 2 : 0) - (phase5 ? 2 : 0); - float fireballSpeed = CalamityWorld.death ? 7.5f : 7f; + float fireballSpeed = (CalamityWorld.death ? 7f : 6.5f) - (isCultist ? 0f : 3f); int lightningOrbFireRate = 40 - (phase2 ? 5 : 0) - @@ -11390,6 +11390,92 @@ namespace CalamityMod.NPCs return false; } + + public static bool BuffedAncientDoomAI(NPC npc, Mod mod) + { + float num1496 = 420f; + float num1497 = 120f; + int num1498 = 1; + float value57 = 0f; + float value58 = 1f; + float num1499 = CalamityWorld.death ? 5.5f : 5f; + bool flag110 = npc.ai[1] < 0f || !Main.npc[(int)npc.ai[0]].active; + if (Main.npc[(int)npc.ai[0]].type == NPCID.CultistBoss) + { + if (Main.npc[(int)npc.ai[0]].life < Main.npc[(int)npc.ai[0]].lifeMax / 2) + { + num1498 = 2; + } + if (Main.npc[(int)npc.ai[0]].life < Main.npc[(int)npc.ai[0]].lifeMax / 4) + { + num1498 = 3; + } + } + else + { + flag110 = true; + } + npc.ai[1] += (float)num1498; + float num1500 = npc.ai[1] / num1497; + num1500 = MathHelper.Clamp(num1500, 0f, 1f); + npc.position = npc.Center; + npc.scale = MathHelper.Lerp(value57, value58, num1500); + npc.Center = npc.position; + npc.alpha = (int)(255f - num1500 * 255f); + if (Main.rand.Next(6) == 0) + { + Vector2 spinningpoint4 = Vector2.UnitY.RotatedByRandom(6.2831854820251465); + Dust dust17 = Main.dust[Dust.NewDust(npc.Center - spinningpoint4 * 20f, 0, 0, 27, 0f, 0f, 0, default(Color), 1f)]; + dust17.noGravity = true; + dust17.position = npc.Center - spinningpoint4 * (float)Main.rand.Next(10, 21) * npc.scale; + dust17.velocity = spinningpoint4.RotatedBy(1.5707963705062866, default(Vector2)) * 4f; + dust17.scale = 0.5f + Main.rand.NextFloat(); + dust17.fadeIn = 0.5f; + } + if (Main.rand.Next(6) == 0) + { + Vector2 spinningpoint5 = Vector2.UnitY.RotatedByRandom(6.2831854820251465); + Dust dust18 = Main.dust[Dust.NewDust(npc.Center - spinningpoint5 * 30f, 0, 0, 240, 0f, 0f, 0, default(Color), 1f)]; + dust18.noGravity = true; + dust18.position = npc.Center - spinningpoint5 * 20f * npc.scale; + dust18.velocity = spinningpoint5.RotatedBy(-1.5707963705062866, default(Vector2)) * 2f; + dust18.scale = 0.5f + Main.rand.NextFloat(); + dust18.fadeIn = 0.5f; + } + if (Main.rand.Next(6) == 0) + { + Vector2 vector254 = Vector2.UnitY.RotatedByRandom(6.2831854820251465); + Dust dust19 = Main.dust[Dust.NewDust(npc.Center - vector254 * 30f, 0, 0, 240, 0f, 0f, 0, default(Color), 1f)]; + dust19.position = npc.Center - vector254 * 20f * npc.scale; + dust19.velocity = Vector2.Zero; + dust19.scale = 0.5f + Main.rand.NextFloat(); + dust19.fadeIn = 0.5f; + dust19.noLight = true; + } + npc.localAI[0] += 0.05235988f; + npc.localAI[1] = 0.25f + Vector2.UnitY.RotatedBy((double)(npc.ai[1] * 6.28318548f / 60f), default(Vector2)).Y * 0.25f; + if (npc.ai[1] >= num1496) + { + flag110 = true; + if (Main.netMode != NetmodeID.MultiplayerClient) + { + int num; + for (int num1501 = 0; num1501 < 4; num1501 = num + 1) + { + Vector2 vector255 = new Vector2(0f, -num1499).RotatedBy((double)(1.57079637f * (float)num1501), default(Vector2)); + Projectile.NewProjectile(npc.Center.X, npc.Center.Y, vector255.X, vector255.Y, ProjectileID.AncientDoomProjectile, 45, 0f, Main.myPlayer, 0f, 0f); + num = num1501; + } + } + } + if (flag110) + { + npc.HitEffect(0, 9999.0); + npc.active = false; + } + + return false; + } #endregion #region Buffed Mothron AI diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 97cf264142..af6745744f 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -33,11 +33,6 @@ namespace CalamityMod.NPCs // Draedons Remote public static bool DraedonMayhem = false; - // Lunatic Cultist Rev+ attack - public int CultProjectiles = 2; - public float CultAngleSpread = 170f; - public int CultCountdown = 0; - // Debuffs public bool timeSlow = false; public bool wCleave = false; @@ -695,7 +690,7 @@ namespace CalamityMod.NPCs npc.lifeMax = CalamityWorld.death ? (int)(npc.lifeMax * 3.4) : (int)(npc.lifeMax * 2.3); npc.npcSlots = 32f; } - else if (npc.type == NPCID.PlanterasHook) + else if (npc.type == NPCID.PlanterasHook || npc.type == NPCID.AncientDoom) { npc.damage = (npc.defDamage = 0); } @@ -1599,6 +1594,8 @@ namespace CalamityMod.NPCs case NPCID.CultistBoss: case NPCID.CultistBossClone: return CalamityGlobalAI.BuffedCultistAI(npc, enraged, mod); + case NPCID.AncientDoom: + return CalamityGlobalAI.BuffedAncientDoomAI(npc, mod); default: break; diff --git a/NPCs/TheDevourerofGods/DevourerofGodsBody.cs b/NPCs/TheDevourerofGods/DevourerofGodsBody.cs index 0195e92a6d..cdbc3dff1d 100644 --- a/NPCs/TheDevourerofGods/DevourerofGodsBody.cs +++ b/NPCs/TheDevourerofGods/DevourerofGodsBody.cs @@ -24,10 +24,10 @@ namespace CalamityMod.NPCs.TheDevourerofGods npc.width = 56; npc.height = 56; npc.defense = 0; - npc.lifeMax = CalamityWorld.revenge ? 500000 : 450000; + npc.lifeMax = CalamityWorld.revenge ? 750000 : 675000; if (CalamityWorld.death) { - npc.lifeMax = 850000; + npc.lifeMax = 1300000; } double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); diff --git a/NPCs/TheDevourerofGods/DevourerofGodsBodyS.cs b/NPCs/TheDevourerofGods/DevourerofGodsBodyS.cs index b10f615674..a32d1f2077 100644 --- a/NPCs/TheDevourerofGods/DevourerofGodsBodyS.cs +++ b/NPCs/TheDevourerofGods/DevourerofGodsBodyS.cs @@ -25,10 +25,10 @@ namespace CalamityMod.NPCs.TheDevourerofGods npc.width = 70; npc.height = 70; npc.defense = 0; - npc.lifeMax = CalamityWorld.revenge ? 1875000 : 1650000; + npc.lifeMax = CalamityWorld.revenge ? 1450000 : 1250000; if (CalamityWorld.death) { - npc.lifeMax = 3060000; + npc.lifeMax = 2300000; } if (CalamityWorld.bossRushActive) { diff --git a/NPCs/TheDevourerofGods/DevourerofGodsHead.cs b/NPCs/TheDevourerofGods/DevourerofGodsHead.cs index beb0209cc5..5f45c23bef 100644 --- a/NPCs/TheDevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/TheDevourerofGods/DevourerofGodsHead.cs @@ -33,10 +33,10 @@ namespace CalamityMod.NPCs.TheDevourerofGods npc.width = 104; npc.height = 104; npc.defense = 0; - npc.lifeMax = CalamityWorld.revenge ? 500000 : 450000; + npc.lifeMax = CalamityWorld.revenge ? 750000 : 675000; if (CalamityWorld.death) { - npc.lifeMax = 850000; + npc.lifeMax = 1300000; } double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); @@ -697,14 +697,6 @@ namespace CalamityMod.NPCs.TheDevourerofGods } } - public override void ModifyHitByProjectile(Projectile projectile, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) - { - if (projectile.type == mod.ProjectileType("SulphuricAcidMist2")) - { - damage /= 2; - } - } - public override bool CanHitPlayer(Player target, ref int cooldownSlot) { cooldownSlot = 1; diff --git a/NPCs/TheDevourerofGods/DevourerofGodsHeadS.cs b/NPCs/TheDevourerofGods/DevourerofGodsHeadS.cs index f76c575be8..1f827f872b 100644 --- a/NPCs/TheDevourerofGods/DevourerofGodsHeadS.cs +++ b/NPCs/TheDevourerofGods/DevourerofGodsHeadS.cs @@ -39,10 +39,10 @@ namespace CalamityMod.NPCs.TheDevourerofGods npc.width = 186; npc.height = 186; npc.defense = 0; - npc.lifeMax = CalamityWorld.revenge ? 1875000 : 1650000; + npc.lifeMax = CalamityWorld.revenge ? 1450000 : 1250000; if (CalamityWorld.death) { - npc.lifeMax = 3060000; + npc.lifeMax = 2300000; } if (CalamityWorld.bossRushActive) { @@ -273,18 +273,18 @@ namespace CalamityMod.NPCs.TheDevourerofGods float speed = 4f; int divisor = CalamityWorld.bossRushActive ? 90 : (CalamityWorld.death ? 105 : 120); - // Walls from the sides if (laserShoot % divisor == 0) { Main.PlaySound(2, (int)Main.player[npc.target].position.X, (int)Main.player[npc.target].position.Y, 12); float targetPosY = Main.player[npc.target].position.Y + (Main.rand.NextBool(2) ? 50f : 0f); + // Side walls for (int x = 0; x < totalShots; x++) { Projectile.NewProjectile(Main.player[npc.target].position.X + 1000f, targetPosY + (float)shotSpacing[0], -speed, 0f, mod.ProjectileType("DoGDeath"), projectileDamage, 0f, Main.myPlayer, 0f, 0f); Projectile.NewProjectile(Main.player[npc.target].position.X - 1000f, targetPosY + (float)shotSpacing[0], speed, 0f, mod.ProjectileType("DoGDeath"), projectileDamage, 0f, Main.myPlayer, 0f, 0f); - shotSpacing[0] -= spacingVar; //105 + shotSpacing[0] -= spacingVar; } if (Main.rand.NextBool(2) && (CalamityWorld.revenge || CalamityWorld.bossRushActive)) @@ -298,22 +298,16 @@ namespace CalamityMod.NPCs.TheDevourerofGods shotSpacing[3] = 1050; } shotSpacing[0] = 1050; - } - // Wall from below - if (laserShoot % divisor == 0) - { + // Lower wall for (int x = 0; x < totalShots; x++) { Projectile.NewProjectile(Main.player[npc.target].position.X + (float)shotSpacing[1], Main.player[npc.target].position.Y + 1000f, 0f, -speed, mod.ProjectileType("DoGDeath"), projectileDamage, 0f, Main.myPlayer, 0f, 0f); - shotSpacing[1] -= spacingVar; //105 + shotSpacing[1] -= spacingVar; } shotSpacing[1] = 1050; - } - // Wall from above - if (laserShoot % divisor == 0) - { + // Upper wall if (lifeRatio < 0.4f && CalamityWorld.revenge) { if (shotSpacing[2] < 2100) @@ -322,7 +316,7 @@ namespace CalamityMod.NPCs.TheDevourerofGods for (int x = 0; x < 40; x++) { Projectile.NewProjectile(Main.player[npc.target].position.X + (float)shotSpacing[2], Main.player[npc.target].position.Y - 1000f, 0f, speed, mod.ProjectileType("DoGDeath"), projectileDamage, 0f, Main.myPlayer, 0f, 0f); - shotSpacing[2] -= spacingVar; //105 + shotSpacing[2] -= spacingVar; } shotSpacing[2] = 2100; } @@ -331,7 +325,7 @@ namespace CalamityMod.NPCs.TheDevourerofGods for (int x = 0; x < totalShots; x++) { Projectile.NewProjectile(Main.player[npc.target].position.X + (float)shotSpacing[2], Main.player[npc.target].position.Y - 1000f, 0f, speed, mod.ProjectileType("DoGDeath"), projectileDamage, 0f, Main.myPlayer, 0f, 0f); - shotSpacing[2] -= spacingVar; //105 + shotSpacing[2] -= spacingVar; } shotSpacing[2] = 1050; } @@ -909,14 +903,6 @@ namespace CalamityMod.NPCs.TheDevourerofGods CalamityMod.UpdateServerBoolean(); } - public override void ModifyHitByProjectile(Projectile projectile, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) - { - if (projectile.type == mod.ProjectileType("SulphuricAcidMist2")) - { - damage /= 2; - } - } - // Can only hit the target if within certain distance public override bool CanHitPlayer(Player target, ref int cooldownSlot) { diff --git a/NPCs/TheDevourerofGods/DevourerofGodsTail.cs b/NPCs/TheDevourerofGods/DevourerofGodsTail.cs index 7828a42da0..678d694707 100644 --- a/NPCs/TheDevourerofGods/DevourerofGodsTail.cs +++ b/NPCs/TheDevourerofGods/DevourerofGodsTail.cs @@ -22,10 +22,10 @@ namespace CalamityMod.NPCs.TheDevourerofGods npc.width = 66; npc.height = 66; npc.defense = 0; - npc.lifeMax = CalamityWorld.revenge ? 500000 : 450000; + npc.lifeMax = CalamityWorld.revenge ? 750000 : 675000; if (CalamityWorld.death) { - npc.lifeMax = 850000; + npc.lifeMax = 1300000; } double HPBoost = (double)Config.BossHealthPercentageBoost * 0.01; npc.lifeMax += (int)((double)npc.lifeMax * HPBoost); @@ -158,14 +158,6 @@ namespace CalamityMod.NPCs.TheDevourerofGods return true; } - public override void ModifyHitByProjectile(Projectile projectile, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) - { - if (projectile.type == mod.ProjectileType("SulphuricAcidMist2") || projectile.type == mod.ProjectileType("EidolicWail")) - { - damage /= 4; - } - } - public override void HitEffect(int hitDirection, double damage) { if (npc.life <= 0) diff --git a/NPCs/TheDevourerofGods/DevourerofGodsTailS.cs b/NPCs/TheDevourerofGods/DevourerofGodsTailS.cs index e42baedf33..913a0a1de5 100644 --- a/NPCs/TheDevourerofGods/DevourerofGodsTailS.cs +++ b/NPCs/TheDevourerofGods/DevourerofGodsTailS.cs @@ -27,10 +27,10 @@ namespace CalamityMod.NPCs.TheDevourerofGods npc.width = 80; npc.height = 140; npc.defense = 0; - npc.lifeMax = CalamityWorld.revenge ? 1875000 : 1650000; + npc.lifeMax = CalamityWorld.revenge ? 1450000 : 1250000; if (CalamityWorld.death) { - npc.lifeMax = 3060000; + npc.lifeMax = 2300000; } if (CalamityWorld.bossRushActive) { @@ -275,14 +275,6 @@ namespace CalamityMod.NPCs.TheDevourerofGods return true; } - public override void ModifyHitByProjectile(Projectile projectile, ref int damage, ref float knockback, ref bool crit, ref int hitDirection) - { - if (projectile.type == mod.ProjectileType("SulphuricAcidMist2") || projectile.type == mod.ProjectileType("EidolicWail")) - { - damage /= 4; - } - } - public override bool CheckActive() { return false; diff --git a/Projectiles/Magic/HolyLaser.cs b/Projectiles/Magic/HolyLaser.cs index 5070b9ee04..30096f88ee 100644 --- a/Projectiles/Magic/HolyLaser.cs +++ b/Projectiles/Magic/HolyLaser.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Projectiles.Magic { if (projectile.owner == Main.myPlayer) { - int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, 612, projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); + int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("FuckYou"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); Main.projectile[proj].GetGlobalProjectile(mod).forceMagic = true; } } diff --git a/Projectiles/Magic/SolarBeam2.cs b/Projectiles/Magic/SolarBeam2.cs index 69e4071df6..8330a37750 100644 --- a/Projectiles/Magic/SolarBeam2.cs +++ b/Projectiles/Magic/SolarBeam2.cs @@ -67,7 +67,7 @@ namespace CalamityMod.Projectiles.Magic target.immune[projectile.owner] = 4; if (projectile.owner == Main.myPlayer) { - int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, 612, projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); + int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("FuckYou"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); Main.projectile[proj].GetGlobalProjectile(mod).forceMagic = true; } } diff --git a/Projectiles/Melee/FlameScytheProjectileMelee.cs b/Projectiles/Melee/FlameScytheProjectileMelee.cs index e7e2d6d764..fdecd721f6 100644 --- a/Projectiles/Melee/FlameScytheProjectileMelee.cs +++ b/Projectiles/Melee/FlameScytheProjectileMelee.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Melee target.AddBuff(BuffID.OnFire, 300); if (projectile.owner == Main.myPlayer) { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, 612, projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("FuckYou"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); } } } diff --git a/Projectiles/Melee/FuckYou.cs b/Projectiles/Melee/FuckYou.cs new file mode 100644 index 0000000000..05e486c0bf --- /dev/null +++ b/Projectiles/Melee/FuckYou.cs @@ -0,0 +1,126 @@ +using System; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + public class FuckYou : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Explosion"); + Main.projFrames[projectile.type] = 5; + } + + public override void SetDefaults() + { + projectile.width = 8; + projectile.height = 8; + projectile.friendly = true; + projectile.ignoreWater = false; + projectile.tileCollide = false; + projectile.alpha = 255; + projectile.penetrate = -1; + projectile.timeLeft = 60; + projectile.melee = true; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 5; + } + + public override void AI() + { + Lighting.AddLight(projectile.Center, 0.9f, 0.8f, 0.6f); + projectile.ai[1] += 0.01f; + projectile.scale = projectile.ai[1] * 0.5f; + projectile.ai[0] += 1f; + if (projectile.ai[0] >= (float)(3 * Main.projFrames[projectile.type])) + { + projectile.Kill(); + return; + } + int num3 = projectile.frameCounter + 1; + projectile.frameCounter = num3; + if (num3 >= 3) + { + projectile.frameCounter = 0; + num3 = projectile.frame + 1; + projectile.frame = num3; + if (num3 >= Main.projFrames[projectile.type]) + { + projectile.hide = true; + } + } + projectile.alpha -= 63; + if (projectile.alpha < 0) + { + projectile.alpha = 0; + } + if (projectile.ai[0] == 1f) + { + projectile.position = projectile.Center; + projectile.width = (projectile.height = (int)(52f * projectile.scale)); + projectile.Center = projectile.position; + projectile.Damage(); + Main.PlaySound(SoundID.Item14, projectile.position); + for (int num991 = 0; num991 < 4; num991 = num3 + 1) + { + int num992 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num992].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; + num3 = num991; + } + for (int num993 = 0; num993 < 10; num993 = num3 + 1) + { + int num994 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 200, default(Color), 2.7f); + Main.dust[num994].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; + Main.dust[num994].noGravity = true; + Dust dust = Main.dust[num994]; + dust.velocity *= 3f; + num994 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 100, default(Color), 1.5f); + Main.dust[num994].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f; + dust = Main.dust[num994]; + dust.velocity *= 2f; + Main.dust[num994].noGravity = true; + Main.dust[num994].fadeIn = 2.5f; + num3 = num993; + } + for (int num995 = 0; num995 < 5; num995 = num3 + 1) + { + int num996 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 6, 0f, 0f, 0, default(Color), 2.7f); + Main.dust[num996].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)) * (float)projectile.width / 2f; + Main.dust[num996].noGravity = true; + Dust dust = Main.dust[num996]; + dust.velocity *= 3f; + num3 = num995; + } + for (int num997 = 0; num997 < 10; num997 = num3 + 1) + { + int num998 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 31, 0f, 0f, 0, default(Color), 1.5f); + Main.dust[num998].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default(Vector2)) * (float)projectile.width / 2f; + Main.dust[num998].noGravity = true; + Dust dust = Main.dust[num998]; + dust.velocity *= 3f; + num3 = num997; + } + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + return projectile.ai[0] > 1f; + } + + public override Color? GetAlpha(Color lightColor) + { + return new Color(255, 255, 255, 127); + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(BuffID.OnFire, 300); + projectile.direction = Main.player[projectile.owner].direction; + } + } +} diff --git a/Projectiles/Melee/FuckYou.png b/Projectiles/Melee/FuckYou.png new file mode 100644 index 0000000000..dd5b92073e Binary files /dev/null and b/Projectiles/Melee/FuckYou.png differ diff --git a/Projectiles/Melee/OPHammerMelee.cs b/Projectiles/Melee/OPHammerMelee.cs index 87fdef2c08..33f77e4cc0 100644 --- a/Projectiles/Melee/OPHammerMelee.cs +++ b/Projectiles/Melee/OPHammerMelee.cs @@ -116,7 +116,7 @@ namespace CalamityMod.Projectiles.Melee target.AddBuff(mod.BuffType("BrimstoneFlames"), 300); if (projectile.owner == Main.myPlayer) { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, 612, projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("FuckYou"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); } } diff --git a/Projectiles/Melee/Spears/ExsanguinationLanceProjectile.cs b/Projectiles/Melee/Spears/ExsanguinationLanceProjectile.cs index 51fa02a96a..a984cbc409 100644 --- a/Projectiles/Melee/Spears/ExsanguinationLanceProjectile.cs +++ b/Projectiles/Melee/Spears/ExsanguinationLanceProjectile.cs @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Melee.Spears target.AddBuff(BuffID.OnFire, 300); if (projectile.owner == Main.myPlayer) { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, 612, projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("FuckYou"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); } if (crit) { diff --git a/Projectiles/Melee/Yoyos/ChaotrixProjectile.cs b/Projectiles/Melee/Yoyos/ChaotrixProjectile.cs index 5d5baf2566..81c72bb94e 100644 --- a/Projectiles/Melee/Yoyos/ChaotrixProjectile.cs +++ b/Projectiles/Melee/Yoyos/ChaotrixProjectile.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos target.AddBuff(BuffID.OnFire, 300); if (projectile.owner == Main.myPlayer) { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, 612, projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); + Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("FuckYou"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); } } diff --git a/Projectiles/Ranged/DragonBurst.cs b/Projectiles/Ranged/DragonBurst.cs index 13c1eed2de..9a760b8ef2 100644 --- a/Projectiles/Ranged/DragonBurst.cs +++ b/Projectiles/Ranged/DragonBurst.cs @@ -57,8 +57,9 @@ namespace CalamityMod.Projectiles.Ranged { if (projectile.owner == Main.myPlayer) { - Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, 612, projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); - } + int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("FuckYou"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); + Main.projectile[proj].GetGlobalProjectile(mod).forceRanged = true; + } } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Ranged/ExplodingStake.cs b/Projectiles/Ranged/ExplodingStake.cs index d0bacb7ed2..589334b9dd 100644 --- a/Projectiles/Ranged/ExplodingStake.cs +++ b/Projectiles/Ranged/ExplodingStake.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Projectiles.Ranged target.immune[projectile.owner] = 5; if (projectile.owner == Main.myPlayer) { - int boom = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, 612, projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); + int boom = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("FuckYou"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); Main.projectile[boom].GetGlobalProjectile(mod).forceRanged = true; } } diff --git a/Projectiles/Ranged/HolyFireBullet.cs b/Projectiles/Ranged/HolyFireBullet.cs index b13449867b..429ebdc681 100644 --- a/Projectiles/Ranged/HolyFireBullet.cs +++ b/Projectiles/Ranged/HolyFireBullet.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Ranged { if (projectile.owner == Main.myPlayer) { - int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, 612, (int)((double)projectile.damage * 0.85), projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); + int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("FuckYou"), (int)((double)projectile.damage * 0.85), projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); Main.projectile[proj].GetGlobalProjectile(mod).forceRanged = true; } for (int k = 0; k < 10; k++) diff --git a/Projectiles/Rogue/FlameScytheProjectile.cs b/Projectiles/Rogue/FlameScytheProjectile.cs index 69502c597f..a9ec2eae4c 100644 --- a/Projectiles/Rogue/FlameScytheProjectile.cs +++ b/Projectiles/Rogue/FlameScytheProjectile.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(BuffID.OnFire, 300); if (projectile.owner == Main.myPlayer) { - int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, 612, projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); + int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("FuckYou"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); Main.projectile[proj].GetGlobalProjectile(mod).forceRogue = true; } } diff --git a/Projectiles/Rogue/GhoulishGouger.cs b/Projectiles/Rogue/GhoulishGouger.cs index cdfc4778ac..b36f80b549 100644 --- a/Projectiles/Rogue/GhoulishGouger.cs +++ b/Projectiles/Rogue/GhoulishGouger.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Rogue if (projectile.ai[0] == 0f) { projectile.ai[1] += 1f; - if (projectile.ai[1] >= 30f) + if (projectile.ai[1] >= 45f) { projectile.ai[0] = 1f; projectile.ai[1] = 0f; diff --git a/Projectiles/Rogue/OPHammer.cs b/Projectiles/Rogue/OPHammer.cs index 069d2b7270..41efc251d1 100644 --- a/Projectiles/Rogue/OPHammer.cs +++ b/Projectiles/Rogue/OPHammer.cs @@ -116,7 +116,7 @@ namespace CalamityMod.Projectiles.Rogue target.AddBuff(mod.BuffType("BrimstoneFlames"), 300); if (projectile.owner == Main.myPlayer) { - int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, 612, projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); + int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, mod.ProjectileType("FuckYou"), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f); Main.projectile[proj].GetGlobalProjectile(mod).forceRogue = true; } }