diff --git a/Items/Ammo/BloodRune.cs b/Items/Ammo/BloodRune.cs new file mode 100644 index 0000000000..7cfc46677a --- /dev/null +++ b/Items/Ammo/BloodRune.cs @@ -0,0 +1,31 @@ +using CalamityMod.Projectiles.Magic; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Ammo +{ + public class BloodRune : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Blood Rune"); + Tooltip.SetDefault("Used with the Ice Barrage \n" + + "Found in some sort of runic landscape"); + } + + public override void SetDefaults() + { + item.damage = 1; + item.width = 22; + item.height = 24; + item.maxStack = 999; + item.consumable = true; + item.knockBack = 10f; + item.value = Item.buyPrice(0, 1, 0, 0); + item.Calamity().postMoonLordRarity = 21; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 0f; + item.ammo = item.type; // CONSIDER -- Would item.type work here instead of a self reference? + } + } +} diff --git a/Items/Ammo/BloodRune.png b/Items/Ammo/BloodRune.png new file mode 100644 index 0000000000..f77f7e58bf Binary files /dev/null and b/Items/Ammo/BloodRune.png differ diff --git a/Items/Weapons/Magic/IceBarrage.cs b/Items/Weapons/Magic/IceBarrage.cs new file mode 100644 index 0000000000..0c6c700c0f --- /dev/null +++ b/Items/Weapons/Magic/IceBarrage.cs @@ -0,0 +1,85 @@ +using CalamityMod.Items.Ammo; +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.Magic; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.Magic +{ + public class IceBarrage : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ice Barrage"); + Tooltip.SetDefault("Casts a deadly and powerful ice spell in the location of the cursor \n" + + "Consumes 2 Blood Runes every time its used \n" + + "Oh dear, you are dead!"); + } + + public override void SetDefaults() + { + item.width = 60; + item.height = 60; + item.Calamity().postMoonLordRarity = 21; + item.value = Item.buyPrice(1, 80, 0, 0); + item.useStyle = ItemUseStyleID.HoldingUp; + item.magic = true; + item.mana = 530; + item.noMelee = true; + item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/IceBarrageCast"); + + item.damage = 9000; + item.knockBack = 6f; + item.useTime = 300; + item.useAnimation = 300; + item.reuseDelay = 60; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 2f; + item.useAmmo = ModContent.ItemType(); + } + + public override bool CanUseItem(Player player) + { + return CalamityGlobalItem.HasEnoughAmmo(player, item, 2); + } + + public override bool ConsumeAmmo(Player player) + { + return false; + } + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + 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, type, damage, knockBack, player.whoAmI, 0f, 0f); + + CalamityGlobalItem.ConsumeAdditionalAmmo(player, item, 2); + + return false; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.BlizzardStaff); + recipe.AddIngredient(ItemID.IceRod); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ModContent.ItemType(), 23); + recipe.AddIngredient(ModContent.ItemType(), 18); + recipe.AddTile(ModContent.TileType()); + recipe.SetResult(this); + recipe.AddRecipe(); + } + + public override void UseStyle(Player player) + { + player.itemLocation.X -= 8f * player.direction; + player.itemRotation = player.direction * MathHelper.ToRadians(-45f); + } + } +} diff --git a/Items/Weapons/Magic/IceBarrage.png b/Items/Weapons/Magic/IceBarrage.png new file mode 100644 index 0000000000..ebcab85a1d Binary files /dev/null and b/Items/Weapons/Magic/IceBarrage.png differ diff --git a/Items/Weapons/Rogue/BurningStrife.cs b/Items/Weapons/Rogue/BurningStrife.cs index 7d44b2cec1..de2370dae1 100644 --- a/Items/Weapons/Rogue/BurningStrife.cs +++ b/Items/Weapons/Rogue/BurningStrife.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Rogue item.useAnimation = 25; item.useTime = 25; - item.damage = 60; + item.damage = 80; item.crit = 8; item.shootSpeed = 8f; item.shoot = ModContent.ProjectileType(); diff --git a/NPCs/TownNPCs/DILF.cs b/NPCs/TownNPCs/DILF.cs index 406cd0bf86..8265c33469 100644 --- a/NPCs/TownNPCs/DILF.cs +++ b/NPCs/TownNPCs/DILF.cs @@ -175,6 +175,11 @@ namespace CalamityMod.NPCs.TownNPCs shop.item[nextSlot].SetDefaults(ModContent.ItemType()); shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 15, 0, 0); nextSlot++; + if (Main.LocalPlayer.HasItem(ModContent.ItemType())) + { + shop.item[nextSlot].SetDefaults(ModContent.ItemType()); + nextSlot++; + } } // Make this Town NPC teleport to the King statue when triggered. diff --git a/Projectiles/Magic/IceBarrageMain.cs b/Projectiles/Magic/IceBarrageMain.cs new file mode 100644 index 0000000000..de666f090d --- /dev/null +++ b/Projectiles/Magic/IceBarrageMain.cs @@ -0,0 +1,171 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; +using Terraria.ID; +using CalamityMod.Buffs.StatDebuffs; + +namespace CalamityMod.Projectiles.Magic +{ + public class IceBarrageMain : ModProjectile + { + private int pwidth = 58; + private int pheight = 58; + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ice Barrage"); + } + + public override void SetDefaults() + { + projectile.width = pwidth; + projectile.height = pheight; + projectile.friendly = true; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.magic = true; + projectile.timeLeft = 280; + projectile.penetrate = -1; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 10; + } + + public override void AI() + { + projectile.ai[0]++; + projectile.ai[1]++; + for (int j = 0; j < 3; j++) + { + int num297 = Main.rand.NextBool(2) ? 68 : 67; + if (Main.rand.NextBool(4)) + { + num297 = 80; + } + if (projectile.ai[0] < 140f) + { + Vector2 direction = new Vector2(Main.rand.NextFloat(-4f, 4f), Main.rand.NextFloat(-4f, 4f)); + int dust = Dust.NewDust(projectile.Center, 1, 1, num297, direction.X, direction.Y, 50, default, 1.3f); + Main.dust[dust].noGravity = true; + } + else + { + int direct = Main.rand.NextBool(2) ? 1 : -1; + Vector2 dir1 = new Vector2(0f, 10f) * direct; + int dust1 = Dust.NewDust(projectile.position, projectile.width, projectile.height, num297, dir1.X, dir1.Y, 50, default, 1.3f); + Main.dust[dust1].noGravity = true; + Main.dust[dust1].velocity = dir1; + int direct2 = Main.rand.NextBool(2) ? 1 : -1; + Vector2 dir2 = new Vector2(10f, 0f) * direct2; + int dust2 = Dust.NewDust(projectile.position, projectile.width, projectile.height, num297, dir2.X, dir2.Y, 50, default, 1.3f); + Main.dust[dust2].noGravity = true; + Main.dust[dust2].velocity = dir2; + } + } + if (projectile.ai[0] < 55) + { + for (int i = 0; i < 10; i++) + { + int dtype1 = Main.rand.NextBool(2) ? 68 : 67; + if (Main.rand.NextBool(4)) + { + dtype1 = 80; + } + Vector2 Dpos = projectile.Center + new Vector2(Main.rand.NextFloat(250f, 270f), Main.rand.NextFloat(250f, 270f)).RotatedBy(MathHelper.ToRadians(Main.rand.Next(1, 360))); + Vector2 Dspeed = projectile.Center - Dpos; + Dspeed.Normalize(); + Dspeed *= 0.5f; + float Dscale = Main.rand.NextFloat(1.5f, 2f); + int d1 = Dust.NewDust(Dpos, 1, 1, dtype1, Dspeed.X, Dspeed.Y, 0, default, Dscale); + Main.dust[d1].velocity = Dspeed; + Main.dust[d1].noGravity = true; + } + } + else if (projectile.ai[0] == 55f) + { + for (int i = 0; i < 270; i++) + { + int dtype2 = Main.rand.NextBool(2) ? 68 : 67; + if (Main.rand.NextBool(4)) + { + dtype2 = 80; + } + Vector2 Dpos = projectile.Center + new Vector2(Main.rand.NextFloat(250f, 270f), Main.rand.NextFloat(250f, 270f)).RotatedBy(MathHelper.ToRadians(Main.rand.Next(1, 360))); + Vector2 Dspeed = projectile.Center - Dpos; + Dspeed.Normalize(); + Dspeed *= Main.rand.NextFloat(8f,34f); + float Dscale = Main.rand.NextFloat(1.5f, 2f); + int d1 = Dust.NewDust(Dpos, 1, 1, dtype2, Dspeed.X, Dspeed.Y, 0, default, Dscale); + Main.dust[d1].velocity = Dspeed; + Main.dust[d1].noGravity = true; + } + + } + else if (projectile.ai[0] == 140f) + { + Vector2 projcenter = projectile.Center; + projectile.width = 200; + projectile.height = 200; + projectile.Center = projcenter; + projectile.Damage(); + for (int i = 0; i < 180; i++) + { + int dtype3 = Main.rand.NextBool(2) ? 68 : 67; + if (Main.rand.NextBool(4)) + { + dtype3 = 80; + } + Vector2 explosiondir = new Vector2(Main.rand.NextFloat(-18f, 18f), Main.rand.NextFloat(-18f, 18f)); + int d2 = Dust.NewDust(projectile.Center, 1, 1, dtype3, explosiondir.X, explosiondir.Y, 50, default, 1.5f); + Main.dust[d2].noGravity = true; + } + for (int k = 0; k < 45; k++) + { + Vector2 projspeed = new Vector2(Main.rand.NextFloat(-8f, 8f), Main.rand.NextFloat(-8f, 8f)); + int ice = Projectile.NewProjectile(projectile.Center, projspeed, ProjectileID.NorthPoleSnowflake, (int)(projectile.damage * 0.05f), 2f, projectile.owner, 0f, (float)Main.rand.Next(3)); + Main.projectile[ice].timeLeft = 600; + Main.projectile[ice].melee = false; + Main.projectile[ice].Calamity().forceMagic = true; + } + projectile.width = pwidth; + projectile.height = pheight; + projectile.Center = projcenter; + Vector2 pos1 = new Vector2(projectile.Center.X, projectile.Center.Y - (projectile.height * 0.5f) - 44f); + int block1 = Projectile.NewProjectile(pos1, Vector2.Zero, ModContent.ProjectileType(), (int)(projectile.damage * 0.3f), 5f, projectile.owner, 0f, 0f); + Main.projectile[block1].Center = pos1; + Vector2 pos2 = new Vector2(projectile.Center.X + (projectile.width * 0.5f) + 48f, projectile.Center.Y); + int block2 = Projectile.NewProjectile(pos2, Vector2.Zero, ModContent.ProjectileType(), (int)(projectile.damage * 0.3f), 5f, projectile.owner, 1f, 0f); + Main.projectile[block2].Center = pos2; + Vector2 pos3 = new Vector2(projectile.Center.X, projectile.Center.Y + (projectile.height * 0.5f) + 44f); + int block3 = Projectile.NewProjectile(pos3, Vector2.Zero, ModContent.ProjectileType(), (int)(projectile.damage * 0.3f), 5f, projectile.owner, 2f, 0f); + Main.projectile[block3].Center = pos3; + Vector2 pos4 = new Vector2(projectile.Center.X - (projectile.width * 0.5f) - 49f, projectile.Center.Y); + int block4 = Projectile.NewProjectile(pos4, Vector2.Zero, ModContent.ProjectileType(), (int)(projectile.damage * 0.3f), 5f, projectile.owner, 3f, 0f); + Main.projectile[block4].Center = pos4; + } + if (projectile.ai[0] > 90) + { + if (projectile.ai[1] >= 5f) + { + Vector2 projspeed = new Vector2(Main.rand.NextFloat(-5f, 5f), Main.rand.NextFloat(-5f, 5f)); + int ice = Projectile.NewProjectile(projectile.Center, projspeed, ProjectileID.NorthPoleSnowflake, (int)(projectile.damage * 0.05f), 2f, projectile.owner, 0f, (float)Main.rand.Next(3)); + Main.projectile[ice].timeLeft = 600; + Main.projectile[ice].melee = false; + Main.projectile[ice].Calamity().forceMagic = true; + projectile.ai[1] = 0f; + } + } + } + + public override bool CanDamage() + { + if (projectile.ai[0] == 140f) + return true; + return false; + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + { + target.AddBuff(ModContent.BuffType(), 900); + target.AddBuff(ModContent.BuffType(), 900); + } + } +} diff --git a/Projectiles/Magic/IceBarrageMain.png b/Projectiles/Magic/IceBarrageMain.png new file mode 100644 index 0000000000..6ea4de3903 Binary files /dev/null and b/Projectiles/Magic/IceBarrageMain.png differ diff --git a/Projectiles/Magic/IceBlock.cs b/Projectiles/Magic/IceBlock.cs new file mode 100644 index 0000000000..dd4536fa42 --- /dev/null +++ b/Projectiles/Magic/IceBlock.cs @@ -0,0 +1,74 @@ +using Terraria; +using Terraria.ModLoader; +using Terraria.ID; +using Microsoft.Xna.Framework; + +namespace CalamityMod.Projectiles.Magic +{ + public class IceBlock : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ice Barrage"); + } + + public override void SetDefaults() + { + projectile.width = 58; + projectile.height = 58; + projectile.friendly = true; + projectile.tileCollide = false; + projectile.ignoreWater = true; + projectile.magic = true; + projectile.timeLeft = 140; + projectile.alpha = 255; + projectile.penetrate = -1; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 60; + } + + public override void AI() + { + if (projectile.alpha > 20) + { + projectile.alpha -= 12; + } + if(projectile.alpha < 20) + { + projectile.alpha = 20; + } + switch(projectile.ai[0]) + { + case 1: projectile.rotation = (MathHelper.Pi * 0.5f); + break; + case 2: projectile.rotation = MathHelper.Pi; + break; + case 3: projectile.rotation = (MathHelper.Pi * 1.5f); + break; + default: break; + } + } + + public override void Kill(int timeLeft) + { + for (int i = 0; i < 40; i++) + { + int num297 = Main.rand.NextBool(2) ? 68 : 67; + if (Main.rand.NextBool(4)) + { + num297 = 80; + } + Vector2 direction = new Vector2(Main.rand.NextFloat(-4f, 4f), Main.rand.NextFloat(-4f, 4f)); + int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, num297, direction.X, direction.Y, 50, default, 1.5f); + Main.dust[dust].noGravity = true; + } + Main.PlaySound(SoundID.NPCHit5, projectile.Center); + for (int i = 0; i< 8; i++) + { + Vector2 projdir = new Vector2(Main.rand.NextFloat(-10f, 10f), Main.rand.NextFloat(-10f, 10f)); + Vector2 projpos = projectile.Center + new Vector2(Main.rand.NextFloat(-50f, 50f), Main.rand.NextFloat(-50f, 50f)); + Projectile.NewProjectile(projpos, projdir, ModContent.ProjectileType(), (int)(projectile.damage * 0.2f), 4f, projectile.owner, Main.rand.Next(0, 2), 0f); + } + } + } +} diff --git a/Projectiles/Magic/IceBlock.png b/Projectiles/Magic/IceBlock.png new file mode 100644 index 0000000000..be4154e9ea Binary files /dev/null and b/Projectiles/Magic/IceBlock.png differ diff --git a/Projectiles/Magic/IceBlockIcicle.cs b/Projectiles/Magic/IceBlockIcicle.cs new file mode 100644 index 0000000000..ef1d5a730f --- /dev/null +++ b/Projectiles/Magic/IceBlockIcicle.cs @@ -0,0 +1,64 @@ +using Terraria; +using Terraria.ModLoader; +using Terraria.ID; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; + +namespace CalamityMod.Projectiles.Magic +{ + public class IceBlockIcicle : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Ice Barrage"); + } + + public override void SetDefaults() + { + projectile.width = 18; + projectile.height = 18; + projectile.friendly = true; + projectile.ignoreWater = true; + projectile.magic = true; + projectile.timeLeft = 600; + } + + public override void AI() + { + projectile.spriteDirection = projectile.direction = (projectile.velocity.X > 0).ToDirectionInt(); + projectile.rotation = projectile.velocity.ToRotation() + (projectile.spriteDirection == 1 ? 0f : MathHelper.Pi) + (MathHelper.Pi * 0.5f * projectile.direction); + projectile.velocity.Y += 0.25f; + if(projectile.velocity.Y > 16f) + { + projectile.velocity.Y = 16f; + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor) + { + if (projectile.ai[0] == 1f) + { + Texture2D texture = ModContent.GetTexture("CalamityMod/Projectiles/Magic/IceBlockIcicle2"); + Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition, new Rectangle?(new Rectangle(0, 0, texture.Width, texture.Height)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2(texture.Width / 2f, texture.Height / 2f), projectile.scale, SpriteEffects.None, 0f); + return false; + } + return true; + } + + public override void Kill(int timeLeft) + { + for (int i = 0; i < 20; i++) + { + int num297 = Main.rand.NextBool(2) ? 68 : 67; + if (Main.rand.NextBool(4)) + { + num297 = 80; + } + Vector2 direction = new Vector2(Main.rand.NextFloat(-4f, 4f), Main.rand.NextFloat(-4f, 4f)); + int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, num297, direction.X, direction.Y, 50, default, 1.1f); + Main.dust[dust].noGravity = true; + } + Main.PlaySound(SoundID.NPCHit5, projectile.Center); + } + } +} diff --git a/Projectiles/Magic/IceBlockIcicle.png b/Projectiles/Magic/IceBlockIcicle.png new file mode 100644 index 0000000000..a5900c7e0a Binary files /dev/null and b/Projectiles/Magic/IceBlockIcicle.png differ diff --git a/Projectiles/Magic/IceBlockIcicle2.png b/Projectiles/Magic/IceBlockIcicle2.png new file mode 100644 index 0000000000..5014c5f5e1 Binary files /dev/null and b/Projectiles/Magic/IceBlockIcicle2.png differ diff --git a/Projectiles/Summon/EndoCooperBody.cs b/Projectiles/Summon/EndoCooperBody.cs index 3503b0f4fa..33bca03eee 100644 --- a/Projectiles/Summon/EndoCooperBody.cs +++ b/Projectiles/Summon/EndoCooperBody.cs @@ -96,6 +96,7 @@ namespace CalamityMod.Projectiles.Summon Main.dust[dust].noGravity = true; } } + projectile.localAI[1] = AttackMode; //Damage Update if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue) diff --git a/Projectiles/Summon/EndoCooperLimbs.cs b/Projectiles/Summon/EndoCooperLimbs.cs index a161da7f0a..1a54f840b8 100644 --- a/Projectiles/Summon/EndoCooperLimbs.cs +++ b/Projectiles/Summon/EndoCooperLimbs.cs @@ -73,11 +73,12 @@ namespace CalamityMod.Projectiles.Summon SpawnDust(); } + AttackMode = (int)body.localAI[1]; //Rotation if (AttackMode == 3) { - projectile.rotation += 0.02f; + projectile.rotation += 0.015f; } else { diff --git a/Projectiles/Typeless/ShadowflameExplosion.cs b/Projectiles/Typeless/ShadowflameExplosion.cs index a2157362e0..b47c288c50 100644 --- a/Projectiles/Typeless/ShadowflameExplosion.cs +++ b/Projectiles/Typeless/ShadowflameExplosion.cs @@ -39,6 +39,10 @@ namespace CalamityMod.Projectiles.Typeless } projectile.ai[1] = 0f; } + if (projectile.timeLeft < 25) + { + projectile.damage = 0; + } } diff --git a/Projectiles/Typeless/ShadowflameExplosionBig.cs b/Projectiles/Typeless/ShadowflameExplosionBig.cs index 1d72d4bcc6..caf854b491 100644 --- a/Projectiles/Typeless/ShadowflameExplosionBig.cs +++ b/Projectiles/Typeless/ShadowflameExplosionBig.cs @@ -42,6 +42,10 @@ namespace CalamityMod.Projectiles.Typeless } projectile.ai[1] = 0f; } + if (projectile.timeLeft < 25) + { + projectile.damage = 0; + } } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Sounds/Item/IceBarrageCast.cs b/Sounds/Item/IceBarrageCast.cs new file mode 100644 index 0000000000..e049fa0553 --- /dev/null +++ b/Sounds/Item/IceBarrageCast.cs @@ -0,0 +1,18 @@ +using Terraria; +using Terraria.ModLoader; +using Microsoft.Xna.Framework.Audio; + +namespace CalamityMod.Sounds.Item +{ + public class IceBarrageCast : ModSound + { + public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type) + { + soundInstance = sound.CreateInstance(); + soundInstance.Volume = volume * 1f; + soundInstance.Pan = pan; + Main.PlaySoundInstance(soundInstance); + return soundInstance; + } + } +} diff --git a/Sounds/Item/IceBarrageCast.ogg b/Sounds/Item/IceBarrageCast.ogg new file mode 100644 index 0000000000..6265408239 Binary files /dev/null and b/Sounds/Item/IceBarrageCast.ogg differ