Commit of decompiled and "updated" code.
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace FabusMod.Items.Weapons.Melee.Swords;
|
||||
|
||||
public class RainbowClaymore : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("The Spectrum");
|
||||
Tooltip.SetDefault("[c/B6FF00:Autoswings] \nShoots three homing rainbow orbs in a large spread on swing");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.damage = 185;
|
||||
Item.width = 60;
|
||||
Item.height = 68;
|
||||
Item.useTime = 12;
|
||||
Item.useAnimation = 12;
|
||||
Item.useStyle = ItemUseStyleID.Swing;
|
||||
Item.knockBack = 3f;
|
||||
Item.value = Item.sellPrice(3, 20, 0, 0);
|
||||
Item.expert = true;
|
||||
Item.UseSound = SoundID.Item1;
|
||||
Item.autoReuse = true;
|
||||
Item.shoot = ModContent.ProjectileType<Projectiles.RainbowOrb>();
|
||||
Item.shootSpeed = 20f;
|
||||
}
|
||||
|
||||
public override void MeleeEffects(Player player, Rectangle hitbox)
|
||||
{
|
||||
if (Main.rand.NextBool(3))
|
||||
{
|
||||
Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, ModContent.DustType<Dusts.RainbowDust>());
|
||||
Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, ModContent.DustType<Dusts.RainbowDust2>());
|
||||
Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, ModContent.DustType<Dusts.RainbowDust3>());
|
||||
}
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
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 rotation = MathHelper.ToRadians(45f);
|
||||
position += Vector2.Normalize(new Vector2(velocity.X, velocity.Y)) * 45f;
|
||||
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;
|
||||
Projectile.NewProjectile(source, position.X, position.Y, perturbedSpeed.X, perturbedSpeed.Y, type, damage, knockback, player.whoAmI, 0f, 0f);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user