From 02fbf61389e3a2f95489d4cd2fe40276fd2193f9 Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Mon, 17 Jan 2022 01:21:06 -0600 Subject: [PATCH] 1 - MORE. --- Items/Weapons/Magic/EyeofMagnus.cs | 43 ------------ Items/Weapons/Typeless/EyeofMagnus.cs | 64 ++++++++++++++++++ .../{Magic => Typeless}/EyeofMagnus.png | Bin Items/Weapons/Typeless/LunicEye.cs | 8 +-- Projectiles/Magic/MagnusBeam.cs | 13 +++- 5 files changed, 75 insertions(+), 53 deletions(-) delete mode 100644 Items/Weapons/Magic/EyeofMagnus.cs create mode 100644 Items/Weapons/Typeless/EyeofMagnus.cs rename Items/Weapons/{Magic => Typeless}/EyeofMagnus.png (100%) diff --git a/Items/Weapons/Magic/EyeofMagnus.cs b/Items/Weapons/Magic/EyeofMagnus.cs deleted file mode 100644 index f8aa65a0e4..0000000000 --- a/Items/Weapons/Magic/EyeofMagnus.cs +++ /dev/null @@ -1,43 +0,0 @@ -using CalamityMod.Projectiles.Magic; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ModLoader; -using Terraria.ID; - -namespace CalamityMod.Items.Weapons.Magic -{ - public class EyeofMagnus : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Eye of Magnus"); - Tooltip.SetDefault("Fires powerful beams\n" + - "Heals mana and health on hit"); - } - - public override void SetDefaults() - { - item.width = 80; - item.damage = 64; - item.rare = ItemRarityID.Cyan; - item.useAnimation = 20; - item.useTime = 20; - item.useStyle = ItemUseStyleID.HoldingOut; - item.knockBack = 2f; - item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserCannon"); - item.magic = true; - item.mana = 7; - item.autoReuse = true; - item.noMelee = true; - item.height = 50; - item.value = CalamityGlobalItem.Rarity9BuyPrice; - item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 12f; - } - - public override Vector2? HoldoutOffset() - { - return new Vector2(-15, 0); - } - } -} diff --git a/Items/Weapons/Typeless/EyeofMagnus.cs b/Items/Weapons/Typeless/EyeofMagnus.cs new file mode 100644 index 0000000000..f81d830b40 --- /dev/null +++ b/Items/Weapons/Typeless/EyeofMagnus.cs @@ -0,0 +1,64 @@ +using CalamityMod.Projectiles.Magic; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; +using Terraria.ID; + +namespace CalamityMod.Items.Weapons.Typeless +{ + public class EyeofMagnus : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Eye of Magnus"); + Tooltip.SetDefault("Fires powerful beams that reduce enemy protection\n" + + "This weapon scales with all your damage stats at once\n" + + "Heals mana and health on hit"); + } + + public override void SetDefaults() + { + item.width = 80; + item.damage = 32; + item.rare = ItemRarityID.Cyan; + item.useAnimation = 20; + item.useTime = 20; + item.useStyle = ItemUseStyleID.HoldingOut; + item.knockBack = 5f; + item.UseSound = mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserCannon"); + item.autoReuse = true; + item.noMelee = true; + item.height = 50; + item.value = CalamityGlobalItem.Rarity9BuyPrice; + item.shoot = ModContent.ProjectileType(); + item.shootSpeed = 12f; + } + + public override Vector2? HoldoutOffset() + { + return new Vector2(-15, 0); + } + + // Eye of Magnus scales off of all damage types simultaneously (meaning it scales 5x from universal damage boosts). + public override void ModifyWeaponDamage(Player player, ref float add, ref float mult, ref float flat) + { + float formula = 5f * (player.allDamage - 1f); + formula += player.meleeDamage - 1f; + formula += player.rangedDamage - 1f; + formula += player.magicDamage - 1f; + formula += player.minionDamage - 1f; + formula += player.Calamity().throwingDamage - 1f; + add += formula; + } + + public override void AddRecipes() + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(ModContent.ItemType()); + recipe.AddIngredient(ItemID.FragmentNebula, 10); + recipe.AddTile(TileID.LunarCraftingStation); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } +} diff --git a/Items/Weapons/Magic/EyeofMagnus.png b/Items/Weapons/Typeless/EyeofMagnus.png similarity index 100% rename from Items/Weapons/Magic/EyeofMagnus.png rename to Items/Weapons/Typeless/EyeofMagnus.png diff --git a/Items/Weapons/Typeless/LunicEye.cs b/Items/Weapons/Typeless/LunicEye.cs index 3eae5e7508..4c2beac1b9 100644 --- a/Items/Weapons/Typeless/LunicEye.cs +++ b/Items/Weapons/Typeless/LunicEye.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Typeless item.height = 50; item.value = Item.buyPrice(0, 36, 0, 0); item.shoot = ModContent.ProjectileType(); - item.shootSpeed = 13f; + item.shootSpeed = 12f; } public override Vector2? HoldoutOffset() @@ -52,12 +52,6 @@ namespace CalamityMod.Items.Weapons.Typeless add += formula; } - 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, type, damage, knockBack, player.whoAmI, 0f, 0f); - return false; - } - public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); diff --git a/Projectiles/Magic/MagnusBeam.cs b/Projectiles/Magic/MagnusBeam.cs index 132b7a79af..cf0547c878 100644 --- a/Projectiles/Magic/MagnusBeam.cs +++ b/Projectiles/Magic/MagnusBeam.cs @@ -1,3 +1,4 @@ +using CalamityMod.Buffs.StatDebuffs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -23,7 +24,6 @@ namespace CalamityMod.Projectiles.Magic projectile.penetrate = 1; projectile.extraUpdates = 2; projectile.alpha = 0; - projectile.magic = true; } public override void AI() @@ -202,9 +202,16 @@ namespace CalamityMod.Projectiles.Magic return false; } - public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) + public override void OnHitPvp(Player target, int damage, bool crit) + { + target.AddBuff(ModContent.BuffType(), 480); + } + + public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) { - if (!target.canGhostHeal || Main.player[projectile.owner].moonLeech) + target.AddBuff(ModContent.BuffType(), 480); + + if (!target.canGhostHeal || Main.player[projectile.owner].moonLeech) return; Player player = Main.player[projectile.owner];