From 15b4da5bf6151e7a37c003470fa0b413d80fafd3 Mon Sep 17 00:00:00 2001 From: Dominic Date: Sat, 11 Jun 2022 20:17:25 -0500 Subject: [PATCH] Removed Aether's Whisper's right click --- Items/Weapons/Magic/AethersWhisper.cs | 55 +++++++++ .../{Typeless => Magic}/AethersWhisper.png | Bin Items/Weapons/Ranged/MagnomalyCannon.cs | 1 - Items/Weapons/Typeless/AethersWhisper.cs | 110 ------------------ 4 files changed, 55 insertions(+), 111 deletions(-) create mode 100644 Items/Weapons/Magic/AethersWhisper.cs rename Items/Weapons/{Typeless => Magic}/AethersWhisper.png (100%) delete mode 100644 Items/Weapons/Typeless/AethersWhisper.cs diff --git a/Items/Weapons/Magic/AethersWhisper.cs b/Items/Weapons/Magic/AethersWhisper.cs new file mode 100644 index 0000000000..014db92147 --- /dev/null +++ b/Items/Weapons/Magic/AethersWhisper.cs @@ -0,0 +1,55 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Projectiles.Hybrid; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Sounds; + +namespace CalamityMod.Items.Weapons.Magic +{ + public class AethersWhisper : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Aether's Whisper"); + Tooltip.SetDefault("Inflicts long-lasting shadowflame and splits on tile hits\n" + + "Projectiles gain damage as they travel"); + SacrificeTotal = 1; + } + + public override void SetDefaults() + { + Item.damage = 504; + Item.knockBack = 5.5f; + Item.useTime = Item.useAnimation = 24; + Item.shootSpeed = 12f; + Item.shoot = ModContent.ProjectileType(); + Item.mana = 30; + Item.DamageType = DamageClass.Magic; + Item.autoReuse = true; + + Item.width = 134; + Item.height = 44; + Item.noMelee = true; + Item.useStyle = ItemUseStyleID.Shoot; + Item.UseSound = CommonCalamitySounds.LaserCannonSound; + + Item.value = CalamityGlobalItem.Rarity12BuyPrice; + Item.Calamity().customRarity = CalamityRarity.Turquoise; + } + + public override Vector2? HoldoutOffset() => new Vector2(-10, 0); + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(). + AddIngredient(). + AddIngredient(3). + AddTile(TileID.LunarCraftingStation). + Register(); + } + } +} diff --git a/Items/Weapons/Typeless/AethersWhisper.png b/Items/Weapons/Magic/AethersWhisper.png similarity index 100% rename from Items/Weapons/Typeless/AethersWhisper.png rename to Items/Weapons/Magic/AethersWhisper.png diff --git a/Items/Weapons/Ranged/MagnomalyCannon.cs b/Items/Weapons/Ranged/MagnomalyCannon.cs index ed50ac1d51..a46dec82d5 100644 --- a/Items/Weapons/Ranged/MagnomalyCannon.cs +++ b/Items/Weapons/Ranged/MagnomalyCannon.cs @@ -65,7 +65,6 @@ namespace CalamityMod.Items.Weapons.Ranged CreateRecipe(). AddIngredient(). AddIngredient(). - AddIngredient(). AddIngredient(ItemID.ElectrosphereLauncher). AddIngredient(). AddTile(). diff --git a/Items/Weapons/Typeless/AethersWhisper.cs b/Items/Weapons/Typeless/AethersWhisper.cs deleted file mode 100644 index 02eead0479..0000000000 --- a/Items/Weapons/Typeless/AethersWhisper.cs +++ /dev/null @@ -1,110 +0,0 @@ -using CalamityMod.Items.Materials; -using CalamityMod.Items.Weapons.Magic; -using CalamityMod.Items.Weapons.Ranged; -using CalamityMod.Projectiles.Hybrid; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; -using CalamityMod.Sounds; - -namespace CalamityMod.Items.Weapons.Typeless -{ - public class AethersWhisper : ModItem - { - public override void SetStaticDefaults() - { - DisplayName.SetDefault("Aether's Whisper"); - Tooltip.SetDefault("Inflicts long-lasting shadowflame and splits on tile hits\n" + - "Projectiles gain damage as they travel\n" + - "Right click to change from magic to ranged damage\n" + - "Right click consumes no mana"); - SacrificeTotal = 1; - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true; - } - - public override void SetDefaults() - { - Item.damage = 504; - Item.knockBack = 5.5f; - Item.useTime = Item.useAnimation = 24; - Item.shootSpeed = 12f; - Item.shoot = ModContent.ProjectileType(); - Item.mana = 30; - Item.DamageType = DamageClass.Magic; - Item.autoReuse = true; - - Item.width = 134; - Item.height = 44; - Item.noMelee = true; - Item.useStyle = ItemUseStyleID.Shoot; - Item.UseSound = CommonCalamitySounds.LaserCannonSound; - - Item.value = CalamityGlobalItem.Rarity12BuyPrice; - Item.Calamity().customRarity = CalamityRarity.Turquoise; - } - - public override Vector2? HoldoutOffset() => new Vector2(-10, 0); - - public override bool AltFunctionUse(Player player) => true; - - public override bool CanUseItem(Player player) - { - if (player.altFunctionUse == 2) - { - Item.DamageType = DamageClass.Ranged; - // item.magic = false /* tModPorter - this is redundant, for more info see https://github.com/tModLoader/tModLoader/wiki/Update-Migration-Guide#damage-classes */ ; - } - else - { - // item.ranged = false /* tModPorter - this is redundant, for more info see https://github.com/tModLoader/tModLoader/wiki/Update-Migration-Guide#damage-classes */ ; - Item.DamageType = DamageClass.Magic; - } - return base.CanUseItem(player); - } - - public override bool OnPickup(Player player) - { - // item.ranged = false /* tModPorter - this is redundant, for more info see https://github.com/tModLoader/tModLoader/wiki/Update-Migration-Guide#damage-classes */ ; - Item.DamageType = DamageClass.Magic; - return true; - } - - public override void UpdateInventory(Player player) - { - // Reset to magic if not using an item to prevent sorting bugs. - if (player.itemAnimation <= 0) - { - // item.ranged = false /* tModPorter - this is redundant, for more info see https://github.com/tModLoader/tModLoader/wiki/Update-Migration-Guide#damage-classes */ ; - Item.DamageType = DamageClass.Magic; - } - } - - public override void ModifyManaCost(Player player, ref float reduce, ref float mult) - { - if (player.altFunctionUse == 2) - mult *= 0f; - } - - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) - { - // This is coded weirdly because it defaults to using magic boosts without this. - int dmg = player.GetWeaponDamage(player.ActiveItem()); - float ai0 = player.altFunctionUse == 2 ? 1f : 0f; - Projectile.NewProjectile(source, position, velocity, type, dmg, knockback, player.whoAmI, ai0, 0f); - return false; - } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(). - AddIngredient(). - AddIngredient(). - AddIngredient(3). - AddTile(TileID.LunarCraftingStation). - Register(); - } - } -}