diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 97d7e90159..7ef0de9576 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -305,6 +305,8 @@ namespace CalamityMod.CalPlayer public bool eclipseMirror = false; public bool eclipseMirrorCooldown = false; public bool oldDie = false; + public bool featherCrown = false; + public bool moonCrown = false; // Armor Set public bool victideSet = false; @@ -1012,6 +1014,8 @@ namespace CalamityMod.CalPlayer abyssalMirrorCooldown = false; eclipseMirror = false; eclipseMirrorCooldown = false; + featherCrown = false; + moonCrown = false; shadowflame = false; wDeath = false; @@ -4790,23 +4794,9 @@ namespace CalamityMod.CalPlayer for (int i = 0; i < 50; i++) { - //Get which projectile to use - int projType = Main.rand.Next(0, 3); - int lumenylType; - switch (projType) - { - case 0: - lumenylType = mod.ProjectileType("AbyssalMirrorProjectile1"); - break; - case 1: - lumenylType = mod.ProjectileType("AbyssalMirrorProjectile2"); - break; - default: - lumenylType = mod.ProjectileType("AbyssalMirrorProjectile3"); - break; - } - int lumenyl = Projectile.NewProjectile(player.Center.X, player.Center.Y, Main.rand.NextFloat(-2f, 2f), Main.rand.NextFloat(-2f, 2f), lumenylType, 55, 0, player.whoAmI); + int lumenyl = Projectile.NewProjectile(player.Center.X, player.Center.Y, Main.rand.NextFloat(-2f, 2f), Main.rand.NextFloat(-2f, 2f), mod.ProjectileType("AbyssalMirrorProjectile"), 55, 0, player.whoAmI); Main.projectile[lumenyl].rotation = Main.rand.NextFloat(0, 360); + Main.projectile[lumenyl].frame = Main.rand.Next(0, 4); } } } diff --git a/Items/Accessories/FeatherCrown.cs b/Items/Accessories/FeatherCrown.cs new file mode 100644 index 0000000000..5de38271e6 --- /dev/null +++ b/Items/Accessories/FeatherCrown.cs @@ -0,0 +1,51 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.CalPlayer; + +namespace CalamityMod.Items.Accessories +{ + public class FeatherCrown : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Feather Crown"); + Tooltip.SetDefault("15% increased rogue projectile velocity\n" + + "Stealth strikes cause feathers to fall from the sky on enemy hits"); + } + + public override void SetDefaults() + { + item.width = 20; + item.height = 20; + item.value = Item.buyPrice(0, 0, 80, 0); + item.rare = 4; + item.accessory = true; + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + CalamityPlayer modPlayer = player.GetModPlayer(mod); + modPlayer.throwingVelocity += 0.15f; + modPlayer.featherCrown = true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.GoldCrown); + recipe.AddIngredient(mod.ItemType("AerialiteBar"), 6); + recipe.AddIngredient(ItemID.Feather, 8); + recipe.AddTile(TileID.SkyMill); + recipe.SetResult(this); + recipe.AddRecipe(); + recipe = new ModRecipe(mod); + recipe.AddIngredient(ItemID.PlatinumCrown); + recipe.AddIngredient(mod.ItemType("AerialiteBar"), 6); + recipe.AddIngredient(ItemID.Feather, 8); + recipe.AddTile(TileID.SkyMill); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Accessories/FeatherCrown.png b/Items/Accessories/FeatherCrown.png new file mode 100644 index 0000000000..00716d0487 Binary files /dev/null and b/Items/Accessories/FeatherCrown.png differ diff --git a/Items/Accessories/MoonstoneCrown.cs b/Items/Accessories/MoonstoneCrown.cs new file mode 100644 index 0000000000..707312fb45 --- /dev/null +++ b/Items/Accessories/MoonstoneCrown.cs @@ -0,0 +1,45 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.CalPlayer; + +namespace CalamityMod.Items.Accessories +{ + public class MoonstoneCrown : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Moonstone Crown"); + Tooltip.SetDefault("15% increased rogue projectile velocity\n" + + "Stealth strikes summon lunar flares on enemy hits\n" + + "Rogue projectiles very occasionally summon moon sigils behind them"); + } + + public override void SetDefaults() + { + item.width = 20; + item.height = 20; + item.value = Item.buyPrice(0, 18, 0, 0); + item.GetGlobalItem(mod).postMoonLordRarity = 12; + item.accessory = true; + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + CalamityPlayer modPlayer = player.GetModPlayer(mod); + modPlayer.throwingVelocity += 0.15f; + modPlayer.moonCrown = true; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(mod.ItemType("AerialiteBar")); + recipe.AddIngredient(ItemID.LunarBar, 5); + recipe.AddIngredient(mod.ItemType("GalacticaSingularity"), 5); + recipe.AddTile(TileID.LunarCraftingStation); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Accessories/MoonstoneCrown.png b/Items/Accessories/MoonstoneCrown.png new file mode 100644 index 0000000000..e889e88ce5 Binary files /dev/null and b/Items/Accessories/MoonstoneCrown.png differ diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 43a59770f1..ad6ac29ea5 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -38,6 +38,9 @@ namespace CalamityMod.Projectiles public int spawnedPlayerMinionProjectileDamageValue = 0; public int defDamage = 0; + // Rogue Stuff + public bool stealthStrike = false; //Update all existing rogue weapons with this + // Iron Heart public int ironHeartDamage = 0; @@ -528,6 +531,18 @@ namespace CalamityMod.Projectiles int dust = Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 244, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f, 0, default, 0.5f); Main.dust[dust].noGravity = true; } + + if (rogue) + { + if (Main.player[projectile.owner].GetCalamityPlayer().moonCrown) + { + //Summon moon sigils infrequently + if (Main.rand.NextBool(300)) + { + Projectile.NewProjectile(projectile.position, Vector2.Zero, mod.ProjectileType("MoonSigil"), 10, 0); + } + } + } } #endregion @@ -1095,7 +1110,32 @@ namespace CalamityMod.Projectiles num9 *= num10; Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, num8, num9, mod.ProjectileType("XerocStar"), (int)((double)num * 1.6), 0f, projectile.owner, (float)num6, 0f); } - } + + if (Main.player[projectile.owner].GetCalamityPlayer().featherCrown && stealthStrike) + { + for (int i = 0; i < 10; i++) + { + Vector2 pos = new Vector2(target.position.X + (float)target.width * 0.5f + (float)Main.rand.Next(-201, 201), Main.screenPosition.Y - 600f - Main.rand.Next(50)); + float speedX = (target.position.X - pos.X) / 30f; + float speedY = (target.position.Y - pos.Y) * 8; + int feather = Projectile.NewProjectile(pos.X, pos.Y, speedX, speedY, mod.ProjectileType("StickyFeather"), 15, 3, projectile.owner, 0f, (float)Main.rand.Next(15)); + Main.projectile[feather].magic = false; + Main.projectile[feather].GetGlobalProjectile(mod).rogue = true; + } + } + + if (Main.player[projectile.owner].GetCalamityPlayer().moonCrown && stealthStrike) + { + for (int i = 0; i < 20; i++) + { + Vector2 pos = new Vector2(target.position.X + (float)target.width * 0.5f + (float)Main.rand.Next(-201, 201), Main.screenPosition.Y - 600f - Main.rand.Next(50)); + Vector2 velocity = (target.position - pos) / 10f; + int flare = Projectile.NewProjectile(pos, velocity, ProjectileID.LunarFlare, 50, 3, projectile.owner); + Main.projectile[flare].magic = false; + Main.projectile[flare].GetGlobalProjectile(mod).rogue = true; + } + } + } else if (projectile.minion || projectile.sentry || CalamityMod.projectileMinionList.Contains(projectile.type)) { if (Main.player[projectile.owner].GetCalamityPlayer().pArtifact) diff --git a/Projectiles/Rogue/AbyssalMirrorProjectile1.cs b/Projectiles/Rogue/AbyssalMirrorProjectile.cs similarity index 85% rename from Projectiles/Rogue/AbyssalMirrorProjectile1.cs rename to Projectiles/Rogue/AbyssalMirrorProjectile.cs index 5c9e704a5f..fceb84d554 100644 --- a/Projectiles/Rogue/AbyssalMirrorProjectile1.cs +++ b/Projectiles/Rogue/AbyssalMirrorProjectile.cs @@ -4,17 +4,18 @@ using CalamityMod.CalPlayer; namespace CalamityMod.Projectiles.Rogue { - public class AbyssalMirrorProjectile1 : ModProjectile + public class AbyssalMirrorProjectile : ModProjectile { public override void SetStaticDefaults() { DisplayName.SetDefault("Lumenyl Fluid"); - } + Main.projFrames[projectile.type] = 3; + } public override void SetDefaults() { projectile.width = 12; - projectile.height = 12; + projectile.height = 14; projectile.friendly = true; projectile.alpha = 0; projectile.penetrate = -1; @@ -22,7 +23,7 @@ namespace CalamityMod.Projectiles.Rogue projectile.ignoreWater = true; projectile.timeLeft = 50; projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 2; + projectile.localNPCHitCooldown = -1; Mod calamity = ModLoader.GetMod("CalamityMod"); projectile.GetGlobalProjectile(calamity).rogue = true; } diff --git a/Projectiles/Rogue/AbyssalMirrorProjectile.png b/Projectiles/Rogue/AbyssalMirrorProjectile.png new file mode 100644 index 0000000000..e7cc9f5a56 Binary files /dev/null and b/Projectiles/Rogue/AbyssalMirrorProjectile.png differ diff --git a/Projectiles/Rogue/AbyssalMirrorProjectile1.png b/Projectiles/Rogue/AbyssalMirrorProjectile1.png deleted file mode 100644 index 7fed7e0043..0000000000 Binary files a/Projectiles/Rogue/AbyssalMirrorProjectile1.png and /dev/null differ diff --git a/Projectiles/Rogue/AbyssalMirrorProjectile2.cs b/Projectiles/Rogue/AbyssalMirrorProjectile2.cs deleted file mode 100644 index 44d911d0a1..0000000000 --- a/Projectiles/Rogue/AbyssalMirrorProjectile2.cs +++ /dev/null @@ -1,43 +0,0 @@ -using Terraria; -using Terraria.ModLoader; -using CalamityMod.CalPlayer; - -namespace CalamityMod.Projectiles.Rogue -{ - public class AbyssalMirrorProjectile2 : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Lumenyl Fluid"); - } - - public override void SetDefaults() - { - projectile.width = 12; - projectile.height = 12; - projectile.friendly = true; - projectile.alpha = 0; - projectile.penetrate = -1; - projectile.tileCollide = true; - projectile.ignoreWater = true; - projectile.timeLeft = 50; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 2; - Mod calamity = ModLoader.GetMod("CalamityMod"); - projectile.GetGlobalProjectile(calamity).rogue = true; - } - - public override void AI() - { - if (projectile.timeLeft < 25) { projectile.alpha += 10; } - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - if (!target.friendly && target.rarity != 2 && !CalamityPlayer.areThereAnyDamnBosses) - { - target.AddBuff(mod.BuffType("SilvaStun"), 300); - } - } - } -} diff --git a/Projectiles/Rogue/AbyssalMirrorProjectile2.png b/Projectiles/Rogue/AbyssalMirrorProjectile2.png deleted file mode 100644 index 26516f9035..0000000000 Binary files a/Projectiles/Rogue/AbyssalMirrorProjectile2.png and /dev/null differ diff --git a/Projectiles/Rogue/AbyssalMirrorProjectile3.cs b/Projectiles/Rogue/AbyssalMirrorProjectile3.cs deleted file mode 100644 index 80e28ccd17..0000000000 --- a/Projectiles/Rogue/AbyssalMirrorProjectile3.cs +++ /dev/null @@ -1,43 +0,0 @@ -using Terraria; -using Terraria.ModLoader; -using CalamityMod.CalPlayer; - -namespace CalamityMod.Projectiles.Rogue -{ - public class AbyssalMirrorProjectile3 : ModProjectile - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Lumenyl Fluid"); - } - - public override void SetDefaults() - { - projectile.width = 12; - projectile.height = 12; - projectile.friendly = true; - projectile.alpha = 0; - projectile.penetrate = -1; - projectile.tileCollide = true; - projectile.ignoreWater = true; - projectile.timeLeft = 50; - projectile.usesLocalNPCImmunity = true; - projectile.localNPCHitCooldown = 2; - Mod calamity = ModLoader.GetMod("CalamityMod"); - projectile.GetGlobalProjectile(calamity).rogue = true; - } - - public override void AI() - { - if (projectile.timeLeft < 25) { projectile.alpha += 10; } - } - - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) - { - if (!target.friendly && target.rarity != 2 && !CalamityPlayer.areThereAnyDamnBosses) - { - target.AddBuff(mod.BuffType("SilvaStun"), 300); - } - } - } -} diff --git a/Projectiles/Rogue/AbyssalMirrorProjectile3.png b/Projectiles/Rogue/AbyssalMirrorProjectile3.png deleted file mode 100644 index bab50601a9..0000000000 Binary files a/Projectiles/Rogue/AbyssalMirrorProjectile3.png and /dev/null differ diff --git a/Projectiles/Rogue/MoonSigil.cs b/Projectiles/Rogue/MoonSigil.cs new file mode 100644 index 0000000000..2d26e87e69 --- /dev/null +++ b/Projectiles/Rogue/MoonSigil.cs @@ -0,0 +1,58 @@ +using Terraria; +using Terraria.ModLoader; +using CalamityMod.CalPlayer; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; + +namespace CalamityMod.Projectiles.Rogue +{ + public class MoonSigil : ModProjectile + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Moon Sigil"); + } + + public override void SetDefaults() + { + projectile.width = 20; + projectile.height = 20; + projectile.friendly = true; + projectile.alpha = 0; + projectile.penetrate = -1; + projectile.tileCollide = true; + projectile.ignoreWater = true; + projectile.timeLeft = 250; + projectile.usesLocalNPCImmunity = true; + projectile.localNPCHitCooldown = 2; + Mod calamity = ModLoader.GetMod("CalamityMod"); + projectile.GetGlobalProjectile(calamity).rogue = true; + } + + public override void AI() + { + if (projectile.timeLeft < 25) { projectile.alpha += 10; } + } + + public override void PostDraw(SpriteBatch spriteBatch, Color lightColor) + { + Texture2D texture = mod.GetTexture("Projectiles/Rogue/MoonSigil"); + spriteBatch.Draw + ( + texture, + new Vector2 + ( + projectile.position.X - Main.screenPosition.X + projectile.width * 0.5f, + projectile.position.Y - Main.screenPosition.Y + projectile.height - 20 * 0.5f + ), + new Rectangle(0, 0, 20, 20), + Color.White, + projectile.rotation, + new Vector2(10, 10), + projectile.scale, + SpriteEffects.None, + 0f + ); + } + } +} diff --git a/Projectiles/Rogue/MoonSigil.png b/Projectiles/Rogue/MoonSigil.png new file mode 100644 index 0000000000..75d98fdbe5 Binary files /dev/null and b/Projectiles/Rogue/MoonSigil.png differ