Cleaned up code for melee weapons.

This commit is contained in:
Big Duckie
2022-07-05 19:43:21 -06:00
parent 1871f6cfe8
commit 148d1fc728
19 changed files with 168 additions and 182 deletions
+14 -15
View File
@@ -11,7 +11,6 @@ public class CarbonDagger : ModItem
{ {
public override void SetStaticDefaults() public override void SetStaticDefaults()
{ {
DisplayName.SetDefault("Carbon Dagger");
Tooltip.SetDefault("[c/B6FF00:Autoswings, dyeable]\nThrows a medium-ranged Carbon Knife that deals more damage the closer you are to the target \nShortsword hits inflict [c/007700:Poison] debuff for 8 seconds\n[c/FF0000:Shortsword hits steal a small amount of life] \nShortsword hits grant the [c/FC3A3A:Rage] buff for 8 seconds"); Tooltip.SetDefault("[c/B6FF00:Autoswings, dyeable]\nThrows a medium-ranged Carbon Knife that deals more damage the closer you are to the target \nShortsword hits inflict [c/007700:Poison] debuff for 8 seconds\n[c/FF0000:Shortsword hits steal a small amount of life] \nShortsword hits grant the [c/FC3A3A:Rage] buff for 8 seconds");
} }
@@ -50,13 +49,13 @@ public class CarbonDagger : ModItem
int healingAmount = damage / 18; int healingAmount = damage / 18;
player.statLife += healingAmount; player.statLife += healingAmount;
player.HealEffect(healingAmount, true); player.HealEffect(healingAmount, true);
target.AddBuff(20, 480, false); target.AddBuff(BuffID.Poisoned, 480, false);
player.AddBuff(115, 480, true); player.AddBuff(BuffID.Rage, 480, true);
} }
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{ {
Vector2 muzzleOffset = Vector2.Normalize(new Vector2(velocity.X, velocity.Y)) * 45f; Vector2 muzzleOffset = Vector2.Normalize(velocity) * 45f;
if (Collision.CanHit(position, 0, 0, position + muzzleOffset, 0, 0)) if (Collision.CanHit(position, 0, 0, position + muzzleOffset, 0, 0))
{ {
position += muzzleOffset; position += muzzleOffset;
@@ -66,17 +65,17 @@ public class CarbonDagger : ModItem
public override void AddRecipes() public override void AddRecipes()
{ {
Recipe recipe1 = CreateRecipe(); CreateRecipe()
recipe1.AddIngredient(ModContent.ItemType<Wakizashi>()); .AddIngredient(ModContent.ItemType<Wakizashi>())
recipe1.AddRecipeGroup("FabusMod:OrichalcumBar", 6); .AddRecipeGroup("FabusMod:OrichalcumBar", 6)
recipe1.AddIngredient(ItemID.Sapphire, 2); .AddIngredient(ItemID.Sapphire, 2)
recipe1.AddTile(TileID.MythrilAnvil); .AddTile(TileID.MythrilAnvil)
recipe1.Register(); .Register();
Recipe recipe2 = CreateRecipe(); CreateRecipe()
recipe2.AddIngredient(ModContent.ItemType<CarbonDaggerNihon>()); .AddIngredient(ModContent.ItemType<CarbonDaggerNihon>())
recipe2.AddIngredient(ItemID.BlueDye, 1); .AddIngredient(ItemID.BlueDye)
recipe2.AddTile(TileID.DyeVat); .AddTile(TileID.DyeVat)
recipe2.Register(); .Register();
} }
} }
@@ -49,13 +49,13 @@ public class CarbonDaggerNihon : ModItem
int healingAmount = damage / 16; int healingAmount = damage / 16;
player.statLife += healingAmount; player.statLife += healingAmount;
player.HealEffect(healingAmount, true); player.HealEffect(healingAmount, true);
target.AddBuff(20, 480, false); target.AddBuff(BuffID.Poisoned, 480, false);
player.AddBuff(115, 480, true); player.AddBuff(BuffID.Rage, 480, true);
} }
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{ {
Vector2 muzzleOffset = Vector2.Normalize(new Vector2(velocity.X, velocity.Y)) * 45f; Vector2 muzzleOffset = Vector2.Normalize(velocity) * 45f;
if (Collision.CanHit(position, 0, 0, position + muzzleOffset, 0, 0)) { if (Collision.CanHit(position, 0, 0, position + muzzleOffset, 0, 0)) {
position += muzzleOffset; position += muzzleOffset;
} }
@@ -64,10 +64,10 @@ public class CarbonDaggerNihon : ModItem
public override void AddRecipes() public override void AddRecipes()
{ {
Recipe recipe = Recipe.Create(Type); CreateRecipe()
recipe.AddIngredient(ModContent.ItemType<CarbonDagger>()); .AddIngredient(ModContent.ItemType<CarbonDagger>())
recipe.AddIngredient(ItemID.BlueDye, 1); .AddIngredient(ItemID.BlueDye)
recipe.AddTile(TileID.DyeVat); .AddTile(TileID.DyeVat)
recipe.Register(); .Register();
} }
} }
+11 -12
View File
@@ -1,4 +1,3 @@
using FabusMod.Projectiles.Shortsword;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Terraria; using Terraria;
using Terraria.DataStructures; using Terraria.DataStructures;
@@ -27,7 +26,7 @@ public class GoldenDagger : ModItem
Item.knockBack = 6f; Item.knockBack = 6f;
Item.value = Item.sellPrice(0, 54, 96, 0); Item.value = Item.sellPrice(0, 54, 96, 0);
Item.rare = ItemRarityID.Yellow; Item.rare = ItemRarityID.Yellow;
Item.shoot = ModContent.ProjectileType<GoldenKnife>(); Item.shoot = ModContent.ProjectileType<Projectiles.Shortsword.GoldenKnife>();
Item.shootSpeed = 50f; Item.shootSpeed = 50f;
Item.UseSound = SoundID.Item1; Item.UseSound = SoundID.Item1;
Item.autoReuse = true; Item.autoReuse = true;
@@ -49,12 +48,12 @@ public class GoldenDagger : ModItem
{ {
float numberProjectiles = 2f; float numberProjectiles = 2f;
float rotation = MathHelper.ToRadians(4f); float rotation = MathHelper.ToRadians(4f);
position += Vector2.Normalize(new Vector2(velocity.X, velocity.Y)) * 6f; position += Vector2.Normalize(velocity) * 6f;
for (int i = 0; i < numberProjectiles; i++) for (int i = 0; i < numberProjectiles; i++)
{ {
Vector2 perturbedSpeed = Utils.RotatedBy(new Vector2(velocity.X, velocity.Y), (double)MathHelper.Lerp(0f - rotation, rotation, i / (numberProjectiles - 1f)), default) * 0.2f; Vector2 perturbedSpeed = Utils.RotatedBy(velocity, (double)MathHelper.Lerp(0f - rotation, rotation, i / (numberProjectiles - 1f)), default) * 0.2f;
Projectile.NewProjectile(source, position.X, position.Y, perturbedSpeed.X, perturbedSpeed.Y, type, damage, knockback, player.whoAmI, 0f, 0f); Projectile.NewProjectile(source, position, perturbedSpeed, type, damage, knockback, player.whoAmI);
Vector2 muzzleOffset = Vector2.Normalize(new Vector2(velocity.X, velocity.Y)) * 55f; Vector2 muzzleOffset = Vector2.Normalize(velocity) * 55f;
if (Collision.CanHit(position, 0, 0, position + muzzleOffset, 0, 0)) if (Collision.CanHit(position, 0, 0, position + muzzleOffset, 0, 0))
{ {
position += muzzleOffset; position += muzzleOffset;
@@ -75,11 +74,11 @@ public class GoldenDagger : ModItem
public override void AddRecipes() public override void AddRecipes()
{ {
Recipe recipe = CreateRecipe(); CreateRecipe()
recipe.AddIngredient(ModContent.ItemType<OniDagger>()); .AddIngredient(ModContent.ItemType<OniDagger>())
recipe.AddIngredient(ModContent.ItemType<Items.CraftingIngredients.GoddessGold>(), 6); .AddIngredient(ModContent.ItemType<Items.CraftingIngredients.GoddessGold>(), 6)
recipe.AddIngredient(ModContent.ItemType<Items.CraftingIngredients.SoulofWisdom>(), 4); .AddIngredient(ModContent.ItemType<Items.CraftingIngredients.SoulofWisdom>(), 4)
recipe.AddTile(TileID.AdamantiteForge); .AddTile(TileID.AdamantiteForge)
recipe.Register(); .Register();
} }
} }
+8 -8
View File
@@ -56,7 +56,7 @@ public class OniDagger : ModItem
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{ {
Vector2 muzzleOffset = Vector2.Normalize(new Vector2(velocity.X, velocity.Y)) * 55f; Vector2 muzzleOffset = Vector2.Normalize(velocity) * 55f;
if (Collision.CanHit(position, 0, 0, position + muzzleOffset, 0, 0)) if (Collision.CanHit(position, 0, 0, position + muzzleOffset, 0, 0))
{ {
position += muzzleOffset; position += muzzleOffset;
@@ -66,12 +66,12 @@ public class OniDagger : ModItem
public override void AddRecipes() public override void AddRecipes()
{ {
Recipe recipe = CreateRecipe(); CreateRecipe()
recipe.AddRecipeGroup("FabusMod:CarbonDagger", 1); .AddRecipeGroup("FabusMod:CarbonDagger")
recipe.AddRecipeGroup("FabusMod:AdamantiteBar", 6); .AddRecipeGroup("FabusMod:AdamantiteBar", 6)
recipe.AddIngredient(ItemID.SoulofNight, 4); .AddIngredient(ItemID.SoulofNight, 4)
recipe.AddIngredient(ModContent.ItemType<Items.CraftingIngredients.SoulofWisdom>(), 2); .AddIngredient(ModContent.ItemType<Items.CraftingIngredients.SoulofWisdom>(), 2)
recipe.AddTile(TileID.MythrilAnvil); .AddTile(TileID.MythrilAnvil)
recipe.Register(); .Register();
} }
} }
@@ -29,10 +29,10 @@ public class StonePlatedShortsword : ModItem
public override void AddRecipes() public override void AddRecipes()
{ {
Recipe recipe = CreateRecipe(); CreateRecipe()
recipe.AddIngredient(ModContent.ItemType<Items.WeaponParts.UntreatedShortswordPart>()); .AddIngredient(ModContent.ItemType<Items.WeaponParts.UntreatedShortswordPart>())
recipe.AddIngredient(ItemID.StoneBlock, 6); .AddIngredient(ItemID.StoneBlock, 6)
recipe.AddTile(ModContent.TileType<global::FabusMod.Tiles.ReinforcedWorkBench>()); .AddTile(ModContent.TileType<global::FabusMod.Tiles.ReinforcedWorkBench>())
recipe.Register(); .Register();
} }
} }
@@ -60,12 +60,12 @@ public class TheRainbowsCurse : ModItem
{ {
float numberProjectiles = 3f; float numberProjectiles = 3f;
float rotation = MathHelper.ToRadians(6f); float rotation = MathHelper.ToRadians(6f);
position += Vector2.Normalize(new Vector2(velocity.X, velocity.Y)) * 6f; position += Vector2.Normalize(velocity) * 6f;
for (int i = 0; i < numberProjectiles; i++) for (int i = 0; i < numberProjectiles; i++)
{ {
Vector2 perturbedSpeed = Utils.RotatedBy(new Vector2(velocity.X, velocity.Y), (double)MathHelper.Lerp(0f - rotation, rotation, i / (numberProjectiles - 1f)), default) * 0.2f; Vector2 perturbedSpeed = Utils.RotatedBy(velocity, (double)MathHelper.Lerp(0f - rotation, rotation, i / (numberProjectiles - 1f)), default) * 0.2f;
Projectile.NewProjectile(source, position.X, position.Y, perturbedSpeed.X, perturbedSpeed.Y, type, damage, knockback, player.whoAmI, 0f, 0f); Projectile.NewProjectile(source, position, perturbedSpeed, type, damage, knockback, player.whoAmI);
Vector2 muzzleOffset = Vector2.Normalize(new Vector2(velocity.X, velocity.Y)) * 60f; Vector2 muzzleOffset = Vector2.Normalize(velocity) * 60f;
if (Collision.CanHit(position, 0, 0, position + muzzleOffset, 0, 0)) if (Collision.CanHit(position, 0, 0, position + muzzleOffset, 0, 0))
{ {
position += muzzleOffset; position += muzzleOffset;
@@ -86,10 +86,10 @@ public class TheRainbowsCurse : ModItem
public override void AddRecipes() public override void AddRecipes()
{ {
Recipe recipe = CreateRecipe(); CreateRecipe()
recipe.AddIngredient(ModContent.ItemType<GoldenDagger>()); .AddIngredient(ModContent.ItemType<GoldenDagger>())
recipe.AddIngredient(ModContent.ItemType<Bars.RainbowChunk>(), 6); .AddIngredient(ModContent.ItemType<Bars.RainbowChunk>(), 6)
recipe.AddTile(ModContent.TileType<global::FabusMod.Tiles.RainbowStation>()); .AddTile(ModContent.TileType<global::FabusMod.Tiles.RainbowStation>())
recipe.Register(); .Register();
} }
} }
+6 -7
View File
@@ -9,7 +9,6 @@ public class Wakizashi : ModItem
{ {
public override void SetStaticDefaults() public override void SetStaticDefaults()
{ {
DisplayName.SetDefault("Wakizashi");
Tooltip.SetDefault("Inflicts [c/007700:Poison] debuff for 5 seconds on hit"); Tooltip.SetDefault("Inflicts [c/007700:Poison] debuff for 5 seconds on hit");
} }
@@ -48,11 +47,11 @@ public class Wakizashi : ModItem
public override void AddRecipes() public override void AddRecipes()
{ {
Recipe recipe = CreateRecipe(); CreateRecipe()
recipe.AddIngredient(ModContent.ItemType<StonePlatedShortsword>()); .AddIngredient(ModContent.ItemType<StonePlatedShortsword>())
recipe.AddRecipeGroup("IronBar", 6); .AddRecipeGroup("IronBar", 6)
recipe.AddIngredient(ItemID.Emerald, 2); .AddIngredient(ItemID.Emerald, 2)
recipe.AddTile(TileID.Anvils); .AddTile(TileID.Anvils)
recipe.Register(); .Register();
} }
} }
+12 -13
View File
@@ -11,7 +11,6 @@ public class GoldenSlasher : ModItem
{ {
public override void SetStaticDefaults() public override void SetStaticDefaults()
{ {
DisplayName.SetDefault("Golden Slasher");
Tooltip.SetDefault("[c/B6FF00:Autoswings] \nShoots two homing golden orbs in a medium-sized spread on swing"); Tooltip.SetDefault("[c/B6FF00:Autoswings] \nShoots two homing golden orbs in a medium-sized spread on swing");
} }
@@ -40,24 +39,24 @@ public class GoldenSlasher : ModItem
} }
} }
public override void AddRecipes() public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{ {
Recipe val = CreateRecipe();
val.AddIngredient(ModContent.ItemType<Items.CraftingIngredients.GoddessGold>(), 14);
val.AddTile(TileID.AdamantiteForge);
val.Register();
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
float numberProjectiles = 2f; float numberProjectiles = 2f;
float rotation = MathHelper.ToRadians(25f); float rotation = MathHelper.ToRadians(25f);
position += Vector2.Normalize(new Vector2(velocity.X, velocity.Y)) * 45f; position += Vector2.Normalize(velocity) * 45f;
for (int i = 0; i < numberProjectiles; i++) for (int i = 0; i < numberProjectiles; i++)
{ {
Vector2 perturbedSpeed = Utils.RotatedBy(new Vector2(velocity.X, velocity.Y), (double)MathHelper.Lerp(0f - rotation, rotation, i / (numberProjectiles - 1f)), default) * 0.2f; Vector2 perturbedSpeed = Utils.RotatedBy(velocity, (double)MathHelper.Lerp(0f - rotation, rotation, i / (numberProjectiles - 1f)), default) * 0.2f;
Projectile.NewProjectile(source, position.X, position.Y, perturbedSpeed.X, perturbedSpeed.Y, type, damage, knockback, player.whoAmI); Projectile.NewProjectile(source, position, perturbedSpeed, type, damage, knockback, player.whoAmI);
} }
return false; return false;
} }
public override void AddRecipes()
{
CreateRecipe()
.AddIngredient(ModContent.ItemType<Items.CraftingIngredients.GoddessGold>(), 14)
.AddTile(TileID.AdamantiteForge)
.Register();
}
} }
+13 -13
View File
@@ -41,25 +41,25 @@ public class RainbowClaymore : ModItem
} }
} }
public override void AddRecipes() public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{ {
Recipe val = CreateRecipe();
val.AddIngredient(ModContent.ItemType<GoldenSlasher>());
val.AddIngredient(ModContent.ItemType<Bars.RainbowChunk>(), 14);
val.AddTile(ModContent.TileType<global::FabusMod.Tiles.RainbowStation>());
val.Register();
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
float numberProjectiles = 3f; float numberProjectiles = 3f;
float rotation = MathHelper.ToRadians(45f); float rotation = MathHelper.ToRadians(45f);
position += Vector2.Normalize(new Vector2(velocity.X, velocity.Y)) * 45f; position += Vector2.Normalize(velocity) * 45f;
for (int i = 0; i < numberProjectiles; i++) for (int i = 0; i < numberProjectiles; i++)
{ {
Vector2 perturbedSpeed = Utils.RotatedBy(new Vector2(velocity.X, velocity.Y), (double)MathHelper.Lerp(0f - rotation, rotation, i / (numberProjectiles - 1f)), default) * 0.2f; Vector2 perturbedSpeed = Utils.RotatedBy(velocity, (double)MathHelper.Lerp(0f - rotation, rotation, i / (numberProjectiles - 1f)), default) * 0.2f;
Projectile.NewProjectile(source, position.X, position.Y, perturbedSpeed.X, perturbedSpeed.Y, type, damage, knockback, player.whoAmI, 0f, 0f); Projectile.NewProjectile(source, position, perturbedSpeed, type, damage, knockback, player.whoAmI);
} }
return false; return false;
} }
public override void AddRecipes()
{
CreateRecipe()
.AddIngredient(ModContent.ItemType<GoldenSlasher>())
.AddIngredient(ModContent.ItemType<Bars.RainbowChunk>(), 14)
.AddTile(ModContent.TileType<global::FabusMod.Tiles.RainbowStation>())
.Register();
}
} }
@@ -1,4 +1,3 @@
using FabusMod.Projectiles.Shimada;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Terraria; using Terraria;
using Terraria.DataStructures; using Terraria.DataStructures;
@@ -11,7 +10,6 @@ public class CarbonSword : ModItem
{ {
public override void SetStaticDefaults() public override void SetStaticDefaults()
{ {
DisplayName.SetDefault("Carbon Sword");
Tooltip.SetDefault("[c/B6FF00:Autoswings, dyeable]\nFires a stream of particles that deals damage three times\nInflicts [c/7B2D2F:Advanced Blood Loss] for 10 seconds when hit with the blade, dealing damage over time"); Tooltip.SetDefault("[c/B6FF00:Autoswings, dyeable]\nFires a stream of particles that deals damage three times\nInflicts [c/7B2D2F:Advanced Blood Loss] for 10 seconds when hit with the blade, dealing damage over time");
} }
@@ -28,19 +26,19 @@ public class CarbonSword : ModItem
Item.knockBack = 2f; Item.knockBack = 2f;
Item.value = Item.sellPrice(0, 6, 0, 0); Item.value = Item.sellPrice(0, 6, 0, 0);
Item.rare = ItemRarityID.LightRed; Item.rare = ItemRarityID.LightRed;
Item.shoot = ModContent.ProjectileType<ShimadaWave>(); Item.shoot = ModContent.ProjectileType<Projectiles.Shimada.ShimadaWave>();
Item.shootSpeed = 10f; Item.shootSpeed = 10f;
Item.UseSound = SoundID.Item1; Item.UseSound = SoundID.Item1;
Item.autoReuse = true; Item.autoReuse = true;
} }
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{ {
int numberProjectiles = 3; int numberProjectiles = 3;
for (int i = 0; i < numberProjectiles; i++) for (int i = 0; i < numberProjectiles; i++)
{ {
Vector2 perturbedSpeed = Utils.RotatedByRandom(new Vector2(velocity.X, velocity.Y), (double)MathHelper.ToRadians(0f)); Vector2 perturbedSpeed = Utils.RotatedByRandom(velocity, (double)MathHelper.ToRadians(0f));
Projectile.NewProjectile(source, position.X, position.Y, perturbedSpeed.X, perturbedSpeed.Y, type, damage, knockback, player.whoAmI, 0f, 0f); Projectile.NewProjectile(source, position, perturbedSpeed, type, damage, knockback, player.whoAmI);
} }
return false; return false;
} }
@@ -64,16 +62,16 @@ public class CarbonSword : ModItem
public override void AddRecipes() public override void AddRecipes()
{ {
Recipe recipe1 = CreateRecipe(); CreateRecipe()
recipe1.AddIngredient(ModContent.ItemType<ShimadaSword>()); .AddIngredient(ModContent.ItemType<ShimadaSword>())
recipe1.AddRecipeGroup("FabusMod:OrichalcumBar", 10); .AddRecipeGroup("FabusMod:OrichalcumBar", 10)
recipe1.AddTile(TileID.DemonAltar); .AddTile(TileID.DemonAltar)
recipe1.Register(); .Register();
Recipe recipe2 = CreateRecipe(); CreateRecipe()
recipe2.AddIngredient(ModContent.ItemType<CarbonSwordNihon>()); .AddIngredient(ModContent.ItemType<CarbonSwordNihon>())
recipe2.AddIngredient(ItemID.BlueDye, 1); .AddIngredient(ItemID.BlueDye, 1)
recipe2.AddTile(TileID.DyeVat); .AddTile(TileID.DyeVat)
recipe2.Register(); .Register();
} }
} }
@@ -1,4 +1,3 @@
using FabusMod.Projectiles.Shimada;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Terraria; using Terraria;
using Terraria.DataStructures; using Terraria.DataStructures;
@@ -28,19 +27,19 @@ public class CarbonSwordNihon : ModItem
Item.knockBack = 2f; Item.knockBack = 2f;
Item.value = Item.sellPrice(0, 6, 0, 0); Item.value = Item.sellPrice(0, 6, 0, 0);
Item.rare = ItemRarityID.LightRed; Item.rare = ItemRarityID.LightRed;
Item.shoot = ModContent.ProjectileType<ShimadaWaveNihon>(); Item.shoot = ModContent.ProjectileType<Projectiles.Shimada.ShimadaWaveNihon>();
Item.shootSpeed = 10f; Item.shootSpeed = 10f;
Item.UseSound = SoundID.Item1; Item.UseSound = SoundID.Item1;
Item.autoReuse = true; Item.autoReuse = true;
} }
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{ {
int numberProjectiles = 3; int numberProjectiles = 3;
for (int i = 0; i < numberProjectiles; i++) for (int i = 0; i < numberProjectiles; i++)
{ {
Vector2 perturbedSpeed = Utils.RotatedByRandom(new Vector2(velocity.X, velocity.Y), (double)MathHelper.ToRadians(0f)); Vector2 perturbedSpeed = Utils.RotatedByRandom(velocity, (double)MathHelper.ToRadians(0f));
Projectile.NewProjectile(source, position.X, position.Y, perturbedSpeed.X, perturbedSpeed.Y, type, damage, knockback, player.whoAmI, 0f, 0f); Projectile.NewProjectile(source, position, perturbedSpeed, type, damage, knockback, player.whoAmI);
} }
return false; return false;
} }
@@ -64,10 +63,10 @@ public class CarbonSwordNihon : ModItem
public override void AddRecipes() public override void AddRecipes()
{ {
Recipe recipe = CreateRecipe(); CreateRecipe()
recipe.AddIngredient(ModContent.ItemType<CarbonSword>()); .AddIngredient(ModContent.ItemType<CarbonSword>())
recipe.AddIngredient(ItemID.SilverDye, 1); .AddIngredient(ItemID.SilverDye, 1)
recipe.AddTile(TileID.DyeVat); .AddTile(TileID.DyeVat)
recipe.Register(); .Register();
} }
} }
@@ -1,4 +1,3 @@
using FabusMod.Projectiles.Shimada;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Terraria; using Terraria;
using Terraria.ID; using Terraria.ID;
@@ -64,7 +63,7 @@ public class DemonsFury : ModItem
Item.useAnimation = 60; Item.useAnimation = 60;
Item.shootSpeed = 0f; Item.shootSpeed = 0f;
Item.mana = 40; Item.mana = 40;
Item.shoot = ModContent.ProjectileType<DemonProjRMB>(); Item.shoot = ModContent.ProjectileType<Projectiles.Shimada.DemonProjRMB>();
Item.UseSound = SoundID.Item88; Item.UseSound = SoundID.Item88;
} }
else else
@@ -76,11 +75,11 @@ public class DemonsFury : ModItem
Item.mana = 0; Item.mana = 0;
if (Utils.NextFloat(Main.rand) < 0.08f) if (Utils.NextFloat(Main.rand) < 0.08f)
{ {
Item.shoot = ModContent.ProjectileType<DemonProjTwo>(); Item.shoot = ModContent.ProjectileType<Projectiles.Shimada.DemonProjTwo>();
} }
else else
{ {
Item.shoot = ModContent.ProjectileType<DemonWave>(); Item.shoot = ModContent.ProjectileType<Projectiles.Shimada.DemonWave>();
} }
Item.UseSound = SoundID.Item1; Item.UseSound = SoundID.Item1;
} }
@@ -89,12 +88,12 @@ public class DemonsFury : ModItem
public override void AddRecipes() public override void AddRecipes()
{ {
Recipe recipe = CreateRecipe(); CreateRecipe()
recipe.AddRecipeGroup("FabusMod:CarbonSword", 1); .AddRecipeGroup("FabusMod:CarbonSword")
recipe.AddRecipeGroup("FabusMod:AdamantiteBar", 10); .AddRecipeGroup("FabusMod:AdamantiteBar", 10)
recipe.AddIngredient(ItemID.SoulofNight, 8); .AddIngredient(ItemID.SoulofNight, 8)
recipe.AddIngredient(ModContent.ItemType<Items.CraftingIngredients.SoulofWisdom>(), 4); .AddIngredient(ModContent.ItemType<Items.CraftingIngredients.SoulofWisdom>(), 4)
recipe.AddTile(TileID.DemonAltar); .AddTile(TileID.DemonAltar)
recipe.Register(); .Register();
} }
} }
@@ -6,11 +6,10 @@ using Terraria.ModLoader;
namespace FabusMod.Items.Weapons.Melee.Swords.ShimadaSwords; namespace FabusMod.Items.Weapons.Melee.Swords.ShimadaSwords;
public class TheRainbowsHonor : ModItem public class DreamCatcher : ModItem
{ {
public override void SetStaticDefaults() public override void SetStaticDefaults()
{ {
DisplayName.SetDefault("Dream Catcher");
Tooltip.SetDefault("[c/B6FF00:Autoswings]\nFires a beam of particles that ignores immunity frames, pierces 8 times, and regenerates 1 Mana with every hit\nInflicts [c/806580:Bad Dream] for 16 seconds when hit with the blade, dealing damage over time\n<right> uses 40 Mana to bring up [c/C4AB37:Midas]-inducing spikes from the ground, dealing damage with a 2% chance of granting a [c/FF52DC:Dream] stack\nHas a 10% chance to fire homing, soul-absorbing shards, healing for 20 HP and granting a stack of [c/FF52DC:Dream] when hit\nHaving 6 stacks of [c/FF52DC:Dream] restores 85 HP and Mana and puts you into an enraged state for 8 seconds, increasing melee damage dealt"); Tooltip.SetDefault("[c/B6FF00:Autoswings]\nFires a beam of particles that ignores immunity frames, pierces 8 times, and regenerates 1 Mana with every hit\nInflicts [c/806580:Bad Dream] for 16 seconds when hit with the blade, dealing damage over time\n<right> uses 40 Mana to bring up [c/C4AB37:Midas]-inducing spikes from the ground, dealing damage with a 2% chance of granting a [c/FF52DC:Dream] stack\nHas a 10% chance to fire homing, soul-absorbing shards, healing for 20 HP and granting a stack of [c/FF52DC:Dream] when hit\nHaving 6 stacks of [c/FF52DC:Dream] restores 85 HP and Mana and puts you into an enraged state for 8 seconds, increasing melee damage dealt");
} }
@@ -42,19 +41,19 @@ public class TheRainbowsHonor : ModItem
{ {
if (Main.rand.NextBool(3)) if (Main.rand.NextBool(3))
{ {
int dust1 = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, ModContent.DustType<Dusts.RainbowDust>(), 0f, 0f, 0, default(Color), 1f); int dust1 = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, ModContent.DustType<Dusts.RainbowDust>());
Main.dust[dust1].scale = 1f; Main.dust[dust1].scale = 1f;
Main.dust[dust1].velocity.Y = 0f; Main.dust[dust1].velocity.Y = 0f;
Main.dust[dust1].velocity.X = 0.5f; Main.dust[dust1].velocity.X = 0.5f;
Main.dust[dust1].noGravity = true; Main.dust[dust1].noGravity = true;
int dust2 = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, ModContent.DustType<Dusts.RainbowDust2>(), 0f, 0f, 0, default(Color), 1f); int dust2 = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, ModContent.DustType<Dusts.RainbowDust2>());
Main.dust[dust2].scale = 1f; Main.dust[dust2].scale = 1f;
Main.dust[dust2].velocity.Y = 0f; Main.dust[dust2].velocity.Y = 0f;
Main.dust[dust2].velocity.X = 0.5f; Main.dust[dust2].velocity.X = 0.5f;
Main.dust[dust2].noGravity = true; Main.dust[dust2].noGravity = true;
int dust3 = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, ModContent.DustType<Dusts.RainbowDust3>(), 0f, 0f, 0, default(Color), 1f); int dust3 = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, ModContent.DustType<Dusts.RainbowDust3>());
Main.dust[dust3].scale = 1f; Main.dust[dust3].scale = 1f;
Main.dust[dust3].velocity.Y = 0f; Main.dust[dust3].velocity.Y = 0f;
Main.dust[dust3].velocity.X = 0.5f; Main.dust[dust3].velocity.X = 0.5f;
@@ -101,10 +100,10 @@ public class TheRainbowsHonor : ModItem
public override void AddRecipes() public override void AddRecipes()
{ {
Recipe recipe = CreateRecipe(); CreateRecipe()
recipe.AddIngredient(ModContent.ItemType<GoldenFury>()); .AddIngredient(ModContent.ItemType<GoldenFury>())
recipe.AddIngredient(ModContent.ItemType<Bars.RainbowChunk>(), 10); .AddIngredient(ModContent.ItemType<Bars.RainbowChunk>(), 10)
recipe.AddTile(null, "RainbowStation"); .AddTile(null, "RainbowStation")
recipe.Register(); .Register();
} }
} }

Before

Width:  |  Height:  |  Size: 1009 B

After

Width:  |  Height:  |  Size: 1009 B

@@ -1,4 +1,3 @@
using FabusMod.Projectiles.Shimada;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Terraria; using Terraria;
using Terraria.ID; using Terraria.ID;
@@ -10,7 +9,6 @@ public class GoldenFury : ModItem
{ {
public override void SetStaticDefaults() public override void SetStaticDefaults()
{ {
DisplayName.SetDefault("Golden Fury");
Tooltip.SetDefault("[c/B6FF00:Autoswings]\nFires a beam of particles that ignores immunity frames, pierces 6 times, and regenerates 1 Mana with every hit\nInflicts [c/7B2D2F:Advanced Blood Loss] for 14 seconds when hit with the blade, dealing damage over time\n<right> uses 40 Mana to bring up [c/C4AB37:Midas]-inducing spikes from the ground, dealing damage with a 2% chance of granting an [c/D2D25A:Enrichment] stack\nHas a 10% chance to fire soul-absorbing shards, granting a stack of [c/D2D25A:Enrichment] when hit\nHaving 6 stacks of [c/D2D25A:Enrichment] restores 75 HP and Mana"); Tooltip.SetDefault("[c/B6FF00:Autoswings]\nFires a beam of particles that ignores immunity frames, pierces 6 times, and regenerates 1 Mana with every hit\nInflicts [c/7B2D2F:Advanced Blood Loss] for 14 seconds when hit with the blade, dealing damage over time\n<right> uses 40 Mana to bring up [c/C4AB37:Midas]-inducing spikes from the ground, dealing damage with a 2% chance of granting an [c/D2D25A:Enrichment] stack\nHas a 10% chance to fire soul-absorbing shards, granting a stack of [c/D2D25A:Enrichment] when hit\nHaving 6 stacks of [c/D2D25A:Enrichment] restores 75 HP and Mana");
} }
@@ -42,11 +40,11 @@ public class GoldenFury : ModItem
{ {
if (Main.rand.NextBool(3)) if (Main.rand.NextBool(3))
{ {
int num1 = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, ModContent.DustType<Dusts.MeatDust>(), 0f, 0f, 0, default(Color), 1f); int dust = Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, ModContent.DustType<Dusts.MeatDust>(), 0f, 0f, 0, default(Color), 1f);
Main.dust[num1].scale = 1f; Main.dust[dust].scale = 1f;
Main.dust[num1].velocity.Y = 0f; Main.dust[dust].velocity.Y = 0f;
Main.dust[num1].velocity.X = 0.5f; Main.dust[dust].velocity.X = 0.5f;
Main.dust[num1].noGravity = true; Main.dust[dust].noGravity = true;
} }
} }
@@ -64,7 +62,7 @@ public class GoldenFury : ModItem
Item.useAnimation = 60; Item.useAnimation = 60;
Item.shootSpeed = 0f; Item.shootSpeed = 0f;
Item.mana = 40; Item.mana = 40;
Item.shoot = ModContent.ProjectileType<GoldenFuryProjRMB>(); Item.shoot = ModContent.ProjectileType<Projectiles.Shimada.GoldenFuryProjRMB>();
Item.UseSound = SoundID.Item88; Item.UseSound = SoundID.Item88;
} }
else else
@@ -76,11 +74,11 @@ public class GoldenFury : ModItem
Item.mana = 0; Item.mana = 0;
if (Utils.NextFloat(Main.rand) < 0.1f) if (Utils.NextFloat(Main.rand) < 0.1f)
{ {
Item.shoot = ModContent.ProjectileType<GoldenFuryProjTwo>(); Item.shoot = ModContent.ProjectileType<Projectiles.Shimada.GoldenFuryProjTwo>();
} }
else else
{ {
Item.shoot = ModContent.ProjectileType<GoldenFuryWave>(); Item.shoot = ModContent.ProjectileType<Projectiles.Shimada.GoldenFuryWave>();
} }
Item.UseSound = SoundID.Item1; Item.UseSound = SoundID.Item1;
} }
@@ -89,11 +87,11 @@ public class GoldenFury : ModItem
public override void AddRecipes() public override void AddRecipes()
{ {
Recipe recipe = CreateRecipe(); CreateRecipe()
recipe.AddIngredient(ModContent.ItemType<DemonsFury>()); .AddIngredient(ModContent.ItemType<DemonsFury>())
recipe.AddIngredient(ModContent.ItemType<Items.CraftingIngredients.GoddessGold>(), 10); .AddIngredient(ModContent.ItemType<Items.CraftingIngredients.GoddessGold>(), 10)
recipe.AddIngredient(ModContent.ItemType<Items.CraftingIngredients.SoulofWisdom>(), 4); .AddIngredient(ModContent.ItemType<Items.CraftingIngredients.SoulofWisdom>(), 4)
recipe.AddTile(TileID.DemonAltar); .AddTile(TileID.DemonAltar)
recipe.Register(); .Register();
} }
} }
@@ -9,7 +9,6 @@ public class ShimadaSword : ModItem
{ {
public override void SetStaticDefaults() public override void SetStaticDefaults()
{ {
DisplayName.SetDefault("Shimada Sword");
Tooltip.SetDefault("Inflicts [c/7B2D2F:Blood Loss] for 3 seconds on hit, dealing damage over time"); Tooltip.SetDefault("Inflicts [c/7B2D2F:Blood Loss] for 3 seconds on hit, dealing damage over time");
} }
@@ -49,11 +48,11 @@ public class ShimadaSword : ModItem
public override void AddRecipes() public override void AddRecipes()
{ {
Recipe recipe = CreateRecipe(); CreateRecipe()
recipe.AddIngredient(ModContent.ItemType<StonePlatedKatana>()); .AddIngredient(ModContent.ItemType<StonePlatedKatana>())
recipe.AddRecipeGroup("FabusMod:LightsBane"); .AddRecipeGroup("FabusMod:LightsBane")
recipe.AddIngredient(ItemID.Emerald, 10); .AddIngredient(ItemID.Emerald, 10)
recipe.AddTile(TileID.Anvils); .AddTile(TileID.Anvils)
recipe.Register(); .Register();
} }
} }
@@ -30,10 +30,10 @@ public class StonePlatedKatana : ModItem
public override void AddRecipes() public override void AddRecipes()
{ {
Recipe recipe = CreateRecipe(); CreateRecipe()
recipe.AddIngredient(ModContent.ItemType<Items.WeaponParts.UntreatedSwordParts>()); .AddIngredient(ModContent.ItemType<Items.WeaponParts.UntreatedSwordParts>())
recipe.AddIngredient(ItemID.StoneBlock, 12); .AddIngredient(ItemID.StoneBlock, 12)
recipe.AddTile(ModContent.TileType<global::FabusMod.Tiles.ReinforcedWorkBench>()); .AddTile(ModContent.TileType<global::FabusMod.Tiles.ReinforcedWorkBench>())
recipe.Register(); .Register();
} }
} }
@@ -1,4 +1,3 @@
using FabusMod.Projectiles;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Terraria; using Terraria;
using Terraria.DataStructures; using Terraria.DataStructures;
@@ -7,11 +6,10 @@ using Terraria.ModLoader;
namespace FabusMod.Items.Weapons.Melee.Waraxes; namespace FabusMod.Items.Weapons.Melee.Waraxes;
public class RainbowAxe : ModItem public class SpectralShredder : ModItem
{ {
public override void SetStaticDefaults() public override void SetStaticDefaults()
{ {
DisplayName.SetDefault("Spectral Shredder");
Tooltip.SetDefault("[c/B6FF00:Autoswings] \nPressing <right> fires a long-ranged Rainbow-Axe wall"); Tooltip.SetDefault("[c/B6FF00:Autoswings] \nPressing <right> fires a long-ranged Rainbow-Axe wall");
} }
@@ -59,7 +57,7 @@ public class RainbowAxe : ModItem
Item.damage = 280; Item.damage = 280;
Item.axe = 38; Item.axe = 38;
Item.tileBoost = 6; Item.tileBoost = 6;
Item.shoot = ModContent.ProjectileType<RainbowAxeBeam>(); Item.shoot = ModContent.ProjectileType<Projectiles.RainbowAxeBeam>();
} }
else else
{ {
@@ -78,24 +76,24 @@ public class RainbowAxe : ModItem
{ {
float numberProjectiles = 16f; float numberProjectiles = 16f;
float rotation = MathHelper.ToRadians(35f); float rotation = MathHelper.ToRadians(35f);
position += Vector2.Normalize(new Vector2(velocity.X, velocity.Y)) * 80f; position += Vector2.Normalize(velocity) * 80f;
for (int i = 0; i < numberProjectiles; i++) for (int i = 0; i < numberProjectiles; i++)
{ {
Vector2 perturbedSpeed = Utils.RotatedBy(new Vector2(velocity.X, velocity.Y), (double)MathHelper.Lerp(0f - rotation, rotation, i / (numberProjectiles - 1f)), default) * 0.2f; Vector2 perturbedSpeed = Utils.RotatedBy(velocity, (double)MathHelper.Lerp(0f - rotation, rotation, i / (numberProjectiles - 1f)), default) * 0.2f;
Projectile.NewProjectile(source, position.X, position.Y, perturbedSpeed.X, perturbedSpeed.Y, type, damage, knockback, player.whoAmI); Projectile.NewProjectile(source, position, perturbedSpeed, type, damage, knockback, player.whoAmI);
} }
return false; return false;
} }
public override void AddRecipes() public override void AddRecipes()
{ {
Recipe recipe = CreateRecipe(); CreateRecipe()
recipe.AddIngredient(ItemID.LunarHamaxeSolar); .AddIngredient(ItemID.LunarHamaxeSolar)
recipe.AddIngredient(ItemID.LunarHamaxeVortex); .AddIngredient(ItemID.LunarHamaxeVortex)
recipe.AddIngredient(ItemID.LunarHamaxeNebula); .AddIngredient(ItemID.LunarHamaxeNebula)
recipe.AddIngredient(ItemID.LunarHamaxeStardust); .AddIngredient(ItemID.LunarHamaxeStardust)
recipe.AddIngredient(ModContent.ItemType<Bars.RainbowChunk>(), 14); .AddIngredient(ModContent.ItemType<Bars.RainbowChunk>(), 14)
recipe.AddTile(ModContent.TileType<global::FabusMod.Tiles.RainbowStation>()); .AddTile(ModContent.TileType<global::FabusMod.Tiles.RainbowStation>())
recipe.Register(); .Register();
} }
} }

Before

Width:  |  Height:  |  Size: 910 B

After

Width:  |  Height:  |  Size: 910 B